From: villberg Date: Wed, 30 Apr 2014 11:36:59 +0000 (+0000) Subject: refs #4848 X-Git-Tag: 1.8.1~76 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=cfa1f6ff9ac34767e6d22708ebacb0ab83780916;p=simantics%2Fsysdyn.git refs #4848 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@29396 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 4d1f39a4..c1bbf181 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 @@ -27,7 +27,12 @@ import org.simantics.g2d.canvas.ICanvasContext; import org.simantics.g2d.canvas.impl.CanvasContext; import org.simantics.g2d.connection.IConnectionAdvisor; import org.simantics.g2d.diagram.DiagramHints; +import org.simantics.g2d.diagram.handler.PickRequest; +import org.simantics.g2d.diagram.participant.DiagramParticipant; +import org.simantics.g2d.diagram.participant.ElementInteractor; import org.simantics.g2d.diagram.participant.ElementPainter; +import org.simantics.g2d.diagram.participant.Selection; +import org.simantics.g2d.diagram.participant.ZOrderHandler; import org.simantics.g2d.diagram.participant.pointertool.PointerInteractor; import org.simantics.g2d.element.ElementClass; import org.simantics.g2d.element.ElementClasses; @@ -36,6 +41,7 @@ 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.g2d.tooltip.TerminalTooltipParticipant; import org.simantics.jfreechart.chart.element.PopulateChartDropParticipant; import org.simantics.modeling.mapping.ElementCopyAdvisor; import org.simantics.modeling.mapping.MappedElementCopyAdvisor; @@ -177,7 +183,7 @@ public class DiagramViewer extends org.simantics.modeling.ui.diagramEditor.Diagr @Override protected PointerInteractor getPointerInteractor() { - return new org.simantics.sysdyn.ui.editor.participant.SysdynPointerInteractor(true, true, true, false, true, false, synchronizer.getElementClassProvider()); + return new org.simantics.sysdyn.ui.editor.participant.SysdynPointerInteractor(true, true, true, false, true, false, synchronizer.getElementClassProvider(), PickRequest.PickSorter.CONNECTIONS_FIRST); } @Override @@ -185,4 +191,18 @@ public class DiagramViewer extends org.simantics.modeling.ui.diagramEditor.Diagr return new SysdynConnectionAdvisor(modelingRules, sessionContext.getSession()); } + @Override + protected void addDiagramParticipants(ICanvasContext ctx) { + ctx.add(new ZOrderHandler()); + ctx.add(getPointerInteractor()); + ctx.add(new ElementInteractor(PickRequest.PickSorter.CONNECTIONS_FIRST)); + ctx.add(new Selection()); + ctx.add(new DiagramParticipant()); + ctx.add(new ElementPainter()); + //ctx.add(new ElementHeartbeater()); + //ctx.add(new ZoomTransitionParticipant(TransitionFunction.SIGMOID)); + //ctx.add(new TooltipParticipant()); + ctx.add(new TerminalTooltipParticipant()); + } + } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/SysdynPointerInteractor.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/SysdynPointerInteractor.java index 7b348707..ef74d7b5 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/SysdynPointerInteractor.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/SysdynPointerInteractor.java @@ -24,6 +24,7 @@ import org.simantics.g2d.canvas.impl.DependencyReflection.Reference; import org.simantics.g2d.connection.IConnectionAdvisor; import org.simantics.g2d.diagram.DiagramHints; import org.simantics.g2d.diagram.handler.PickContext; +import org.simantics.g2d.diagram.handler.PickRequest.PickSorter; import org.simantics.g2d.diagram.participant.Selection; import org.simantics.g2d.diagram.participant.TerminalPainter; import org.simantics.g2d.diagram.participant.pointertool.PointerInteractor; @@ -71,8 +72,8 @@ public class SysdynPointerInteractor extends PointerInteractor { @Dependency MouseUtil mice; @Reference TerminalPainter terminalPainter; - public SysdynPointerInteractor(boolean clickSelect, boolean boxSelect, boolean dragElement, boolean dndDragElement, boolean connect, boolean doubleClickEdit, IElementClassProvider newConnectionClassProvider) { - super(clickSelect, boxSelect, dragElement, dndDragElement, connect, doubleClickEdit, newConnectionClassProvider); + public SysdynPointerInteractor(boolean clickSelect, boolean boxSelect, boolean dragElement, boolean dndDragElement, boolean connect, boolean doubleClickEdit, IElementClassProvider newConnectionClassProvider, PickSorter pickSorter) { + super(clickSelect, boxSelect, dragElement, dndDragElement, connect, doubleClickEdit, newConnectionClassProvider, pickSorter); } @Override