From: lempinen Date: Fri, 15 Oct 2010 14:16:42 +0000 (+0000) Subject: prevent deadlocks in show module X-Git-Tag: simantics-1.2.1~23 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=81a2bd575fd5d5afc691e88ca6a97a605d8dcc74;p=simantics%2Fsysdyn.git prevent deadlocks in show module git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@18436 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 44546ec0..85b88f8a 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 @@ -108,15 +108,21 @@ public class DiagramViewer extends org.simantics.modeling.ui.diagramEditor.Diagr } + + @Override + public ICanvasContext createViewerCanvas() { + ICanvasContext ctx = super.createViewerCanvas(); + // GRID and RULER have to be set here. They cause deadlocks in Show Module if set in onCreated() + IHintContext h = ctx.getDefaultHintContext(); + h.setHint(GridPainter.KEY_GRID_ENABLED, Boolean.FALSE); + h.setHint(RulerPainter.KEY_RULER_ENABLED, Boolean.FALSE); + return ctx; + } @Override protected void onCreated() { sourceDiagram.setHint(DiagramHints.KEY_ALLOW_ROUTE_POINTS, Boolean.FALSE); sourceDiagram.setHint(SynchronizationHints.COPY_ADVISOR, new MappedElementCopyAdvisor(new ElementCopyAdvisor(), new SysdynComponentCopyAdvisor())); - - IHintContext h = canvasContext.getDefaultHintContext(); - h.setHint(GridPainter.KEY_GRID_ENABLED, Boolean.FALSE); - h.setHint(RulerPainter.KEY_RULER_ENABLED, Boolean.FALSE); } @Override