]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
prevent deadlocks in show module
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 15 Oct 2010 14:16:42 +0000 (14:16 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 15 Oct 2010 14:16:42 +0000 (14:16 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@18436 ac1ea38d-2e2b-0410-8846-a27921b304fc

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

index 44546ec0b09d547fe4e3532ca5bc31f7e3989d71..85b88f8af83b40e9b51144c5135a35f5ee9513ee 100644 (file)
@@ -108,15 +108,21 @@ public class DiagramViewer extends org.simantics.modeling.ui.diagramEditor.Diagr
 \r
 \r
        }\r
+       \r
+       @Override\r
+    public ICanvasContext createViewerCanvas() {\r
+       ICanvasContext ctx = super.createViewerCanvas();\r
+       // GRID and RULER have to be set here. They cause deadlocks in Show Module if set in onCreated()\r
+               IHintContext h = ctx.getDefaultHintContext();\r
+               h.setHint(GridPainter.KEY_GRID_ENABLED, Boolean.FALSE);\r
+               h.setHint(RulerPainter.KEY_RULER_ENABLED, Boolean.FALSE);\r
+       return ctx;\r
+    }\r
 \r
        @Override\r
        protected void onCreated() {\r
                sourceDiagram.setHint(DiagramHints.KEY_ALLOW_ROUTE_POINTS, Boolean.FALSE);\r
                sourceDiagram.setHint(SynchronizationHints.COPY_ADVISOR, new MappedElementCopyAdvisor(new ElementCopyAdvisor(), new SysdynComponentCopyAdvisor()));\r
-\r
-               IHintContext h = canvasContext.getDefaultHintContext();\r
-               h.setHint(GridPainter.KEY_GRID_ENABLED, Boolean.FALSE);\r
-               h.setHint(RulerPainter.KEY_RULER_ENABLED, Boolean.FALSE);\r
        }\r
 \r
        @Override\r