X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Fparticipant%2FRulerPainter.java;h=bffe0c9df4862a160f95ac0e61610dffb1d2a1e1;hb=84b52b5e5dc00fd0ddfab398e420b56b379ee867;hp=e4f90791e2123b8fa1c01bf1566ae82de90ac0f7;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/participant/RulerPainter.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/participant/RulerPainter.java index e4f90791e..bffe0c9df 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/participant/RulerPainter.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/participant/RulerPainter.java @@ -102,17 +102,21 @@ public class RulerPainter extends AbstractCanvasParticipant { @SGInit public void initSG(G2DParentNode parent) { - node = parent.addNode("ruler", RulerNode.class); + node = parent.addNode("ruler", getNodeClass()); node.setZIndex(PAINT_PRIORITY); updateNode(); } + protected Class getNodeClass() { + return RulerNode.class; + } + @SGCleanup public void cleanupSG() { node.remove(); } - void updateNode() { + protected void updateNode() { node.setEnabled(isPaintingEnabled()); node.setGridSize(getGridSize()); }