|
@@ -207,7 +207,6 @@ public final class GraphDisplayManager {
|
|
|
// set basic style
|
|
|
v.setStylesheet(StylesheetManager.DEFAULT_STYLESHEET);
|
|
|
} else {
|
|
|
- // TODO: Testing new Merging code
|
|
|
v = new GraphManager(GraphHelper.newMerge(false, getGraphManager().getGraph(), g));
|
|
|
v.getGraph().addAttribute("layer", currentLayer);
|
|
|
v.getGraph().addAttribute("ui.antialias");
|
|
@@ -216,16 +215,6 @@ public final class GraphDisplayManager {
|
|
|
ret = count++;
|
|
|
// set basic style
|
|
|
v.setStylesheet(StylesheetManager.DEFAULT_STYLESHEET);
|
|
|
-
|
|
|
- /*
|
|
|
- * TODO: remove this OLD CODE v = getGraphManager();
|
|
|
- * Debug.out(v.getGraph().toString() + " Nodes: " +
|
|
|
- * v.getGraph().getNodeCount() + " Edges: " +
|
|
|
- * v.getGraph().getEdgeCount()); GraphHelper.merge(v.getGraph(), g);
|
|
|
- * ret = currentGraphManager; Debug.out(v.getGraph().toString() +
|
|
|
- * " Nodes: " + v.getGraph().getNodeCount() + " Edges: " +
|
|
|
- * v.getGraph().getEdgeCount());
|
|
|
- */
|
|
|
}
|
|
|
|
|
|
// set ui.class
|
|
@@ -362,19 +351,19 @@ public final class GraphDisplayManager {
|
|
|
}
|
|
|
}
|
|
|
if (underlay == null) {
|
|
|
- Debug.out("no Underlay found");
|
|
|
+ Debug.out("ERROR: no Underlay found", 3);
|
|
|
return;
|
|
|
}
|
|
|
if (operator == null) {
|
|
|
- Debug.out("no Operator found");
|
|
|
+ Debug.out("ERROR: no Operator found", 3);
|
|
|
return;
|
|
|
}
|
|
|
if (mapping == null || !mapping.hasGraphManagerAsParent(underlay)
|
|
|
|| !mapping.hasGraphManagerAsParent(operator)) {
|
|
|
if (mapping == null)
|
|
|
- Debug.out("no Mapping found");
|
|
|
+ Debug.out("WARNING: no Mapping found", 2);
|
|
|
else {
|
|
|
- Debug.out("old Mapping found");
|
|
|
+ Debug.out("WARNING: old Mapping found", 2);
|
|
|
vList.remove(mapping);
|
|
|
}
|
|
|
MyGraph g;
|
|
@@ -417,7 +406,7 @@ public final class GraphDisplayManager {
|
|
|
Layer tempLayer = currentLayer;
|
|
|
|
|
|
// underlay Graph
|
|
|
- MyGraph tempGraph = new MyGraph(getGraphStringID(count));
|
|
|
+ MyGraph tempGraph = new MyGraph(getGraphStringID(count++));
|
|
|
count++;
|
|
|
for (Node n : g.getNodeSet()) {
|
|
|
String id = n.getId();
|
|
@@ -425,7 +414,6 @@ public final class GraphDisplayManager {
|
|
|
id = id.substring(MappingGraphManager.UNDERLAY.length());
|
|
|
Node tempNode = tempGraph.addNode(id);
|
|
|
for (String s : n.getAttributeKeySet()) {
|
|
|
- Debug.out(s + ":" + n.getAttribute(s).toString());
|
|
|
tempNode.addAttribute(s, (Object) n.getAttribute(s));
|
|
|
}
|
|
|
}
|
|
@@ -446,16 +434,16 @@ public final class GraphDisplayManager {
|
|
|
currentLayer = Layer.UNDERLAY;
|
|
|
addGraph(tempGraph, true);
|
|
|
GraphManager und = getGraphManager(Layer.UNDERLAY);
|
|
|
+
|
|
|
// operator graph
|
|
|
- tempGraph = new MyGraph(getGraphStringID(count));
|
|
|
+ MyGraph tempGraph2 = new MyGraph(getGraphStringID(count++));
|
|
|
count++;
|
|
|
for (Node n : g.getNodeSet()) {
|
|
|
String id = n.getId();
|
|
|
if (id.startsWith(MappingGraphManager.OPERATOR)) {
|
|
|
id = id.substring(MappingGraphManager.OPERATOR.length());
|
|
|
- Node tempNode = tempGraph.addNode(id);
|
|
|
+ Node tempNode = tempGraph2.addNode(id);
|
|
|
for (String s : n.getAttributeKeySet()) {
|
|
|
- Debug.out(s + ":" + n.getAttribute(s).toString());
|
|
|
tempNode.addAttribute(s, (Object) n.getAttribute(s));
|
|
|
}
|
|
|
}
|
|
@@ -464,7 +452,7 @@ public final class GraphDisplayManager {
|
|
|
String id = e.getId();
|
|
|
if (id.startsWith(MappingGraphManager.OPERATOR)) {
|
|
|
id = id.substring(MappingGraphManager.OPERATOR.length());
|
|
|
- Edge tempEdge = tempGraph.addEdge(id,
|
|
|
+ Edge tempEdge = tempGraph2.addEdge(id,
|
|
|
e.getSourceNode().getId().substring(MappingGraphManager.OPERATOR.length()),
|
|
|
e.getTargetNode().getId().substring(MappingGraphManager.OPERATOR.length()), e.isDirected());
|
|
|
for (String s : e.getAttributeKeySet()) {
|
|
@@ -473,8 +461,9 @@ public final class GraphDisplayManager {
|
|
|
}
|
|
|
}
|
|
|
currentLayer = Layer.OPERATOR;
|
|
|
- addGraph(tempGraph, true);
|
|
|
+ addGraph(tempGraph2, true);
|
|
|
GraphManager op = getGraphManager(Layer.OPERATOR);
|
|
|
+
|
|
|
// Mapping graph
|
|
|
MyGraph moreTempGraph = new MyGraph(getGraphStringID(count));
|
|
|
moreTempGraph.addAttribute("layer", Layer.MAPPING);
|
|
@@ -492,6 +481,7 @@ public final class GraphDisplayManager {
|
|
|
op.addNodeCreatedListener(map);
|
|
|
map.loadGraph(g);
|
|
|
currentLayer = tempLayer;
|
|
|
+ switchActiveGraph();
|
|
|
}
|
|
|
|
|
|
}
|