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%2FRulerPainter.java;h=bffe0c9df4862a160f95ac0e61610dffb1d2a1e1;hp=e4f90791e2123b8fa1c01bf1566ae82de90ac0f7;hb=560d8aa2e37cb6b0249aec6d7e96e67d5a64c59f;hpb=7ebd0005704fe333211591ccacdaa26d7c7639ac 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()); }