From f992cbbaa65e3457d53ecf03180de98c684e091c Mon Sep 17 00:00:00 2001 From: Marko Luukkainen Date: Mon, 5 Dec 2016 17:27:08 +0200 Subject: [PATCH] RouteGraph related methods are now public for code reuse refs #3832 Change-Id: I44e4a4ca72aea8c7514faa24533602dfeb4b565c --- .../adapter/RouteGraphConnectionClassFactory.java | 2 +- .../simantics/diagram/adapter/RouteGraphUtils.java | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) 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; -- 2.47.1