Browse Source

Formatting is your friend

Jan Enders 8 years ago
parent
commit
1794dece28
18 changed files with 208 additions and 198 deletions
  1. 49 40
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphHelper.java
  2. 5 4
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphManager.java
  3. 12 13
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MappingGraphManager.java
  4. 5 6
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MyEdge.java
  5. 3 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/GraphMLExporter.java
  6. 2 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/GraphMLImporter.java
  7. 3 2
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/BasicMappingOperator.java
  8. 1 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/PlacementCostMetric.java
  9. 2 2
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/TaskFulfillmentMetric.java
  10. 26 24
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ButtonManager.java
  11. 21 29
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java
  12. 13 13
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GraphDisplayManager.java
  13. 2 2
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/MenuBarManager.java
  14. 16 14
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/OptionsManager.java
  15. 28 22
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/PropertiesManager.java
  16. 6 6
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ToolboxManager.java
  17. 6 6
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/css/CSSSelector.java
  18. 8 8
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/KeyboardShortcuts.java

+ 49 - 40
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphHelper.java

@@ -1,4 +1,5 @@
 package de.tu_darmstadt.informatik.tk.scopviz.graphs;
 package de.tu_darmstadt.informatik.tk.scopviz.graphs;
+
 import java.util.Collection;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Iterator;
@@ -69,11 +70,13 @@ public class GraphHelper {
 			while (searchingForId) {
 			while (searchingForId) {
 				if (target.getEdge(newId) == null) {
 				if (target.getEdge(newId) == null) {
 					searchingForId = false;
 					searchingForId = false;
-					target.addEdge(newId, newIds.get(e.getSourceNode().getId()), newIds.get(e.getTargetNode().getId()), e.isDirected());
-					if(e.getAttribute("originalElement") == null) {
+					target.addEdge(newId, newIds.get(e.getSourceNode().getId()), newIds.get(e.getTargetNode().getId()),
+							e.isDirected());
+					if (e.getAttribute("originalElement") == null) {
 						target.getEdge(newId).addAttribute("originalElement", source.getId().concat("+#" + e.getId()));
 						target.getEdge(newId).addAttribute("originalElement", source.getId().concat("+#" + e.getId()));
-					} else  {
-						target.getEdge(newId).addAttribute("originalElement",(Object) e.getAttribute("originalElement"));
+					} else {
+						target.getEdge(newId).addAttribute("originalElement",
+								(Object) e.getAttribute("originalElement"));
 					}
 					}
 
 
 				} else {
 				} else {
@@ -99,10 +102,11 @@ public class GraphHelper {
 					searchingForId = false;
 					searchingForId = false;
 					target.addNode(newId);
 					target.addNode(newId);
 					newIds.put(n.getId(), newId);
 					newIds.put(n.getId(), newId);
-					if(n.getAttribute("originalElement") == null) {
+					if (n.getAttribute("originalElement") == null) {
 						target.getNode(newId).addAttribute("originalElement", source.getId().concat("+#" + n.getId()));
 						target.getNode(newId).addAttribute("originalElement", source.getId().concat("+#" + n.getId()));
-					} else  {
-						target.getNode(newId).addAttribute("originalElement",(Object) n.getAttribute("originalElement"));
+					} else {
+						target.getNode(newId).addAttribute("originalElement",
+								(Object) n.getAttribute("originalElement"));
 					}
 					}
 				} else {
 				} else {
 					newId = newId.concat(String.valueOf((char) (ran.nextInt(52) + 'a')));
 					newId = newId.concat(String.valueOf((char) (ran.nextInt(52) + 'a')));
@@ -232,8 +236,8 @@ public class GraphHelper {
 		}
 		}
 	}
 	}
 
 
-	public static void propagateAttribute (MyGraph g, Element n, String attribute, Object value){
-		if(n.getAttribute("originalElement") == null){
+	public static void propagateAttribute(MyGraph g, Element n, String attribute, Object value) {
+		if (n.getAttribute("originalElement") == null) {
 			Debug.out("Debug: Attribute originalElement does not Exist");
 			Debug.out("Debug: Attribute originalElement does not Exist");
 			return;
 			return;
 		}
 		}
@@ -243,14 +247,14 @@ public class GraphHelper {
 		Edge oldEdge = null;
 		Edge oldEdge = null;
 		MyGraph old = null;
 		MyGraph old = null;
 		Iterator<MyGraph> graphIter = g.getAllSubGraphs().iterator();
 		Iterator<MyGraph> graphIter = g.getAllSubGraphs().iterator();
-		while(graphIter.hasNext()){
+		while (graphIter.hasNext()) {
 			old = graphIter.next();
 			old = graphIter.next();
-			if(old.getId().equals(origGraph)){
+			if (old.getId().equals(origGraph)) {
 				Iterator<Node> nodeIter = old.getNodeIterator();
 				Iterator<Node> nodeIter = old.getNodeIterator();
-				while (nodeIter.hasNext()){
+				while (nodeIter.hasNext()) {
 					oldNode = nodeIter.next();
 					oldNode = nodeIter.next();
-					if(oldNode.getId().equals(origNode)){
-						if(value == null){
+					if (oldNode.getId().equals(origNode)) {
+						if (value == null) {
 							oldNode.removeAttribute(attribute);
 							oldNode.removeAttribute(attribute);
 						} else {
 						} else {
 							oldNode.addAttribute(attribute, value);
 							oldNode.addAttribute(attribute, value);
@@ -260,10 +264,10 @@ public class GraphHelper {
 					}
 					}
 				}
 				}
 				Iterator<Edge> edgeIter = old.getEdgeIterator();
 				Iterator<Edge> edgeIter = old.getEdgeIterator();
-				while (edgeIter.hasNext()){
+				while (edgeIter.hasNext()) {
 					oldEdge = edgeIter.next();
 					oldEdge = edgeIter.next();
-					if(oldEdge.getId().equals(origNode)){
-						if(value == null){
+					if (oldEdge.getId().equals(origNode)) {
+						if (value == null) {
 							oldEdge.removeAttribute(attribute);
 							oldEdge.removeAttribute(attribute);
 						} else {
 						} else {
 							oldEdge.addAttribute(attribute, value);
 							oldEdge.addAttribute(attribute, value);
@@ -272,7 +276,8 @@ public class GraphHelper {
 						return;
 						return;
 					}
 					}
 				}
 				}
-				Debug.out("WARNING: could not find the specified Element " + origNode + " in the Graph " + origGraph, 2);
+				Debug.out("WARNING: could not find the specified Element " + origNode + " in the Graph " + origGraph,
+						2);
 				return;
 				return;
 			}
 			}
 		}
 		}
@@ -281,31 +286,32 @@ public class GraphHelper {
 
 
 	public static String propagateElementDeletion(MyGraph g, Collection<? extends Element> col) {
 	public static String propagateElementDeletion(MyGraph g, Collection<? extends Element> col) {
 		Iterator<? extends Element> elementIter = col.iterator();
 		Iterator<? extends Element> elementIter = col.iterator();
-		while (elementIter.hasNext()){
+		while (elementIter.hasNext()) {
 			Element e = elementIter.next();
 			Element e = elementIter.next();
 			return propagateElementDeletion(g, e);
 			return propagateElementDeletion(g, e);
 		}
 		}
 		return null;
 		return null;
 	}
 	}
 
 
-	public static String propagateElementDeletion(MyGraph g, Element e){
-		if(e.getAttribute("originalElement") == null){
+	public static String propagateElementDeletion(MyGraph g, Element e) {
+		if (e.getAttribute("originalElement") == null) {
 			return null;
 			return null;
 		}
 		}
 		String origGraph = e.getAttribute("originalElement").toString().split("\\+#")[0];
 		String origGraph = e.getAttribute("originalElement").toString().split("\\+#")[0];
 		String origId = e.getAttribute("originalElement").toString().split("\\+#")[1];
 		String origId = e.getAttribute("originalElement").toString().split("\\+#")[1];
 		Iterator<MyGraph> graphIter = g.getAllSubGraphs().iterator();
 		Iterator<MyGraph> graphIter = g.getAllSubGraphs().iterator();
-		while(graphIter.hasNext()){
+		while (graphIter.hasNext()) {
 			MyGraph temp = graphIter.next();
 			MyGraph temp = graphIter.next();
-			if (temp.getId().equals(origGraph)){
-				if(e instanceof Node && temp.getNode(origId) != null){
+			if (temp.getId().equals(origGraph)) {
+				if (e instanceof Node && temp.getNode(origId) != null) {
 					temp.removeNode(origId);
 					temp.removeNode(origId);
 					return temp.getId();
 					return temp.getId();
-				} else if (e instanceof Edge && temp.getEdge(origId) != null){
+				} else if (e instanceof Edge && temp.getEdge(origId) != null) {
 					temp.removeEdge(origId);
 					temp.removeEdge(origId);
 					return temp.getId();
 					return temp.getId();
 				} else {
 				} else {
-					Debug.out("INFORMATION: could not Delete Element bećause it didn't exist: " + origGraph + ":" + origId ,1);
+					Debug.out("INFORMATION: could not Delete Element bećause it didn't exist: " + origGraph + ":"
+							+ origId, 1);
 				}
 				}
 				return null;
 				return null;
 			}
 			}
@@ -314,40 +320,43 @@ public class GraphHelper {
 		return null;
 		return null;
 	}
 	}
 
 
-	public static String propagateElementUndeletion(MyGraph g,Element e, String newNodeId){
-		if(e.getAttribute("originalElement") == null){
+	public static String propagateElementUndeletion(MyGraph g, Element e, String newNodeId) {
+		if (e.getAttribute("originalElement") == null) {
 			return null;
 			return null;
 		}
 		}
 		String origGraph = e.getAttribute("originalElement").toString().split("\\+#")[0];
 		String origGraph = e.getAttribute("originalElement").toString().split("\\+#")[0];
-		//String origId = e.getAttribute("originalElement").toString().split("\\+#")[1];
+		// String origId =
+		// e.getAttribute("originalElement").toString().split("\\+#")[1];
 		Iterator<MyGraph> graphIter = g.getAllSubGraphs().iterator();
 		Iterator<MyGraph> graphIter = g.getAllSubGraphs().iterator();
 		HashMap<String, Object> attributes = new HashMap<String, Object>();
 		HashMap<String, Object> attributes = new HashMap<String, Object>();
 		for (String s : e.getAttributeKeySet()) {
 		for (String s : e.getAttributeKeySet()) {
 			attributes.put(s, e.getAttribute(s));
 			attributes.put(s, e.getAttribute(s));
 		}
 		}
 
 
-		while(graphIter.hasNext()){
+		while (graphIter.hasNext()) {
 			MyGraph temp = graphIter.next();
 			MyGraph temp = graphIter.next();
-			if (temp.getId().equals(origGraph)){
+			if (temp.getId().equals(origGraph)) {
 				String newId = Main.getInstance().getUnusedID(new GraphManager(temp));
 				String newId = Main.getInstance().getUnusedID(new GraphManager(temp));
-				if(e instanceof Node){
+				if (e instanceof Node) {
 					temp.addNode(newId);
 					temp.addNode(newId);
 					temp.getNode(newId).addAttributes(attributes);
 					temp.getNode(newId).addAttributes(attributes);
-					return temp.getId() + "+#" + newId;//the id of Graph+newNode
-				} else if (e instanceof Edge){
+					return temp.getId() + "+#" + newId;// the id of
+														// Graph+newNode
+				} else if (e instanceof Edge) {
 					Edge ed = (Edge) e;
 					Edge ed = (Edge) e;
 					String sourceId = ed.getSourceNode().getAttribute("originalElement").toString()
 					String sourceId = ed.getSourceNode().getAttribute("originalElement").toString()
-							.split("\\+#")[newNodeId.split("\\+#").length-1];
+							.split("\\+#")[newNodeId.split("\\+#").length - 1];
 					String targetId = ed.getTargetNode().getAttribute("originalElement").toString()
 					String targetId = ed.getTargetNode().getAttribute("originalElement").toString()
-							.split("\\+#")[newNodeId.split("\\+#").length-1];
-					if(temp.getNode(sourceId) == null){
-						sourceId = newNodeId.split("\\+#")[newNodeId.split("\\+#").length-1];
+							.split("\\+#")[newNodeId.split("\\+#").length - 1];
+					if (temp.getNode(sourceId) == null) {
+						sourceId = newNodeId.split("\\+#")[newNodeId.split("\\+#").length - 1];
 					} else {
 					} else {
-						targetId = newNodeId.split("\\+#")[newNodeId.split("\\+#").length-1];
+						targetId = newNodeId.split("\\+#")[newNodeId.split("\\+#").length - 1];
 					}
 					}
 					temp.addEdge(newId, sourceId, targetId, ed.isDirected());
 					temp.addEdge(newId, sourceId, targetId, ed.isDirected());
 					temp.getEdge(newId).addAttributes(attributes);
 					temp.getEdge(newId).addAttributes(attributes);
-					return temp.getId() + "+#" + newId;//the id of graph+newEdge
+					return temp.getId() + "+#" + newId;// the id of
+														// graph+newEdge
 				}
 				}
 			}
 			}
 		}
 		}

+ 5 - 4
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphManager.java

@@ -165,8 +165,8 @@ public class GraphManager {
 			g.addNode(newId);
 			g.addNode(newId);
 			g.getNode(newId).addAttributes(attributes);
 			g.getNode(newId).addAttributes(attributes);
 			String origElement = GraphHelper.propagateElementUndeletion(g, deletedNode, null);
 			String origElement = GraphHelper.propagateElementUndeletion(g, deletedNode, null);
-			if(origElement != null){
-			g.getNode(newId).addAttribute("originalElement", origElement);
+			if (origElement != null) {
+				g.getNode(newId).addAttribute("originalElement", origElement);
 			}
 			}
 		}
 		}
 
 
@@ -188,8 +188,9 @@ public class GraphManager {
 			}
 			}
 			g.addEdge(id, sourceId, targetId, e.isDirected());
 			g.addEdge(id, sourceId, targetId, e.isDirected());
 			g.getEdge(id).addAttributes(attributes);
 			g.getEdge(id).addAttributes(attributes);
-			String origElement = GraphHelper.propagateElementUndeletion(g, e, g.getNode(newId).getAttribute("originalElement"));
-			if(origElement != null){
+			String origElement = GraphHelper.propagateElementUndeletion(g, e,
+					g.getNode(newId).getAttribute("originalElement"));
+			if (origElement != null) {
 				g.getEdge(id).addAttribute("originalElement", origElement);
 				g.getEdge(id).addAttribute("originalElement", origElement);
 			}
 			}
 
 

+ 12 - 13
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MappingGraphManager.java

@@ -81,7 +81,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 		mergeGraph(underlay, UNDERLAY, UNDERLAYER_MOVE_Y);
 		mergeGraph(underlay, UNDERLAY, UNDERLAYER_MOVE_Y);
 		mergeGraph(operator, OPERATOR, OPERATOR_MOVE_Y);
 		mergeGraph(operator, OPERATOR, OPERATOR_MOVE_Y);
 		autoMapSourcesAndSinks(underlay, operator);
 		autoMapSourcesAndSinks(underlay, operator);
-		
+
 		view.getCamera().resetView();
 		view.getCamera().resetView();
 	}
 	}
 
 
@@ -97,13 +97,13 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 				resetCapacity(n);
 				resetCapacity(n);
 			}
 			}
 		}
 		}
-		
+
 		// recreates mapping edges from saved Attributes
 		// recreates mapping edges from saved Attributes
 		autoMapLoadedEdgeAttributes(underlay, operator);
 		autoMapLoadedEdgeAttributes(underlay, operator);
 
 
 		// recreates every mapping edge to properly calculate capacities
 		// recreates every mapping edge to properly calculate capacities
 		for (Edge e : g.getEdgeSet()) {
 		for (Edge e : g.getEdgeSet()) {
-			if (e.getAttribute(ATTRIBUTE_KEY_MAPPING) != null &&(boolean) e.getAttribute(ATTRIBUTE_KEY_MAPPING)) {
+			if (e.getAttribute(ATTRIBUTE_KEY_MAPPING) != null && (boolean) e.getAttribute(ATTRIBUTE_KEY_MAPPING)) {
 				createEdge(e.getSourceNode().getId(), e.getTargetNode().getId());
 				createEdge(e.getSourceNode().getId(), e.getTargetNode().getId());
 			}
 			}
 		}
 		}
@@ -259,7 +259,8 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 		attributes.put(ATTRIBUTE_KEY_MAPPING_PARENT, idPrefix);
 		attributes.put(ATTRIBUTE_KEY_MAPPING_PARENT, idPrefix);
 		attributes.put(ATTRIBUTE_KEY_MAPPING_PARENT_ID, parentsID.get(idPrefix));
 		attributes.put(ATTRIBUTE_KEY_MAPPING_PARENT_ID, parentsID.get(idPrefix));
 
 
-		g.addEdge(idPrefix + e.getId(), idPrefix + e.getSourceNode().getId(), idPrefix + e.getTargetNode().getId(), e.isDirected());
+		g.addEdge(idPrefix + e.getId(), idPrefix + e.getSourceNode().getId(), idPrefix + e.getTargetNode().getId(),
+				e.isDirected());
 		g.getEdge(idPrefix + e.getId()).addAttributes(attributes);
 		g.getEdge(idPrefix + e.getId()).addAttributes(attributes);
 	}
 	}
 
 
@@ -375,16 +376,15 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 			return false;
 			return false;
 
 
 		// check and update capacity
 		// check and update capacity
-		if (!addMapping(underlayNode, operatorNode)){
+		if (!addMapping(underlayNode, operatorNode)) {
 			Debug.out("Could not place Mapping Edge due to insufficient capacity!", 2);
 			Debug.out("Could not place Mapping Edge due to insufficient capacity!", 2);
 			return false;
 			return false;
 		}
 		}
-			
 
 
 		e = getGraph().addEdge(newID, operatorNode, underlayNode, true);
 		e = getGraph().addEdge(newID, operatorNode, underlayNode, true);
 		Debug.out("Created an directed edge with Id " + newID + " from " + operatorNode + " to " + underlayNode);
 		Debug.out("Created an directed edge with Id " + newID + " from " + operatorNode + " to " + underlayNode);
 
 
-		//adds an Attribute for loading Edges from file
+		// adds an Attribute for loading Edges from file
 		GraphHelper.propagateAttribute(this.g, underlayNode, "mappingEdge", newID);
 		GraphHelper.propagateAttribute(this.g, underlayNode, "mappingEdge", newID);
 		underlay.getGraph().getNode(underlayNode.getId().substring(8)).addAttribute("mappingEdge", newID);
 		underlay.getGraph().getNode(underlayNode.getId().substring(8)).addAttribute("mappingEdge", newID);
 		GraphHelper.propagateAttribute(this.g, operatorNode, "mappingEdge", newID);
 		GraphHelper.propagateAttribute(this.g, operatorNode, "mappingEdge", newID);
@@ -545,18 +545,18 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	public void deleteEdge(final String id) {
 	public void deleteEdge(final String id) {
 		Edge e = g.getEdge(id);
 		Edge e = g.getEdge(id);
 		if ((boolean) e.getAttribute(ATTRIBUTE_KEY_MAPPING)) {
 		if ((boolean) e.getAttribute(ATTRIBUTE_KEY_MAPPING)) {
-			Node operatorNode = e.getSourceNode();		
+			Node operatorNode = e.getSourceNode();
 			Node underlayNode = e.getTargetNode();
 			Node underlayNode = e.getTargetNode();
-			
-			//delete mapping attriute
+
+			// delete mapping attriute
 			GraphHelper.propagateAttribute(this.g, underlayNode, "mappingEdge", null);
 			GraphHelper.propagateAttribute(this.g, underlayNode, "mappingEdge", null);
 			underlay.getGraph().getNode(underlayNode.getId().substring(8)).removeAttribute("mappingEdge");
 			underlay.getGraph().getNode(underlayNode.getId().substring(8)).removeAttribute("mappingEdge");
 			GraphHelper.propagateAttribute(this.g, operatorNode, "mappingEdge", null);
 			GraphHelper.propagateAttribute(this.g, operatorNode, "mappingEdge", null);
 			operator.getGraph().getNode(operatorNode.getId().substring(8)).removeAttribute("mappingEdge");
 			operator.getGraph().getNode(operatorNode.getId().substring(8)).removeAttribute("mappingEdge");
-			
+
 			removeMapping(underlayNode, operatorNode);
 			removeMapping(underlayNode, operatorNode);
 			super.deleteEdge(id);
 			super.deleteEdge(id);
-			
+
 		}
 		}
 	}
 	}
 
 
@@ -638,4 +638,3 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	}
 	}
 
 
 }
 }
-

+ 5 - 6
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MyEdge.java

@@ -10,13 +10,12 @@ import de.tu_darmstadt.informatik.tk.scopviz.ui.css.CSSable;
 
 
 public class MyEdge extends AbstractEdge implements CSSable {
 public class MyEdge extends AbstractEdge implements CSSable {
 	// TODO comment
 	// TODO comment
-		Set<String> classes;
-		// TODO comment
-		String type = "edge";
-		// TODO comment
-		String css;
+	Set<String> classes;
+	// TODO comment
+	String type = "edge";
+	// TODO comment
+	String css;
 
 
-		
 	public MyEdge(String id, AbstractNode source, AbstractNode target, boolean directed) {
 	public MyEdge(String id, AbstractNode source, AbstractNode target, boolean directed) {
 		super(id, source, target, directed);
 		super(id, source, target, directed);
 		// TODO Auto-generated constructor stub
 		// TODO Auto-generated constructor stub

+ 3 - 3
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/GraphMLExporter.java

@@ -95,8 +95,7 @@ public class GraphMLExporter {
 		return fileName;
 		return fileName;
 	}
 	}
 
 
-
-	public void exportMapping(MyGraph g){
+	public void exportMapping(MyGraph g) {
 		Stage stage = Main.getInstance().getPrimaryStage();
 		Stage stage = Main.getInstance().getPrimaryStage();
 		String fileName;
 		String fileName;
 		FileChooser fileChooser = new FileChooser();
 		FileChooser fileChooser = new FileChooser();
@@ -112,6 +111,7 @@ public class GraphMLExporter {
 			if (fileName != null) {
 			if (fileName != null) {
 				writeGraph(g, fileName, false);
 				writeGraph(g, fileName, false);
 			}
 			}
-		} catch (NullPointerException e) {}
+		} catch (NullPointerException e) {
+		}
 	}
 	}
 }
 }

+ 2 - 3
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/GraphMLImporter.java

@@ -11,8 +11,8 @@ 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.MyGraph;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import javafx.stage.FileChooser;
 import javafx.stage.FileChooser;
-import javafx.stage.Stage;
 import javafx.stage.FileChooser.ExtensionFilter;
 import javafx.stage.FileChooser.ExtensionFilter;
+import javafx.stage.Stage;
 
 
 /**
 /**
  * Importer to import a graph from a GraphML file and return it as a Graph
  * Importer to import a graph from a GraphML file and return it as a Graph
@@ -122,8 +122,7 @@ public class GraphMLImporter {
 	public void yEdConversion(MyGraph g) {
 	public void yEdConversion(MyGraph g) {
 		for (Node n : g.getNodeSet()) {
 		for (Node n : g.getNodeSet()) {
 			// yed conversion
 			// yed conversion
-			if ((!n.hasAttribute("ui.label") || n.getAttribute("ui.label").equals("")) 
-					&& n.hasAttribute("yEd.label")) {
+			if ((!n.hasAttribute("ui.label") || n.getAttribute("ui.label").equals("")) && n.hasAttribute("yEd.label")) {
 				n.addAttribute("ui.label", n.getAttribute("yEd.label").toString());
 				n.addAttribute("ui.label", n.getAttribute("yEd.label").toString());
 				n.removeAttribute("yEd.label");
 				n.removeAttribute("yEd.label");
 			} else if (n.hasAttribute("ui.label")) {
 			} else if (n.hasAttribute("ui.label")) {

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

@@ -81,8 +81,9 @@ public class BasicMappingOperator implements ScopvizGraphOperator {
 		@Override
 		@Override
 		public int compare(Node o1, Node o2) {
 		public int compare(Node o1, Node o2) {
 			Main m = Main.getInstance();
 			Main m = Main.getInstance();
-			
-			// the cmparator uses a reverse ordering so that the resulting list is sorted descending
+
+			// the cmparator uses a reverse ordering so that the resulting list
+			// is sorted descending
 			// this does: process-need(o1) - process-need(o2)
 			// this does: process-need(o1) - process-need(o2)
 			Double result = m.convertAttributeTypes(o1.getAttribute("process-need"), new Double(0))
 			Double result = m.convertAttributeTypes(o1.getAttribute("process-need"), new Double(0))
 					- m.convertAttributeTypes(o2.getAttribute("process-need"), new Double(0));
 					- m.convertAttributeTypes(o2.getAttribute("process-need"), new Double(0));

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

@@ -114,7 +114,7 @@ public class PlacementCostMetric implements ScopvizGraphMetric {
 					.collect(Collectors.toList()));
 					.collect(Collectors.toList()));
 			for (Edge e : mappingEdges) {
 			for (Edge e : mappingEdges) {
 				placementCostSum += placementCost(e.getNode0(), e.getNode1());
 				placementCostSum += placementCost(e.getNode0(), e.getNode1());
-			}			
+			}
 			results.add(new Pair<String, String>("Overall Cost", "" + placementCostSum));
 			results.add(new Pair<String, String>("Overall Cost", "" + placementCostSum));
 		}
 		}
 		return results;
 		return results;

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

@@ -63,7 +63,7 @@ public class TaskFulfillmentMetric implements ScopvizGraphMetric {
 			}
 			}
 		}
 		}
 		// This corresponds to F'
 		// This corresponds to F'
-		double percentagePlaced = (placedSum / prioritySum)*100;
+		double percentagePlaced = (placedSum / prioritySum) * 100;
 
 
 		if (error) {
 		if (error) {
 			error = false;
 			error = false;
@@ -71,7 +71,7 @@ public class TaskFulfillmentMetric implements ScopvizGraphMetric {
 		}
 		}
 
 
 		results.add(new Pair<String, String>("Task Placement", "" + placedSum));
 		results.add(new Pair<String, String>("Task Placement", "" + placedSum));
-		results.add(new Pair<String, String>("Placement Percentage", percentagePlaced+"%"));
+		results.add(new Pair<String, String>("Placement Percentage", percentagePlaced + "%"));
 
 
 		return results;
 		return results;
 	}
 	}

+ 26 - 24
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ButtonManager.java

@@ -5,7 +5,6 @@ import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.HashSet;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
-import org.graphstream.graph.implementations.Graphs;
 import org.jxmapviewer.viewer.GeoPosition;
 import org.jxmapviewer.viewer.GeoPosition;
 import org.jxmapviewer.viewer.WaypointPainter;
 import org.jxmapviewer.viewer.WaypointPainter;
 
 
@@ -220,7 +219,7 @@ public final class ButtonManager {
 		controller.rightSide.getChildren().remove(controller.updateButtonAPane);
 		controller.rightSide.getChildren().remove(controller.updateButtonAPane);
 		controller.metricbox.setVisible(false);
 		controller.metricbox.setVisible(false);
 		controller.leftSide.getChildren().remove(controller.resetMappingButtonAPane);
 		controller.leftSide.getChildren().remove(controller.resetMappingButtonAPane);
-		
+
 		// show operator graph selection box
 		// show operator graph selection box
 		controller.opGraphSelectionBox.setVisible(true);
 		controller.opGraphSelectionBox.setVisible(true);
 	}
 	}
@@ -479,42 +478,45 @@ public final class ButtonManager {
 	 * @param newVal
 	 * @param newVal
 	 *            Its new Value
 	 *            Its new Value
 	 */
 	 */
-/*	public static void mapViewChoiceChange(ObservableValue<? extends String> ov, String oldVal, String newVal) {
-		MapViewFunctions.changeMapView();
-	}
-
-	/**
-	 * select the given MapType in the ChoiceBox and change Map View
+	/*
+	 * public static void mapViewChoiceChange(ObservableValue<? extends String>
+	 * ov, String oldVal, String newVal) { MapViewFunctions.changeMapView(); }
+	 * 
+	 * /** select the given MapType in the ChoiceBox and change Map View
 	 * 
 	 * 
 	 * @param mapType
 	 * @param mapType
 	 */
 	 */
-/*	public static void switchToMap(String mapType) {
-		controller.mapViewChoiceBox.getSelectionModel().select(mapType);
-		MapViewFunctions.changeMapView();
-	}
-*/
+	/*
+	 * public static void switchToMap(String mapType) {
+	 * controller.mapViewChoiceBox.getSelectionModel().select(mapType);
+	 * MapViewFunctions.changeMapView(); }
+	 */
 	public static void setupOpGraphComboBox() {
 	public static void setupOpGraphComboBox() {
 		controller.opGraphSelectionBox.getItems().clear();
 		controller.opGraphSelectionBox.getItems().clear();
 		GraphManager operatorManager = GraphDisplayManager.getGraphManager(Layer.OPERATOR);
 		GraphManager operatorManager = GraphDisplayManager.getGraphManager(Layer.OPERATOR);
-		for (MyGraph g: operatorManager.getGraph().getAllSubGraphs().stream().filter((g) -> !g.isComposite()).collect(Collectors.toList())){
+		for (MyGraph g : operatorManager.getGraph().getAllSubGraphs().stream().filter((g) -> !g.isComposite())
+				.collect(Collectors.toList())) {
 			controller.opGraphSelectionBox.getItems().add(g.getId());
 			controller.opGraphSelectionBox.getItems().add(g.getId());
 		}
 		}
-		controller.opGraphSelectionBox.getItems().add("Add...");	
-		
-		//Platform.runLater(() -> controller.opGraphSelectionBox.setValue(controller.opGraphSelectionBox.getItems().get(0)));
+		controller.opGraphSelectionBox.getItems().add("Add...");
+
+		// Platform.runLater(() ->
+		// controller.opGraphSelectionBox.setValue(controller.opGraphSelectionBox.getItems().get(0)));
 	}
 	}
 
 
-	public static void addToOpGraphComboBox(String id){
-		controller.opGraphSelectionBox.getItems().add(controller.opGraphSelectionBox.getItems().size()-1, id);
+	public static void addToOpGraphComboBox(String id) {
+		controller.opGraphSelectionBox.getItems().add(controller.opGraphSelectionBox.getItems().size() - 1, id);
 	}
 	}
-	
+
 	public static void opGraphSelectedAction(ActionEvent v) {
 	public static void opGraphSelectedAction(ActionEvent v) {
-		
-		if (controller.opGraphSelectionBox.getValue().equals("Add...")){
+
+		if (controller.opGraphSelectionBox.getValue().equals("Add...")) {
 			MenuBarManager.addAction(v);
 			MenuBarManager.addAction(v);
-			Platform.runLater(() -> controller.opGraphSelectionBox.setValue(controller.opGraphSelectionBox.getItems().get(controller.opGraphSelectionBox.getItems().size()-2)));
+			Platform.runLater(() -> controller.opGraphSelectionBox.setValue(controller.opGraphSelectionBox.getItems()
+					.get(controller.opGraphSelectionBox.getItems().size() - 2)));
 		} else {
 		} else {
-			//FIXME: aktuell zu bearbeitenden graphen im GraphManager setzen (erfordert Jaschas Implementierung)!
+			// FIXME: aktuell zu bearbeitenden graphen im GraphManager setzen
+			// (erfordert Jaschas Implementierung)!
 		}
 		}
 	}
 	}
 
 

+ 21 - 29
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java

@@ -9,12 +9,9 @@ import javax.swing.event.MouseInputListener;
 
 
 import org.jxmapviewer.JXMapViewer;
 import org.jxmapviewer.JXMapViewer;
 import org.jxmapviewer.input.CenterMapListener;
 import org.jxmapviewer.input.CenterMapListener;
-import org.jxmapviewer.input.PanKeyListener;
 import org.jxmapviewer.input.PanMouseInputListener;
 import org.jxmapviewer.input.PanMouseInputListener;
 import org.jxmapviewer.input.ZoomMouseWheelListenerCursor;
 import org.jxmapviewer.input.ZoomMouseWheelListenerCursor;
 
 
-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.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.KeyboardShortcuts;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.KeyboardShortcuts;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.ResizeListener;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.ResizeListener;
@@ -23,13 +20,11 @@ import de.tu_darmstadt.informatik.tk.scopviz.ui.mapView.WorldView;
 import javafx.application.Platform;
 import javafx.application.Platform;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
 import javafx.beans.value.ObservableValue;
-import javafx.collections.FXCollections;
 import javafx.embed.swing.SwingNode;
 import javafx.embed.swing.SwingNode;
 import javafx.fxml.FXML;
 import javafx.fxml.FXML;
 import javafx.fxml.Initializable;
 import javafx.fxml.Initializable;
 import javafx.scene.control.Button;
 import javafx.scene.control.Button;
 import javafx.scene.control.CheckBox;
 import javafx.scene.control.CheckBox;
-import javafx.scene.control.ChoiceBox;
 import javafx.scene.control.ComboBox;
 import javafx.scene.control.ComboBox;
 import javafx.scene.control.Label;
 import javafx.scene.control.Label;
 import javafx.scene.control.MenuItem;
 import javafx.scene.control.MenuItem;
@@ -161,10 +156,10 @@ public class GUIController implements Initializable {
 
 
 	@FXML
 	@FXML
 	public Button updateMetricButton;
 	public Button updateMetricButton;
-	
+
 	@FXML
 	@FXML
 	public Button resetMappingButton;
 	public Button resetMappingButton;
-	
+
 	// The items of the top left box in the symbol visualization layer
 	// The items of the top left box in the symbol visualization layer
 	@FXML
 	@FXML
 	public VBox symbolToolVBox;
 	public VBox symbolToolVBox;
@@ -177,7 +172,7 @@ public class GUIController implements Initializable {
 
 
 	@FXML
 	@FXML
 	public VBox leftSide;
 	public VBox leftSide;
-	
+
 	@FXML
 	@FXML
 	public VBox rightSide;
 	public VBox rightSide;
 
 
@@ -402,8 +397,8 @@ public class GUIController implements Initializable {
 		});
 		});
 
 
 		toolbox.getColumns().setAll(toolboxObjectColumn, toolboxStringColumn);
 		toolbox.getColumns().setAll(toolboxObjectColumn, toolboxStringColumn);
-		
-		//TODO make this work!!!!!!!!!!!!
+
+		// TODO make this work!!!!!!!!!!!!
 
 
 		toolbox.getSelectionModel().selectedItemProperty()
 		toolbox.getSelectionModel().selectedItemProperty()
 				.addListener((ov, oldVal, newVal) -> ToolboxManager.selectedItemChanged(ov, oldVal, newVal));
 				.addListener((ov, oldVal, newVal) -> ToolboxManager.selectedItemChanged(ov, oldVal, newVal));
@@ -413,7 +408,7 @@ public class GUIController implements Initializable {
 			TableRow<Pair<Object, String>> row = new TableRow<>();
 			TableRow<Pair<Object, String>> row = new TableRow<>();
 			row.setOnMouseClicked((event) -> ToolboxManager.rowClickedHandler(event));
 			row.setOnMouseClicked((event) -> ToolboxManager.rowClickedHandler(event));
 			row.setOnDragDetected((event) -> {
 			row.setOnDragDetected((event) -> {
-			
+
 			});
 			});
 			return row;
 			return row;
 		});
 		});
@@ -486,7 +481,7 @@ public class GUIController implements Initializable {
 		// Update button initialization
 		// Update button initialization
 		updateMetricButton.setOnAction((event) -> MetricboxManager.updateMetrics());
 		updateMetricButton.setOnAction((event) -> MetricboxManager.updateMetrics());
 		rightSide.getChildren().remove(updateButtonAPane);
 		rightSide.getChildren().remove(updateButtonAPane);
-		
+
 		// reset mapping button initialization
 		// reset mapping button initialization
 		resetMappingButton.setOnAction((event) -> GraphDisplayManager.initMappingLayer(true));
 		resetMappingButton.setOnAction((event) -> GraphDisplayManager.initMappingLayer(true));
 		leftSide.getChildren().remove(resetMappingButtonAPane);
 		leftSide.getChildren().remove(resetMappingButtonAPane);
@@ -498,30 +493,27 @@ public class GUIController implements Initializable {
 	private void initializeOpGraphComboBox() {
 	private void initializeOpGraphComboBox() {
 
 
 		opGraphSelectionBox.setVisible(false);
 		opGraphSelectionBox.setVisible(false);
-		
+
 		ButtonManager.setupOpGraphComboBox();
 		ButtonManager.setupOpGraphComboBox();
 
 
 		// initialization of the values of the box
 		// initialization of the values of the box
-		
+
 		Platform.runLater(() -> opGraphSelectionBox.setValue(opGraphSelectionBox.getItems().get(0)));
 		Platform.runLater(() -> opGraphSelectionBox.setValue(opGraphSelectionBox.getItems().get(0)));
 
 
 		opGraphSelectionBox.setOnAction((v) -> ButtonManager.opGraphSelectedAction(v));
 		opGraphSelectionBox.setOnAction((v) -> ButtonManager.opGraphSelectedAction(v));
 		/*
 		/*
-		opGraphSelectionBox.setOnAction((v) -> {
-			if (opGraphSelectionBox.getValue().equals("Add...")) {
-				// add Dialog erscheint, Operator Graph wird importiert und fügt
-				// neuen Punkt in ComboBox hinzu
-				// per
-				// opGraphSelectionBox.getItems().add(opGraphSelectionBox.getItems().size()
-				// - 1, "");
-				Debug.out("add Operator");
-				Platform.runLater(() -> opGraphSelectionBox.setValue(firstOpGraph));
-			} else {
-
-				// wechselt auf Operatorgraph mit diesem Namen
-
-			}
-		});*/
+		 * opGraphSelectionBox.setOnAction((v) -> { if
+		 * (opGraphSelectionBox.getValue().equals("Add...")) { // add Dialog
+		 * erscheint, Operator Graph wird importiert und fügt // neuen Punkt in
+		 * ComboBox hinzu // per //
+		 * opGraphSelectionBox.getItems().add(opGraphSelectionBox.getItems().
+		 * size() // - 1, ""); Debug.out("add Operator"); Platform.runLater(()
+		 * -> opGraphSelectionBox.setValue(firstOpGraph)); } else {
+		 * 
+		 * // wechselt auf Operatorgraph mit diesem Namen
+		 * 
+		 * } });
+		 */
 	}
 	}
 
 
 	/**
 	/**

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

@@ -7,6 +7,7 @@ import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.LinkedList;
 
 
 import org.apache.commons.math3.exception.NullArgumentException;
 import org.apache.commons.math3.exception.NullArgumentException;
+
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 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.GraphHelper;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.GraphManager;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.GraphManager;
@@ -22,8 +23,8 @@ import javafx.event.EventHandler;
 import javafx.scene.input.ScrollEvent;
 import javafx.scene.input.ScrollEvent;
 import javafx.scene.layout.Pane;
 import javafx.scene.layout.Pane;
 import javafx.stage.FileChooser;
 import javafx.stage.FileChooser;
-import javafx.stage.Stage;
 import javafx.stage.FileChooser.ExtensionFilter;
 import javafx.stage.FileChooser.ExtensionFilter;
+import javafx.stage.Stage;
 
 
 /**
 /**
  * This class holds all GraphManagers, provides Functions to add Graphs and get
  * This class holds all GraphManagers, provides Functions to add Graphs and get
@@ -403,7 +404,7 @@ public final class GraphDisplayManager {
 	 * accordingly
 	 * accordingly
 	 */
 	 */
 	public static void readMapping() {
 	public static void readMapping() {
-		//import the root Graph
+		// import the root Graph
 		MyGraph g = null;
 		MyGraph g = null;
 		GraphMLImporter reader = new GraphMLImporter();
 		GraphMLImporter reader = new GraphMLImporter();
 		FileChooser fileChooser = new FileChooser();
 		FileChooser fileChooser = new FileChooser();
@@ -415,23 +416,22 @@ public final class GraphDisplayManager {
 		try {
 		try {
 			String fileName = fileChooser.showOpenDialog(Main.getInstance().getPrimaryStage()).getPath();
 			String fileName = fileChooser.showOpenDialog(Main.getInstance().getPrimaryStage()).getPath();
 			Main.getInstance().getGraphManager().setCurrentPath(fileName);
 			Main.getInstance().getGraphManager().setCurrentPath(fileName);
-			g =  reader.readGraph(getGraphStringID(count++), fileName);
+			g = reader.readGraph(getGraphStringID(count++), fileName);
 			g.getId();
 			g.getId();
 		} catch (NullPointerException e) {
 		} catch (NullPointerException e) {
 			Debug.out("INFORMATION: Mapping loading aborted", 1);
 			Debug.out("INFORMATION: Mapping loading aborted", 1);
 			return;
 			return;
 		}
 		}
-		
-		
-		//splitting graphs
-		//saving the layer for reuse later
+
+		// splitting graphs
+		// saving the layer for reuse later
 		Layer tempLayer = currentLayer;
 		Layer tempLayer = currentLayer;
-		
-		//underlay graph
+
+		// underlay graph
 		LinkedList<MyGraph> graphs = g.getAllSubGraphs();
 		LinkedList<MyGraph> graphs = g.getAllSubGraphs();
 		Iterator<MyGraph> graphIter = graphs.iterator();
 		Iterator<MyGraph> graphIter = graphs.iterator();
-		while(graphIter.hasNext()){
-			if(!"UNDERLAY".equalsIgnoreCase(graphIter.next().getAttribute("layer"))){
+		while (graphIter.hasNext()) {
+			if (!"UNDERLAY".equalsIgnoreCase(graphIter.next().getAttribute("layer"))) {
 				graphIter.remove();
 				graphIter.remove();
 			}
 			}
 		}
 		}
@@ -443,8 +443,8 @@ public final class GraphDisplayManager {
 		// operator graph
 		// operator graph
 		graphs = g.getAllSubGraphs();
 		graphs = g.getAllSubGraphs();
 		graphIter = graphs.iterator();
 		graphIter = graphs.iterator();
-		while(graphIter.hasNext()){
-			if(!"OPERATOR".equalsIgnoreCase(graphIter.next().getAttribute("layer"))){
+		while (graphIter.hasNext()) {
+			if (!"OPERATOR".equalsIgnoreCase(graphIter.next().getAttribute("layer"))) {
 				graphIter.remove();
 				graphIter.remove();
 			}
 			}
 		}
 		}

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

@@ -57,7 +57,7 @@ public final class MenuBarManager {
 	 */
 	 */
 	public static void saveAction(ActionEvent event) {
 	public static void saveAction(ActionEvent event) {
 		GraphManager v = Main.getInstance().getGraphManager();
 		GraphManager v = Main.getInstance().getGraphManager();
-		if(GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING)){
+		if (GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING)) {
 			new GraphMLExporter().exportMapping(v.getGraph());
 			new GraphMLExporter().exportMapping(v.getGraph());
 			return;
 			return;
 		}
 		}
@@ -73,7 +73,7 @@ public final class MenuBarManager {
 	 */
 	 */
 	public static void saveAsAction(ActionEvent event) {
 	public static void saveAsAction(ActionEvent event) {
 		GraphManager v = Main.getInstance().getGraphManager();
 		GraphManager v = Main.getInstance().getGraphManager();
-		if(GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING)){
+		if (GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING)) {
 			new GraphMLExporter().exportMapping(v.getGraph());
 			new GraphMLExporter().exportMapping(v.getGraph());
 			return;
 			return;
 		}
 		}

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

@@ -40,17 +40,17 @@ public final class OptionsManager {
 	private static double defaultLong = 8.654546;
 	private static double defaultLong = 8.654546;
 	/** If the default coordinates have been changed */
 	/** If the default coordinates have been changed */
 	private static boolean coordinatesChanged = false;
 	private static boolean coordinatesChanged = false;
-	
+
 	/**
 	/**
 	 * the default device size
 	 * the default device size
 	 */
 	 */
 	private static int defaultDeviceSize = 50;
 	private static int defaultDeviceSize = 50;
-	
+
 	/**
 	/**
 	 * the default thickness of edges
 	 * the default thickness of edges
 	 */
 	 */
 	private static int defaultEdgeThickness = 2;
 	private static int defaultEdgeThickness = 2;
-	
+
 	/**
 	/**
 	 * default Color theme in symbol layer
 	 * default Color theme in symbol layer
 	 */
 	 */
@@ -131,25 +131,25 @@ public final class OptionsManager {
 		TextField edgeThickness = new TextField(Integer.toString(EdgePainter.getThickness()));
 		TextField edgeThickness = new TextField(Integer.toString(EdgePainter.getThickness()));
 
 
 		TextField deviceSize = new TextField(Integer.toString(CustomWaypointRenderer.getDeviceSize()));
 		TextField deviceSize = new TextField(Integer.toString(CustomWaypointRenderer.getDeviceSize()));
-		
+
 		Button resetButton = new Button("Reset");
 		Button resetButton = new Button("Reset");
 		resetButton.setOnAction((event) -> {
 		resetButton.setOnAction((event) -> {
 
 
 			edgeThickness.setText(Integer.toString(defaultEdgeThickness));
 			edgeThickness.setText(Integer.toString(defaultEdgeThickness));
 			EdgePainter.setEdgeThickness(defaultEdgeThickness);
 			EdgePainter.setEdgeThickness(defaultEdgeThickness);
-			
+
 			deviceSize.setText(Integer.toString(defaultDeviceSize));
 			deviceSize.setText(Integer.toString(defaultDeviceSize));
 			CustomWaypointRenderer.setScaleSize(defaultDeviceSize);
 			CustomWaypointRenderer.setScaleSize(defaultDeviceSize);
-			
+
 			edgeStandardColorSymbolLayer.getSelectionModel().select(defaultStandardEdgeColor);
 			edgeStandardColorSymbolLayer.getSelectionModel().select(defaultStandardEdgeColor);
 			edgePlacementColorSymbolLayer.getSelectionModel().select(defaultPlacementColor);
 			edgePlacementColorSymbolLayer.getSelectionModel().select(defaultPlacementColor);
 			edgeSelectedColorSymbolLayer.getSelectionModel().select(defaultClickedEdgeColor);
 			edgeSelectedColorSymbolLayer.getSelectionModel().select(defaultClickedEdgeColor);
 			EdgePainter.setColor(defaultStandardEdgeColor, defaultPlacementColor, defaultClickedEdgeColor);
 			EdgePainter.setColor(defaultStandardEdgeColor, defaultPlacementColor, defaultClickedEdgeColor);
-			
+
 			waypointStandardColorSymbolLayer.getSelectionModel().select(defaultStandardDeviceColor);
 			waypointStandardColorSymbolLayer.getSelectionModel().select(defaultStandardDeviceColor);
 			waypointSelectedColorSymbolLayer.getSelectionModel().select(defaultClickedDeviceColor);
 			waypointSelectedColorSymbolLayer.getSelectionModel().select(defaultClickedDeviceColor);
 			CustomWaypointRenderer.setColor(defaultStandardDeviceColor, defaultClickedDeviceColor);
 			CustomWaypointRenderer.setColor(defaultStandardDeviceColor, defaultClickedDeviceColor);
-			
+
 		});
 		});
 
 
 		// position elements on grid
 		// position elements on grid
@@ -188,9 +188,9 @@ public final class OptionsManager {
 		grid.add(new Label("Edge thickness (int):"), 0, row);
 		grid.add(new Label("Edge thickness (int):"), 0, row);
 		grid.add(edgeThickness, 1, row);
 		grid.add(edgeThickness, 1, row);
 		row++;
 		row++;
-		//TODO: This line might be unneccesary
+		// TODO: This line might be unneccesary
 		grid.add(new Label(""), 1, row);
 		grid.add(new Label(""), 1, row);
-		 row++;
+		row++;
 		grid.add(new Label("Edge Colors"), 1, row);
 		grid.add(new Label("Edge Colors"), 1, row);
 		row++;
 		row++;
 		grid.add(new Label("Standard Edge Color"), 0, row);
 		grid.add(new Label("Standard Edge Color"), 0, row);
@@ -212,9 +212,11 @@ public final class OptionsManager {
 		row++;
 		row++;
 
 
 		grid.add(new Label("Clicked Device Color"), 0, row);
 		grid.add(new Label("Clicked Device Color"), 0, row);
-		grid.add(waypointSelectedColorSymbolLayer, 1, row); row++;
-		//TODO: unnecessary?
-		grid.add(new Label(""), 1, row); row++;
+		grid.add(waypointSelectedColorSymbolLayer, 1, row);
+		row++;
+		// TODO: unnecessary?
+		grid.add(new Label(""), 1, row);
+		row++;
 		grid.add(resetButton, 1, row);
 		grid.add(resetButton, 1, row);
 
 
 		row++;
 		row++;
@@ -244,7 +246,7 @@ public final class OptionsManager {
 						EdgePainter.setEdgeThickness(Integer.parseInt(edgeThickness.getText()));
 						EdgePainter.setEdgeThickness(Integer.parseInt(edgeThickness.getText()));
 					}
 					}
 					// symbol layer waypoint size
 					// symbol layer waypoint size
-					if(Integer.parseInt(deviceSize.getText()) != CustomWaypointRenderer.getDeviceSize()) {
+					if (Integer.parseInt(deviceSize.getText()) != CustomWaypointRenderer.getDeviceSize()) {
 						CustomWaypointRenderer.setScaleSize(Integer.parseInt(deviceSize.getText()));
 						CustomWaypointRenderer.setScaleSize(Integer.parseInt(deviceSize.getText()));
 						MapViewFunctions.resetImageMap();
 						MapViewFunctions.resetImageMap();
 						MapViewFunctions.initializeWaypointImages();
 						MapViewFunctions.initializeWaypointImages();

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

@@ -21,8 +21,9 @@ import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
 import javafx.collections.ObservableList;
 import javafx.event.EventHandler;
 import javafx.event.EventHandler;
 import javafx.geometry.Insets;
 import javafx.geometry.Insets;
-import javafx.scene.control.ButtonBar.ButtonData;
 import javafx.scene.control.Alert;
 import javafx.scene.control.Alert;
+import javafx.scene.control.Alert.AlertType;
+import javafx.scene.control.ButtonBar.ButtonData;
 import javafx.scene.control.ButtonType;
 import javafx.scene.control.ButtonType;
 import javafx.scene.control.ChoiceBox;
 import javafx.scene.control.ChoiceBox;
 import javafx.scene.control.ContextMenu;
 import javafx.scene.control.ContextMenu;
@@ -33,7 +34,6 @@ import javafx.scene.control.TableColumn.CellEditEvent;
 import javafx.scene.control.TableRow;
 import javafx.scene.control.TableRow;
 import javafx.scene.control.TableView;
 import javafx.scene.control.TableView;
 import javafx.scene.control.TextField;
 import javafx.scene.control.TextField;
-import javafx.scene.control.Alert.AlertType;
 import javafx.scene.layout.GridPane;
 import javafx.scene.layout.GridPane;
 import javafx.util.Callback;
 import javafx.util.Callback;
 
 
@@ -156,36 +156,41 @@ public final class PropertiesManager {
 			Element selected = getSelected();
 			Element selected = getSelected();
 
 
 			// Type-Check the input
 			// Type-Check the input
-			if (classType.equals(Integer.class) && newValue.matches(IS_INT)){
-				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, key, newValue);
+			if (classType.equals(Integer.class) && newValue.matches(IS_INT)) {
+				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, key,
+						newValue);
 				selected.changeAttribute(key, Integer.valueOf(newValue));
 				selected.changeAttribute(key, Integer.valueOf(newValue));
 				editedPair.setValue(newValue);
 				editedPair.setValue(newValue);
 				Debug.out("Edited integer Attribute " + key);
 				Debug.out("Edited integer Attribute " + key);
 
 
 			} else if (classType.equals(Boolean.class) && newValue.matches(IS_BOOL)) {
 			} else if (classType.equals(Boolean.class) && newValue.matches(IS_BOOL)) {
-				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, key, newValue);
+				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, key,
+						newValue);
 				selected.changeAttribute(key, Boolean.valueOf(newValue));
 				selected.changeAttribute(key, Boolean.valueOf(newValue));
 				editedPair.setValue(newValue);
 				editedPair.setValue(newValue);
 				Debug.out("Edited boolean Attribute " + key);
 				Debug.out("Edited boolean Attribute " + key);
 
 
 			} else if (classType.equals(Float.class) && newValue.matches(IS_FLOAT)) {
 			} else if (classType.equals(Float.class) && newValue.matches(IS_FLOAT)) {
-				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, key, newValue);
+				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, key,
+						newValue);
 				selected.changeAttribute(key, Float.valueOf(newValue));
 				selected.changeAttribute(key, Float.valueOf(newValue));
 				editedPair.setValue(newValue);
 				editedPair.setValue(newValue);
 				Debug.out("Edited float Attribute " + key);
 				Debug.out("Edited float Attribute " + key);
 
 
 			} else if (classType.equals(Double.class) && newValue.matches(IS_FLOAT)) {
 			} else if (classType.equals(Double.class) && newValue.matches(IS_FLOAT)) {
-				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, key, newValue);
+				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, key,
+						newValue);
 				selected.changeAttribute(key, Double.valueOf(newValue));
 				selected.changeAttribute(key, Double.valueOf(newValue));
 				editedPair.setValue(newValue);
 				editedPair.setValue(newValue);
 				Debug.out("Edited double Attribute " + key);
 				Debug.out("Edited double Attribute " + key);
 
 
 			} else if (classType.equals(String.class)) {
 			} else if (classType.equals(String.class)) {
-				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, key, newValue);
+				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, key,
+						newValue);
 				selected.changeAttribute(key, newValue);
 				selected.changeAttribute(key, newValue);
 				editedPair.setValue(newValue);
 				editedPair.setValue(newValue);
 				Debug.out("Edited String Attribute " + key);
 				Debug.out("Edited String Attribute " + key);
-				if(key.equals("typeofNode")){
+				if (key.equals("typeofNode")) {
 					selected.changeAttribute("ui.class", newValue);
 					selected.changeAttribute("ui.class", newValue);
 				}
 				}
 
 
@@ -456,7 +461,7 @@ public final class PropertiesManager {
 		Dialog<ArrayList<String>> addPropDialog = new Dialog<>();
 		Dialog<ArrayList<String>> addPropDialog = new Dialog<>();
 		addPropDialog.setTitle("Add Property");
 		addPropDialog.setTitle("Add Property");
 		addPropDialog.setHeaderText("Choose your Property Details");
 		addPropDialog.setHeaderText("Choose your Property Details");
-		
+
 		// Alert window -> when problems with input
 		// Alert window -> when problems with input
 		Alert alert = new Alert(AlertType.WARNING);
 		Alert alert = new Alert(AlertType.WARNING);
 		alert.setTitle("Property-Type Alert");
 		alert.setTitle("Property-Type Alert");
@@ -495,9 +500,9 @@ public final class PropertiesManager {
 
 
 		nameSet = false;
 		nameSet = false;
 		valueSet = false;
 		valueSet = false;
-		
+
 		// show pre defined property name
 		// show pre defined property name
-		if(preConfigPropName != null){
+		if (preConfigPropName != null) {
 			name.setText(preConfigPropName);
 			name.setText(preConfigPropName);
 			PropertiesManager.nameSet = true;
 			PropertiesManager.nameSet = true;
 		}
 		}
@@ -551,22 +556,23 @@ public final class PropertiesManager {
 
 
 			if (t.get(2).equals("Integer") && t.get(1).matches(IS_INT)) {
 			if (t.get(2).equals("Integer") && t.get(1).matches(IS_INT)) {
 				selected.addAttribute(t.get(0), Integer.valueOf(t.get(1)));
 				selected.addAttribute(t.get(0), Integer.valueOf(t.get(1)));
-				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph()
-						, selected, t.get(0), Integer.valueOf(t.get(1)));
+				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, t.get(0),
+						Integer.valueOf(t.get(1)));
 			} else if (t.get(2).equals("Float") && t.get(1).matches(IS_FLOAT)) {
 			} else if (t.get(2).equals("Float") && t.get(1).matches(IS_FLOAT)) {
 				selected.addAttribute(t.get(0), Float.valueOf(t.get(1)));
 				selected.addAttribute(t.get(0), Float.valueOf(t.get(1)));
-				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph()
-						, selected, t.get(0), Float.valueOf(t.get(1)));
+				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, t.get(0),
+						Float.valueOf(t.get(1)));
 			} else if (t.get(2).equals("String")) {
 			} else if (t.get(2).equals("String")) {
 				selected.addAttribute(t.get(0), String.valueOf(t.get(1)));
 				selected.addAttribute(t.get(0), String.valueOf(t.get(1)));
-				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph()
-						, selected, t.get(0), String.valueOf(t.get(1)));
-			} else if (t.get(2).equals("Boolean")&& t.get(1).matches(IS_BOOL)) {
+				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, t.get(0),
+						String.valueOf(t.get(1)));
+			} else if (t.get(2).equals("Boolean") && t.get(1).matches(IS_BOOL)) {
 				selected.addAttribute(t.get(0), Boolean.valueOf(t.get(1)));
 				selected.addAttribute(t.get(0), Boolean.valueOf(t.get(1)));
-				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph()
-						, selected, t.get(0), Boolean.valueOf(t.get(1)));
+				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), selected, t.get(0),
+						Boolean.valueOf(t.get(1)));
 			} else {
 			} else {
-				// type doesnt fit input -> show alert and re-open property creation window
+				// type doesnt fit input -> show alert and re-open property
+				// creation window
 				alert.showAndWait();
 				alert.showAndWait();
 				addPropFunctionality(t.get(0));
 				addPropFunctionality(t.get(0));
 			}
 			}

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

@@ -283,8 +283,8 @@ public final class ToolboxManager {
 			Optional<String> result = weightDialog.showAndWait();
 			Optional<String> result = weightDialog.showAndWait();
 			if (result.isPresent()) {
 			if (result.isPresent()) {
 				e.addAttribute("weight", Double.parseDouble(result.get()));
 				e.addAttribute("weight", Double.parseDouble(result.get()));
-				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), 
-						e, "weight", Double.parseDouble(result.get()));
+				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), e, "weight",
+						Double.parseDouble(result.get()));
 
 
 			}
 			}
 		});
 		});
@@ -374,8 +374,8 @@ public final class ToolboxManager {
 			org.graphstream.graph.Node actualNode = Main.getInstance().getGraphManager().getGraph().getNode(n.getId());
 			org.graphstream.graph.Node actualNode = Main.getInstance().getGraphManager().getGraph().getNode(n.getId());
 			if (result.isPresent()) {
 			if (result.isPresent()) {
 				actualNode.addAttribute("process-max", Double.parseDouble(result.get()));
 				actualNode.addAttribute("process-max", Double.parseDouble(result.get()));
-				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), 
-						actualNode, "process-max", Double.parseDouble(result.get()));
+				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), actualNode,
+						"process-max", Double.parseDouble(result.get()));
 			}
 			}
 			PropertiesManager.setItemsProperties();
 			PropertiesManager.setItemsProperties();
 		});
 		});
@@ -395,8 +395,8 @@ public final class ToolboxManager {
 			org.graphstream.graph.Node actualNode = Main.getInstance().getGraphManager().getGraph().getNode(n.getId());
 			org.graphstream.graph.Node actualNode = Main.getInstance().getGraphManager().getGraph().getNode(n.getId());
 			if (result.isPresent()) {
 			if (result.isPresent()) {
 				actualNode.addAttribute("process-need", Double.parseDouble(result.get()));
 				actualNode.addAttribute("process-need", Double.parseDouble(result.get()));
-				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), 
-				actualNode, "process-need", Double.parseDouble(result.get()));
+				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), actualNode,
+						"process-need", Double.parseDouble(result.get()));
 			}
 			}
 		});
 		});
 	}
 	}

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

@@ -4,21 +4,21 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Iterator;
 
 
 class CSSSelector {
 class CSSSelector {
-	//TODO comment
+	// TODO comment
 	String type;
 	String type;
-	//TODO comment
+	// TODO comment
 	HashSet<String> classes;
 	HashSet<String> classes;
-	//TODO comment
+	// TODO comment
 	int value;
 	int value;
 
 
-	//TODO comment
+	// TODO comment
 	CSSSelector(String type, HashSet<String> classes) {
 	CSSSelector(String type, HashSet<String> classes) {
 		this.type = type;
 		this.type = type;
 		this.classes = classes;
 		this.classes = classes;
 		value = (type != null ? 1 : 0) + classes.size() << 1;
 		value = (type != null ? 1 : 0) + classes.size() << 1;
 	}
 	}
 
 
-	//TODO comment
+	// TODO comment
 	boolean ConditionsMetBy(CSSable suspect) {
 	boolean ConditionsMetBy(CSSable suspect) {
 		if (type != null && !type.equals(suspect.getType()))
 		if (type != null && !type.equals(suspect.getType()))
 			return false;
 			return false;
@@ -30,7 +30,7 @@ class CSSSelector {
 		return true;
 		return true;
 	}
 	}
 
 
-	//TODO comment
+	// TODO comment
 	int getValue() {
 	int getValue() {
 		return value;
 		return value;
 	}
 	}

+ 8 - 8
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/KeyboardShortcuts.java

@@ -1,14 +1,14 @@
 package de.tu_darmstadt.informatik.tk.scopviz.ui.handlers;
 package de.tu_darmstadt.informatik.tk.scopviz.ui.handlers;
 
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
-import de.tu_darmstadt.informatik.tk.scopviz.ui.GraphDisplayManager;
 import de.tu_darmstadt.informatik.tk.scopviz.main.CreationMode;
 import de.tu_darmstadt.informatik.tk.scopviz.main.CreationMode;
-import de.tu_darmstadt.informatik.tk.scopviz.ui.MenuBarManager;
-import de.tu_darmstadt.informatik.tk.scopviz.ui.mapView.MapViewFunctions;
-import javafx.event.ActionEvent;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
 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.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.GUIController;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.GUIController;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.GraphDisplayManager;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.MenuBarManager;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.mapView.MapViewFunctions;
+import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
 import javafx.event.EventHandler;
 import javafx.scene.input.KeyCode;
 import javafx.scene.input.KeyCode;
 import javafx.scene.input.KeyCodeCombination;
 import javafx.scene.input.KeyCodeCombination;
@@ -35,7 +35,7 @@ public final class KeyboardShortcuts {
 	final static KeyCombination mShift = new KeyCodeCombination(KeyCode.M, KeyCombination.SHIFT_DOWN);
 	final static KeyCombination mShift = new KeyCodeCombination(KeyCode.M, KeyCombination.SHIFT_DOWN);
 	final static KeyCombination rAltShift = new KeyCodeCombination(KeyCode.R, KeyCombination.ALT_DOWN,
 	final static KeyCombination rAltShift = new KeyCodeCombination(KeyCode.R, KeyCombination.ALT_DOWN,
 			KeyCombination.SHIFT_DOWN);
 			KeyCombination.SHIFT_DOWN);
-	
+
 	/**
 	/**
 	 * preferences shortcut
 	 * preferences shortcut
 	 */
 	 */
@@ -117,17 +117,17 @@ public final class KeyboardShortcuts {
 				}
 				}
 
 
 			}
 			}
-			
+
 			else if (pCtrl.match(event)) {
 			else if (pCtrl.match(event)) {
 				MenuBarManager.preferencesAction(new ActionEvent());
 				MenuBarManager.preferencesAction(new ActionEvent());
 			}
 			}
-			
+
 			else if (event.getCode().equals(KeyCode.RIGHT)) {
 			else if (event.getCode().equals(KeyCode.RIGHT)) {
 				if (GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
 				if (GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
 					MapViewFunctions.switchToNextWaypoint();
 					MapViewFunctions.switchToNextWaypoint();
 				}
 				}
 			}
 			}
-			
+
 			else if (event.getCode().equals(KeyCode.LEFT)) {
 			else if (event.getCode().equals(KeyCode.LEFT)) {
 				if (GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
 				if (GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
 					MapViewFunctions.switchToPreviousWaypoint();
 					MapViewFunctions.switchToPreviousWaypoint();