X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Fparticipant%2FPanZoomRotateHandler.java;h=371ecbf1586bb22910410a728ddf8325deb4bbb9;hp=eeab18069717aaa250ffe5ffb5d0e06320b47871;hb=56e6bade5f3a9cd2210184ffc13ffb29f007dccf;hpb=436ecca6458503a993a92af8aa456b6b0f266418 diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/participant/PanZoomRotateHandler.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/participant/PanZoomRotateHandler.java index eeab18069..371ecbf15 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/participant/PanZoomRotateHandler.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/participant/PanZoomRotateHandler.java @@ -185,18 +185,22 @@ public class PanZoomRotateHandler extends AbstractCanvasParticipant { super.removedFromContext(ctx); } + protected Class getNavigationNodeClass() { + return NavigationNode.class; + } + @SGInit public void initSG(G2DParentNode parent) { // Replace old NAVIGATION_NODE with a new one INode oldnav = NodeUtil.getRootNode(parent).getNode(SceneGraphConstants.NAVIGATION_NODE_NAME); if(oldnav != null) { - node = oldnav.appendParent(SceneGraphConstants.NAVIGATION_NODE_NAME, NavigationNode.class); + node = oldnav.appendParent(SceneGraphConstants.NAVIGATION_NODE_NAME, getNavigationNodeClass()); // FIXME : oldnav seems to be the same node as parent (most of the cases). // Deleting it will cause plenty of code to fail, since they refer to the node directly. // The bug was not shown, since deleting() a Node did not actually wipe its structures (until now). // oldnav.delete(); } else { - node = parent.addNode(SceneGraphConstants.NAVIGATION_NODE_NAME, NavigationNode.class); + node = parent.addNode(SceneGraphConstants.NAVIGATION_NODE_NAME, getNavigationNodeClass()); } node.setLookupId(SceneGraphConstants.NAVIGATION_NODE_NAME); node.setZIndex(0);