--- /dev/null
+package org.simantics.diagram.connection;
+
+public class Link {
+ RouteNode node1;
+ RouteNode node2;
+
+ public Link(RouteNode node1, RouteNode node2) {
+ this.node1 = node1;
+ this.node2 = node2;
+ }
+
+ public RouteNode getNode1() {
+ return node1;
+ }
+
+ public RouteNode getNode2() {
+ return node2;
+ }
+}
*******************************************************************************/
package org.simantics.diagram.connection;
-import gnu.trove.list.array.TDoubleArrayList;
-import gnu.trove.map.hash.THashMap;
-import gnu.trove.map.hash.TObjectIntHashMap;
-import gnu.trove.set.hash.THashSet;
-
import java.awt.geom.Line2D;
import java.awt.geom.Path2D;
import java.awt.geom.Rectangle2D;
import org.simantics.diagram.connection.segments.Segment;
import org.simantics.diagram.connection.splitting.SplittedRouteGraph;
+import gnu.trove.list.array.TDoubleArrayList;
+import gnu.trove.map.hash.THashMap;
+import gnu.trove.map.hash.TObjectIntHashMap;
+import gnu.trove.set.hash.THashSet;
+
public class RouteGraph implements Serializable {
private static final long serialVersionUID = 2004022454972623908L;
ArrayList<RouteLine> lines = new ArrayList<RouteLine>(4);
ArrayList<RouteTerminal> terminals = new ArrayList<RouteTerminal>(4);
+
ArrayList<RouteLine> transientLines = new ArrayList<RouteLine>(4);
int caseId;
boolean isSimpleConnection;
PlainLineEndStyle.INSTANCE, null);
}
+ private Collection<Link> initialLinks;
+ public void setInitialLinks(Collection<Link> initialLinks) {
+ this.initialLinks = initialLinks;
+ }
+
+ public Collection<Link> getInitialLinks() {
+ return initialLinks;
+ }
+
/**
* Links nodes.
*/
import java.awt.Stroke;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import org.simantics.db.common.utils.NameUtils;
import org.simantics.db.exception.DatabaseException;
import org.simantics.diagram.connection.ConnectionVisuals;
+import org.simantics.diagram.connection.Link;
import org.simantics.diagram.connection.RouteGraph;
import org.simantics.diagram.connection.RouteGraphConnectionClass;
import org.simantics.diagram.connection.RouteLine;
}
}
+ Collection<Link> initialLinks = new ArrayList<>();
+
// Finish route graph loading by Linking route nodes together
for (EdgeResource link : links) {
RouteNode n1 = nodeByData.get(link.first());
continue;
}
rg.link(n1, n2);
+ initialLinks.add(new Link(n1, n2));
}
+ rg.setInitialLinks(initialLinks);
return rg;