]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Elimination of compiler warnings.
authorReino Ruusu <reino.ruusu@semantum.fi>
Mon, 8 Apr 2019 07:45:05 +0000 (10:45 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sat, 31 Aug 2019 20:07:22 +0000 (23:07 +0300)
Change-Id: I115eca19e5750b8a60f312a537a9355082d45220

21 files changed:
org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java
org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/ComponentMappingPage.java
org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/controls/DynamicComboFieldEditor.java
org.simantics.district.imports/src/org/simantics/district/imports/DistrictImportUtils.java
org.simantics.district.maps/src/org/simantics/maps/sg/MapAttributionNode.java
org.simantics.district.maps/src/org/simantics/maps/sg/MapLocationZoomInfoNode.java
org.simantics.district.maps/src/org/simantics/maps/sg/MapNode.java
org.simantics.district.maps/src/org/simantics/maps/sg/MapScaleNode.java
org.simantics.district.network.ui/src/org/simantics/district/network/ui/DNEdgeBuilder.java
org.simantics.district.network.ui/src/org/simantics/district/network/ui/DistrictDiagramViewer.java
org.simantics.district.network.ui/src/org/simantics/district/network/ui/DistrictPanZoomRotateHandler.java
org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/ChangeMappingTypeHandler.java
org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkNodeUtils.java
org.simantics.district.network/src/org/simantics/district/network/changeset/DistrictChangeListener.java
org.simantics.district.network/src/org/simantics/district/network/profile/DNElementColorStyle.java
org.simantics.district.network/src/org/simantics/district/network/profile/ThrottledStyleBase.java
org.simantics.district.region.ui/src/org/simantics/district/region/ui/DiagramRegionsTableUI.java
org.simantics.district.region.ui/src/org/simantics/district/region/ui/handlers/RemoveRegionHandler.java
org.simantics.district.selection.ui/src/org/simantics/district/selection/ui/handlers/DeleteElementSelector.java
org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/prefs/MapsServerPreferencePage.java
org.simantics.maps.server/src/org/simantics/district/maps/server/TileserverMapnik.java

index 6c852dab33a3fa88cb9e2c86bcf8ef85c676d47b..3d121e7aca9d3889fad99e64c9db4ac861d4e70f 100644 (file)
@@ -52,7 +52,6 @@ public class CSVImportWizardPage extends WizardPage {
     // Common for vertex and edge
     private DynamicComboFieldEditor componentMappingSelector;
     private DynamicComboFieldEditor idSelector;
-    private DynamicComboFieldEditor labelSelector;
     
     // For vertex import
     private DynamicComboFieldEditor xCoordSelector;
index c74603be90b96949059cb1a659f1cd057f3b1976..8bdf26dc5951b85320ed6a72bcf2e577a6173935 100644 (file)
@@ -32,7 +32,6 @@ public class ComponentMappingPage extends WizardPage {
     private Composite composite;
     private Composite childComposite;
     protected Map<String, Resource> componentMappings;
-    private Collection<String> distinctMappingIvalues;
     private Collection<String> distinctMappingIndexColumnValues;
 
     public ComponentMappingPage(CSVImportModel model) {
index 5fc8cad30a09cc470c80b6756729d96f5bce7597..f3bb8c72a952a673bd490325889bae8c114db390 100644 (file)
@@ -66,6 +66,7 @@ public class DynamicComboFieldEditor extends FieldEditor {
         *
         * @return <code>true</code> if it is ok, and <code>false</code> otherwise
         */
+       @SuppressWarnings("unused")
        private boolean checkArray(String[][] table) {
                if (table == null) {
                        return false;
index ca3f4be59aef4a6c055ed1e77522d693242b7e6a..ef000d75218c1dbe788acacbc3bb46c6a880bb50 100644 (file)
@@ -12,7 +12,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.Consumer;
 import java.util.function.Function;
 
 import org.apache.commons.csv.CSVFormat;
index d97d22ebd5eec6dff9388cfefe38b8c02db04160..b2d28c0b7575491bdd0e3d690c19fbf42fc30ccc 100644 (file)
@@ -29,8 +29,6 @@ public class MapAttributionNode extends G2DNode {
         Color originalColor = g2d.getColor();
         g2d.transform(transform);
         
-        AffineTransform tr = g2d.getTransform();
-        
         g2d.setTransform(new AffineTransform());
         // do the rendering magic
         
index 9e027ecbbf27b535960a3574830b4fa480cb5b41..c081c92336c692c75d5031fa5ea46e8523713208 100644 (file)
@@ -36,8 +36,6 @@ public class MapLocationZoomInfoNode extends G2DNode {
         Color originalColor = g2d.getColor();
         g2d.transform(transform);
         
-        AffineTransform tr = g2d.getTransform();
-        
         g2d.setTransform(new AffineTransform());
         // do the rendering magic
         
index 7ca092cf74b711939b460ab3b9e2b24edbe4a296..ae418de477f61d55daedf9f9af1bdcef755c7452 100644 (file)
@@ -61,8 +61,8 @@ public class MapNode extends G2DNode implements ITileListener  {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(MapNode.class);
 
-    private final double MAP_SCALE          = 1;
-    private final int    MAX_TILE_LEVEL     = 19;
+    //private final double MAP_SCALE          = 1;
+    //private final int    MAX_TILE_LEVEL     = 19;
     private final int    TILE_PIXEL_SIZE    = 256;
     private final int    VIEWBOX_QUIET_TIME = 500;
 
index dc6b393d5a4ea2e8daf334d1095e3f7b46f0cb98..c213995516bd6bd7e283b106e4b9bbbf8c37db49 100644 (file)
@@ -141,7 +141,7 @@ public class MapScaleNode extends G2DNode {
     private static final transient int    MAX_DIGITS = 0;
     private static final transient double EPSILON    = 0.01;
     private static final transient double TRIM_THRESHOLD_MAX_VALUE = Math.pow(10, 2);
-    private static final transient String[] SI_UNIT_LARGE_PREFIXES = { "m", "km" };
+    //private static final transient String[] SI_UNIT_LARGE_PREFIXES = { "m", "km" };
     
     private static final transient double[] SCALE_VALUES = { 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000, 1000000, 2000000, 50000000 };
     
index 7ed99c363be31a83dd139534f08b71be812b33d3..e47e9a8743f8f66557cbbcf8a228fe846621a168 100644 (file)
@@ -1,7 +1,6 @@
 package org.simantics.district.network.ui;
 
 import java.awt.geom.Rectangle2D;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Optional;
@@ -135,7 +134,8 @@ public class DNEdgeBuilder {
         double y2= coords[1] + halfPadding;
         Envelope e = new Envelope(x1, x2, y1, y2);
         
-        List result = qtree.query(e);
+        List<?> result = qtree.query(e);
+        @SuppressWarnings("unchecked")
         List<ResourceVertex> vertices = (List<ResourceVertex>) result;
         for (ResourceVertex vertx : vertices) {
             Rectangle2D existing = new Rectangle2D.Double(vertx.coords[0] - halfPadding, vertx.coords[1] - halfPadding, padding, padding);
index 6175ace7cb1885d60d3f920ba551ae8fe3d92801..3bd0bfda1cc31d92d69b01f3974681b96f270fea 100644 (file)
@@ -41,7 +41,8 @@ import org.slf4j.LoggerFactory;
 
 public class DistrictDiagramViewer extends DiagramViewer {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(DistrictDiagramViewer.class);
+    @SuppressWarnings("unused")
+       private static final Logger LOGGER = LoggerFactory.getLogger(DistrictDiagramViewer.class);
 
     @Override
     protected void addDiagramParticipants(ICanvasContext ctx) {
index 05866bdabb3fea2b6bf14f4562267d5309bf11f9..ac0d22e3df34bb79b8ec17f07d44f25fb86d13ae 100644 (file)
@@ -114,8 +114,6 @@ public class DistrictPanZoomRotateHandler extends PanZoomRotateHandler {
     }
 
     private boolean zoomToPage() {
-        int currentZoomLevel = MapScalingTransform.zoomLevel(util.getTransform());
-        
         util.setTransform(new AffineTransform(2,0,0,2,270,270));
         return true;
     }
index 1047dc13e8b6f953192e487684c90fc9ff02f0c4..a2c02532c4b3f84c23065e27ca7f068a414e6534 100644 (file)
@@ -183,18 +183,12 @@ public class ChangeMappingTypeHandler {
         
         private Map<NamedResource, Map<String, Resource>> possibleMappings = new HashMap<>();
         
-        private Resource defaultVertexMapping;
-
         protected SelectMappingDialog(Shell parentShell, CompletableFuture<Map<NamedResource, Collection<NamedResource>>> elements) {
             super(parentShell);
             this.elements = elements;
             setTitle("Change mappings");
         }
 
-        public Resource getDefaultVertexMapping() {
-            return defaultVertexMapping;
-        }
-
         @Override
         protected Control createDialogArea(Composite parent) {
             composite = (Composite) super.createDialogArea(parent);
index 08253bb28d3e552b200d12a5c57c9509e5b4e07a..20479a781471ab968c0fe5b1c334c80b852a6e1f 100644 (file)
@@ -6,7 +6,6 @@ import java.awt.geom.Rectangle2D;
 
 import org.simantics.district.network.ModelledCRS;
 import org.simantics.maps.MapScalingTransform;
-import org.simantics.scenegraph.utils.GeometryUtils;
 
 public class DistrictNetworkNodeUtils {
 
index 39227a872777c75c3ee5a781bc7cc68051feb465..7cdb9c7db3d757e7fa7705d36ef288d146ef2c1c 100644 (file)
@@ -1,6 +1,5 @@
 package org.simantics.district.network.changeset;
 
-import java.util.Arrays;
 import java.util.Map;
 
 import org.simantics.db.MetadataI;
@@ -23,7 +22,8 @@ import org.slf4j.LoggerFactory;
 
 public class DistrictChangeListener extends GenericChangeListener<DependencyChangesRequest, DependencyChanges> {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(DistrictChangeListener.class);
+    @SuppressWarnings("unused")
+       private static final Logger LOGGER = LoggerFactory.getLogger(DistrictChangeListener.class);
     
     @Override
     public void onEvent(ReadGraph graph, MetadataI metadata, DependencyChanges event) throws DatabaseException {
index f8f6ba5c5760d8ddd2c1e118382dc3b35269dfa4..859faa67e999be5ae09b63dfdcfdab0b91d97302 100644 (file)
@@ -7,7 +7,6 @@ import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;
 import org.simantics.db.exception.DatabaseException;
-import org.simantics.diagram.profile.StyleBase;
 import org.simantics.scenegraph.INode;
 import org.simantics.scenegraph.g2d.nodes.SingleElementNode;
 import org.simantics.scenegraph.profile.EvaluationContext;
index 67ca25952522f41caa0b7a59a163131fa2a7b878..93af11c4fa633e73dbc8ca4e885fe2e4a45ad599 100644 (file)
@@ -38,7 +38,7 @@ public abstract class ThrottledStyleBase<Result> extends StyleBase<Optional<Resu
     private static final Logger LOGGER = LoggerFactory.getLogger(ThrottledStyleBase.class);
     private static final long DEFAULT_INTERVAL = 2000;
 
-    private long lastCalculateTimestamp = 0;
+    //private long lastCalculateTimestamp = 0;
     private AtomicLong interval = new AtomicLong(DEFAULT_INTERVAL);
     private Listener<Optional<Result>> resultListener;
 
index 562dd24bb7d22108ae4e810bd42174c5ff6fc18b..bedea060f9628b23cdccd39d1ceea5cf5b5348ab 100644 (file)
@@ -101,7 +101,8 @@ public class DiagramRegionsTableUI extends Composite {
             public Object[] getElements(Object inputElement) {
                 if (inputElement == null && (!(inputElement instanceof Collection)))
                     return new Object[0];
-                Set<DiagramRegion> set = (Set) inputElement;
+                @SuppressWarnings("unchecked")
+                Set<DiagramRegion> set = (Set<DiagramRegion>) inputElement;
                 return set.toArray();
             }
             
index 46b11a2febedada000c662607628f96727ece4e9..0fe76c36310a5d63723e76e281601bd5cf775d1c 100644 (file)
@@ -18,7 +18,8 @@ import org.slf4j.LoggerFactory;
 
 public class RemoveRegionHandler {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(RemoveRegionHandler.class);
+    @SuppressWarnings("unused")
+       private static final Logger LOGGER = LoggerFactory.getLogger(RemoveRegionHandler.class);
     public static final String COMMAND_ID = "org.simantics.district.region.ui.command.removeRegion";
     public static final String LABEL = "Remove Region";
 
index 4382e70c1e55c6efca2b284b8d632e6dd6874b79..6a005c4186f95454e77ca34d82534228ba7f39f5 100644 (file)
@@ -20,6 +20,7 @@ import org.slf4j.LoggerFactory;
 
 public class DeleteElementSelector {
 
+       @SuppressWarnings("unused")
        private static final Logger LOGGER = LoggerFactory.getLogger(DeleteElementSelector.class);
 
        @Inject
index 0dc33f13041741b2bbc60ff9ba0d101922183b58..8a1a6f91271f2bd2d54372f5724f5c68d99a59d3 100644 (file)
@@ -89,10 +89,8 @@ public class MapsServerPreferencePage extends FieldEditorPreferencePage implemen
         String labelText = "";
         String buttonText = "";
         int labelColor = -1;
-        boolean running = false;
         try {
             if (server.isRunning()) {
-                running = true;
                 buttonText = "Stop";
                 labelText = "running";
                 labelColor = SWT.COLOR_DARK_GREEN;
index dbe525725dff6d6bc3fa9ef456b3ab8a023011bd..3ba5157da66407bc3f9020e20f8d3d4e9d643307 100644 (file)
@@ -1,13 +1,11 @@
 package org.simantics.district.maps.server;
 
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.DirectoryStream;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.nio.file.StandardOpenOption;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -37,7 +35,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 public class TileserverMapnik {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(TileserverMapnik.class);
-    private static final String[] ADDITIONAL_DEPENDENCIES = new String[] { "tilelive-vector@3.9.4", "tilelive-tmstyle@0.6.0" };
     
     private SystemProcess process;
     private Path serverRoot;
@@ -173,7 +170,8 @@ public class TileserverMapnik {
 //    }
 
     
-    private Path tileserverMapnikRoot() {
+    @SuppressWarnings("unused")
+       private Path tileserverMapnikRoot() {
         return serverRoot.resolve("tileserver-mapnik").toAbsolutePath();
     }
     
@@ -185,7 +183,8 @@ public class TileserverMapnik {
         return serverRoot.resolve("dist/share/icu").toAbsolutePath();
     }
     
-    private Path getTessera() {
+    @SuppressWarnings("unused")
+       private Path getTessera() {
         return serverRoot.resolve("tileserver-mapnik/bin/tessera.js").toAbsolutePath();
     }
     
@@ -244,6 +243,7 @@ public class TileserverMapnik {
         return getDataDirectory().resolve(MapsServerPreferences.currentMBTiles());
     }
     
+    @SuppressWarnings("unchecked")
     public void checkTm2Styles() {
         Path tm2 = getStyleDirectory();
         try (DirectoryStream<Path> stream = Files.newDirectoryStream(tm2)) {