]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
refs #4848
authorvillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 30 Apr 2014 11:36:59 +0000 (11:36 +0000)
committervillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 30 Apr 2014 11:36:59 +0000 (11:36 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@29396 ac1ea38d-2e2b-0410-8846-a27921b304fc

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

index 4d1f39a42762b70096ec10ee6a79e0de595b024a..c1bbf181147a771210ab08a6fa3d54ca26f650e0 100644 (file)
@@ -27,7 +27,12 @@ import org.simantics.g2d.canvas.ICanvasContext;
 import org.simantics.g2d.canvas.impl.CanvasContext;\r
 import org.simantics.g2d.connection.IConnectionAdvisor;\r
 import org.simantics.g2d.diagram.DiagramHints;\r
+import org.simantics.g2d.diagram.handler.PickRequest;\r
+import org.simantics.g2d.diagram.participant.DiagramParticipant;\r
+import org.simantics.g2d.diagram.participant.ElementInteractor;\r
 import org.simantics.g2d.diagram.participant.ElementPainter;\r
+import org.simantics.g2d.diagram.participant.Selection;\r
+import org.simantics.g2d.diagram.participant.ZOrderHandler;\r
 import org.simantics.g2d.diagram.participant.pointertool.PointerInteractor;\r
 import org.simantics.g2d.element.ElementClass;\r
 import org.simantics.g2d.element.ElementClasses;\r
@@ -36,6 +41,7 @@ import org.simantics.g2d.element.IElementClassProvider;
 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.g2d.tooltip.TerminalTooltipParticipant;\r
 import org.simantics.jfreechart.chart.element.PopulateChartDropParticipant;\r
 import org.simantics.modeling.mapping.ElementCopyAdvisor;\r
 import org.simantics.modeling.mapping.MappedElementCopyAdvisor;\r
@@ -177,7 +183,7 @@ public class DiagramViewer extends org.simantics.modeling.ui.diagramEditor.Diagr
 \r
        @Override \r
        protected PointerInteractor getPointerInteractor() {\r
-               return new org.simantics.sysdyn.ui.editor.participant.SysdynPointerInteractor(true, true, true, false, true, false, synchronizer.getElementClassProvider());\r
+               return new org.simantics.sysdyn.ui.editor.participant.SysdynPointerInteractor(true, true, true, false, true, false, synchronizer.getElementClassProvider(), PickRequest.PickSorter.CONNECTIONS_FIRST);\r
        }\r
 \r
        @Override\r
@@ -185,4 +191,18 @@ public class DiagramViewer extends org.simantics.modeling.ui.diagramEditor.Diagr
                return new SysdynConnectionAdvisor(modelingRules, sessionContext.getSession());\r
        }\r
 \r
+       @Override\r
+    protected void addDiagramParticipants(ICanvasContext ctx) {\r
+        ctx.add(new ZOrderHandler());\r
+        ctx.add(getPointerInteractor());\r
+        ctx.add(new ElementInteractor(PickRequest.PickSorter.CONNECTIONS_FIRST));\r
+        ctx.add(new Selection());\r
+        ctx.add(new DiagramParticipant());\r
+        ctx.add(new ElementPainter());\r
+        //ctx.add(new ElementHeartbeater());\r
+        //ctx.add(new ZoomTransitionParticipant(TransitionFunction.SIGMOID));\r
+        //ctx.add(new TooltipParticipant());\r
+        ctx.add(new TerminalTooltipParticipant());\r
+    }\r
+       \r
 }\r
index 7b3487071e02924e0e8caefcf62a41755392ba8b..ef74d7b5afb6ac62dce7bba836025fc8d75c8b0f 100644 (file)
@@ -24,6 +24,7 @@ import org.simantics.g2d.canvas.impl.DependencyReflection.Reference;
 import org.simantics.g2d.connection.IConnectionAdvisor;\r
 import org.simantics.g2d.diagram.DiagramHints;\r
 import org.simantics.g2d.diagram.handler.PickContext;\r
+import org.simantics.g2d.diagram.handler.PickRequest.PickSorter;\r
 import org.simantics.g2d.diagram.participant.Selection;\r
 import org.simantics.g2d.diagram.participant.TerminalPainter;\r
 import org.simantics.g2d.diagram.participant.pointertool.PointerInteractor;\r
@@ -71,8 +72,8 @@ public class SysdynPointerInteractor extends PointerInteractor {
        @Dependency MouseUtil mice;\r
        @Reference TerminalPainter terminalPainter;\r
 \r
-       public SysdynPointerInteractor(boolean clickSelect, boolean boxSelect, boolean dragElement, boolean dndDragElement, boolean connect, boolean doubleClickEdit, IElementClassProvider newConnectionClassProvider) {\r
-               super(clickSelect, boxSelect, dragElement, dndDragElement, connect, doubleClickEdit, newConnectionClassProvider);\r
+       public SysdynPointerInteractor(boolean clickSelect, boolean boxSelect, boolean dragElement, boolean dndDragElement, boolean connect, boolean doubleClickEdit, IElementClassProvider newConnectionClassProvider, PickSorter pickSorter) {\r
+               super(clickSelect, boxSelect, dragElement, dndDragElement, connect, doubleClickEdit, newConnectionClassProvider, pickSorter);\r
        }\r
 \r
        @Override\r