From 46c5306fe5aa09663b1749c14749185c1a5a78fb Mon Sep 17 00:00:00 2001 From: Jussi Koskela Date: Mon, 27 Jan 2020 14:43:30 +0200 Subject: [PATCH] Grant access to diagram APIs to enable web based diagram editing gitlab #455 Change-Id: Iacbfc3eece3c49712cdfa240395d8b2df58c51b4 (cherry picked from commit e353ca45b2ad3ce36ea48336feca56e86ad0b089) --- .../src/org/simantics/diagram/connection/RouteLine.java | 4 ++++ .../simantics/modeling/ui/sg/DiagramSceneGraphProvider.java | 4 ++++ .../scenegraph/g2d/nodes/connection/RouteGraphNode.java | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/RouteLine.java b/bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/RouteLine.java index 9e7d07721..a6a4f22d2 100644 --- a/bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/RouteLine.java +++ b/bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/RouteLine.java @@ -196,6 +196,10 @@ public class RouteLine implements RouteNode, Serializable { this.terminal = terminal; } + public RouteLine getNextTransient() { + return nextTransient; + } + public boolean beginsWithTerminal() { RoutePoint begin = points.get(0); if(begin == terminal) diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/sg/DiagramSceneGraphProvider.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/sg/DiagramSceneGraphProvider.java index 4ef9c6369..61305ade0 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/sg/DiagramSceneGraphProvider.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/sg/DiagramSceneGraphProvider.java @@ -171,6 +171,10 @@ public class DiagramSceneGraphProvider implements ICanvasSceneGraphProvider, IDi } } + public GraphToDiagramSynchronizer getGraphToDiagramSynchronizer() { + return synchronizer; + } + protected CopyPasteStrategy getCopyPasteStrategy() { try { CopyPasteStrategy cpStrategy = Simantics.getSession().syncRequest(new PossibleAdapter(resource, CopyPasteStrategy.class)); diff --git a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/connection/RouteGraphNode.java b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/connection/RouteGraphNode.java index 048514f3a..b0e9147f6 100644 --- a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/connection/RouteGraphNode.java +++ b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/connection/RouteGraphNode.java @@ -379,7 +379,7 @@ public class RouteGraphNode extends G2DNode implements ISelectionPainterNode, In * @param after * @return true if changes were fired */ - private boolean setRouteGraphAndFireChanges(RouteGraph before, RouteGraph after) { + public boolean setRouteGraphAndFireChanges(RouteGraph before, RouteGraph after) { RouteGraphDelta delta = new RouteGraphDelta(before, after); if (!delta.isEmpty()) { setRouteGraph(after); -- 2.47.1