]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/SelectionNode.java
Diagram to SVG enhancements
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / g2d / nodes / SelectionNode.java
index b5b8c4151fc7510a5c828bdbf36b5261b737e5e3..445a66fe3e9b5a7d431042c677f7323f12ee1ba5 100644 (file)
@@ -35,7 +35,12 @@ public class SelectionNode extends G2DNode implements Decoration {
     protected transient Rectangle2D rect;
     protected transient BasicStroke scaledStroke;
     protected transient double previousScaleRecip = Double.NaN;
+    private boolean ignore = false;
 
+    public void setIgnore(boolean value) {
+        ignore = value;
+    }
+  
     @SyncField({"transform", "bounds", "color"})
     public void init(AffineTransform transform, Rectangle2D bounds, Color color) {
         this.transform = transform;
@@ -46,6 +51,8 @@ public class SelectionNode extends G2DNode implements Decoration {
     @Override
     public void render(Graphics2D g) {
         if (bounds == null) return;
+        
+        if (ignore) return;
 
         // Prevent exceptions during rendering.
         if (transform.getDeterminant() == 0)
@@ -84,6 +91,10 @@ public class SelectionNode extends G2DNode implements Decoration {
         g.setTransform(ot);
 
     }
+    
+    public Rectangle2D getRect() {
+       return transform.createTransformedShape(rect).getBounds2D();
+    }
 
     @Override
     public Rectangle2D getBoundsInLocal() {