From: lempinen Date: Tue, 12 Oct 2010 11:14:43 +0000 (+0000) Subject: Set Ruler and Grid to be disabled as default X-Git-Tag: simantics-1.2.1~27 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=f10289df5627af6a6c0a7611864d5f3c19b43c2e;p=simantics%2Fsysdyn.git Set Ruler and Grid to be disabled as default git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@18388 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java index de5af993..fa5ef393 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java @@ -34,6 +34,8 @@ import org.simantics.g2d.element.ElementHints; import org.simantics.g2d.element.IElement; import org.simantics.g2d.element.IElementClassProvider; import org.simantics.g2d.element.handler.impl.StaticObjectAdapter; +import org.simantics.g2d.participant.GridPainter; +import org.simantics.g2d.participant.RulerPainter; import org.simantics.modeling.mapping.ElementCopyAdvisor; import org.simantics.modeling.mapping.MappedElementCopyAdvisor; import org.simantics.modeling.ui.diagramEditor.PopulateElementMonitorDropParticipant; @@ -70,6 +72,27 @@ public class DiagramViewer extends org.simantics.modeling.ui.diagramEditor.Diagr ep.update(e); } } + + final GridPainter gp = canvasContext.getSingleItem(GridPainter.class); + if (gp != null) + gp.getThread().asyncExec(new Runnable() { + + @Override + public void run() { + gp.setEnabled(false); + } + }); + + final RulerPainter rp = canvasContext.getSingleItem(RulerPainter.class); + if (rp != null) + rp.getThread().asyncExec(new Runnable() { + + @Override + public void run() { + rp.setEnabled(false); + } + }); + scheduleZoomToFit(); }