]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.maps/src/org/simantics/maps/sg/MapScaleNode.java
Elimination of compiler warnings.
[simantics/district.git] / org.simantics.district.maps / src / org / simantics / maps / sg / MapScaleNode.java
index 793550b6087b05b92694b36e0291ab85ae6ce30c..c213995516bd6bd7e283b106e4b9bbbf8c37db49 100644 (file)
@@ -58,9 +58,9 @@ public class MapScaleNode extends G2DNode {
 
         double previousText = -100;
         
-        double minY = bounds.getMaxY() - 30;
+        double minY = bounds.getMaxY() - 40;
         
-        double scaleRight = bounds.getMaxX() - 30;
+        double scaleRight = bounds.getMaxX() - 20;
         
         double meterPerPixel = getMeterPerPixel(scaleRight - offsetX, minY - offsetY, scaleX, scaleY);
         
@@ -77,7 +77,7 @@ public class MapScaleNode extends G2DNode {
         
         double newScaleLeft = scaleRight - pixels;
         g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f));
-        Rectangle2D vertical = new Rectangle2D.Double(newScaleLeft, bounds.getMaxY() - 30, pixels, 20);
+        Rectangle2D vertical = new Rectangle2D.Double(newScaleLeft, bounds.getMaxY() - 40, pixels, 20);
         g.fill(vertical);
         
         g.setColor(GRAY);
@@ -101,9 +101,9 @@ public class MapScaleNode extends G2DNode {
         
         // Horizontal ruler
         double label = 0;
+        FontMetrics fm = g.getFontMetrics();
         for(double x = newScaleLeft; x < scaleRight; x += stepX) {
             String str = formatValue(label * meterPerPixel);
-            FontMetrics fm = g.getFontMetrics();
             Rectangle2D r = fm.getStringBounds(str, g);
             if((x - r.getWidth() / 2) > previousText) {
                 g.setColor(Color.BLACK);
@@ -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 };