X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scenegraph%2Fsrc%2Forg%2Fsimantics%2Fscenegraph%2Fg2d%2FG2DSceneGraph.java;h=df28d317f692adbe10c506353bc3ad73c5687caf;hb=4771663b6e8a67f0cdfee6438ee3eeb7c296550b;hp=885b8c3a049aae024848250847310d78853f6a16;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/G2DSceneGraph.java b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/G2DSceneGraph.java index 885b8c3a0..df28d317f 100644 --- a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/G2DSceneGraph.java +++ b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/G2DSceneGraph.java @@ -48,6 +48,7 @@ public class G2DSceneGraph extends G2DParentNode implements ILookupService, INod private static final long serialVersionUID = -7066146333849901429L; public static final String IGNORE_FOCUS = "ignoreFocus"; + public static final String PICK_DISTANCE = "pickDistance"; protected transient Container rootPane = null; // TODO: swing dependency in here might not be a good idea @@ -105,9 +106,9 @@ public class G2DSceneGraph extends G2DParentNode implements ILookupService, INod return focusNode; } - @Override + @Override public void render(Graphics2D g2d) { - performCleanup(); + refresh(); Component rootPane = getRootPane(); if (rootPane != null) g2d.setRenderingHint(G2DRenderingHints.KEY_COMPONENT, rootPane); @@ -116,6 +117,12 @@ public class G2DSceneGraph extends G2DParentNode implements ILookupService, INod } } + @Override + public void refresh() { + performCleanup(); + super.refresh(); + } + /** * Util method for executing updates to scenegraph tree * NOTE: You should really consider performance issues when using this @@ -158,7 +165,6 @@ public class G2DSceneGraph extends G2DParentNode implements ILookupService, INod RepaintManager.setCurrentManager(repaintManager); } this.rootPane = rootPane; - eventHandler.setRootPane(rootPane); } private RepaintManager findProperRepaintManager(RepaintManager old) { @@ -329,7 +335,7 @@ public class G2DSceneGraph extends G2DParentNode implements ILookupService, INod } } - public boolean isPending() { + synchronized public boolean isPending() { return !pending.isEmpty(); }