]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Set Ruler and Grid to be disabled as default
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 12 Oct 2010 11:14:43 +0000 (11:14 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 12 Oct 2010 11:14:43 +0000 (11:14 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@18388 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/DiagramViewer.java

index de5af9932e84158b46ee4a712722f3432e3807cc..fa5ef393e359d14d103206ec788b663e1d300935 100644 (file)
@@ -34,6 +34,8 @@ import org.simantics.g2d.element.ElementHints;
 import org.simantics.g2d.element.IElement;\r
 import org.simantics.g2d.element.IElementClassProvider;\r
 import org.simantics.g2d.element.handler.impl.StaticObjectAdapter;\r
+import org.simantics.g2d.participant.GridPainter;\r
+import org.simantics.g2d.participant.RulerPainter;\r
 import org.simantics.modeling.mapping.ElementCopyAdvisor;\r
 import org.simantics.modeling.mapping.MappedElementCopyAdvisor;\r
 import org.simantics.modeling.ui.diagramEditor.PopulateElementMonitorDropParticipant;\r
@@ -70,6 +72,27 @@ public class DiagramViewer extends org.simantics.modeling.ui.diagramEditor.Diagr
                                ep.update(e);\r
                        }\r
                }\r
+               \r
+               final GridPainter gp = canvasContext.getSingleItem(GridPainter.class);\r
+               if (gp != null)\r
+                       gp.getThread().asyncExec(new Runnable() {\r
+                       \r
+                       @Override\r
+                       public void run() {\r
+                               gp.setEnabled(false);\r
+                       }\r
+               });\r
+                       \r
+               final RulerPainter rp = canvasContext.getSingleItem(RulerPainter.class);\r
+               if (rp != null)\r
+                       rp.getThread().asyncExec(new Runnable() {\r
+                       \r
+                       @Override\r
+                       public void run() {\r
+                               rp.setEnabled(false);\r
+                       }\r
+               });\r
+               \r
                scheduleZoomToFit();\r
        } \r
 \r