]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.maps/src/org/simantics/maps/eclipse/MapPainter.java
Lots of changes to district stuff
[simantics/district.git] / org.simantics.district.maps / src / org / simantics / maps / eclipse / MapPainter.java
index 3c4a9944fd628a95d979722b7fd2ee62267b9966..00f06dea21839e06859a1908524df132a02948d3 100644 (file)
@@ -17,6 +17,7 @@ import org.simantics.g2d.canvas.impl.AbstractCanvasParticipant;
 import org.simantics.g2d.canvas.impl.SGNodeReflection.SGCleanup;
 import org.simantics.g2d.canvas.impl.SGNodeReflection.SGInit;
 import org.simantics.maps.sg.MapNode;
+import org.simantics.maps.sg.MapScaleNode;
 import org.simantics.scenegraph.g2d.G2DParentNode;
 import org.simantics.scenegraph.g2d.events.EventHandlerReflection.EventHandler;
 import org.simantics.scenegraph.g2d.events.command.CommandEvent;
@@ -57,6 +58,7 @@ public class MapPainter extends AbstractCanvasParticipant {
     };
 
     protected MapNode node = null;
+    protected MapScaleNode scaleNode = null;
 
     private int scale;
 
@@ -103,6 +105,11 @@ public class MapPainter extends AbstractCanvasParticipant {
         node.setScale(scale);
         node.setEnabled(true);
         node.setZIndex(Integer.MIN_VALUE + 999); // Just under the grid
+        
+        scaleNode = parent.addNode("mapScale", MapScaleNode.class);
+        scaleNode.setScale(scale);
+        scaleNode.setEnabled(true);
+        scaleNode.setZIndex(Integer.MAX_VALUE - 999); // Just under the grid
     }
 
     @SGCleanup