From: Marko Luukkainen Date: Mon, 5 Dec 2016 15:27:08 +0000 (+0200) Subject: RouteGraph related methods are now public for code reuse X-Git-Tag: v1.25.0~20 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F88%2F188%2F1;p=simantics%2Fplatform.git RouteGraph related methods are now public for code reuse refs #3832 Change-Id: I44e4a4ca72aea8c7514faa24533602dfeb4b565c --- diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/RouteGraphConnectionClassFactory.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/RouteGraphConnectionClassFactory.java index c4594ff51..741696a60 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/RouteGraphConnectionClassFactory.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/RouteGraphConnectionClassFactory.java @@ -127,7 +127,7 @@ public class RouteGraphConnectionClassFactory extends SyncElementFactory { * * @see ElementHints#KEY_CONNECTION_ENTITY */ - private static class CE implements ConnectionEntity { + public static class CE implements ConnectionEntity { /** * Needed to gain access to {@link DataElementMap}. diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/RouteGraphUtils.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/RouteGraphUtils.java index a957377f8..83a4f1b44 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/RouteGraphUtils.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/RouteGraphUtils.java @@ -351,7 +351,7 @@ public class RouteGraphUtils { } - private static EdgeEnd toEdgeEnd(ReadGraph graph, Resource attachmentRelation, EdgeEnd defaultValue, DiagramResource DIA) + public static EdgeEnd toEdgeEnd(ReadGraph graph, Resource attachmentRelation, EdgeEnd defaultValue, DiagramResource DIA) throws DatabaseException { if (graph.isSubrelationOf(attachmentRelation, DIA.HasTailConnector)) return EdgeEnd.Begin; @@ -360,7 +360,7 @@ public class RouteGraphUtils { return defaultValue; } - private static Resource resolveFlagAttachment(ReadGraph graph, Resource connection, Resource flag, IModelingRules modelingRules, DiagramResource DIA) throws DatabaseException { + public static Resource resolveFlagAttachment(ReadGraph graph, Resource connection, Resource flag, IModelingRules modelingRules, DiagramResource DIA) throws DatabaseException { Type type = resolveFlagType(graph, connection, flag, modelingRules, DIA); if (type != null) { switch (type) { @@ -381,7 +381,7 @@ public class RouteGraphUtils { return type; } - private static Statement findTerminalStatement(ReadGraph graph, Resource connection, Resource connector, StructuralResource2 STR) + public static Statement findTerminalStatement(ReadGraph graph, Resource connection, Resource connector, StructuralResource2 STR) throws DatabaseException { for (Statement stm : graph.getStatements(connector, STR.Connects)) { if (connection.equals(stm.getObject())) @@ -391,7 +391,7 @@ public class RouteGraphUtils { return null; } - private static Resource getInverseAttachment(ReadGraph graph, Resource attachmentRelation, DiagramResource DIA) + public static Resource getInverseAttachment(ReadGraph graph, Resource attachmentRelation, DiagramResource DIA) throws DatabaseException { Resource inverse = graph.getPossibleObject(attachmentRelation, DIA.HasInverseAttachment); if (inverse != null) @@ -497,7 +497,7 @@ public class RouteGraphUtils { * @return * @throws DatabaseException */ - protected static StyledRouteGraphRenderer getRenderer(ReadGraph graph, ConnectionStyle style) + public static StyledRouteGraphRenderer getRenderer(ReadGraph graph, ConnectionStyle style) throws DatabaseException { return graph.syncRequest(new Renderer(style), TransientCacheListener.instance()); @@ -657,7 +657,7 @@ public class RouteGraphUtils { private static final double DEG_45 = Math.PI/4.; private static final double DEG_135 = Math.PI*3./4.; - static class BackendConnection { + public static class BackendConnection { public final Resource node; public final Resource terminal; public final EdgeEnd end;