Browse Source

Merge remote-tracking branch 'origin/Matthias'

Jan Enders 7 years ago
parent
commit
765f926fc3
43 changed files with 707 additions and 479 deletions
  1. 4 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/debug/Debug.java
  2. 1 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/EdgeCreatedListener.java
  3. 25 27
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphHelper.java
  4. 28 73
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphManager.java
  5. 64 53
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MappingGraphManager.java
  6. 20 4
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MyEdge.java
  7. 49 4
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MyGraph.java
  8. 20 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MyNode.java
  9. 1 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/NodeCreatedListener.java
  10. 4 5
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/GraphMLImporter.java
  11. 6 6
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MyFileSinkGraphML.java
  12. 77 66
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MyFileSourceGraphML.java
  13. 19 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MySourceBase.java
  14. 15 15
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/EdgeSelectionHelper.java
  15. 8 18
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/MainApp.java
  16. 15 16
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/BasicMappingOperator.java
  17. 9 9
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/CommunicationCostMetric.java
  18. 7 8
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/OperatorInfoMetric.java
  19. 5 6
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/PlacementCostMetric.java
  20. 7 8
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/TaskFulfillmentMetric.java
  21. 2 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/TestOperator.java
  22. 1 2
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java
  23. 5 5
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GraphDisplayManager.java
  24. 0 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/OperatorManager.java
  25. 1 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/OptionsManager.java
  26. 10 10
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/PropertiesManager.java
  27. 1 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/StylesheetManager.java
  28. 3 4
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ToolboxManager.java
  29. 0 9
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSConditionException.java
  30. 27 15
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSDeclaration.java
  31. 0 10
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSException.java
  32. 119 23
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSManager.java
  33. 32 17
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSRule.java
  34. 46 8
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSSelector.java
  35. 0 10
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSSytnaxException.java
  36. 27 5
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSValueValue.java
  37. 8 2
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSable.java
  38. 10 4
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/MyMouseManager.java
  39. 6 6
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomMapClickListener.java
  40. 7 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomTile.java
  41. 5 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomTileFactory.java
  42. 7 6
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/EdgePainter.java
  43. 6 6
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/WorldView.java

+ 4 - 3
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/debug/Debug.java

@@ -1,5 +1,6 @@
 package de.tu_darmstadt.informatik.tk.scopviz.debug;
 
+import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.events.Attribute;
 import javax.xml.stream.events.XMLEvent;
 
@@ -140,13 +141,13 @@ public final class Debug {
 	public static void out(XMLEvent e) {
 		MyFileSourceGraphML t = new MyFileSourceGraphML();
 		switch (e.getEventType()) {
-		case XMLEvent.START_ELEMENT:
+		case XMLStreamConstants.START_ELEMENT:
 			Debug.out(t.gotWhat(e.getEventType(), e.asStartElement().getName().getLocalPart()));
 			break;
-		case XMLEvent.END_ELEMENT:
+		case XMLStreamConstants.END_ELEMENT:
 			Debug.out(t.gotWhat(e.getEventType(), e.asEndElement().getName().getLocalPart()));
 			break;
-		case XMLEvent.ATTRIBUTE:
+		case XMLStreamConstants.ATTRIBUTE:
 			Debug.out(t.gotWhat(e.getEventType(), ((Attribute) e).getName().getLocalPart()));
 			break;
 		default:

+ 1 - 3
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/EdgeCreatedListener.java

@@ -1,7 +1,5 @@
 package de.tu_darmstadt.informatik.tk.scopviz.graphs;
 
-import org.graphstream.graph.Edge;
-
 /**
  * Interface for listeners on new Edges being created.
  * 
@@ -19,5 +17,5 @@ public interface EdgeCreatedListener {
 	 * @param graphID
 	 *            the ID of the Graph that had the Edge added to it
 	 */
-	public void edgeCreated(Edge e, String graphID);
+	public void edgeCreated(MyEdge e, String graphID);
 }

+ 25 - 27
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphHelper.java

@@ -5,11 +5,10 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Random;
 
-import org.graphstream.algorithm.Toolkit;
-import org.graphstream.graph.Edge;
 import org.graphstream.graph.Element;
 import org.graphstream.graph.Node;
 import org.graphstream.ui.geom.Point3;
+import org.graphstream.ui.graphicGraph.GraphPosLengthUtils;
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
@@ -63,7 +62,7 @@ public class GraphHelper {
 	private static void copyEdges(MyGraph target, MyGraph source, HashMap<String, String> newIds) {
 		Random ran = new Random();
 		boolean searchingForId = true;
-		for (Edge e : source.getEdgeSet()) {
+		for (MyEdge e : source.<MyEdge>getEdgeSet()) {
 			// finding a new ID for the Node
 			searchingForId = true;
 			String newId = source.getId() + e.getId();
@@ -75,8 +74,7 @@ public class GraphHelper {
 					if (e.getAttribute("originalElement") == null) {
 						target.getEdge(newId).addAttribute("originalElement", source.getId().concat("+#" + e.getId()));
 					} else {
-						target.getEdge(newId).addAttribute("originalElement",
-								(Object) e.getAttribute("originalElement"));
+						target.getEdge(newId).addAttribute("originalElement", e.getAttribute("originalElement"));
 					}
 
 				} else {
@@ -84,7 +82,7 @@ public class GraphHelper {
 				}
 			}
 			for (String s : e.getAttributeKeySet()) {
-				target.getEdge(newId).addAttribute(s, (Object) e.getAttribute(s));
+				target.getEdge(newId).addAttribute(s, e.getAttribute(s));
 			}
 		}
 	}
@@ -93,7 +91,7 @@ public class GraphHelper {
 		HashMap<String, String> newIds = new HashMap<>();
 		Random ran = new Random();
 		boolean searchingForId = true;
-		for (Node n : source.getNodeSet()) {
+		for (MyNode n : source.<MyNode>getNodeSet()) {
 			// finding a new ID for the Node
 			searchingForId = true;
 			String newId = source.getId() + n.getId();
@@ -105,15 +103,15 @@ public class GraphHelper {
 					if (n.getAttribute("originalElement") == null) {
 						target.getNode(newId).addAttribute("originalElement", source.getId().concat("+#" + n.getId()));
 					} else {
-						target.getNode(newId).addAttribute("originalElement",
-								(Object) n.getAttribute("originalElement"));
+						target.getNode(newId).addAttribute("originalElement", n.getAttribute("originalElement"));
 					}
 				} else {
 					newId = newId.concat(String.valueOf((char) (ran.nextInt(52) + 'a')));
 				}
 			}
 			for (String s : n.getAttributeKeySet()) {
-				target.getNode(newId).addAttribute(s, (Object) n.getAttribute(s));
+				Debug.out(s);
+				target.getNode(newId).addAttribute(s, n.getAttribute(s));
 			}
 		}
 
@@ -122,7 +120,7 @@ public class GraphHelper {
 
 	private static void adjustSourceYCoordinates(MyGraph g, double scalingFactor, double targetMinY,
 			double sourceMinY) {
-		for (Node n : g.getNodeSet()) {
+		for (MyNode n : g.<MyNode>getNodeSet()) {
 			double d = (Double) n.getAttribute("y");
 			d = d - sourceMinY;
 			d = d * scalingFactor;
@@ -132,7 +130,7 @@ public class GraphHelper {
 	}
 
 	private static void graphAttribute(MyGraph g) {
-		for (Node n : g.getNodeSet()) {
+		for (MyNode n : g.<MyNode>getNodeSet()) {
 			if (n.getAttribute("originalGraph") == null) {
 				n.addAttribute("originalGraph", g.getId());
 			}
@@ -140,7 +138,7 @@ public class GraphHelper {
 	}
 
 	private static void adjustSourceXCoordinates(MyGraph g, Double scalingFactor, Double xOffset, Double SourceMinX) {
-		for (Node n : g.getNodeSet()) {
+		for (MyNode n : g.<MyNode>getNodeSet()) {
 			Double d = (Double) n.getAttribute("x");
 			d = d - SourceMinX;
 			d = d * scalingFactor;
@@ -155,13 +153,13 @@ public class GraphHelper {
 	 */
 	public static void correctCoordinates(MyGraph g) {
 		Point3 coords;
-		Node n = null;
-		Iterator<Node> allNodes = g.getNodeIterator();
+		MyNode n = null;
+		Iterator<MyNode> allNodes = g.getNodeIterator();
 
 		while (allNodes.hasNext()) {
 			n = allNodes.next();
 			if (n.hasAttribute("xyz")) {
-				coords = Toolkit.nodePointPosition(n);
+				coords = GraphPosLengthUtils.nodePointPosition(n);
 				n.setAttribute("x", coords.x);
 				propagateAttribute(g, n, "x", coords.x);
 				n.setAttribute("y", coords.y);
@@ -179,8 +177,8 @@ public class GraphHelper {
 		if (!Layer.UNDERLAY.equals(g.getAttribute("layer"))) {
 			return;
 		}
-		Edge e = null;
-		Iterator<Edge> allEdges = g.getEdgeIterator();
+		MyEdge e = null;
+		Iterator<MyEdge> allEdges = g.getEdgeIterator();
 
 		while (allEdges.hasNext()) {
 			e = allEdges.next();
@@ -243,14 +241,14 @@ public class GraphHelper {
 		}
 		String origGraph = n.getAttribute("originalElement").toString().split("\\+#")[0];
 		String origNode = n.getAttribute("originalElement").toString().split("\\+#")[1];
-		Node oldNode = null;
-		Edge oldEdge = null;
+		MyNode oldNode = null;
+		MyEdge oldEdge = null;
 		MyGraph old = null;
 		Iterator<MyGraph> graphIter = g.getAllSubGraphs().iterator();
 		while (graphIter.hasNext()) {
 			old = graphIter.next();
 			if (old.getId().equals(origGraph)) {
-				Iterator<Node> nodeIter = old.getNodeIterator();
+				Iterator<MyNode> nodeIter = old.getNodeIterator();
 				while (nodeIter.hasNext()) {
 					oldNode = nodeIter.next();
 					if (oldNode.getId().equals(origNode)) {
@@ -263,7 +261,7 @@ public class GraphHelper {
 						return;
 					}
 				}
-				Iterator<Edge> edgeIter = old.getEdgeIterator();
+				Iterator<MyEdge> edgeIter = old.getEdgeIterator();
 				while (edgeIter.hasNext()) {
 					oldEdge = edgeIter.next();
 					if (oldEdge.getId().equals(origNode)) {
@@ -303,10 +301,10 @@ public class GraphHelper {
 		while (graphIter.hasNext()) {
 			MyGraph temp = graphIter.next();
 			if (temp.getId().equals(origGraph)) {
-				if (e instanceof Node && temp.getNode(origId) != null) {
+				if (e instanceof MyNode && temp.getNode(origId) != null) {
 					temp.removeNode(origId);
 					return temp.getId();
-				} else if (e instanceof Edge && temp.getEdge(origId) != null) {
+				} else if (e instanceof MyEdge && temp.getEdge(origId) != null) {
 					temp.removeEdge(origId);
 					return temp.getId();
 				} else {
@@ -337,13 +335,13 @@ public class GraphHelper {
 			MyGraph temp = graphIter.next();
 			if (temp.getId().equals(origGraph)) {
 				String newId = Main.getInstance().getUnusedID(new GraphManager(temp));
-				if (e instanceof Node) {
+				if (e instanceof MyNode) {
 					temp.addNode(newId);
 					temp.getNode(newId).addAttributes(attributes);
 					return temp.getId() + "+#" + newId;// the id of
 														// Graph+newNode
-				} else if (e instanceof Edge) {
-					Edge ed = (Edge) e;
+				} else if (e instanceof MyEdge) {
+					MyEdge ed = (MyEdge) e;
 					String sourceId = ed.getSourceNode().getAttribute("originalElement").toString()
 							.split("\\+#")[newNodeId.split("\\+#").length - 1];
 					String targetId = ed.getTargetNode().getAttribute("originalElement").toString()

+ 28 - 73
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphManager.java

@@ -4,9 +4,7 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.LinkedList;
 
-import org.graphstream.graph.Edge;
 import org.graphstream.graph.Element;
-import org.graphstream.graph.Node;
 import org.graphstream.ui.swingViewer.ViewPanel;
 import org.graphstream.ui.view.Viewer;
 import org.graphstream.ui.view.ViewerPipe;
@@ -17,7 +15,6 @@ import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.GraphDisplayManager;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.PropertiesManager;
-import de.tu_darmstadt.informatik.tk.scopviz.ui.StylesheetManager;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.MyMouseManager;
 
 /**
@@ -39,16 +36,10 @@ public class GraphManager {
 
 	protected MyGraph activeSubGraph;
 
-	/**
-	 * The Stylesheet for this Graph, excluding parts that can be set by
-	 * NodeGraphics.
-	 */
-	protected String stylesheet = "";
-
 	/** The last Node that was deleted. */
-	protected Node deletedNode;
+	protected MyNode deletedNode;
 	/** The last Edge that was deleted. */
-	protected LinkedList<Edge> deletedEdges = new LinkedList<>();
+	protected LinkedList<MyEdge> deletedEdges = new LinkedList<>();
 
 	/** The currently selected Node, mutually exclusive with selectedEdgeID. */
 	protected String selectedNodeID = null;
@@ -134,13 +125,13 @@ public class GraphManager {
 	 */
 	protected void deleteEdgesOfNode(final String id) {
 		deselect();
-		Node node = g.getNode(id);
+		MyNode node = g.getNode(id);
 		deletedEdges.removeAll(deletedEdges);
 		deletedNode = null;
-		Edge[] temp = new Edge[0];
+		MyEdge[] temp = new MyEdge[0];
 		temp = g.getEdgeSet().toArray(temp);
 
-		for (Edge e : temp) {
+		for (MyEdge e : temp) {
 			if (e.getSourceNode().equals(node) || e.getTargetNode().equals(node)) {
 				// adds the Edge to the list of deleted Edges and remove sit
 				// from the Graph
@@ -172,7 +163,7 @@ public class GraphManager {
 			}
 		}
 
-		for (Edge e : deletedEdges) {
+		for (MyEdge e : deletedEdges) {
 			String sourceId = null;
 			String targetId = null;
 			attributes = new HashMap<String, Object>();
@@ -254,13 +245,9 @@ public class GraphManager {
 			deselect();
 			this.selectedNodeID = nodeID;
 
-			Node n = g.getNode(nodeID);
-			// set selected node color to red
-			if (!hasClass(n, UI_CLASS_PROCESSING_ENABLED)
-					|| !GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING)) {
-				n.changeAttribute("ui.style", "fill-color : #F00; size: 15px;");
-				PropertiesManager.setItemsProperties();
-			}
+			MyNode n = g.getNode(nodeID);
+			n.addCSSClass("selected");
+			PropertiesManager.setItemsProperties();
 		}
 	}
 
@@ -275,7 +262,7 @@ public class GraphManager {
 			deselect();
 			this.selectedEdgeID = edgeID;
 
-			addClass(edgeID, "selected");
+			g.<MyEdge>getEdge(edgeID).addCSSClass("selected");
 			PropertiesManager.setItemsProperties();
 		}
 	}
@@ -287,19 +274,13 @@ public class GraphManager {
 	public void deselect() {
 		// Set last selected Edge Color to Black
 		if (getSelectedEdgeID() != null && g.getEdge(getSelectedEdgeID()) != null) {
-			removeClass(getSelectedEdgeID(), "selected");
+			g.<MyEdge>getEdge(getSelectedEdgeID()).removeCSSClass("selected");
 		}
 		// Set last selected Node color to black
 		else if (getSelectedNodeID() != null && g.getNode(getSelectedNodeID()) != null) {
-			Node n = g.getNode(getSelectedNodeID());
-			if (!hasClass(n, UI_CLASS_PROCESSING_ENABLED)
-					|| !GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING)) {
-				String nodeType = n.getAttribute("ui.class");
-				n.removeAttribute("ui.style");
-				n.changeAttribute("ui.style", "fill-color: #000000; size: 15px;");
-				n.changeAttribute("ui.class", nodeType.split("_")[0]);
-			}
+			g.<MyNode>getNode(getSelectedNodeID()).removeCSSClass("selected");
 		}
+		PropertiesManager.setItemsProperties();
 		this.selectedNodeID = null;
 		this.selectedEdgeID = null;
 	}
@@ -378,7 +359,7 @@ public class GraphManager {
 	 * @param n
 	 *            the Node to be added to the graph
 	 */
-	public void addNode(Node n) {
+	public void addNode(MyNode n) {
 		HashMap<String, Object> attributes = new HashMap<>();
 
 		for (String s : n.getAttributeKeySet()) {
@@ -434,29 +415,11 @@ public class GraphManager {
 		return g.getMaxY();
 	}
 
-	/**
-	 * Returns the Stylesheet used by the Graph.
-	 * 
-	 * @return the Stylesheet in use
-	 */
-	public String getStylesheet() {
-		return stylesheet;
-	}
-
 	/**
 	 * Sets the Stylesheet to be used by the Graph.
-	 * 
-	 * @param stylesheet
-	 *            the new stylesheet to use
 	 */
-	public void setStylesheet(String stylesheet) {
-		this.stylesheet = stylesheet;
-		g.removeAttribute("ui.stylesheet");
-		String completeStylesheet = stylesheet;
-		completeStylesheet = completeStylesheet.concat(StylesheetManager.getNodeStylesheet());
-		completeStylesheet = completeStylesheet
-				.concat(StylesheetManager.getLayerStyle((Layer) g.getAttribute("layer")));
-		g.addAttribute("ui.stylesheet", completeStylesheet);
+	public void setStylesheet() {
+		g.addAttribute("ui.stylesheet", "edge{text-offset: 4px,-4px;}");
 	}
 
 	/**
@@ -467,7 +430,7 @@ public class GraphManager {
 	 *            the EdgeCreatedListener
 	 */
 	public void addEdgeCreatedListener(EdgeCreatedListener e) {
-		((MyGraph) g).addEdgeCreatedListener(e);
+		g.addEdgeCreatedListener(e);
 	}
 
 	/**
@@ -478,14 +441,7 @@ public class GraphManager {
 	 *            the NodeCreatedListener
 	 */
 	public void addNodeCreatedListener(NodeCreatedListener n) {
-		((MyGraph) g).addNodeCreatedListener(n);
-	}
-
-	/**
-	 * Updates the Stylesheet, causing any changes to it to come into effect.
-	 */
-	public void updateStylesheet() {
-		setStylesheet(this.stylesheet);
+		g.addNodeCreatedListener(n);
 	}
 
 	/**
@@ -493,8 +449,8 @@ public class GraphManager {
 	 * 
 	 */
 	public void convertUiClass() {
-		Collection<Node> allNodes = g.getNodeSet();
-		for (Node n : allNodes) {
+		Collection<MyNode> allNodes = g.getNodeSet();
+		for (MyNode n : allNodes) {
 			if (n.hasAttribute("typeofNode")) {
 				n.addAttribute("ui.class", n.getAttribute("typeofNode").toString());
 			}
@@ -543,8 +499,8 @@ public class GraphManager {
 		String newID = Main.getInstance().getUnusedID();
 
 		boolean isDirected = (Main.getInstance().getCreationMode() == CreationMode.CREATE_DIRECTED_EDGE);
-		Node sourceNode = g.getNode(from);
-		Node targetNode = g.getNode(to);
+		MyNode sourceNode = g.getNode(from);
+		MyNode targetNode = g.getNode(to);
 		
 		if (activeSubGraph != null && !activeSubGraph.equals(g)) {
 			
@@ -584,9 +540,9 @@ public class GraphManager {
 	 */
 	protected boolean selectNodeForEdgeCreation(String nodeID) {
 		deselect();
-		Node n = getGraph().getNode(nodeID);
+		MyNode n = getGraph().getNode(nodeID);
 		if (!hasClass(n, UI_CLASS_PROCESSING_ENABLED) || !GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING)) {
-			n.changeAttribute("ui.style", "fill-color:green; size: 15px;");
+			n.addCSSClass("selectedForEdgeCreation");
 		}
 		return true;
 	}
@@ -598,13 +554,12 @@ public class GraphManager {
 	 *            the Id of the node to deselect.
 	 */
 	protected void deselectNodesAfterEdgeCreation(String nodeID) {
-		Node n = getGraph().getNode(nodeID);
+		MyNode n = getGraph().getNode(nodeID);
 		if (n == null) {
 			return;
 		}
 		if (!hasClass(n, UI_CLASS_PROCESSING_ENABLED) || !GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING)) {
-			n.removeAttribute("ui.style");
-			n.changeAttribute("ui.style", "fill-color: #000000; size: 15px;");
+			n.removeCSSClass("selectedForEdgeCreation");
 		}
 	}
 
@@ -685,7 +640,7 @@ public class GraphManager {
 				|| eClass.contains(", ".concat(className))));
 	}
 
-	protected boolean hasClass(Edge e, String className) {
+	protected boolean hasClass(MyEdge e, String className) {
 		if (e == null)
 			return false;
 		String eClass = e.getAttribute("ui.class");
@@ -693,7 +648,7 @@ public class GraphManager {
 				|| eClass.contains(", ".concat(className))));
 	}
 
-	protected boolean hasClass(Node n, String className) {
+	protected boolean hasClass(MyNode n, String className) {
 		if (n == null)
 			return false;
 		String nClass = n.getAttribute("ui.class");

+ 64 - 53
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MappingGraphManager.java

@@ -4,9 +4,7 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.LinkedList;
 
-import org.graphstream.algorithm.Toolkit;
-import org.graphstream.graph.Edge;
-import org.graphstream.graph.Node;
+import org.graphstream.ui.graphicGraph.GraphPosLengthUtils;
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
@@ -92,7 +90,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	public void loadGraph(MyGraph g) {
 
 		// reset used capacity to 0 for every procEnabled node
-		for (Node n : this.g.getNodeSet()) {
+		for (MyNode n : this.g.<MyNode>getNodeSet()) {
 			if (hasClass(n, UI_CLASS_PROCESSING_ENABLED)) {
 				resetCapacity(n);
 			}
@@ -102,7 +100,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 		autoMapLoadedEdgeAttributes(underlay, operator);
 
 		// recreates every mapping edge to properly calculate capacities
-		for (Edge e : g.getEdgeSet()) {
+		for (MyEdge e : g.<MyEdge>getEdgeSet()) {
 			if (e.getAttribute(ATTRIBUTE_KEY_MAPPING) != null && (boolean) e.getAttribute(ATTRIBUTE_KEY_MAPPING)) {
 				createEdge(e.getSourceNode().getId(), e.getTargetNode().getId());
 			}
@@ -127,9 +125,8 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 		// Debug only
 		int i = 0;
 
-		for (Edge edge : gm.getGraph().getEdgeSet()) {
+		for (MyEdge edge : gm.getGraph().<MyEdge>getEdgeSet()) {
 			addEdge(edge, idPrefix);
-
 			// Debug only
 			i++;
 		}
@@ -180,9 +177,9 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 
 		// loops through all nodes, adds them if they don't exist already and
 		// normalizes their coordinates
-		for (Node node : gm.getGraph().getNodeSet()) {
+		for (MyNode node : gm.getGraph().<MyNode>getNodeSet()) {
 			// add node if it doesn't exist
-			Node newNode = getGraph().getNode(idPrefix + node.getId());
+			MyNode newNode = getGraph().getNode(idPrefix + node.getId());
 			if (newNode == null) {
 				addNode(node, idPrefix);
 				newNode = getGraph().getNode(idPrefix + node.getId());
@@ -192,7 +189,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 			}
 
 			// normalize coordinates
-			double[] n = Toolkit.nodePosition(node);
+			double[] n = GraphPosLengthUtils.nodePosition(node);
 			double cX = n[0];
 			double x = cX * scaleX + addX;
 			double cY = n[1];
@@ -248,7 +245,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	 * @param idPrefix
 	 *            the String to be added as prefix to the ID
 	 */
-	private void addEdge(Edge e, String idPrefix) {
+	private void addEdge(MyEdge e, String idPrefix) {
 		HashMap<String, Object> attributes = new HashMap<>();
 
 		for (String s : e.getAttributeKeySet()) {
@@ -265,7 +262,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	}
 
 	@Override
-	public void addNode(Node n) {
+	public void addNode(MyNode n) {
 		// This function mustn't be called.
 		Debug.out("Someone called addNode(Node n) with a MappingGraphManager");
 	}
@@ -279,7 +276,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	 * @param idPrefix
 	 *            the String to be added as prefix to the ID
 	 */
-	private void addNode(Node n, String idPrefix) {
+	private void addNode(MyNode n, String idPrefix) {
 		HashMap<String, Object> attributes = new HashMap<>();
 
 		for (String s : n.getAttributeKeySet()) {
@@ -291,10 +288,11 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 
 		g.addNode(idPrefix + n.getId());
 		g.getNode(idPrefix + n.getId()).addAttributes(attributes);
+		g.<MyNode>getNode(idPrefix + n.getId()).addCSSClass("onMapping");
 	}
 
 	@Override
-	public void nodeCreated(Node n, String graphID) {
+	public void nodeCreated(MyNode n, String graphID) {
 		if (graphID.equals(underlay.getGraph().getId()))
 			underlayNodesChanged = true;
 		else if (graphID.equals(operator.getGraph().getId()))
@@ -302,7 +300,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	}
 
 	@Override
-	public void edgeCreated(Edge e, String graphID) {
+	public void edgeCreated(MyEdge e, String graphID) {
 		if (graphID.equals(underlay.getGraph().getId()))
 			addEdge(e, UNDERLAY);
 		else if (graphID.equals(operator.getGraph().getId()))
@@ -316,29 +314,33 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 		if (lastClickedID != null) {
 			Double need = g.getNode(lastClickedID).getAttribute(ATTRIBUTE_KEY_PROCESS_NEED);
 			if (need != null)
-				for (Node n : g.getNodeSet())
+				for (MyNode n : g.<MyNode>getNodeSet())
 					if (hasClass(n, UI_CLASS_PROCESSING_ENABLED))
 						showExpectedCapacity(n, need);
-		} else {
-			for (Node n : g.getNodeSet())
-				if (hasClass(n, UI_CLASS_PROCESSING_ENABLED))
-					showExpectedCapacity(n, 0);
 		}
 	}
 
+	@Override
+	protected void deselectNodesAfterEdgeCreation(String nodeID) {
+		super.deselectNodesAfterEdgeCreation(nodeID);
+		for (MyNode n : g.<MyNode>getNodeSet())
+			if (hasClass(n, UI_CLASS_PROCESSING_ENABLED))
+				showExpectedCapacity(n, 0);
+	}
+
 	/**
 	 * checks whether the Node can handle the load first.<br/>
 	 * creates a edge between to nodes
 	 */
 	@Override
 	public boolean createEdge(String to, String from) {
-		Node fromNode = getGraph().getNode(from);
-		Node toNode = getGraph().getNode(to);
+		MyNode fromNode = getGraph().getNode(from);
+		MyNode toNode = getGraph().getNode(to);
 
 		if (fromNode.hasEdgeBetween(to))
 			return false;
 
-		for (Edge e : fromNode.getEdgeSet()) {
+		for (MyEdge e : fromNode.<MyEdge>getEdgeSet()) {
 			Boolean mapped = e.getAttribute("mapping");
 			if (mapped != null && mapped)
 				return false;
@@ -351,17 +353,18 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 			return false;
 		if (fromParent.equals(toParent)) {
 			deselectNodesAfterEdgeCreation(lastClickedID);
-			lastClickedID = to;
-			selectNodeForEdgeCreation(lastClickedID);
+			/*
+			 * lastClickedID = to; selectNodeForEdgeCreation(lastClickedID);
+			 */
 			return false;
 		}
 
 		String newID = Main.getInstance().getUnusedID();
 
-		Edge e;
+		MyEdge e;
 
-		Node underlayNode;
-		Node operatorNode;
+		MyNode underlayNode;
+		MyNode operatorNode;
 		if (fromParent.equals(UNDERLAY)) {
 			underlayNode = fromNode;
 			operatorNode = toNode;
@@ -406,7 +409,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	 * @param underlayNode
 	 *            The Node for which the pie chart should be initialized
 	 */
-	private void initCapacity(Node underlayNode) {
+	private void initCapacity(MyNode underlayNode) {
 		Double used = underlayNode.getAttribute(ATTRIBUTE_KEY_PROCESS_USE);
 		Double max = underlayNode.getAttribute(ATTRIBUTE_KEY_PROCESS_MAX);
 		if (max == null || max == 0)
@@ -425,7 +428,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	 * @param underlayNode
 	 *            The Node for which the pie chart should be initialized
 	 */
-	private void resetCapacity(Node underlayNode) {
+	private void resetCapacity(MyNode underlayNode) {
 		Double used = new Double(0);
 		underlayNode.setAttribute(ATTRIBUTE_KEY_PROCESS_USE, used);
 		Double max = underlayNode.getAttribute(ATTRIBUTE_KEY_PROCESS_MAX);
@@ -445,7 +448,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	 *            The operatorNode which gets mapped
 	 * @return true if the mapping was successful. false otherwise.
 	 */
-	private boolean addMapping(Node underlayNode, Node operatorNode) {
+	private boolean addMapping(MyNode underlayNode, MyNode operatorNode) {
 		Double needed = operatorNode.getAttribute(ATTRIBUTE_KEY_PROCESS_NEED);
 		if (needed == null)
 			return true;
@@ -462,7 +465,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	 *            The operatorNode which gets mapped
 	 * @return true if the mapping was successful. false otherwise.
 	 */
-	private boolean removeMapping(Node underlayNode, Node operatorNode) {
+	private boolean removeMapping(MyNode underlayNode, MyNode operatorNode) {
 		Double needed = operatorNode.getAttribute(ATTRIBUTE_KEY_PROCESS_NEED);
 		if (needed == null)
 			return true;
@@ -479,7 +482,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	 *            The capacity. may be positive or negative
 	 * @return true if the capacity change was successful. false otherwise.
 	 */
-	private boolean changeCapacity(Node underlayNode, double capacity) {
+	private boolean changeCapacity(MyNode underlayNode, double capacity) {
 		Double needed = capacity;
 		Double used = underlayNode.getAttribute(ATTRIBUTE_KEY_PROCESS_USE);
 		Double max = underlayNode.getAttribute(ATTRIBUTE_KEY_PROCESS_MAX);
@@ -508,7 +511,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	 * @param need
 	 *            the capacity change
 	 */
-	private void showExpectedCapacity(Node underlayNode, double need) {
+	private void showExpectedCapacity(MyNode underlayNode, double need) {
 		Double used = underlayNode.getAttribute(ATTRIBUTE_KEY_PROCESS_USE);
 		Double max = underlayNode.getAttribute(ATTRIBUTE_KEY_PROCESS_MAX);
 		if (max == null || max == 0)
@@ -530,12 +533,18 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 
 	@Override
 	protected boolean selectNodeForEdgeCreation(String nodeID) {
-		Node n = g.getNode(nodeID);
+		MyNode n = g.getNode(nodeID);
 		String parent = n.getAttribute(ATTRIBUTE_KEY_MAPPING_PARENT);
 		if (parent == null)
 			return false;
-		if (parent.equals(OPERATOR))
+		if (parent.equals(OPERATOR)) {
+			for (MyEdge e : n.<MyEdge>getEdgeSet()) {
+				Boolean isMapped = e.getAttribute(ATTRIBUTE_KEY_MAPPING);
+				if (isMapped != null && isMapped)
+					return false;
+			}
 			return super.selectNodeForEdgeCreation(nodeID);
+		}
 		if (hasClass(n, UI_CLASS_PROCESSING_ENABLED))
 			return super.selectNodeForEdgeCreation(nodeID);
 		return false;
@@ -543,10 +552,10 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 
 	@Override
 	public void deleteEdge(final String id) {
-		Edge e = g.getEdge(id);
+		MyEdge e = g.getEdge(id);
 		if ((boolean) e.getAttribute(ATTRIBUTE_KEY_MAPPING)) {
-			Node operatorNode = e.getSourceNode();
-			Node underlayNode = e.getTargetNode();
+			MyNode operatorNode = e.getSourceNode();
+			MyNode underlayNode = e.getTargetNode();
 
 			// delete mapping attriute
 			GraphHelper.propagateAttribute(this.g, underlayNode, "mappingEdge", null);
@@ -568,47 +577,49 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	@Override
 	public void undelete() {
 		super.undelete();
-		for (Edge e : deletedEdges) {
+		for (MyEdge e : deletedEdges) {
 			if ((boolean) e.getAttribute(ATTRIBUTE_KEY_MAPPING))
 				changeCapacity(e.getTargetNode(), e.getSourceNode().getAttribute(ATTRIBUTE_KEY_PROCESS_NEED));
 		}
 	}
 
 	private void autoMapSourcesAndSinks(GraphManager underlay, GraphManager operator) {
-		for (Node operatorNode : getOperatorNodeSet()) {
+		for (MyNode operatorNode : getOperatorNodeSet()) {
 			if (operatorNode.getAttribute("typeofNode").toString().equals("source")) {
-				for (Node underlayNode : getUnderlayNodeSet()) {
+				for (MyNode underlayNode : getUnderlayNodeSet()) {
 					if (operatorNode.getAttribute("identifier") != null && operatorNode.getAttribute("identifier")
 							.equals(underlayNode.getAttribute("identifier"))) {
 						String newID = Main.getInstance().getUnusedID(this);
-						Edge e = getGraph().addEdge(newID, operatorNode, underlayNode, true);
+						MyEdge e = getGraph().addEdge(newID, operatorNode, underlayNode, true);
 						Debug.out("Created an directed edge with Id " + newID + " from " + operatorNode + " to "
 								+ underlayNode);
 
 						e.addAttribute("ui.class", UI_CLASS_MAPPING);
 						e.addAttribute(ATTRIBUTE_KEY_MAPPING, true);
+						e.addCSSClass("blue");
 					}
 				}
 			} else if (operatorNode.getAttribute("typeofNode").equals("sink")) {
-				for (Node underlayNode : getUnderlayNodeSet()) {
+				for (MyNode underlayNode : getUnderlayNodeSet()) {
 					String identifier = operatorNode.getAttribute("identifier");
 					if (identifier != null && identifier.equals(underlayNode.getAttribute("identifier"))) {
 						String newID = Main.getInstance().getUnusedID(this);
-						Edge e = getGraph().addEdge(newID, operatorNode, underlayNode, true);
+						MyEdge e = getGraph().addEdge(newID, operatorNode, underlayNode, true);
 						Debug.out("Created an directed edge with Id " + newID + " from " + operatorNode + " to "
 								+ underlayNode);
 
 						e.addAttribute("ui.class", UI_CLASS_MAPPING);
 						e.addAttribute(ATTRIBUTE_KEY_MAPPING, true);
+						e.addCSSClass("blue");
 					}
 				}
 			}
 		}
 	}
 
-	private Collection<Node> getOperatorNodeSet() {
-		LinkedList<Node> result = new LinkedList<Node>();
-		for (Node n : getGraph().getNodeSet()) {
+	private Collection<MyNode> getOperatorNodeSet() {
+		LinkedList<MyNode> result = new LinkedList<MyNode>();
+		for (MyNode n : getGraph().<MyNode>getNodeSet()) {
 			if (n.getAttribute(ATTRIBUTE_KEY_MAPPING_PARENT) == OPERATOR) {
 				result.add(n);
 			}
@@ -616,9 +627,9 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 		return result;
 	}
 
-	private Collection<Node> getUnderlayNodeSet() {
-		LinkedList<Node> result = new LinkedList<Node>();
-		for (Node n : getGraph().getNodeSet()) {
+	private Collection<MyNode> getUnderlayNodeSet() {
+		LinkedList<MyNode> result = new LinkedList<MyNode>();
+		for (MyNode n : getGraph().<MyNode>getNodeSet()) {
 			if (n.getAttribute(ATTRIBUTE_KEY_MAPPING_PARENT) == UNDERLAY) {
 				result.add(n);
 			}
@@ -627,8 +638,8 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	}
 
 	private void autoMapLoadedEdgeAttributes(GraphManager underlay2, GraphManager operator2) {
-		for (Node operatorNode : getOperatorNodeSet()) {
-			for (Node underlayNode : getUnderlayNodeSet()) {
+		for (MyNode operatorNode : getOperatorNodeSet()) {
+			for (MyNode underlayNode : getUnderlayNodeSet()) {
 				String identifier = operatorNode.getAttribute("mappingEdge");
 				if (identifier != null && identifier.equals(underlayNode.getAttribute("mappingEdge"))) {
 					createEdge(operatorNode.getId(), underlayNode.getId());

+ 20 - 4
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MyEdge.java

@@ -1,16 +1,17 @@
 package de.tu_darmstadt.informatik.tk.scopviz.graphs;
 
-import java.util.Set;
+import java.util.HashSet;
 
 import org.graphstream.graph.implementations.AbstractEdge;
 import org.graphstream.graph.implementations.AbstractNode;
 
+import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.css.CSSManager;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.css.CSSable;
 
 public class MyEdge extends AbstractEdge implements CSSable {
 	// TODO comment
-	Set<String> classes;
+	HashSet<String> classes;
 	// TODO comment
 	String type = "edge";
 	// TODO comment
@@ -18,17 +19,20 @@ public class MyEdge extends AbstractEdge implements CSSable {
 
 	public MyEdge(String id, AbstractNode source, AbstractNode target, boolean directed) {
 		super(id, source, target, directed);
-		// TODO Auto-generated constructor stub
+		updateCSS();
+		classes = new HashSet<String>();
 	}
 
 	@Override
 	public void addCSSClass(String c) {
 		classes.add(c);
+		updateCSS();
 	}
 
 	@Override
 	public void removeCSSClass(String c) {
 		classes.remove(c);
+		updateCSS();
 	}
 
 	@Override
@@ -45,7 +49,7 @@ public class MyEdge extends AbstractEdge implements CSSable {
 	}
 
 	@Override
-	public Set<String> getClasses() {
+	public HashSet<String> getClasses() {
 		return classes;
 	}
 
@@ -58,10 +62,22 @@ public class MyEdge extends AbstractEdge implements CSSable {
 	public void updateCSS() {
 		css = CSSManager.getCSS(this);
 		addAttribute("ui.style", css);
+		Debug.out(id + ": " + type + classes + "\n" + css);
 	}
 
 	@Override
 	public String getCSS() {
 		return css;
 	}
+
+	@Override
+	protected void attributeChanged(AttributeChangeEvent event, String attribute, Object oldValue, Object newValue) {
+		super.attributeChanged(event, attribute, oldValue, newValue);
+		if (attribute.equals("ui.class")) {
+			if (oldValue != null && oldValue instanceof String)
+				removeCSSClass((String) oldValue);
+			if (newValue != null && newValue instanceof String)
+				addCSSClass((String) newValue);
+		}
+	}
 }

+ 49 - 4
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MyGraph.java

@@ -4,14 +4,19 @@ import java.util.Iterator;
 import java.util.LinkedList;
 
 import org.graphstream.graph.Edge;
+import org.graphstream.graph.EdgeFactory;
+import org.graphstream.graph.Graph;
 import org.graphstream.graph.Node;
+import org.graphstream.graph.NodeFactory;
+import org.graphstream.graph.implementations.AbstractGraph;
+import org.graphstream.graph.implementations.AbstractNode;
 import org.graphstream.graph.implementations.SingleGraph;
 
-import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.OptionsManager;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.ToolboxManager;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.css.CSSManager;
 
 /**
  * Our own Class to extend GraphStreams Graph with our own Functionality.
@@ -39,6 +44,7 @@ public class MyGraph extends SingleGraph {
 	 */
 	public MyGraph(final String id) {
 		super(id);
+		setMyFactory();
 	}
 
 	/**
@@ -55,6 +61,7 @@ public class MyGraph extends SingleGraph {
 	 */
 	public MyGraph(final String id, final boolean strictChecking, final boolean autoCreate) {
 		super(id, strictChecking, autoCreate);
+		setMyFactory();
 	}
 
 	/**
@@ -82,6 +89,25 @@ public class MyGraph extends SingleGraph {
 	public MyGraph(final String id, final boolean strictChecking, final boolean autoCreate,
 			final int initialNodeCapacity, final int initialEdgeCapacity) {
 		super(id, strictChecking, autoCreate, initialNodeCapacity, initialEdgeCapacity);
+		setMyFactory();
+	}
+
+	/**
+	 * sets Factories to MyNode and MyEdge
+	 */
+	private void setMyFactory() {
+		setNodeFactory(new NodeFactory<MyNode>() {
+			@Override
+			public MyNode newInstance(String id, Graph graph) {
+				return new MyNode((AbstractGraph) graph, id);
+			}
+		});
+		setEdgeFactory(new EdgeFactory<MyEdge>() {
+			@Override
+			public MyEdge newInstance(String id, Node src, Node dst, boolean directed) {
+				return new MyEdge(id, (AbstractNode) src, (AbstractNode) dst, directed);
+			}
+		});
 	}
 
 	/**
@@ -106,10 +132,10 @@ public class MyGraph extends SingleGraph {
 				|| (e.getAttribute("weight") != null && (OptionsManager.getDefaultWeight() == Main.getInstance()
 						.convertAttributeTypes(e.getAttribute("weight"), new Double(0.0)))));
 		if (doWeight) {
-			ToolboxManager.createWeightDialog(e);
+			ToolboxManager.createWeightDialog((MyEdge) e);
 		}
 		for (EdgeCreatedListener list : allEdgeListeners) {
-			list.edgeCreated(e, id);
+			list.edgeCreated((MyEdge) e, id);
 		}
 	}
 
@@ -133,7 +159,7 @@ public class MyGraph extends SingleGraph {
 	private void nodeCreatedNotify(Node n) {
 		GraphHelper.setAllDefaults(this);
 		for (NodeCreatedListener list : allNodeListeners) {
-			list.nodeCreated(n, id);
+			list.nodeCreated((MyNode) n, id);
 		}
 	}
 
@@ -143,6 +169,8 @@ public class MyGraph extends SingleGraph {
 	@Override
 	public <T extends Edge> T addEdge(String id, int index1, int index2) {
 		T e = super.addEdge(id, index1, index2);
+		if (e instanceof MyEdge)
+			CSSManager.addCSSAble((MyEdge) e);
 		edgeCreatedNotify(e);
 		return e;
 	}
@@ -153,6 +181,8 @@ public class MyGraph extends SingleGraph {
 	@Override
 	public <T extends Edge> T addEdge(String id, Node node1, Node node2) {
 		T e = super.addEdge(id, node1, node2);
+		if (e instanceof MyEdge)
+			CSSManager.addCSSAble((MyEdge) e);
 		edgeCreatedNotify(e);
 		return e;
 	}
@@ -163,6 +193,8 @@ public class MyGraph extends SingleGraph {
 	@Override
 	public <T extends Edge> T addEdge(String id, String node1, String node2) {
 		T e = super.addEdge(id, node1, node2);
+		if (e instanceof MyEdge)
+			CSSManager.addCSSAble((MyEdge) e);
 		edgeCreatedNotify(e);
 		return e;
 	}
@@ -173,6 +205,8 @@ public class MyGraph extends SingleGraph {
 	@Override
 	public <T extends Edge> T addEdge(String id, int fromIndex, int toIndex, boolean directed) {
 		T e = super.addEdge(id, fromIndex, toIndex, directed);
+		if (e instanceof MyEdge)
+			CSSManager.addCSSAble((MyEdge) e);
 		edgeCreatedNotify(e);
 		return e;
 	}
@@ -183,6 +217,8 @@ public class MyGraph extends SingleGraph {
 	@Override
 	public <T extends Edge> T addEdge(String id, Node from, Node to, boolean directed) {
 		T e = super.addEdge(id, from, to, directed);
+		if (e instanceof MyEdge)
+			CSSManager.addCSSAble((MyEdge) e);
 		edgeCreatedNotify(e);
 		return e;
 	}
@@ -193,6 +229,8 @@ public class MyGraph extends SingleGraph {
 	@Override
 	public <T extends Edge> T addEdge(String id, String from, String to, boolean directed) {
 		T e = super.addEdge(id, from, to, directed);
+		if (e instanceof MyEdge)
+			CSSManager.addCSSAble((MyEdge) e);
 		edgeCreatedNotify(e);
 		return e;
 	}
@@ -203,10 +241,17 @@ public class MyGraph extends SingleGraph {
 	@Override
 	public <T extends Node> T addNode(String id) {
 		T n = super.addNode(id);
+		if (n instanceof MyNode)
+			CSSManager.addCSSAble((MyNode) n);
 		nodeCreatedNotify(n);
 		return n;
 	}
 
+	@Override
+	public void nodeAdded(String sourceId, long timeId, String nodeId) {
+		super.nodeAdded(sourceId, timeId, nodeId);
+	}
+
 	/**
 	 * Returns the smallest X Coordinate of any Node in the Graph.
 	 * 

+ 20 - 3
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MyNode.java

@@ -1,16 +1,17 @@
 package de.tu_darmstadt.informatik.tk.scopviz.graphs;
 
-import java.util.Set;
+import java.util.HashSet;
 
 import org.graphstream.graph.implementations.AbstractGraph;
 import org.graphstream.graph.implementations.SingleNode;
 
+import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.css.CSSManager;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.css.CSSable;
 
 public class MyNode extends SingleNode implements CSSable {
 	// TODO comment
-	Set<String> classes;
+	HashSet<String> classes;
 	// TODO comment
 	String type = "node";
 	// TODO comment
@@ -19,16 +20,19 @@ public class MyNode extends SingleNode implements CSSable {
 	public MyNode(AbstractGraph graph, String id) {
 		super(graph, id);
 		updateCSS();
+		classes = new HashSet<String>();
 	}
 
 	@Override
 	public void addCSSClass(String c) {
 		classes.add(c);
+		updateCSS();
 	}
 
 	@Override
 	public void removeCSSClass(String c) {
 		classes.remove(c);
+		updateCSS();
 	}
 
 	@Override
@@ -45,7 +49,7 @@ public class MyNode extends SingleNode implements CSSable {
 	}
 
 	@Override
-	public Set<String> getClasses() {
+	public HashSet<String> getClasses() {
 		return classes;
 	}
 
@@ -58,10 +62,23 @@ public class MyNode extends SingleNode implements CSSable {
 	public void updateCSS() {
 		css = CSSManager.getCSS(this);
 		addAttribute("ui.style", css);
+		Debug.out(id + ": " + type + classes + "\n" + css);
 	}
 
 	@Override
 	public String getCSS() {
 		return css;
 	}
+
+	@Override
+	protected void attributeChanged(AttributeChangeEvent event, String attribute, Object oldValue, Object newValue) {
+		super.attributeChanged(event, attribute, oldValue, newValue);
+		if (attribute.equals("ui.class")) {
+			if (oldValue != null && oldValue instanceof String)
+				removeCSSClass((String) oldValue);
+			if (newValue != null && newValue instanceof String)
+				addCSSClass((String) newValue);
+		}
+	}
+
 }

+ 1 - 3
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/NodeCreatedListener.java

@@ -1,7 +1,5 @@
 package de.tu_darmstadt.informatik.tk.scopviz.graphs;
 
-import org.graphstream.graph.Node;
-
 /**
  * Interface for Listeners on new Nodes being created.
  * 
@@ -18,5 +16,5 @@ public interface NodeCreatedListener {
 	 * @param graphID
 	 *            the Id of the Graph the Node was added to.
 	 */
-	public void nodeCreated(Node n, String graphID);
+	public void nodeCreated(MyNode n, String graphID);
 }

+ 4 - 5
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/GraphMLImporter.java

@@ -4,11 +4,10 @@ import java.io.IOException;
 import java.net.URL;
 import java.util.LinkedList;
 
-import org.graphstream.graph.Node;
-
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.GraphHelper;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyGraph;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyNode;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import javafx.stage.FileChooser;
 import javafx.stage.FileChooser.ExtensionFilter;
@@ -53,7 +52,7 @@ public class GraphMLImporter {
 			g = GraphHelper.newMerge(false, fs.getSubGraphs().toArray(new MyGraph[0]));
 		}
 		fs.removeSink(g);
-		for (Node n : g.getNodeSet()) {
+		for (MyNode n : g.<MyNode>getNodeSet()) {
 			n.removeAttribute("ui.class");
 		}
 		yEdConversion(g);
@@ -106,7 +105,7 @@ public class GraphMLImporter {
 			e.printStackTrace();
 		}
 		fs.removeSink(g);
-		for (Node n : g.getNodeSet()) {
+		for (MyNode n : g.<MyNode>getNodeSet()) {
 			n.removeAttribute("ui.class");
 		}
 		yEdConversion(g);
@@ -123,7 +122,7 @@ public class GraphMLImporter {
 	}
 
 	public void yEdConversion(MyGraph g) {
-		for (Node n : g.getNodeSet()) {
+		for (MyNode n : g.<MyNode>getNodeSet()) {
 			// yed conversion
 			if ((!n.hasAttribute("ui.label") || n.getAttribute("ui.label").equals("")) && n.hasAttribute("yEd.label")) {
 				n.addAttribute("ui.label", n.getAttribute("yEd.label").toString());

+ 6 - 6
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MyFileSinkGraphML.java

@@ -5,13 +5,13 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
 
-import org.graphstream.graph.Edge;
 import org.graphstream.graph.Graph;
-import org.graphstream.graph.Node;
 import org.graphstream.stream.file.FileSinkGraphML;
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyEdge;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyGraph;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyNode;
 
 public class MyFileSinkGraphML extends FileSinkGraphML {
 	public boolean isWritingMultigraph = false;
@@ -60,7 +60,7 @@ public class MyFileSinkGraphML extends FileSinkGraphML {
 				}
 			}
 
-			for (Node n : g.getEachNode()) {
+			for (MyNode n : g.<MyNode>getEachNode()) {
 				for (String k : n.getAttributeKeySet()) {
 					// AttributeFiltering
 					if (k.equals("ui.j2dsk") || k.equals("ui.class") || k.equals("ui.pie-values") || k.equalsIgnoreCase("originalgraph")) {
@@ -106,7 +106,7 @@ public class MyFileSinkGraphML extends FileSinkGraphML {
 				}
 			}
 
-			for (Edge n : g.getEachEdge()) {
+			for (MyEdge n : g.<MyEdge>getEachEdge()) {
 				for (String k : n.getAttributeKeySet()) {
 					// AttributeFiltering
 					if (k.equals("ui.j2dsk")) {
@@ -160,7 +160,7 @@ public class MyFileSinkGraphML extends FileSinkGraphML {
 						escapeXmlString(g.getAttribute(k).toString()));
 			}
 
-			for (Node n : g.getEachNode()) {
+			for (MyNode n : g.<MyNode>getEachNode()) {
 				print("\t\t<node id=\"%s\">\n", n.getId());
 				for (String k : n.getAttributeKeySet()) {
 					if (k.equals("ui.j2dsk") || k.equals("ui.class") || k.equals("ui.pie-values") || k.equalsIgnoreCase("originalgraph")) {
@@ -178,7 +178,7 @@ public class MyFileSinkGraphML extends FileSinkGraphML {
 				}
 				print("\t\t</node>\n");
 			}
-			for (Edge e : g.getEachEdge()) {
+			for (MyEdge e : g.<MyEdge>getEachEdge()) {
 				print("\t\t<edge id=\"%s\" source=\"%s\" target=\"%s\" directed=\"%s\">\n", e.getId(),
 						e.getSourceNode().getId(), e.getTargetNode().getId(), e.isDirected());
 				for (String k : e.getAttributeKeySet()) {

+ 77 - 66
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MyFileSourceGraphML.java

@@ -266,6 +266,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	 * 
 	 * @see org.graphstream.stream.file.FileSource#readAll(java.lang.String)
 	 */
+	@Override
 	public void readAll(String fileName) throws IOException {
 		readAll(new FileReader(fileName));
 	}
@@ -275,6 +276,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	 * 
 	 * @see org.graphstream.stream.file.FileSource#readAll(java.net.URL)
 	 */
+	@Override
 	public void readAll(URL url) throws IOException {
 		readAll(url.openStream());
 	}
@@ -284,6 +286,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	 * 
 	 * @see org.graphstream.stream.file.FileSource#readAll(java.io.InputStream)
 	 */
+	@Override
 	public void readAll(InputStream stream) throws IOException {
 		readAll(new InputStreamReader(stream));
 	}
@@ -293,6 +296,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	 * 
 	 * @see org.graphstream.stream.file.FileSource#readAll(java.io.Reader)
 	 */
+	@Override
 	public void readAll(Reader reader) throws IOException {
 		begin(reader);
 		while (nextEvents())
@@ -305,6 +309,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	 * 
 	 * @see org.graphstream.stream.file.FileSource#begin(java.lang.String)
 	 */
+	@Override
 	public void begin(String fileName) throws IOException {
 		begin(new FileReader(fileName));
 	}
@@ -314,6 +319,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	 * 
 	 * @see org.graphstream.stream.file.FileSource#begin(java.net.URL)
 	 */
+	@Override
 	public void begin(URL url) throws IOException {
 		begin(url.openStream());
 	}
@@ -323,6 +329,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	 * 
 	 * @see org.graphstream.stream.file.FileSource#begin(java.io.InputStream)
 	 */
+	@Override
 	public void begin(InputStream stream) throws IOException {
 		begin(new InputStreamReader(stream));
 	}
@@ -332,6 +339,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	 * 
 	 * @see org.graphstream.stream.file.FileSource#begin(java.io.Reader)
 	 */
+	@Override
 	public void begin(Reader reader) throws IOException {
 		openStream(reader);
 	}
@@ -341,6 +349,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	 * 
 	 * @see org.graphstream.stream.file.FileSource#nextEvents()
 	 */
+	@Override
 	public boolean nextEvents() throws IOException {
 		try {
 			__graphml();
@@ -356,6 +365,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	 * 
 	 * @see org.graphstream.stream.file.FileSource#nextStep()
 	 */
+	@Override
 	public boolean nextStep() throws IOException {
 		return nextEvents();
 	}
@@ -365,6 +375,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	 * 
 	 * @see org.graphstream.stream.file.FileSource#end()
 	 */
+	@Override
 	public void end() throws IOException {
 		closeStream();
 	}
@@ -377,7 +388,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		else {
 			temp = reader.nextEvent();
 		}
-		if (temp.getEventType() == XMLEvent.COMMENT) {
+		if (temp.getEventType() == XMLStreamConstants.COMMENT) {
 			temp = getNextEvent();
 		}
 		return temp;
@@ -538,7 +549,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 				e = events.pop();
 			else
 				e = reader.nextEvent();
-		} while (isEvent(e, XMLEvent.CHARACTERS, null) && e.asCharacters().getData().matches("^\\s*$"));
+		} while (isEvent(e, XMLStreamConstants.CHARACTERS, null) && e.asCharacters().getData().matches("^\\s*$"));
 
 		pushback(e);
 	}
@@ -553,7 +564,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 			reader = XMLInputFactory.newInstance().createXMLEventReader(stream);
 
 			e = getNextEvent();
-			checkValid(e, XMLEvent.START_DOCUMENT, null);
+			checkValid(e, XMLStreamConstants.START_DOCUMENT, null);
 
 		} catch (XMLStreamException e) {
 			throw new IOException(e);
@@ -596,13 +607,13 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 
 			switch (currentReaderState) {
 			case START:
-				checkValid(e, XMLEvent.START_ELEMENT, "graphml");
+				checkValid(e, XMLStreamConstants.START_ELEMENT, "graphml");
 				currentReaderState = ReaderState.DESC;
 				e = getNextEvent();
 
 				break;
 			case DESC:
-				if (isEvent(e, XMLEvent.START_ELEMENT, "desc")) {
+				if (isEvent(e, XMLStreamConstants.START_ELEMENT, "desc")) {
 					pushback(e);
 					__desc();
 					e = getNextEvent();
@@ -612,7 +623,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 
 				break;
 			case KEYS:
-				if (isEvent(e, XMLEvent.START_ELEMENT, "key")) {
+				if (isEvent(e, XMLStreamConstants.START_ELEMENT, "key")) {
 					pushback(e);
 					__key();
 					e = getNextEvent();
@@ -621,18 +632,18 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 				}
 				break;
 			case NEW_GRAPH:
-				if (isEvent(e, XMLEvent.START_ELEMENT, "graph")) {
+				if (isEvent(e, XMLStreamConstants.START_ELEMENT, "graph")) {
 					newSubGraph();
 					pushback(e);
 					__graph();
 					e = getNextEvent();
 				}
 
-				if (isEvent(e, XMLEvent.START_ELEMENT, "node") || isEvent(e, XMLEvent.START_ELEMENT, "edge")) {
+				if (isEvent(e, XMLStreamConstants.START_ELEMENT, "node") || isEvent(e, XMLStreamConstants.START_ELEMENT, "edge")) {
 					currentReaderState = ReaderState.NODES_EDGES;
-				} else if (isEvent(e, XMLEvent.END_ELEMENT, "graph")) {
+				} else if (isEvent(e, XMLStreamConstants.END_ELEMENT, "graph")) {
 					currentReaderState = ReaderState.GRAPH_END;
-				} else if (isEvent(e, XMLEvent.START_ELEMENT, "data")) {
+				} else if (isEvent(e, XMLStreamConstants.START_ELEMENT, "data")) {
 					pushback(e);
 					Data data = __data();
 					sendGraphAttributeAdded(sourceId, data.key.name, data.value);
@@ -645,22 +656,22 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 			case NODES_EDGES:
 				pushback(e);
 
-				if (isEvent(e, XMLEvent.START_ELEMENT, "node")) {
+				if (isEvent(e, XMLStreamConstants.START_ELEMENT, "node")) {
 					__node();
 					e = getNextEvent();
-				} else if (isEvent(e, XMLEvent.START_ELEMENT, "edge")) {
+				} else if (isEvent(e, XMLStreamConstants.START_ELEMENT, "edge")) {
 					__edge(edgeDefault);
 					e = getNextEvent();
-				} else if (isEvent(e, XMLEvent.END_ELEMENT, "graph")) {
+				} else if (isEvent(e, XMLStreamConstants.END_ELEMENT, "graph")) {
 					currentReaderState = ReaderState.GRAPH_END;
 					e = getNextEvent();
-				} else if (isEvent(e, XMLEvent.END_ELEMENT, "graphml")) {
+				} else if (isEvent(e, XMLStreamConstants.END_ELEMENT, "graphml")) {
 					currentReaderState = ReaderState.END;
 					e = getNextEvent();
-				} else if (isEvent(e, XMLEvent.START_ELEMENT, "data")) {
+				} else if (isEvent(e, XMLStreamConstants.START_ELEMENT, "data")) {
 					datas.add(__data());
 					e = getNextEvent();
-				} else if (isEvent(e, XMLEvent.START_ELEMENT, "hyperedge")) {
+				} else if (isEvent(e, XMLStreamConstants.START_ELEMENT, "hyperedge")) {
 					__hyperedge();
 					e = getNextEvent();
 				} else {
@@ -673,16 +684,16 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 					e = getNextEvent();
 					subGraphFinished();
 				}
-				if (isEvent(e, XMLEvent.START_ELEMENT, "graph")) {
+				if (isEvent(e, XMLStreamConstants.START_ELEMENT, "graph")) {
 					currentReaderState = ReaderState.NEW_GRAPH;
-				} else if (isEvent(e, XMLEvent.END_ELEMENT, "graphml")) {
+				} else if (isEvent(e, XMLStreamConstants.END_ELEMENT, "graphml")) {
 					currentReaderState = ReaderState.END;
-				} else if (isEvent(e, XMLEvent.START_ELEMENT, "key")) {
+				} else if (isEvent(e, XMLStreamConstants.START_ELEMENT, "key")) {
 					currentReaderState = ReaderState.KEYS;
 
-				} else if (isEvent(e, XMLEvent.START_ELEMENT, "node") || isEvent(e, XMLEvent.START_ELEMENT, "edge")) {
+				} else if (isEvent(e, XMLStreamConstants.START_ELEMENT, "node") || isEvent(e, XMLStreamConstants.START_ELEMENT, "edge")) {
 					currentReaderState = ReaderState.NODES_EDGES;
-				} else if (isEvent(e, XMLEvent.START_ELEMENT, "data")) {
+				} else if (isEvent(e, XMLStreamConstants.START_ELEMENT, "data")) {
 					// ignore <data>
 					pushback(e);
 					__data();
@@ -705,7 +716,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 
 		e = getNextEvent();
 
-		while (e.getEventType() == XMLEvent.CHARACTERS) {
+		while (e.getEventType() == XMLStreamConstants.CHARACTERS) {
 			buffer.append(e.asCharacters());
 			e = getNextEvent();
 		}
@@ -729,12 +740,12 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		String desc;
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.START_ELEMENT, "desc");
+		checkValid(e, XMLStreamConstants.START_ELEMENT, "desc");
 
 		desc = __characters();
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.END_ELEMENT, "desc");
+		checkValid(e, XMLStreamConstants.END_ELEMENT, "desc");
 
 		return desc;
 	}
@@ -757,7 +768,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		XMLEvent e;
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.START_ELEMENT, "locator");
+		checkValid(e, XMLStreamConstants.START_ELEMENT, "locator");
 
 		@SuppressWarnings("unchecked")
 		Iterator<? extends Attribute> attributes = e.asStartElement().getAttributes();
@@ -787,7 +798,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		}
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.END_ELEMENT, "locator");
+		checkValid(e, XMLStreamConstants.END_ELEMENT, "locator");
 
 		if (loc.href == null)
 			throw newParseError(e, "locator requires an href");
@@ -811,7 +822,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		XMLEvent e;
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.START_ELEMENT, "key");
+		checkValid(e, XMLStreamConstants.START_ELEMENT, "key");
 
 		@SuppressWarnings("unchecked")
 		Iterator<? extends Attribute> attributes = e.asStartElement().getAttributes();
@@ -864,16 +875,16 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 
 		e = getNextEvent();
 
-		if (isEvent(e, XMLEvent.START_ELEMENT, "default")) {
+		if (isEvent(e, XMLStreamConstants.START_ELEMENT, "default")) {
 			def = __characters();
 
 			e = getNextEvent();
-			checkValid(e, XMLEvent.END_ELEMENT, "default");
+			checkValid(e, XMLStreamConstants.END_ELEMENT, "default");
 
 			e = getNextEvent();
 		}
 
-		checkValid(e, XMLEvent.END_ELEMENT, "key");
+		checkValid(e, XMLStreamConstants.END_ELEMENT, "key");
 
 		if (id == null)
 			throw newParseError(e, "key requires an id");
@@ -907,7 +918,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		XMLEvent e;
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.START_ELEMENT, "port");
+		checkValid(e, XMLStreamConstants.START_ELEMENT, "port");
 
 		Port port = new Port();
 		@SuppressWarnings("unchecked")
@@ -932,12 +943,12 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 			throw newParseError(e, "'<port>' element requires a 'name' attribute");
 
 		e = getNextEvent();
-		if (isEvent(e, XMLEvent.START_ELEMENT, "desc")) {
+		if (isEvent(e, XMLStreamConstants.START_ELEMENT, "desc")) {
 			pushback(e);
 			port.desc = __desc();
 		} else {
-			while (isEvent(e, XMLEvent.START_ELEMENT, "data") || isEvent(e, XMLEvent.START_ELEMENT, "port")) {
-				if (isEvent(e, XMLEvent.START_ELEMENT, "data")) {
+			while (isEvent(e, XMLStreamConstants.START_ELEMENT, "data") || isEvent(e, XMLStreamConstants.START_ELEMENT, "port")) {
+				if (isEvent(e, XMLStreamConstants.START_ELEMENT, "data")) {
 					Data data;
 
 					pushback(e);
@@ -958,7 +969,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		}
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.END_ELEMENT, "port");
+		checkValid(e, XMLStreamConstants.END_ELEMENT, "port");
 
 		return port;
 	}
@@ -982,7 +993,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		XMLEvent e;
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.START_ELEMENT, "endpoint");
+		checkValid(e, XMLStreamConstants.START_ELEMENT, "endpoint");
 
 		@SuppressWarnings("unchecked")
 		Iterator<? extends Attribute> attributes = e.asStartElement().getAttributes();
@@ -1023,13 +1034,13 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 
 		e = getNextEvent();
 
-		if (isEvent(e, XMLEvent.START_ELEMENT, "desc")) {
+		if (isEvent(e, XMLStreamConstants.START_ELEMENT, "desc")) {
 			pushback(e);
 			ep.desc = __desc();
 		}
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.END_ELEMENT, "endpoint");
+		checkValid(e, XMLStreamConstants.END_ELEMENT, "endpoint");
 
 		return ep;
 	}
@@ -1052,7 +1063,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		StringBuilder buffer = new StringBuilder();
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.START_ELEMENT, "data");
+		checkValid(e, XMLStreamConstants.START_ELEMENT, "data");
 
 		@SuppressWarnings("unchecked")
 		Iterator<? extends Attribute> attributes = e.asStartElement().getAttributes();
@@ -1081,7 +1092,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 			throw newParseError(e, "'<data>' element must have a 'key' attribute");
 
 		e = getNextEvent();
-		while (e.getEventType() == XMLEvent.CHARACTERS) {
+		while (e.getEventType() == XMLStreamConstants.CHARACTERS) {
 			buffer.append(e.asCharacters());
 			e = getNextEvent();
 		}
@@ -1091,7 +1102,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 			parseYed();
 			e = getNextEvent();
 		}
-		checkValid(e, XMLEvent.END_ELEMENT, "data");
+		checkValid(e, XMLStreamConstants.END_ELEMENT, "data");
 
 		if (keys.containsKey(key))
 			newParseError(e, "unknown key '%s'", key);
@@ -1216,7 +1227,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	private void __graph() throws IOException, XMLStreamException {
 		XMLEvent e;
 		e = getNextEvent();
-		checkValid(e, XMLEvent.START_ELEMENT, "graph");
+		checkValid(e, XMLStreamConstants.START_ELEMENT, "graph");
 
 		@SuppressWarnings("unchecked")
 		Iterator<? extends Attribute> attributes = e.asStartElement().getAttributes();
@@ -1269,7 +1280,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 
 		e = getNextEvent();
 
-		if (isEvent(e, XMLEvent.START_ELEMENT, "desc")) {
+		if (isEvent(e, XMLStreamConstants.START_ELEMENT, "desc")) {
 			pushback(e);
 			desc = __desc();
 
@@ -1278,7 +1289,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 			e = getNextEvent();
 		}
 
-		if (isEvent(e, XMLEvent.START_ELEMENT, "locator")) {
+		if (isEvent(e, XMLStreamConstants.START_ELEMENT, "locator")) {
 			pushback(e);
 			__locator();
 			e = getNextEvent();
@@ -1302,7 +1313,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		XMLEvent e;
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.START_ELEMENT, "node");
+		checkValid(e, XMLStreamConstants.START_ELEMENT, "node");
 
 		@SuppressWarnings("unchecked")
 		Iterator<? extends Attribute> attributes = e.asStartElement().getAttributes();
@@ -1332,23 +1343,23 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 
 		e = getNextEvent();
 
-		if (isEvent(e, XMLEvent.START_ELEMENT, "desc")) {
+		if (isEvent(e, XMLStreamConstants.START_ELEMENT, "desc")) {
 			String desc;
 
 			pushback(e);
 			desc = __desc();
 
 			sendNodeAttributeAdded(sourceId, id, "desc", desc);
-		} else if (isEvent(e, XMLEvent.START_ELEMENT, "locator")) {
+		} else if (isEvent(e, XMLStreamConstants.START_ELEMENT, "locator")) {
 			pushback(e);
 			__locator();
 		} else {
 			Data data;
-			while (isEvent(e, XMLEvent.START_ELEMENT, "data") || isEvent(e, XMLEvent.START_ELEMENT, "port")
+			while (isEvent(e, XMLStreamConstants.START_ELEMENT, "data") || isEvent(e, XMLStreamConstants.START_ELEMENT, "port")
 					|| (e.isStartElement() && e.asStartElement().getName().getPrefix() == "y")
 					|| isEvent(e, END_ELEMENT, "data")) {
 				// Yed parsing
-				if (e.getEventType() == XMLEvent.START_ELEMENT && e.asStartElement().getName().getPrefix() == "y") {
+				if (e.getEventType() == XMLStreamConstants.START_ELEMENT && e.asStartElement().getName().getPrefix() == "y") {
 					pushback(e);
 					data = parseYed();
 					if (data != null) {
@@ -1360,9 +1371,9 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 						sentAttributes.add(data.key);
 					}
 				} else if (isEvent(e, END_ELEMENT, "data")) {
-				} else if (isEvent(e, XMLEvent.START_ELEMENT, "data")) {
+				} else if (isEvent(e, XMLStreamConstants.START_ELEMENT, "data")) {
 					XMLEvent yEd = getNextEvent();
-					if (yEd.getEventType() == XMLEvent.START_ELEMENT
+					if (yEd.getEventType() == XMLStreamConstants.START_ELEMENT
 							&& yEd.asStartElement().getName().getPrefix() == "y") {
 						pushback(yEd);
 						data = parseYed();
@@ -1391,7 +1402,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 			}
 		}
 
-		if (isEvent(e, XMLEvent.START_ELEMENT, "graph")) {
+		if (isEvent(e, XMLStreamConstants.START_ELEMENT, "graph")) {
 			Location loc = e.getLocation();
 
 			Debug.out(String.format("[WARNING] %d:%d graph inside node is not implemented", loc.getLineNumber(),
@@ -1403,7 +1414,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 			e = getNextEvent();
 		}
 
-		checkValid(e, XMLEvent.END_ELEMENT, "node");
+		checkValid(e, XMLStreamConstants.END_ELEMENT, "node");
 	}
 
 	/**
@@ -1427,7 +1438,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		XMLEvent e;
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.START_ELEMENT, "edge");
+		checkValid(e, XMLStreamConstants.START_ELEMENT, "edge");
 
 		@SuppressWarnings("unchecked")
 		Iterator<? extends Attribute> attributes = e.asStartElement().getAttributes();
@@ -1476,7 +1487,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 
 		e = getNextEvent();
 
-		if (isEvent(e, XMLEvent.START_ELEMENT, "desc")) {
+		if (isEvent(e, XMLStreamConstants.START_ELEMENT, "desc")) {
 			String desc;
 
 			pushback(e);
@@ -1486,11 +1497,11 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		} else {
 			Data data;
 			// parsing yed and graphstream attribute data
-			while (isEvent(e, XMLEvent.START_ELEMENT, "data")
+			while (isEvent(e, XMLStreamConstants.START_ELEMENT, "data")
 					|| (e.isStartElement() && e.asStartElement().getName().getPrefix() == "y")
 					|| isEvent(e, END_ELEMENT, "data")) {
 				// Yed parsing
-				if (e.getEventType() == XMLEvent.START_ELEMENT && e.asStartElement().getName().getPrefix() == "y") {
+				if (e.getEventType() == XMLStreamConstants.START_ELEMENT && e.asStartElement().getName().getPrefix() == "y") {
 					pushback(e);
 					data = parseYed();
 					if (data != null) {
@@ -1506,7 +1517,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 				} else {
 					XMLEvent yEd = getNextEvent();
 					// parsing a <y: > after <data>
-					if (yEd.getEventType() == XMLEvent.START_ELEMENT
+					if (yEd.getEventType() == XMLStreamConstants.START_ELEMENT
 							&& yEd.asStartElement().getName().getPrefix() == "y") {
 						pushback(yEd);
 						data = parseYed();
@@ -1539,7 +1550,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 				sendEdgeAttributeAdded(sourceId, id, k.name, getDefaultValue(k));
 		}
 
-		if (isEvent(e, XMLEvent.START_ELEMENT, "graph")) {
+		if (isEvent(e, XMLStreamConstants.START_ELEMENT, "graph")) {
 			Location loc = e.getLocation();
 
 			System.err.printf("[WARNING] %d:%d graph inside node is not implemented", loc.getLineNumber(),
@@ -1551,7 +1562,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 			e = getNextEvent();
 		}
 
-		checkValid(e, XMLEvent.END_ELEMENT, "edge");
+		checkValid(e, XMLStreamConstants.END_ELEMENT, "edge");
 	}
 
 	/**
@@ -1569,7 +1580,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		XMLEvent e;
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.START_ELEMENT, "hyperedge");
+		checkValid(e, XMLStreamConstants.START_ELEMENT, "hyperedge");
 
 		Location loc = e.getLocation();
 
@@ -1602,12 +1613,12 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 
 		e = getNextEvent();
 
-		if (isEvent(e, XMLEvent.START_ELEMENT, "desc")) {
+		if (isEvent(e, XMLStreamConstants.START_ELEMENT, "desc")) {
 			pushback(e);
 			__desc();
 		} else {
-			while (isEvent(e, XMLEvent.START_ELEMENT, "data") || isEvent(e, XMLEvent.START_ELEMENT, "endpoint")) {
-				if (isEvent(e, XMLEvent.START_ELEMENT, "data")) {
+			while (isEvent(e, XMLStreamConstants.START_ELEMENT, "data") || isEvent(e, XMLStreamConstants.START_ELEMENT, "endpoint")) {
+				if (isEvent(e, XMLStreamConstants.START_ELEMENT, "data")) {
 					pushback(e);
 					__data();
 				} else {
@@ -1619,7 +1630,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 			}
 		}
 
-		if (isEvent(e, XMLEvent.START_ELEMENT, "graph")) {
+		if (isEvent(e, XMLStreamConstants.START_ELEMENT, "graph")) {
 			loc = e.getLocation();
 
 			System.err.printf("[WARNING] %d:%d graph inside node is not implemented", loc.getLineNumber(),
@@ -1632,6 +1643,6 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		}
 
 		e = getNextEvent();
-		checkValid(e, XMLEvent.END_ELEMENT, "hyperedge");
+		checkValid(e, XMLStreamConstants.END_ELEMENT, "hyperedge");
 	}
 }

+ 19 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MySourceBase.java

@@ -188,6 +188,7 @@ public class MySourceBase implements Source {
 
 	// Command
 
+	@Override
 	public void addSink(Sink sink) {
 		multiGraph = false;
 		originalSink = sink;
@@ -212,6 +213,7 @@ public class MySourceBase implements Source {
 		addElementSink(sink);
 	}
 
+	@Override
 	public void addAttributeSink(AttributeSink sink) {
 		if (!eventProcessing) {
 			eventProcessing = true;
@@ -226,6 +228,7 @@ public class MySourceBase implements Source {
 		}
 	}
 
+	@Override
 	public void addElementSink(ElementSink sink) {
 		if (!eventProcessing) {
 			eventProcessing = true;
@@ -240,11 +243,13 @@ public class MySourceBase implements Source {
 		}
 	}
 
+	@Override
 	public void clearSinks() {
 		clearElementSinks();
 		clearAttributeSinks();
 	}
 
+	@Override
 	public void clearElementSinks() {
 		if (!eventProcessing) {
 			eventProcessing = true;
@@ -259,6 +264,7 @@ public class MySourceBase implements Source {
 		}
 	}
 
+	@Override
 	public void clearAttributeSinks() {
 		if (!eventProcessing) {
 			eventProcessing = true;
@@ -273,11 +279,13 @@ public class MySourceBase implements Source {
 		}
 	}
 
+	@Override
 	public void removeSink(Sink sink) {
 		removeAttributeSink(sink);
 		removeElementSink(sink);
 	}
 
+	@Override
 	public void removeAttributeSink(AttributeSink sink) {
 		if (!eventProcessing) {
 			eventProcessing = true;
@@ -292,6 +300,7 @@ public class MySourceBase implements Source {
 		}
 	}
 
+	@Override
 	public void removeElementSink(ElementSink sink) {
 		if (!eventProcessing) {
 			eventProcessing = true;
@@ -994,6 +1003,7 @@ public class MySourceBase implements Source {
 			this.directed = directed;
 		}
 
+		@Override
 		void trigger() {
 			for (int i = 0; i < eltsSinks.size(); i++)
 				eltsSinks.get(i).edgeAdded(sourceId, timeId, edgeId, fromNodeId, toNodeId, directed);
@@ -1008,6 +1018,7 @@ public class MySourceBase implements Source {
 			this.edgeId = edgeId;
 		}
 
+		@Override
 		void trigger() {
 			for (int i = 0; i < eltsSinks.size(); i++)
 				eltsSinks.get(i).edgeRemoved(sourceId, timeId, edgeId);
@@ -1022,6 +1033,7 @@ public class MySourceBase implements Source {
 			this.nodeId = nodeId;
 		}
 
+		@Override
 		void trigger() {
 			for (int i = 0; i < eltsSinks.size(); i++)
 				eltsSinks.get(i).nodeAdded(sourceId, timeId, nodeId);
@@ -1036,6 +1048,7 @@ public class MySourceBase implements Source {
 			this.nodeId = nodeId;
 		}
 
+		@Override
 		void trigger() {
 			for (int i = 0; i < eltsSinks.size(); i++)
 				eltsSinks.get(i).nodeRemoved(sourceId, timeId, nodeId);
@@ -1047,6 +1060,7 @@ public class MySourceBase implements Source {
 			super(sourceId, timeId);
 		}
 
+		@Override
 		void trigger() {
 			for (int i = 0; i < eltsSinks.size(); i++)
 				eltsSinks.get(i).graphCleared(sourceId, timeId);
@@ -1061,6 +1075,7 @@ public class MySourceBase implements Source {
 			this.step = step;
 		}
 
+		@Override
 		void trigger() {
 			for (int i = 0; i < eltsSinks.size(); i++)
 				eltsSinks.get(i).stepBegins(sourceId, timeId, step);
@@ -1091,6 +1106,7 @@ public class MySourceBase implements Source {
 			this.newValue = newValue;
 		}
 
+		@Override
 		void trigger() {
 			switch (event) {
 			case ADD:
@@ -1151,6 +1167,7 @@ public class MySourceBase implements Source {
 			this.obj = obj;
 		}
 
+		@Override
 		void trigger() {
 			l.add(obj);
 		}
@@ -1166,6 +1183,7 @@ public class MySourceBase implements Source {
 			this.obj = obj;
 		}
 
+		@Override
 		void trigger() {
 			l.remove(obj);
 		}
@@ -1179,6 +1197,7 @@ public class MySourceBase implements Source {
 			this.l = l;
 		}
 
+		@Override
 		void trigger() {
 			l.clear();
 		}

+ 15 - 15
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/EdgeSelectionHelper.java

@@ -2,13 +2,13 @@ package de.tu_darmstadt.informatik.tk.scopviz.main;
 
 import java.util.Iterator;
 
-import org.graphstream.algorithm.Toolkit;
-import org.graphstream.graph.Edge;
-import org.graphstream.graph.Node;
 import org.graphstream.ui.geom.Point3;
+import org.graphstream.ui.graphicGraph.GraphPosLengthUtils;
 import org.graphstream.ui.view.Camera;
 
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.GraphManager;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyEdge;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyNode;
 
 /**
  * This class contains helpful static functions.
@@ -45,7 +45,7 @@ public final class EdgeSelectionHelper {
 	 * @return the closest Edge if a valid Edge exists, returns <b>null</b>
 	 *         otherwise
 	 */
-	public static Edge getClosestEdge(Point3 pos) {
+	public static MyEdge getClosestEdge(Point3 pos) {
 		Camera cam = Main.getInstance().getGraphManager().getView().getCamera();
 
 		// gets to points within a fixed distance of each other and calculates
@@ -74,7 +74,7 @@ public final class EdgeSelectionHelper {
 	 * @return the closest Edge if a valid Edge exists, returns <b>null</b>
 	 *         otherwise
 	 */
-	public static Edge getClosestEdge(Point3 pos, double maxDistance) {
+	public static MyEdge getClosestEdge(Point3 pos, double maxDistance) {
 		double x0 = pos.x;
 		double y0 = pos.y;
 
@@ -83,18 +83,18 @@ public final class EdgeSelectionHelper {
 		double dist = maxDistance;
 
 		// keeps track of the current closest edge
-		Edge result = null;
+		MyEdge result = null;
 
 		GraphManager gm = Main.getInstance().getGraphManager();
 
 		// Iterates over every edge, calculates the distance and updates the
 		// best edge and corresponding distance
-		for (Iterator<Edge> iterator = gm.getGraph().getEdgeIterator(); iterator.hasNext();) {
-			Edge edge = (Edge) iterator.next();
+		for (Iterator<MyEdge> iterator = gm.getGraph().getEdgeIterator(); iterator.hasNext();) {
+			MyEdge edge = iterator.next();
 
 			// Get the positions of the nodes of the currently selected edge.
-			double[] n1 = Toolkit.nodePosition(edge.getNode0());
-			double[] n2 = Toolkit.nodePosition(edge.getNode1());
+			double[] n1 = GraphPosLengthUtils.nodePosition(edge.getNode0());
+			double[] n2 = GraphPosLengthUtils.nodePosition(edge.getNode1());
 
 			// Extract the x and y values of the positions of the nodes
 			double x1 = n1[0];
@@ -146,9 +146,9 @@ public final class EdgeSelectionHelper {
 	 *            Node 2
 	 * @return the distance between the two Nodes as a double
 	 */
-	public static double distance(Node a, Node b) {
-		double[] n1 = Toolkit.nodePosition(a);
-		double[] n2 = Toolkit.nodePosition(b);
+	public static double distance(MyNode a, MyNode b) {
+		double[] n1 = GraphPosLengthUtils.nodePosition(a);
+		double[] n2 = GraphPosLengthUtils.nodePosition(b);
 
 		return distance(n1[0], n1[1], n2[0], n2[1]);
 	}
@@ -164,8 +164,8 @@ public final class EdgeSelectionHelper {
 	 *            the Node
 	 * @return the distance between the position and the Node as a double
 	 */
-	public static double distance(double x0, double y0, Node a) {
-		double[] n1 = Toolkit.nodePosition(a);
+	public static double distance(double x0, double y0, MyNode a) {
+		double[] n1 = GraphPosLengthUtils.nodePosition(a);
 
 		return distance(x0, y0, n1[0], n1[1]);
 	}

+ 8 - 18
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/MainApp.java

@@ -4,7 +4,6 @@ import java.io.IOException;
 import java.net.URL;
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
-import de.tu_darmstadt.informatik.tk.scopviz.io.GraphMLImporter;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.GraphDisplayManager;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.OptionsManager;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.css.CSSManager;
@@ -25,8 +24,6 @@ import javafx.stage.WindowEvent;
  */
 public class MainApp extends Application {
 
-	private static final boolean exportOnClose = false;
-
 	/**
 	 * Primary Stage for the UI Scene.
 	 */
@@ -73,23 +70,16 @@ public class MainApp extends Application {
 			GraphDisplayManager.addGraph(Debug.getDefaultOperatorGraph(), true);
 			GraphDisplayManager.setCurrentLayer(Layer.UNDERLAY);
 			GraphDisplayManager.addGraph(Debug.getDefaultUnderlayGraph(), true);
-		} else {
-			GraphMLImporter imp = new GraphMLImporter();
-			GraphDisplayManager.setCurrentLayer(Layer.OPERATOR);
-			try {
-				GraphDisplayManager.addGraph(imp.readGraph("graph-1", "operator-shutdown.graphml"), true);
-			} catch (Exception e) {
-				Debug.out("INFORMATION: no previous operatorgraph", 1);
-			}
-			GraphDisplayManager.setCurrentLayer(Layer.UNDERLAY);
-			try {
-				GraphDisplayManager.addGraph(imp.readGraph("graph-2", "underlay-shutdown.graphml"), true);
-			} catch (Exception e) {
-				Debug.out("INFORMATION: no previous underlaygraph", 1);
-			}
 		}
 		OptionsManager.load();
-		CSSManager.addRule("node{text-alignment: at-right; size: 15px;}");
+		CSSManager.addRule("node{text-alignment:at-right; size:15px;fill-color: #000000;}"
+				+ "edge{text-offset: 4px,-4px;fill-color: #000000;}" + ".selected{fill-color: #FF0000;}"
+				+ "node.standard{shape: diamond;}" + "node.source{shape: triangle;}" + "node.procEn{shape: circle;}"
+				+ "node.sink{shape: box;}" + "node.operator{shape: diamond;}"
+				+ ".selectedForEdgeCreation{fill-color: #00ff00;}"
+				+ "edge.mapping {stroke-color: #33ff33; stroke-mode: dashes; fill-mode: none; size: 0px;}"
+				+ "node.procEn.onMapping {fill-mode: plain; shape: pie-chart; fill-color: #555555, #cccc00, #32cd32, #8b0000; size: 20px;}"
+				+ "edge.mapping.selected{stroke-color: #FF0000;}"+"node.procEn.onMapping.selected{size: 15px;}"+"edge.mapping.blue {stroke-color: #3333ff}");
 	}
 
 	/**

+ 15 - 16
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/BasicMappingOperator.java

@@ -4,11 +4,10 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.LinkedList;
 
-import org.graphstream.graph.Node;
-
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.GraphManager;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MappingGraphManager;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyNode;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.metrics.interfaces.ScopvizGraphOperator;
 
@@ -26,15 +25,15 @@ public class BasicMappingOperator implements ScopvizGraphOperator {
 		}
 
 		// find the Nodes that have to be mapped and where they can be mapped to
-		LinkedList<Node> operatorNodes = getOperatorNodes(map);
-		LinkedList<Node> procEnNodes = getProcEnNodes(map);
+		LinkedList<MyNode> operatorNodes = getOperatorNodes(map);
+		LinkedList<MyNode> procEnNodes = getProcEnNodes(map);
 
 		// Map the Nodes (beginning with the operatorNode with the highest
 		// Processing requirement)
 		operatorNodes.sort(operatorComparator);
-		Iterator<Node> procEnIterator;
+		Iterator<MyNode> procEnIterator;
 		Boolean successfull;
-		for (Node n : operatorNodes) {
+		for (MyNode n : operatorNodes) {
 			procEnIterator = procEnNodes.iterator();
 			successfull = false;
 			while (procEnIterator.hasNext() && !successfull) {
@@ -52,11 +51,11 @@ public class BasicMappingOperator implements ScopvizGraphOperator {
 		return "Basic Automapping";
 	}
 
-	protected LinkedList<Node> getProcEnNodes(GraphManager g) {
-		LinkedList<Node> result = new LinkedList<Node>();
-		Iterator<Node> nodeIter = g.getGraph().getNodeIterator();
+	protected LinkedList<MyNode> getProcEnNodes(GraphManager g) {
+		LinkedList<MyNode> result = new LinkedList<MyNode>();
+		Iterator<MyNode> nodeIter = g.getGraph().getNodeIterator();
 		while (nodeIter.hasNext()) {
-			Node n = nodeIter.next();
+			MyNode n = nodeIter.next();
 			if ("procEn".equals(n.getAttribute("typeofNode"))) {
 				result.add(n);
 			}
@@ -64,11 +63,11 @@ public class BasicMappingOperator implements ScopvizGraphOperator {
 		return result;
 	}
 
-	protected LinkedList<Node> getOperatorNodes(GraphManager g) {
-		LinkedList<Node> result = new LinkedList<Node>();
-		Iterator<Node> nodeIter = g.getGraph().getNodeIterator();
+	protected LinkedList<MyNode> getOperatorNodes(GraphManager g) {
+		LinkedList<MyNode> result = new LinkedList<MyNode>();
+		Iterator<MyNode> nodeIter = g.getGraph().getNodeIterator();
 		while (nodeIter.hasNext()) {
-			Node n = nodeIter.next();
+			MyNode n = nodeIter.next();
 			if ("operator".equals(n.getAttribute("typeofNode"))) {
 				result.add(n);
 			}
@@ -76,10 +75,10 @@ public class BasicMappingOperator implements ScopvizGraphOperator {
 		return result;
 	}
 
-	protected Comparator<Node> operatorComparator = new Comparator<Node>() {
+	protected Comparator<MyNode> operatorComparator = new Comparator<MyNode>() {
 
 		@Override
-		public int compare(Node o1, Node o2) {
+		public int compare(MyNode o1, MyNode o2) {
 			Main m = Main.getInstance();
 
 			// the cmparator uses a reverse ordering so that the resulting list

+ 9 - 9
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/CommunicationCostMetric.java

@@ -5,12 +5,12 @@ import java.util.stream.Collectors;
 
 import org.graphstream.algorithm.Dijkstra;
 import org.graphstream.algorithm.Toolkit;
-import org.graphstream.graph.Edge;
-import org.graphstream.graph.Node;
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MappingGraphManager;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyEdge;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyGraph;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyNode;
 import de.tu_darmstadt.informatik.tk.scopviz.metrics.interfaces.ScopvizGraphMetric;
 import javafx.util.Pair;
 
@@ -63,13 +63,13 @@ public class CommunicationCostMetric implements ScopvizGraphMetric {
 		}
 
 		MyGraph operator = new MyGraph("opWithTime");
-		for (Node n : g.getNodeSet()) {
+		for (MyNode n : g.<MyNode>getNodeSet()) {
 			if (n.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING_PARENT) == MappingGraphManager.OPERATOR) {
 				operator.addNode(n.getId());
 			}
 
 		}
-		for (Edge e : g.getEdgeSet()) {
+		for (MyEdge e : g.<MyEdge>getEdgeSet()) {
 			if (e.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING_PARENT) == MappingGraphManager.OPERATOR) {
 				String newID = e.getId();
 				double cost = computeCost(e.getNode0(), e.getNode1(), g);
@@ -100,15 +100,15 @@ public class CommunicationCostMetric implements ScopvizGraphMetric {
 	 *            the combined mapping graph
 	 * @return the cost
 	 */
-	private double computeCost(Node n1, Node n2, MyGraph g) {
+	private double computeCost(MyNode n1, MyNode n2, MyGraph g) {
 		double cost = 0;
 		// find the underlay nodes that the operator nodes are mapped to
-		LinkedList<Edge> mappingEdges = new LinkedList<Edge>(g.getEdgeSet().stream()
+		LinkedList<MyEdge> mappingEdges = new LinkedList<MyEdge>(g.<MyEdge>getEdgeSet().stream()
 				.filter(e -> (((Boolean) e.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING)) == true))
 				.collect(Collectors.toList()));
-		Node target1 = null;
-		Node target2 = null;
-		for (Edge e : mappingEdges) {
+		MyNode target1 = null;
+		MyNode target2 = null;
+		for (MyEdge e : mappingEdges) {
 			if (e.getNode0() == n1) {
 				target1 = e.getNode1();
 			} else if (e.getNode0() == n2) {

+ 7 - 8
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/OperatorInfoMetric.java

@@ -3,11 +3,10 @@ package de.tu_darmstadt.informatik.tk.scopviz.metrics;
 import java.util.LinkedList;
 import java.util.stream.Collectors;
 
-import org.graphstream.graph.Edge;
-import org.graphstream.graph.Node;
-
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MappingGraphManager;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyEdge;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyGraph;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyNode;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
 import de.tu_darmstadt.informatik.tk.scopviz.metrics.interfaces.ScopvizGraphMetric;
 import javafx.util.Pair;
@@ -74,12 +73,12 @@ public class OperatorInfoMetric implements ScopvizGraphMetric {
 	 */
 	private boolean fullyPlaced(MyGraph operator, MyGraph mapping) {
 		boolean result = true;
-		LinkedList<Edge> mappingEdges = new LinkedList<Edge>(mapping.getEdgeSet().stream()
+		LinkedList<MyEdge> mappingEdges = new LinkedList<MyEdge>(mapping.<MyEdge>getEdgeSet().stream()
 				.filter(e -> (((Boolean) e.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING)) == true))
 				.collect(Collectors.toList()));
 		// build list of the operator nodes within the mapping graph
-		LinkedList<Node> operatorNodes = new LinkedList<Node>();
-		for (Node n : mapping.getNodeSet()) {
+		LinkedList<MyNode> operatorNodes = new LinkedList<MyNode>();
+		for (MyNode n : mapping.<MyNode>getNodeSet()) {
 			String originalGraph = n.getAttribute("originalGraph");
 			if ((originalGraph != null && originalGraph.equals(operator.getId()))
 					|| n.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING_PARENT_ID).equals(operator.getId())) {
@@ -87,9 +86,9 @@ public class OperatorInfoMetric implements ScopvizGraphMetric {
 			}
 		}
 		// check if they have a mapping
-		for (Node n : operatorNodes) {
+		for (MyNode n : operatorNodes) {
 			boolean isMapped = false;
-			for (Edge e : mappingEdges) {
+			for (MyEdge e : mappingEdges) {
 				if (e.getNode0().getId().equals(n.getId())) {
 					isMapped = true;
 				}

+ 5 - 6
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/PlacementCostMetric.java

@@ -7,12 +7,11 @@ import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.stream.Collectors;
 
-import org.graphstream.graph.Edge;
-import org.graphstream.graph.Node;
-
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MappingGraphManager;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyEdge;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyGraph;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyNode;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.metrics.interfaces.ScopvizGraphMetric;
 import javafx.stage.FileChooser;
@@ -109,10 +108,10 @@ public class PlacementCostMetric implements ScopvizGraphMetric {
 		if (!setupDone) {
 			results.add(SETUP_NEEDED);
 		} else {
-			LinkedList<Edge> mappingEdges = new LinkedList<Edge>(g.getEdgeSet().stream()
+			LinkedList<MyEdge> mappingEdges = new LinkedList<MyEdge>(g.<MyEdge>getEdgeSet().stream()
 					.filter(e -> (((Boolean) e.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING)) == true))
 					.collect(Collectors.toList()));
-			for (Edge e : mappingEdges) {
+			for (MyEdge e : mappingEdges) {
 				placementCostSum += placementCost(e.getNode0(), e.getNode1());
 			}
 			results.add(new Pair<String, String>("Overall Cost", "" + placementCostSum));
@@ -179,7 +178,7 @@ public class PlacementCostMetric implements ScopvizGraphMetric {
 	 *            The Underlay node it is mapped to
 	 * @return The placement cost
 	 */
-	private double placementCost(Node operator, Node target) {
+	private double placementCost(MyNode operator, MyNode target) {
 		if (costs == null) {
 			Debug.out(
 					"Tried to read Costs from nonexistant Cost Matrix. Please run Setup before trying to Compute the Metric!");

+ 7 - 8
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/TaskFulfillmentMetric.java

@@ -3,11 +3,10 @@ package de.tu_darmstadt.informatik.tk.scopviz.metrics;
 import java.util.LinkedList;
 import java.util.stream.Collectors;
 
-import org.graphstream.graph.Edge;
-import org.graphstream.graph.Node;
-
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MappingGraphManager;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyEdge;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyGraph;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyNode;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
 import de.tu_darmstadt.informatik.tk.scopviz.metrics.interfaces.ScopvizGraphMetric;
 import javafx.util.Pair;
@@ -96,12 +95,12 @@ public class TaskFulfillmentMetric implements ScopvizGraphMetric {
 	 */
 	private boolean fullyPlaced(MyGraph operator, MyGraph mapping) {
 		boolean result = true;
-		LinkedList<Edge> mappingEdges = new LinkedList<Edge>(mapping.getEdgeSet().stream()
+		LinkedList<MyEdge> mappingEdges = new LinkedList<MyEdge>(mapping.<MyEdge>getEdgeSet().stream()
 				.filter(e -> (((Boolean) e.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING)) == true))
 				.collect(Collectors.toList()));
 		// build list of the operator nodes within the mapping graph
-		LinkedList<Node> operatorNodes = new LinkedList<Node>();
-		for (Node n : mapping.getNodeSet()) {
+		LinkedList<MyNode> operatorNodes = new LinkedList<MyNode>();
+		for (MyNode n : mapping.<MyNode>getNodeSet()) {
 			String originalGraph = n.getAttribute("originalGraph");
 			if ((originalGraph != null && originalGraph.equals(operator.getId()))
 					|| n.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING_PARENT_ID).equals(operator.getId())) {
@@ -109,9 +108,9 @@ public class TaskFulfillmentMetric implements ScopvizGraphMetric {
 			}
 		}
 		// check if they have a mapping
-		for (Node n : operatorNodes) {
+		for (MyNode n : operatorNodes) {
 			boolean isMapped = false;
-			for (Edge e : mappingEdges) {
+			for (MyEdge e : mappingEdges) {
 				if (e.getNode0().getId().equals(n.getId())) {
 					isMapped = true;
 				}

+ 2 - 3
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/TestOperator.java

@@ -2,16 +2,15 @@ package de.tu_darmstadt.informatik.tk.scopviz.metrics;
 
 import java.util.Iterator;
 
-import org.graphstream.graph.Node;
-
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.GraphManager;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyNode;
 import de.tu_darmstadt.informatik.tk.scopviz.metrics.interfaces.ScopvizGraphOperator;
 
 public class TestOperator implements ScopvizGraphOperator {
 
 	@Override
 	public void calculate(GraphManager g) {
-		Iterator<Node> nodeIter = g.getGraph().getNodeIterator();
+		Iterator<MyNode> nodeIter = g.getGraph().getNodeIterator();
 		while (nodeIter.hasNext()) {
 			nodeIter.next().addAttribute("ui.style", "fill-color: blue;");
 		}

+ 1 - 2
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java

@@ -4,7 +4,6 @@ import java.net.URL;
 import java.util.ArrayList;
 import java.util.ResourceBundle;
 
-import javax.swing.JPanel;
 import javax.swing.event.MouseInputListener;
 
 import org.jxmapviewer.JXMapViewer;
@@ -378,7 +377,7 @@ public class GUIController implements Initializable {
 		pane.heightProperty().addListener(rLis);
 		pane.widthProperty().addListener(rLis);
 		pane.setOnScroll(GraphDisplayManager.scrollHandler);
-		swingNode.setContent((JPanel) Main.getInstance().getGraphManager().getView());
+		swingNode.setContent(Main.getInstance().getGraphManager().getView());
 		pane.setMinSize(200, 200);
 	}
 

+ 5 - 5
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GraphDisplayManager.java

@@ -208,7 +208,7 @@ public final class GraphDisplayManager {
 			vList.add(v);
 			count++;
 			// set basic style
-			v.setStylesheet(StylesheetManager.DEFAULT_STYLESHEET);
+			v.setStylesheet();
 		} else {
 			v = new GraphManager(GraphHelper.newMerge(false, getGraphManager().getGraph(), g));
 			v.getGraph().addAttribute("layer", currentLayer);
@@ -219,7 +219,7 @@ public final class GraphDisplayManager {
 			vList.add(v);
 			count++;
 			// set basic style
-			v.setStylesheet(StylesheetManager.DEFAULT_STYLESHEET);
+			v.setStylesheet();
 		}
 
 		// set ui.class
@@ -264,7 +264,7 @@ public final class GraphDisplayManager {
 				.setPreferredSize(new Dimension((int) pane.getWidth() - 5, (int) pane.getHeight() - 5));
 		guiController.swingNode.setContent(Main.getInstance().getGraphManager().getView());
 
-		Main.getInstance().getGraphManager().updateStylesheet();
+		Main.getInstance().getGraphManager().setStylesheet();
 		Main.getInstance().setCreationMode(CreationMode.CREATE_NONE);
 	}
 
@@ -377,7 +377,7 @@ public final class GraphDisplayManager {
 			mapping = new MappingGraphManager(g, underlay, operator);
 			g.addAttribute("layer", Layer.MAPPING);
 			g.addAttribute("ui.antialias");
-			mapping.setStylesheet(StylesheetManager.DEFAULT_STYLESHEET);
+			mapping.setStylesheet();
 			vList.add(mapping);
 
 		}
@@ -459,7 +459,7 @@ public final class GraphDisplayManager {
 		count++;
 		g.addAttribute("layer", Layer.MAPPING);
 		g.addAttribute("ui.antialias");
-		map.setStylesheet(StylesheetManager.DEFAULT_STYLESHEET);
+		map.setStylesheet();
 		currentLayer = Layer.MAPPING;
 		removeAllCurrentGraphs();
 		vList.add(map);

+ 0 - 1
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/OperatorManager.java

@@ -5,7 +5,6 @@ import java.util.HashMap;
 
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.metrics.BasicMappingOperator;
-import de.tu_darmstadt.informatik.tk.scopviz.metrics.TestOperator;
 import de.tu_darmstadt.informatik.tk.scopviz.metrics.interfaces.ScopvizGraphOperator;
 import javafx.application.Platform;
 import javafx.collections.FXCollections;

+ 1 - 1
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/OptionsManager.java

@@ -18,6 +18,7 @@ import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
 import javafx.geometry.Insets;
 import javafx.scene.control.Alert;
+import javafx.scene.control.Alert.AlertType;
 import javafx.scene.control.Button;
 import javafx.scene.control.ButtonBar.ButtonData;
 import javafx.scene.control.ButtonType;
@@ -26,7 +27,6 @@ import javafx.scene.control.Dialog;
 import javafx.scene.control.Label;
 import javafx.scene.control.RadioButton;
 import javafx.scene.control.TextField;
-import javafx.scene.control.Alert.AlertType;
 import javafx.scene.layout.GridPane;
 
 /**

+ 10 - 10
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/PropertiesManager.java

@@ -6,13 +6,13 @@ import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.Optional;
 
-import org.graphstream.graph.Edge;
 import org.graphstream.graph.Element;
-import org.graphstream.graph.Node;
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.GraphHelper;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.GraphManager;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyEdge;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyNode;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import javafx.application.Platform;
@@ -113,7 +113,7 @@ public final class PropertiesManager {
 
 		// properties, which shall be filtered out of the properties window
 		itemVisibilityRules.put("layout.frozen", -1);
-		itemVisibilityRules.put("ui.style", -1);
+		//itemVisibilityRules.put("ui.style", -1);
 		itemVisibilityRules.put("ui.j2dsk", -1);
 		itemVisibilityRules.put("ui.clicked", -1);
 		itemVisibilityRules.put("ui.map.selected", -1);
@@ -264,11 +264,11 @@ public final class PropertiesManager {
 		String eid = Main.getInstance().getGraphManager().getSelectedEdgeID();
 
 		if (nid != null) {
-			Node selectedNode = Main.getInstance().getGraphManager().getGraph().getNode(nid);
+			MyNode selectedNode = Main.getInstance().getGraphManager().getGraph().getNode(nid);
 			showNewDataSet(selectedNode);
 
 		} else if (eid != null) {
-			Edge selectedEdge = Main.getInstance().getGraphManager().getGraph().getEdge(eid);
+			MyEdge selectedEdge = Main.getInstance().getGraphManager().getGraph().getEdge(eid);
 			showNewDataSet(selectedEdge);
 
 		} else {
@@ -304,7 +304,7 @@ public final class PropertiesManager {
 			// filter out or change attributes added by graphstream that are of
 			// no use to the user
 			case "ui.label":
-				if (selected instanceof Node) {
+				if (selected instanceof MyNode) {
 					Object actualAttribute = selected.getAttribute(key);
 					// replace UI Label with ID"
 					key = "ID";
@@ -312,7 +312,7 @@ public final class PropertiesManager {
 				}
 				break;
 			case "weight":
-				if (selected instanceof Edge
+				if (selected instanceof MyEdge
 						&& Layer.OPERATOR == Main.getInstance().getGraphManager().getGraph().getAttribute("layer")) {
 					break;
 				}
@@ -322,7 +322,7 @@ public final class PropertiesManager {
 				}
 				break;
 			case "process-need":
-				if (selected instanceof Node
+				if (selected instanceof MyNode
 						&& Layer.UNDERLAY == Main.getInstance().getGraphManager().getGraph().getAttribute("layer")) {
 					break;
 				}
@@ -332,12 +332,12 @@ public final class PropertiesManager {
 				}
 				break;
 			case "process-max":
-				if (selected instanceof Node
+				if (selected instanceof MyNode
 						&& Layer.OPERATOR == Main.getInstance().getGraphManager().getGraph().getAttribute("layer")) {
 					break;
 				}
 			case "typeOfDevice":
-				if (selected instanceof Node
+				if (selected instanceof MyNode
 						&& Layer.OPERATOR == Main.getInstance().getGraphManager().getGraph().getAttribute("layer")) {
 					break;
 				}

+ 1 - 1
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/StylesheetManager.java

@@ -74,7 +74,7 @@ public class StylesheetManager {
 				throw new RuntimeException("These graphics do not exist");
 			}
 		}
-		Main.getInstance().getGraphManager().updateStylesheet();
+		Main.getInstance().getGraphManager().setStylesheet();
 	}
 
 	/**

+ 3 - 4
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ToolboxManager.java

@@ -2,9 +2,8 @@ package de.tu_darmstadt.informatik.tk.scopviz.ui;
 
 import java.util.Optional;
 
-import org.graphstream.graph.Edge;
-
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.GraphHelper;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyEdge;
 import de.tu_darmstadt.informatik.tk.scopviz.main.CreationMode;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.main.MainApp;
@@ -261,7 +260,7 @@ public final class ToolboxManager {
 	/**
 	 * the last edge that was created
 	 */
-	private static Edge lastCreatedEdge = null;
+	private static MyEdge lastCreatedEdge = null;
 
 	/**
 	 * opens a dialog that asks for a weight for a newly created Edge. The
@@ -270,7 +269,7 @@ public final class ToolboxManager {
 	 * @param e
 	 *            the new Edge that needs a weight
 	 */
-	public static void createWeightDialog(Edge e) {
+	public static void createWeightDialog(MyEdge e) {
 		if (e.equals(lastCreatedEdge)) {
 			return;
 		}

+ 0 - 9
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSConditionException.java

@@ -1,9 +0,0 @@
-package de.tu_darmstadt.informatik.tk.scopviz.ui.css;
-
-public class CSSConditionException extends CSSException {
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -3594305376563812699L;
-}

+ 27 - 15
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSDeclaration.java

@@ -1,37 +1,49 @@
 package de.tu_darmstadt.informatik.tk.scopviz.ui.css;
 
+/**
+ * Stores a single CSS property value Pair. Provides setter for both.
+ * 
+ * @author Matthias Wilhelm
+ */
 class CSSDeclaration {
-	// TODO comment
+	/**
+	 * The CSS Property name
+	 */
 	String property;
-	// TODO comment
+	/**
+	 * The CSS Value
+	 */
 	String value;
 
-	// TODO comment
+	/**
+	 * Creates a new CSSDeclaration.
+	 * 
+	 * @param property
+	 *            CSS property
+	 * @param value
+	 *            CSS value
+	 */
 	CSSDeclaration(String property, String value) {
 		this.property = property.trim();
 		this.value = value.trim();
 	}
 
-	// TODO comment
+	/**
+	 * 
+	 * @return CSS property
+	 */
 	String getProperty() {
 		return property;
 	}
 
-	// TODO comment
-	void setProperty(String property) {
-		this.property = property;
-	}
-
-	// TODO comment
+	/**
+	 * 
+	 * @return CSS value
+	 */
 	String getValue() {
 		return value;
 	}
 
-	// TODO comment
-	void setValue(String value) {
-		this.value = value;
-	}
-
 	@Override
 	public String toString() {
 		return property + ": " + value;

+ 0 - 10
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSException.java

@@ -1,10 +0,0 @@
-package de.tu_darmstadt.informatik.tk.scopviz.ui.css;
-
-public abstract class CSSException extends Exception {
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 2158319179027554462L;
-
-}

+ 119 - 23
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSManager.java

@@ -5,24 +5,52 @@ import java.util.HashSet;
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 
+/**
+ * Manages CSSables. Offers Functions to store rules and CSSables, to remove
+ * CSSables, to compare a given CSSable with all rules and to update the CSS for
+ * all stored CSSables.
+ * 
+ * @author Matthias Wilhelm
+ */
 public class CSSManager {
 	/**
-	 * Du zerstörst diesen REGEX und Matthias zerstört dich
+	 * REGEX to match CSS
 	 */
-	// TODO comment
-	private static final String CSS_MATCH_REGEX = "(\\s*([A-Za-z]+|[A-Za-z]*(\\.[A-Za-z_-]*)+)\\s*\\{(\\s*[A-Za-z_-]+\\s*\\:\\s*[0-9A-Za-z\\(\\)_\\#\\'\\\"-]+\\s*\\;?)+\\s*\\})+\\s*";
+	private static final String CSS_MATCH_REGEX = "(\\s*([A-Za-z]+|[A-Za-z]*(\\.[A-Za-z_-]*)+\\s*\\,?)*\\s*\\{(\\s*[A-Za-z_-]+\\s*\\:\\s*[0-9A-Za-z\\(\\)\\_\\#\\'\\\"\\,\\s-]+\\s*\\;?)+\\s*\\})+\\s*";
 
-	// TODO comment
+	/**
+	 * A Set to store all rules.
+	 */
 	static HashSet<CSSRule> rules = new HashSet<CSSRule>();
-	// TODO comment
+	/**
+	 * A Set to store references to all CSSable interfaces
+	 */
 	private static HashSet<CSSable> cssAbles = new HashSet<CSSable>();
 
-	// TODO comment
+	/**
+	 * Add a new Rule to the Set. Doesn't check whether the rule is useful.
+	 * Prevents storing the same rule twice silently. Multiple rules are
+	 * recognized, if separated by whitespace only.<br/>
+	 * Updates all stored CSSabled afterwards.
+	 * 
+	 * @param rule
+	 *            the rule to add
+	 * 
+	 */
 	public static void addRule(String rule) {
 		addRule(rule, true);
 	}
 
-	// TODO comment
+	/**
+	 * Add a new Rule to the Set. Doesn't check whether the rule is useful.
+	 * Prevents storing the same rule twice silently. Multiple rules are
+	 * recognized, if separated by whitespace only.
+	 * 
+	 * @param rule
+	 *            the rule to add
+	 * @param updateCSSable
+	 *            Updates all stored CSSabled afterwards, if true
+	 */
 	public static void addRule(String rule, boolean updateCSSable) {
 		if (!rule.matches(CSS_MATCH_REGEX)) {
 			Debug.out("rule << " + rule + " >> doesn't match regex");
@@ -39,29 +67,49 @@ public class CSSManager {
 			updateCSSAble();
 	}
 
-	// TODO comment
+	/**
+	 * Stores a reference to the CSSable. Storing the reference allows this
+	 * Manager to update the CSS for the CSSables
+	 * 
+	 * @param ca
+	 *            the CSSable to store
+	 */
 	public static void addCSSAble(CSSable ca) {
 		cssAbles.add(ca);
 	}
 
-	// TODO comment
+	/**
+	 * Removes the reference to the CSSable. It will no longer get its CSS
+	 * updated by this Manager.
+	 * 
+	 * @param ca
+	 *            the CSSable to remove
+	 */
 	public static void removeCSSAble(CSSable ca) {
 		cssAbles.remove(ca);
 	}
 
-	// TODO comment
+	/**
+	 * Returns the best match of CSS declarations for the given CSSable
+	 * 
+	 * @param ca
+	 *            the CSSable
+	 * @return a String containing all CSS declarations
+	 */
 	public static String getCSS(CSSable ca) {
-		// TODO implement
 		// <Property, <CSSValue, RuleValue>>
 		HashMap<String, CSSValueValue> cssDeclarations = new HashMap<>();
 		for (CSSRule r : rules) {
 			int ruleValue = r.ConditionsMetBy(ca);
-			HashSet<CSSDeclaration> declarations = r.getDeclarations();
-			for (CSSDeclaration d : declarations) {
-				String property = d.getProperty();
-				String value = d.getValue();
-				if (!cssDeclarations.containsKey(property) || ruleValue >= cssDeclarations.get(property).getRuleValue())
-					cssDeclarations.put(property, new CSSValueValue(value, ruleValue));
+			if (ruleValue > 0) {
+				HashSet<CSSDeclaration> declarations = r.getDeclarations();
+				for (CSSDeclaration d : declarations) {
+					String property = d.getProperty();
+					String value = d.getValue();
+					if (!cssDeclarations.containsKey(property)
+							|| ruleValue >= cssDeclarations.get(property).getRuleValue())
+						cssDeclarations.put(property, new CSSValueValue(value, ruleValue));
+				}
 			}
 		}
 		String result = "";
@@ -72,19 +120,39 @@ public class CSSManager {
 		return result.trim();
 	}
 
-	// TODO comment
+	/**
+	 * Iterates over every CSSable and calls its updateCSS function.
+	 */
 	private static void updateCSSAble() {
 		for (CSSable ca : cssAbles)
 			ca.updateCSS();
 	}
 
-	// TODO comment
+	/**
+	 * Converts a String into a Rule. Doesn't check for correct CSS. Check
+	 * should be handled beforehand.<br/>
+	 * String is expected to be in following form:<br/>
+	 * "selectors{declarations"
+	 * 
+	 * @param s
+	 *            the rule as String
+	 * @return the rule as CSSRule
+	 */
 	private static CSSRule extractRule(String s) {
 		String[] sArray = s.trim().split("\\{");
 		return new CSSRule(extractSelectors(sArray[0]), parseCss(sArray[1]));
 	}
 
-	// TODO comment
+	/**
+	 * Converts a String into selectors. Doesn't check for correct CSS. Check
+	 * should be handled beforehand.<br/>
+	 * String is expected to be in following form:<br/>
+	 * "selector(,selector)*"
+	 * 
+	 * @param s
+	 *            the selectors as String
+	 * @return the selectors in a HashSet
+	 */
 	private static HashSet<CSSSelector> extractSelectors(String s) {
 		HashSet<CSSSelector> selectors = new HashSet<>();
 		String[] sArray = s.trim().split("\\,");
@@ -94,7 +162,17 @@ public class CSSManager {
 		return selectors;
 	}
 
-	// TODO comment
+	/**
+	 * Converts a String into a selector. Doesn't check for correct CSS. Check
+	 * should be handled beforehand.<br/>
+	 * String is expected to be in one of the following forms:<br/>
+	 * "type(.class)*"<br/>
+	 * ".class(.class)*"
+	 * 
+	 * @param s
+	 *            the selector as String
+	 * @return the selector as CSSSelector
+	 */
 	private static CSSSelector extractSelector(String s) {
 		HashSet<String> classes = new HashSet<String>();
 		String[] sArray = s.trim().split("\\.");
@@ -104,7 +182,16 @@ public class CSSManager {
 		return new CSSSelector(sArray[0], classes);
 	}
 
-	// TODO comment
+	/**
+	 * Converts a String into declarations. Doesn't check for correct CSS. Check
+	 * should be handled beforehand.<br/>
+	 * String is expected to be in following form:<br/>
+	 * "declaration(;declaration)*"
+	 * 
+	 * @param s
+	 *            the declarations as String
+	 * @return the declarations in a HashSet
+	 */
 	private static HashSet<CSSDeclaration> parseCss(String s) {
 		HashSet<CSSDeclaration> declarations = new HashSet<CSSDeclaration>();
 		String[] sArray = s.trim().split("\\;");
@@ -122,7 +209,16 @@ public class CSSManager {
 		return declarations;
 	}
 
-	// TODO comment
+	/**
+	 * Converts a String into a declaration. Doesn't check for correct CSS.
+	 * Check should be handled beforehand.<br/>
+	 * String is expected to be in following form:<br/>
+	 * "property:value"
+	 * 
+	 * @param s
+	 *            the declaration as String
+	 * @return the declaration as CSSDeclaration
+	 */
 	private static CSSDeclaration parseCssStatement(String s) {
 		String[] sArray = s.trim().split("\\:");
 		return new CSSDeclaration(sArray[0], sArray[1]);

+ 32 - 17
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSRule.java

@@ -3,15 +3,31 @@ package de.tu_darmstadt.informatik.tk.scopviz.ui.css;
 import java.util.HashSet;
 import java.util.Iterator;
 
+/**
+ * Stores a single Rule containing selectors and declarations. Offers a function
+ * to check whether a CSSable matches one selector.
+ * 
+ * @author Matthias Wilhelm
+ */
 class CSSRule {
-	// TODO comment
+	/**
+	 * A Set to store all selectors for the this rule.
+	 */
 	HashSet<CSSSelector> selectors = new HashSet<CSSSelector>();
-	// TODO comment
+	/**
+	 * A Set to store all declarations for the this rule.
+	 */
 	HashSet<CSSDeclaration> declarations = new HashSet<CSSDeclaration>();
-	// TODO comment
+	/**
+	 * A String to store the declarations in a human readable form.
+	 */
 	String css;
 
-	// TODO comment
+	/**
+	 * 
+	 * @param selectors
+	 * @param declarations
+	 */
 	CSSRule(HashSet<CSSSelector> selectors, HashSet<CSSDeclaration> declarations) {
 		super();
 		this.selectors = selectors;
@@ -23,7 +39,14 @@ class CSSRule {
 		css = css.trim();
 	}
 
-	// TODO comment
+	/**
+	 * Checks whether a CSSable matches one selector.
+	 * 
+	 * @param suspect
+	 *            the CSSable to check
+	 * @return a positive integer if the condition is met. The more difficult
+	 *         the rule was to meet, the greater the integer.
+	 */
 	int ConditionsMetBy(CSSable suspect) {
 		int result = 0;
 		Iterator<CSSSelector> i = selectors.iterator();
@@ -35,25 +58,17 @@ class CSSRule {
 			if (r > result)
 				result = r;
 		}
-
 		return result;
 	}
 
-	// TODO comment
-	public HashSet<CSSSelector> getSelectors() {
-		return selectors;
-	}
-
-	// TODO comment
+	/**
+	 * 
+	 * @return all stored declarations
+	 */
 	public HashSet<CSSDeclaration> getDeclarations() {
 		return declarations;
 	}
 
-	// TODO comment
-	String getCSS() {
-		return css;
-	}
-
 	@Override
 	public String toString() {
 		return selectors.toString().replace("[", "").replace("]", "") + " { " + css + " }";

+ 46 - 8
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSSelector.java

@@ -3,34 +3,72 @@ package de.tu_darmstadt.informatik.tk.scopviz.ui.css;
 import java.util.HashSet;
 import java.util.Iterator;
 
+/**
+ * Stores a single CSSSelector consisting of a type and set of classes. Stores
+ * its value. The value is calculated by multiplying the amount of classes by
+ * Two and adding one if the selector has a type.
+ * 
+ * @author Matthias Wilhelm
+ */
 class CSSSelector {
-	// TODO comment
+	/**
+	 * the stored CSS type
+	 */
 	String type;
-	// TODO comment
+	/**
+	 * the stored CSS classes
+	 */
 	HashSet<String> classes;
-	// TODO comment
+	/**
+	 * the stored selector value.<br/>
+	 * The value is calculated by multiplying the amount of classes by Two and
+	 * adding one if the selector has a type
+	 */
 	int value;
 
-	// TODO comment
+	/**
+	 * Creates a new CSSSelector. Calculates its value.<br/>
+	 * The value is calculated by multiplying the amount of classes by Two and
+	 * adding one if the selector has a type
+	 * 
+	 * @param type
+	 *            CSS type
+	 * @param classes
+	 *            a Set CSS classes
+	 */
 	CSSSelector(String type, HashSet<String> classes) {
-		this.type = type;
+		if (type != null && type.trim().length() > 0)
+			this.type = type;
 		this.classes = classes;
 		value = (type != null ? 1 : 0) + classes.size() << 1;
 	}
 
-	// TODO comment
+	/**
+	 * Compares the suspect to its conditions.
+	 * 
+	 * @param suspect
+	 *            the CSSable to check
+	 * @return true if the CSSable contains all classes of the selector and the
+	 *         type matches.
+	 */
 	boolean ConditionsMetBy(CSSable suspect) {
 		if (type != null && !type.equals(suspect.getType()))
 			return false;
 		Iterator<String> i = classes.iterator();
+		HashSet<String> sC = suspect.getClasses();
 		while (i.hasNext()) {
-			if (!suspect.getClasses().contains(i.next()))
+			if (sC == null || !sC.contains(i.next()))
 				return false;
 		}
 		return true;
 	}
 
-	// TODO comment
+	/**
+	 * The value is calculated by multiplying the amount of classes by Two and
+	 * adding one if the selector has a type
+	 * 
+	 * @return the value of this CSS selector
+	 */
 	int getValue() {
 		return value;
 	}

+ 0 - 10
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSSytnaxException.java

@@ -1,10 +0,0 @@
-package de.tu_darmstadt.informatik.tk.scopviz.ui.css;
-
-public class CSSSytnaxException extends CSSException {
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -4040313744607257567L;
-
-}

+ 27 - 5
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSValueValue.java

@@ -1,23 +1,45 @@
 package de.tu_darmstadt.informatik.tk.scopviz.ui.css;
 
+/**
+ * Value Value class. Provides a constructor and two getters for the values.
+ * 
+ * @author Matthias Wilhelm
+ */
 public class CSSValueValue {
-	// TODO comment
+	/**
+	 * the CSS value
+	 */
 	String cssValue;
-	// TODO comment
+	/**
+	 * the rule value
+	 */
 	int ruleValue;
 
-	// TODO comment
+	/**
+	 * Creates a new CSSValueValue pair.
+	 * 
+	 * @param cssValue
+	 *            the CSS value to store
+	 * @param ruleValue
+	 *            the rule value to store
+	 */
 	CSSValueValue(String cssValue, int ruleValue) {
 		this.cssValue = cssValue;
 		this.ruleValue = ruleValue;
 	}
 
-	// TODO comment
+	/**
+	 * 
+	 * @return the stored CSS value
+	 */
 	String getCssValue() {
 		return cssValue;
 	}
 
-	// TODO comment
+	/**
+	 * 
+	 * @return the stored rule value
+	 */
 	int getRuleValue() {
 		return ruleValue;
 	}

+ 8 - 2
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSable.java

@@ -1,7 +1,13 @@
 package de.tu_darmstadt.informatik.tk.scopviz.ui.css;
 
-import java.util.Set;
+import java.util.HashSet;
 
+/**
+ * An Interface which offers functions to store, remove and toggle CSS classes
+ * and update a stored CSS String.
+ * 
+ * @author Matthias Wilhelm
+ */
 public interface CSSable {
 	/**
 	 * Adds a CSS class to the object. classes already added are ignored
@@ -44,7 +50,7 @@ public interface CSSable {
 	 * 
 	 * @return a Set of Strings containing all the previously added CSS classes
 	 */
-	public Set<String> getClasses();
+	public HashSet<String> getClasses();
 
 	/**
 	 * 

+ 10 - 4
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/MyMouseManager.java

@@ -2,8 +2,6 @@ package de.tu_darmstadt.informatik.tk.scopviz.ui.handlers;
 
 import java.awt.event.MouseEvent;
 
-import org.graphstream.graph.Edge;
-import org.graphstream.graph.Node;
 import org.graphstream.ui.geom.Point3;
 import org.graphstream.ui.graphicGraph.GraphicElement;
 import org.graphstream.ui.view.Camera;
@@ -11,7 +9,9 @@ import org.graphstream.ui.view.util.DefaultMouseManager;
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.GraphManager;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyEdge;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyGraph;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyNode;
 import de.tu_darmstadt.informatik.tk.scopviz.main.CreationMode;
 import de.tu_darmstadt.informatik.tk.scopviz.main.EdgeSelectionHelper;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
@@ -66,13 +66,14 @@ public class MyMouseManager extends DefaultMouseManager {
 	 * @param event
 	 *            the corresponding MouseEvent
 	 */
+	@Override
 	protected void mouseButtonPress(MouseEvent event) {
 		view.requestFocus();
 
 		Point3 cursorPos = graphManager.getView().getCamera().transformPxToGu(event.getX(), event.getY());
-		Node n;
+		MyNode n;
 		MyGraph nodeProducer = new MyGraph("temp");
-		Edge selectedEdge = EdgeSelectionHelper.getClosestEdge(cursorPos);
+		MyEdge selectedEdge = EdgeSelectionHelper.getClosestEdge(cursorPos);
 
 		switch (Main.getInstance().getCreationMode()) {
 
@@ -172,6 +173,7 @@ public class MyMouseManager extends DefaultMouseManager {
 	 * @param event
 	 *            the corresponding MouseEvent
 	 */
+	@Override
 	protected void mouseButtonPressOnElement(GraphicElement element, MouseEvent event) {
 		view.freezeElement(element, true);
 		String id = element.getId();
@@ -197,6 +199,7 @@ public class MyMouseManager extends DefaultMouseManager {
 	 * @param event
 	 *            the corresponding MouseEvent
 	 */
+	@Override
 	protected void mouseButtonReleaseOffElement(GraphicElement element, MouseEvent event) {
 		view.freezeElement(element, false);
 		// update the Attributes of a Node after moving it
@@ -211,6 +214,7 @@ public class MyMouseManager extends DefaultMouseManager {
 	 * @param event
 	 *            the corresponding MouseEvent
 	 */
+	@Override
 	public void mousePressed(MouseEvent event) {
 		// Left Click -> Find out whether the User clicked on an Element
 		if (event.getButton() == MouseEvent.BUTTON1) {
@@ -238,6 +242,7 @@ public class MyMouseManager extends DefaultMouseManager {
 	 * @param event
 	 *            the corresponding MouseEvent
 	 */
+	@Override
 	public void mouseDragged(MouseEvent event) {
 		// If the Mouse is dragging an Element, move it
 		if (curElement != null) {
@@ -271,6 +276,7 @@ public class MyMouseManager extends DefaultMouseManager {
 	 * @param event
 	 *            the corresponding MouseEvent
 	 */
+	@Override
 	public void mouseReleased(MouseEvent event) {
 		if (curElement != null) {
 			mouseButtonReleaseOffElement(curElement, event);

+ 6 - 6
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomMapClickListener.java

@@ -4,11 +4,11 @@ import java.awt.geom.Line2D;
 import java.awt.geom.Point2D;
 import java.util.HashSet;
 
-import org.graphstream.graph.Edge;
 import org.jxmapviewer.JXMapViewer;
 import org.jxmapviewer.input.MapClickListener;
 import org.jxmapviewer.viewer.GeoPosition;
 
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyEdge;
 import de.tu_darmstadt.informatik.tk.scopviz.main.EdgeSelectionHelper;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.GraphDisplayManager;
@@ -29,12 +29,12 @@ public class CustomMapClickListener extends MapClickListener {
 	/*
 	 * selected edge
 	 */
-	public static Edge selectedEdge;
+	public static MyEdge selectedEdge;
 
 	/*
 	 * all edges of the graph
 	 */
-	private final static HashSet<Edge> edges = WorldView.edges;
+	private final static HashSet<MyEdge> edges = WorldView.edges;
 
 	/*
 	 * all waypoints of the graph
@@ -122,9 +122,9 @@ public class CustomMapClickListener extends MapClickListener {
 		// max distance between clicked point and edge to select edge
 		double maxDistance = 10.0;
 
-		Edge result = null;
+		MyEdge result = null;
 
-		for (Edge edge : CustomMapClickListener.edges) {
+		for (MyEdge edge : CustomMapClickListener.edges) {
 			// Get geo Positions of the two nodes that define the edge
 			GeoPosition startPos = new GeoPosition(edge.getNode0().getAttribute("lat"),
 					edge.getNode0().getAttribute("long"));
@@ -190,7 +190,7 @@ public class CustomMapClickListener extends MapClickListener {
 	 * 
 	 * @param edge
 	 */
-	public static void selectEdge(Edge edge) {
+	public static void selectEdge(MyEdge edge) {
 
 		PropertiesManager.showNewDataSet(edge);
 

+ 7 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomTile.java

@@ -94,6 +94,7 @@ public class CustomTile extends Tile {
 	 *         This may return null at any time, however if this returns null, a
 	 *         load operation will automatically be started for it.
 	 */
+	@Override
 	public BufferedImage getImage() {
 		BufferedImage img = image.get();
 		if (img == null) {
@@ -114,6 +115,7 @@ public class CustomTile extends Tile {
 	 * 
 	 * @return true if the Tile has been loaded
 	 */
+	@Override
 	public synchronized boolean isLoaded() {
 		return loaded;
 	}
@@ -139,6 +141,7 @@ public class CustomTile extends Tile {
 	/**
 	 * @return the isLoading
 	 */
+	@Override
 	public boolean isLoading() {
 		return isLoading;
 	}
@@ -147,6 +150,7 @@ public class CustomTile extends Tile {
 	 * @param isLoading
 	 *            the isLoading to set
 	 */
+	@Override
 	public void setLoading(boolean isLoading) {
 		this.isLoading = isLoading;
 	}
@@ -175,6 +179,7 @@ public class CustomTile extends Tile {
 	 * 
 	 * @return the priority
 	 */
+	@Override
 	public Priority getPriority() {
 		return priority;
 	}
@@ -185,6 +190,7 @@ public class CustomTile extends Tile {
 	 * @param priority
 	 *            the priority to set
 	 */
+	@Override
 	public void setPriority(Priority priority) {
 		this.priority = priority;
 	}
@@ -194,6 +200,7 @@ public class CustomTile extends Tile {
 	 * 
 	 * @return the url
 	 */
+	@Override
 	public String getURL() {
 		return url;
 	}

+ 5 - 1
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomTileFactory.java

@@ -86,7 +86,7 @@ public class CustomTileFactory extends AbstractTileFactory {
 	 */
 	@Override
 	public CustomTile getTile(int x, int y, int zoom) {
-		return (CustomTile) getTile(x, y, zoom, true);
+		return getTile(x, y, zoom, true);
 	}
 
 	/**
@@ -161,6 +161,7 @@ public class CustomTileFactory extends AbstractTileFactory {
 	/**
 	 * @return the tile cache
 	 */
+	@Override
 	public TileCache getTileCache() {
 		return cache;
 	}
@@ -169,6 +170,7 @@ public class CustomTileFactory extends AbstractTileFactory {
 	 * @param cache
 	 *            the tile cache
 	 */
+	@Override
 	public void setTileCache(TileCache cache) {
 		this.cache = cache;
 	}
@@ -180,6 +182,7 @@ public class CustomTileFactory extends AbstractTileFactory {
 	 * 
 	 * @return ExecutorService to load tiles with
 	 */
+	@Override
 	protected synchronized ExecutorService getService() {
 		if (service == null) {
 			// System.out.println("creating an executor service with a
@@ -216,6 +219,7 @@ public class CustomTileFactory extends AbstractTileFactory {
 	 * @param size
 	 *            the thread pool size
 	 */
+	@Override
 	public void setThreadPoolSize(int size) {
 		if (size <= 0) {
 			throw new IllegalArgumentException(

+ 7 - 6
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/EdgePainter.java

@@ -9,11 +9,12 @@ import java.awt.RenderingHints;
 import java.awt.geom.Point2D;
 import java.util.HashSet;
 
-import org.graphstream.graph.Edge;
 import org.jxmapviewer.JXMapViewer;
 import org.jxmapviewer.painter.Painter;
 import org.jxmapviewer.viewer.GeoPosition;
 
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyEdge;
+
 /**
  * Paints a route
  * 
@@ -54,7 +55,7 @@ public class EdgePainter implements Painter<JXMapViewer> {
 	/**
 	 * the edges of the currently shown graph
 	 */
-	private static HashSet<Edge> edges;
+	private static HashSet<MyEdge> edges;
 
 	/**
 	 * show weights property
@@ -65,10 +66,10 @@ public class EdgePainter implements Painter<JXMapViewer> {
 	 * @param track
 	 *            the track
 	 */
-	public EdgePainter(HashSet<Edge> track) {
+	public EdgePainter(HashSet<MyEdge> track) {
 		// copy the list so that changes in the
 		// original list do not have an effect here
-		edges = new HashSet<Edge>(track);
+		edges = new HashSet<MyEdge>(track);
 	}
 
 	@Override
@@ -104,7 +105,7 @@ public class EdgePainter implements Painter<JXMapViewer> {
 	 */
 	private void drawRoute(Graphics2D g, JXMapViewer mapViewer) {
 
-		for (Edge edge : edges) {
+		for (MyEdge edge : edges) {
 
 			// Get geo Positions of the two nodes that define the edge
 			GeoPosition startPos = new GeoPosition(edge.getNode0().getAttribute("lat"),
@@ -149,7 +150,7 @@ public class EdgePainter implements Painter<JXMapViewer> {
 	 * @param endPoint
 	 *            end point edge
 	 */
-	private void drawWeights(Edge edge, Graphics2D g, Point2D startPoint, Point2D endPoint) {
+	private void drawWeights(MyEdge edge, Graphics2D g, Point2D startPoint, Point2D endPoint) {
 		// Set weight Position on street map
 		String weight = edge.getAttribute("weight").toString();
 

+ 6 - 6
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/WorldView.java

@@ -9,8 +9,6 @@ import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 
-import org.graphstream.graph.Edge;
-import org.graphstream.graph.Node;
 import org.jxmapviewer.JXMapViewer;
 import org.jxmapviewer.OSMTileFactoryInfo;
 import org.jxmapviewer.painter.CompoundPainter;
@@ -20,6 +18,8 @@ import org.jxmapviewer.viewer.TileFactoryInfo;
 import org.jxmapviewer.viewer.WaypointPainter;
 
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.GraphManager;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyEdge;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyNode;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
 import de.tu_darmstadt.informatik.tk.scopviz.main.MainApp;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.GUIController;
@@ -66,7 +66,7 @@ public class WorldView {
 	/*
 	 * All edges in the WorldView
 	 */
-	public static HashSet<Edge> edges;
+	public static HashSet<MyEdge> edges;
 
 	public static HashSet<GeoPosition> nodePositions;
 
@@ -101,7 +101,7 @@ public class WorldView {
 
 		nodePositions = new HashSet<GeoPosition>();
 		waypoints = new HashSet<CustomWaypoint>();
-		edges = new HashSet<Edge>();
+		edges = new HashSet<MyEdge>();
 		waypointsAsList = new ArrayList<CustomWaypoint>();
 
 		// Get GeoPositions of nodes and get all waypoints created
@@ -233,12 +233,12 @@ public class WorldView {
 		GraphManager man = GraphDisplayManager.getGraphManager(Layer.UNDERLAY);
 
 		// add all edges from the Graph to the HashSet
-		for (Edge edge : man.getGraph().getEdgeSet()) {
+		for (MyEdge edge : man.getGraph().<MyEdge>getEdgeSet()) {
 			edges.add(edge);
 		}
 
 		// fetch all needed data from nodes
-		for (Node node : man.getGraph().getEachNode()) {
+		for (MyNode node : man.getGraph().<MyNode>getEachNode()) {
 
 			if (node.hasAttribute("lat") && node.hasAttribute("long")) {