소스 검색

Small fixes and formatting

Jan Enders 8 년 전
부모
커밋
c69705f883
23개의 변경된 파일339개의 추가작업 그리고 334개의 파일을 삭제
  1. 7 5
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/debug/Debug.java
  2. 0 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphHelper.java
  3. 0 6
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphManager.java
  4. 3 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MappingGraphManager.java
  5. 11 14
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MyGraph.java
  6. 1 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/GraphMLImporter.java
  7. 44 43
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/Main.java
  8. 34 27
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/CommunicationCostMetric.java
  9. 18 20
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/PlacementCostMetric.java
  10. 5 8
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/TaskFulfillmentMetric.java
  11. 1 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/TestMetric.java
  12. 34 37
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ButtonManager.java
  13. 20 15
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ConsoleManager.java
  14. 42 47
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java
  15. 31 24
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GraphDisplayManager.java
  16. 29 32
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/MetricboxManager.java
  17. 7 8
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/OptionsManager.java
  18. 38 28
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/PropertiesManager.java
  19. 3 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/StylesheetManager.java
  20. 8 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ToolboxManager.java
  21. 1 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/MyAnimationTimer.java
  22. 2 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/MyMouseManager.java
  23. 0 4
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomTileFactory.java

+ 7 - 5
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/debug/Debug.java

@@ -26,7 +26,8 @@ public final class Debug {
 	/**
 	 * All Logs with a severity smaller than the loglevel will be ignored
 	 * 
-	 * @param logLevel the logLevel to set
+	 * @param logLevel
+	 *            the logLevel to set
 	 */
 	public static void setLogLevel(int logLevel) {
 		Debug.logLevel = logLevel;
@@ -80,14 +81,15 @@ public final class Debug {
 	}
 
 	/**
-	 * Short form for System.out.println(). 
-	 * Also look if a message is important enough to be printed
+	 * Short form for System.out.println(). Also look if a message is important
+	 * enough to be printed
 	 * 
 	 * @param s
 	 *            String to be printed on the console
 	 * 
-	 * @param severity 
-	 * 			  the severity of the message (1 = INFORMATION, 2 = WARNING, 3 = ERROR)
+	 * @param severity
+	 *            the severity of the message (1 = INFORMATION, 2 = WARNING, 3 =
+	 *            ERROR)
 	 */
 	public static void out(String s, int severity) {
 		if (DEBUG_ENABLED && severity >= logLevel) {

+ 0 - 3
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphHelper.java

@@ -2,7 +2,6 @@ package de.tu_darmstadt.informatik.tk.scopviz.graphs;
 
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.Random;
 
 import org.graphstream.algorithm.Toolkit;
@@ -10,7 +9,6 @@ import org.graphstream.graph.Edge;
 import org.graphstream.graph.Node;
 import org.graphstream.ui.geom.Point3;
 
-import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.OptionsManager;
 
 public class GraphHelper {
@@ -138,7 +136,6 @@ public class GraphHelper {
 		}
 	}
 
-	
 	/**
 	 * Converts the Coordinates of all Nodes into a saveable and uniform Format.
 	 */

+ 0 - 6
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphManager.java

@@ -2,14 +2,11 @@ package de.tu_darmstadt.informatik.tk.scopviz.graphs;
 
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedList;
 
-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.swingViewer.ViewPanel;
 import org.graphstream.ui.view.Viewer;
 import org.graphstream.ui.view.ViewerPipe;
@@ -19,7 +16,6 @@ import de.tu_darmstadt.informatik.tk.scopviz.main.CreationMode;
 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.OptionsManager;
 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;
@@ -238,7 +234,6 @@ public class GraphManager {
 			if (!hasClass(n, UI_CLASS_PROCESSING_ENABLED)
 					|| !GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING)) {
 				n.changeAttribute("ui.style", "fill-color : #F00; size: 15px;");
-				PropertiesManager.setItemsProperties();
 			}
 		}
 	}
@@ -255,7 +250,6 @@ public class GraphManager {
 			this.selectedEdgeID = edgeID;
 
 			addClass(edgeID, "selected");
-			PropertiesManager.setItemsProperties();
 		}
 	}
 

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

@@ -33,7 +33,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	private static final double OPERATOR_MOVE_Y = 1.5;
 	private static final double SCALE_WIDTH = 2;
 	private static final double SCALE_HEIGHT = 1;
-	
+
 	/** Variables to keep track of new Nodes in the underlay graph */
 	private boolean underlayNodesChanged = false;
 
@@ -517,7 +517,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 			return super.selectNodeForEdgeCreation(nodeID);
 		return false;
 	}
-	
+
 	@Override
 	public void deleteEdge(final String id) {
 		Edge e = g.getEdge(id);
@@ -533,7 +533,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	public void deleteNode(String id) {
 		Debug.out("default delete Node prevented");
 	}
-	
+
 	@Override
 	public void undelete() {
 		super.undelete();

+ 11 - 14
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MyGraph.java

@@ -1,14 +1,11 @@
 package de.tu_darmstadt.informatik.tk.scopviz.graphs;
 
-import java.util.Collection;
 import java.util.Iterator;
 import java.util.LinkedList;
 
 import org.graphstream.graph.Edge;
 import org.graphstream.graph.Node;
 import org.graphstream.graph.implementations.SingleGraph;
-import org.graphstream.stream.Replayable;
-import org.graphstream.stream.SourceBase;
 
 /**
  * Our own Class to extend GraphStreams Graph with our own Functionality.
@@ -213,7 +210,7 @@ public class MyGraph extends SingleGraph {
 				currentMin = (Double) n.getAttribute("x");
 			}
 		}
-		if (currentMin == Double.MAX_VALUE){
+		if (currentMin == Double.MAX_VALUE) {
 			return 0;
 		}
 		return currentMin;
@@ -224,7 +221,7 @@ public class MyGraph extends SingleGraph {
 	 * 
 	 * @return the biggest X Coordinate in the Graph
 	 */
-	public double getMaxX() {		
+	public double getMaxX() {
 		double currentMax = Double.MIN_VALUE;
 		Node n = null;
 		Iterator<Node> allNodes = getNodeIterator();
@@ -235,9 +232,9 @@ public class MyGraph extends SingleGraph {
 				currentMax = (Double) n.getAttribute("x");
 			}
 		}
-		if (currentMax == Double.MIN_VALUE){
+		if (currentMax == Double.MIN_VALUE) {
 			return 0;
-		}		
+		}
 		return currentMax;
 	}
 
@@ -257,7 +254,7 @@ public class MyGraph extends SingleGraph {
 				currentMin = (Double) n.getAttribute("y");
 			}
 		}
-		if (currentMin == Double.MAX_VALUE){
+		if (currentMin == Double.MAX_VALUE) {
 			return 0;
 		}
 		return currentMin;
@@ -279,7 +276,7 @@ public class MyGraph extends SingleGraph {
 				currentMax = (Double) n.getAttribute("y");
 			}
 		}
-		if (currentMax == Double.MIN_VALUE){
+		if (currentMax == Double.MIN_VALUE) {
 			return 0;
 		}
 		return currentMax;
@@ -289,15 +286,15 @@ public class MyGraph extends SingleGraph {
 		composite = true;
 		children.add(g);
 	}
-	
-	public boolean isComposite(){
+
+	public boolean isComposite() {
 		return composite;
 	}
-	
-	public LinkedList<MyGraph> getAllSubGraphs(){
+
+	public LinkedList<MyGraph> getAllSubGraphs() {
 		LinkedList<MyGraph> result = new LinkedList<MyGraph>();
 		result.addAll(children);
-		for (MyGraph g :children){
+		for (MyGraph g : children) {
 			result.addAll(g.getAllSubGraphs());
 		}
 		return result;

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

@@ -60,7 +60,7 @@ public class GraphMLImporter {
 	 */
 	private void handleAttributes(MyGraph g) {
 		for (Node n : g.getNodeSet()) {
-			if (!n.hasAttribute("ui.label")){
+			if (!n.hasAttribute("ui.label")) {
 				n.addAttribute("ui.label", "");
 			}
 			if (!n.hasAttribute("typeofNode") || n.getAttribute("typeofNode").equals("")) {

+ 44 - 43
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/Main.java

@@ -3,7 +3,6 @@ package de.tu_darmstadt.informatik.tk.scopviz.main;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 
-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.ui.GraphDisplayManager;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.MyAnimationTimer;
@@ -129,26 +128,28 @@ public final class Main {
 		this.creationMode = creationMode;
 	}
 
-	//TODO replace throw by something better for debug
+	// TODO replace throw by something better for debug
 	/**
 	 * Converts a given Attribute into the type of result
 	 * 
-	 * @param attribute the Attribute to be converted.
-	 *  supported types: byte, short, integer, long, float, double, BigInteger, BigDecimal, String 
+	 * @param attribute
+	 *            the Attribute to be converted. supported types: byte, short,
+	 *            integer, long, float, double, BigInteger, BigDecimal, String
 	 * 
-	 * @param result the Attribute will be written in here after the conversion.
-	 *  the supported types are the same as above except for String 
+	 * @param result
+	 *            the Attribute will be written in here after the conversion.
+	 *            the supported types are the same as above except for String
 	 * 
 	 * @return the value of result
 	 */
-	//don't worry I checked all the conversions
+	// don't worry I checked all the conversions
 	@SuppressWarnings("unchecked")
-	public <T extends Number> T convertAttributeTypes (Object attribute, T result){
+	public <T extends Number> T convertAttributeTypes(Object attribute, T result) {
 		String currentType = attribute.getClass().getSimpleName().toLowerCase();
 		String targetType = result.getClass().getSimpleName().toLowerCase();
-		switch (targetType){
-		case "byte" :
-			switch (currentType){
+		switch (targetType) {
+		case "byte":
+			switch (currentType) {
 			case "byte":
 			case "short":
 			case "integer":
@@ -159,15 +160,15 @@ public final class Main {
 			case "bigdecimal":
 				result = (T) new Byte(((Number) attribute).byteValue());
 				break;
-			case "string" :
+			case "string":
 				result = (T) new Byte(new BigDecimal((String) attribute).byteValue());
 				break;
-			default :
+			default:
 				throw new IllegalArgumentException("invalid type: " + attribute.getClass());
 			}
 			break;
-		case "short" :
-			switch (currentType){
+		case "short":
+			switch (currentType) {
 			case "byte":
 			case "short":
 			case "integer":
@@ -178,15 +179,15 @@ public final class Main {
 			case "bigdecimal":
 				result = (T) new Short(((Number) attribute).shortValue());
 				break;
-			case "string" :
+			case "string":
 				result = (T) new Short(new BigDecimal((String) attribute).shortValue());
 				break;
-			default :
+			default:
 				throw new IllegalArgumentException("invalid type: " + attribute.getClass());
 			}
 			break;
-		case "integer" :
-			switch (currentType){
+		case "integer":
+			switch (currentType) {
 			case "byte":
 			case "short":
 			case "integer":
@@ -197,15 +198,15 @@ public final class Main {
 			case "bigdecimal":
 				result = (T) new Integer(((Number) attribute).intValue());
 				break;
-			case "string" :
+			case "string":
 				result = (T) new Integer(new BigDecimal((String) attribute).intValue());
 				break;
-			default :
+			default:
 				throw new IllegalArgumentException("invalid type: " + attribute.getClass());
 			}
 			break;
-		case "long" :
-			switch (currentType){
+		case "long":
+			switch (currentType) {
 			case "byte":
 			case "short":
 			case "integer":
@@ -216,16 +217,16 @@ public final class Main {
 			case "bigdecimal":
 				result = (T) new Long(((Number) attribute).longValue());
 				break;
-			case "string" :
+			case "string":
 				result = (T) new Long(new BigDecimal((String) attribute).longValue());
 				break;
-			default :
+			default:
 				throw new IllegalArgumentException("invalid type: " + attribute.getClass());
 			}
 			break;
-		case "biginteger" :
+		case "biginteger":
 			BigInteger integer;
-			switch (currentType){
+			switch (currentType) {
 			case "byte":
 				integer = new BigInteger(Byte.toString((byte) attribute));
 				break;
@@ -239,10 +240,10 @@ public final class Main {
 				integer = new BigInteger(Long.toString((long) attribute));
 				break;
 			case "float":
-				integer = new BigInteger(Integer.toString((int)(float) attribute));
+				integer = new BigInteger(Integer.toString((int) (float) attribute));
 				break;
 			case "double":
-				integer = new BigInteger(Long.toString((long)(double) attribute));
+				integer = new BigInteger(Long.toString((long) (double) attribute));
 				break;
 			case "biginteger":
 				integer = (BigInteger) attribute;
@@ -250,16 +251,16 @@ public final class Main {
 			case "bigdecimal":
 				integer = ((BigDecimal) attribute).toBigInteger();
 				break;
-			case "string" :
+			case "string":
 				integer = new BigDecimal((String) attribute).toBigInteger();
 				break;
-			default :
+			default:
 				throw new IllegalArgumentException("invalid type: " + attribute.getClass());
 			}
 			result = (T) integer;
 			break;
-		case "float" :
-			switch (currentType){
+		case "float":
+			switch (currentType) {
 			case "byte":
 			case "short":
 			case "integer":
@@ -270,15 +271,15 @@ public final class Main {
 			case "bigdecimal":
 				result = (T) new Float(((Number) attribute).floatValue());
 				break;
-			case "string" :
+			case "string":
 				result = (T) new Float(new BigDecimal((String) attribute).floatValue());
 				break;
-			default :
+			default:
 				throw new IllegalArgumentException("invalid type: " + attribute.getClass());
 			}
 			break;
-		case "double" :
-			switch (currentType){
+		case "double":
+			switch (currentType) {
 			case "byte":
 			case "short":
 			case "integer":
@@ -289,16 +290,16 @@ public final class Main {
 			case "bigdecimal":
 				result = (T) new Double(((Number) attribute).doubleValue());
 				break;
-			case "string" :
+			case "string":
 				result = (T) new Double(new BigDecimal((String) attribute).doubleValue());
 				break;
-			default :
+			default:
 				throw new IllegalArgumentException("invalid type: " + attribute.getClass());
 			}
 			break;
-		case "bigdecimal" :
+		case "bigdecimal":
 			BigDecimal decimal;
-			switch (currentType){
+			switch (currentType) {
 			case "byte":
 				decimal = new BigDecimal((byte) attribute);
 				break;
@@ -323,10 +324,10 @@ public final class Main {
 			case "bigdecimal":
 				decimal = (BigDecimal) attribute;
 				break;
-			case "string" :
+			case "string":
 				decimal = new BigDecimal((String) attribute);
 				break;
-			default :
+			default:
 				throw new IllegalArgumentException("invalid type: " + attribute.getClass());
 			}
 			result = (T) decimal;

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

@@ -15,20 +15,22 @@ import de.tu_darmstadt.informatik.tk.scopviz.metrics.interfaces.ScopvizGraphMetr
 import javafx.util.Pair;
 
 /**
- * Class to compute the communication cost metric.
- * The Metric is defined as the sum of the network traversal costs for each hop in the longest path in the operator graph.
- * wARNING: This might not work fully as intended with multiple Operator graphs!
+ * Class to compute the communication cost metric. The Metric is defined as the
+ * sum of the network traversal costs for each hop in the longest path in the
+ * operator graph. wARNING: This might not work fully as intended with multiple
+ * Operator graphs!
+ * 
  * @author Jan Enders
  * @version 0.9
  *
  */
 // TODO: make this work well with multiple operator graphs
-public class CommunicationCostMetric implements ScopvizGraphMetric{
+public class CommunicationCostMetric implements ScopvizGraphMetric {
 
 	/** Flag for when an error occurs during computation. */
 	// TODO: this is not yet being used for output and never reset
 	private boolean error = false;
-	
+
 	@Override
 	public boolean isSetupRequired() {
 		return false;
@@ -41,62 +43,67 @@ public class CommunicationCostMetric implements ScopvizGraphMetric{
 
 	@Override
 	public void setup() {
-		// No Setup required.		
+		// No Setup required.
 	}
 
 	@Override
 	public LinkedList<Pair<String, String>> calculate(MyGraph g) {
 		LinkedList<Pair<String, String>> results = new LinkedList<Pair<String, String>>();
-		
+
 		MyGraph operator = new MyGraph("opWithTime");
-		for (Node n : g.getNodeSet()){
-			if (n.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING_PARENT) == MappingGraphManager.OPERATOR){
+		for (Node n : g.getNodeSet()) {
+			if (n.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING_PARENT) == MappingGraphManager.OPERATOR) {
 				operator.addNode(n.getId());
 			}
-			
+
 		}
-		for (Edge e : g.getEdgeSet()){
-			if (e.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING_PARENT) == MappingGraphManager.OPERATOR){
+		for (Edge e : g.getEdgeSet()) {
+			if (e.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING_PARENT) == MappingGraphManager.OPERATOR) {
 				String newID = e.getId();
 				double cost = computeCost(e.getNode0(), e.getNode1(), g);
 				operator.addEdge(newID, e.getNode0().getId(), e.getNode1().getId(), true);
 				operator.getEdge(newID).addAttribute("cost", cost);
 			}
 		}
-		
-		//TODO: not fully sure if the diameter Method does exactly what we want, requires testing
+
+		// TODO: not fully sure if the diameter Method does exactly what we
+		// want, requires testing
 		double communicationCost = Toolkit.diameter(operator, "cost", true);
-		
-		results.add(new Pair<String,String>("Overall Cost", ""+communicationCost));
-		
+
+		results.add(new Pair<String, String>("Overall Cost", "" + communicationCost));
+
 		return results;
 	}
 
 	/**
-	 * Compute the Network traversal cost for the Communication between two given operator nodes.
+	 * Compute the Network traversal cost for the Communication between two
+	 * given operator nodes.
 	 * 
-	 * @param n1 The first operator node
-	 * @param n2 The second operator node
-	 * @param g the combined mapping graph
+	 * @param n1
+	 *            The first operator node
+	 * @param n2
+	 *            The second operator node
+	 * @param g
+	 *            the combined mapping graph
 	 * @return the cost
 	 */
-	private double computeCost(Node n1, Node n2, MyGraph g){
+	private double computeCost(Node n1, Node n2, MyGraph g) {
 		double cost = 0;
-		//find the underlay nodes that the operator nodes are mapped to
+		// find the underlay nodes that the operator nodes are mapped to
 		LinkedList<Edge> mappingEdges = new LinkedList<Edge>(g.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){
-			if(e.getNode0() == n1){
+		for (Edge e : mappingEdges) {
+			if (e.getNode0() == n1) {
 				target1 = e.getNode1();
-			} else if (e.getNode0() == n2){
+			} else if (e.getNode0() == n2) {
 				target2 = e.getNode1();
 			}
 		}
 		// Error if not both operator nodes have a valid mapping
-		if (target1 == null || target2 == null){
+		if (target1 == null || target2 == null) {
 			Debug.out("Could not find Mapping target for Operator Node " + n1.getId() + " or " + n2.getId());
 			error = true;
 		} else {

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

@@ -19,9 +19,10 @@ import javafx.stage.FileChooser;
 import javafx.util.Pair;
 
 /**
- * Class to compute the placement cost Metric.
- * Placement Cost is defined as the sum of the costs of individual mapping placements.
- * These Costs are specified in operator node - underlay node pairs and are loaded from an external file during setup.
+ * Class to compute the placement cost Metric. Placement Cost is defined as the
+ * sum of the costs of individual mapping placements. These Costs are specified
+ * in operator node - underlay node pairs and are loaded from an external file
+ * during setup.
  * 
  * @author Jan Enders
  * @version 1.0
@@ -41,9 +42,11 @@ public class PlacementCostMetric implements ScopvizGraphMetric {
 	private static final String UNDERLAY_ID_PREFIX = "underlayIDs:";
 
 	/** The text to display in case of an error during computation. */
-	private static final Pair<String, String> ERROR_MESSAGE = new Pair<String, String>("Error", "ERROR: check Debug logs");
+	private static final Pair<String, String> ERROR_MESSAGE = new Pair<String, String>("Error",
+			"ERROR: check Debug logs");
 	/** The text to display if the Setup has not yet been done. */
-	private static final Pair<String, String> SETUP_NEEDED = new Pair<String, String>("Setup required!", "Setup required!");
+	private static final Pair<String, String> SETUP_NEEDED = new Pair<String, String>("Setup required!",
+			"Setup required!");
 
 	/** The Cost Matrix. */
 	private double[][] costs;
@@ -109,21 +112,17 @@ public class PlacementCostMetric implements ScopvizGraphMetric {
 			LinkedList<Edge> mappingEdges = new LinkedList<Edge>(g.getEdgeSet().stream()
 					.filter(e -> (((Boolean) e.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING)) == true))
 					.collect(Collectors.toList()));
-			for (Edge e: mappingEdges){
+			for (Edge e : mappingEdges) {
 				placementCostSum += placementCost(e.getNode0(), e.getNode1());
 			}
 			/*
-			for (Node n : g.getNodeSet()) {
-				if (n.getId().startsWith(MappingGraphManager.OPERATOR)) {
-					for (Edge e : n.getEdgeSet()) {
-						String edgeTargetParent = e.getNode1()
-								.getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING_PARENT);
-						if (edgeTargetParent == MappingGraphManager.UNDERLAY) {
-							placementCostSum += placementCost(n, e.getNode1());
-						}
-					}
-				}
-			}*/
+			 * for (Node n : g.getNodeSet()) { if
+			 * (n.getId().startsWith(MappingGraphManager.OPERATOR)) { for (Edge
+			 * e : n.getEdgeSet()) { String edgeTargetParent = e.getNode1()
+			 * .getAttribute(MappingGraphManager.ATTRIBUTE_KEY_MAPPING_PARENT);
+			 * if (edgeTargetParent == MappingGraphManager.UNDERLAY) {
+			 * placementCostSum += placementCost(n, e.getNode1()); } } } }
+			 */
 			results.add(new Pair<String, String>("Overall Cost", "" + placementCostSum));
 		}
 		return results;
@@ -149,17 +148,16 @@ public class PlacementCostMetric implements ScopvizGraphMetric {
 			operatorIDs = new LinkedList<String>();
 			String data = line.substring(OPERATOR_ID_PREFIX.length()).trim();
 			String[] opIDs = data.split(",");
-			for (String s: opIDs){
+			for (String s : opIDs) {
 				operatorIDs.add(s.trim());
 			}
-			
 
 			// Read Underlay Node ID list
 		} else if (line.startsWith(UNDERLAY_ID_PREFIX)) {
 			underlayIDs = new LinkedList<String>();
 			String data = line.substring(UNDERLAY_ID_PREFIX.length()).trim();
 			String[] ulIDs = data.split(",");
-			for (String s: ulIDs){
+			for (String s : ulIDs) {
 				underlayIDs.add(s.trim());
 			}
 

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

@@ -1,11 +1,9 @@
 package de.tu_darmstadt.informatik.tk.scopviz.metrics;
 
 import java.util.LinkedList;
-import java.util.List;
 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.MyGraph;
@@ -33,12 +31,12 @@ public class TaskFulfillmentMetric implements ScopvizGraphMetric {
 	@Override
 	public LinkedList<Pair<String, String>> calculate(MyGraph g) {
 		LinkedList<Pair<String, String>> results = new LinkedList<Pair<String, String>>();
-		if (g.isComposite()){
+		if (g.isComposite()) {
 			LinkedList<MyGraph> graphs = g.getAllSubGraphs();
-			for (MyGraph current : graphs){
+			for (MyGraph current : graphs) {
 				String attributes = "";
-				for (String key: current.getAttributeKeySet()){
-					attributes = attributes.concat(key+":"+current.getAttribute(key)+", ");
+				for (String key : current.getAttributeKeySet()) {
+					attributes = attributes.concat(key + ":" + current.getAttribute(key) + ", ");
 				}
 				results.add(new Pair<String, String>(current.getId(), attributes));
 			}
@@ -48,6 +46,5 @@ public class TaskFulfillmentMetric implements ScopvizGraphMetric {
 				.collect(Collectors.toList()));
 		return results;
 	}
-	
-	
+
 }

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

@@ -15,7 +15,7 @@ public class TestMetric implements ScopvizGraphMetric {
 
 	@Override
 	public LinkedList<Pair<String, String>> calculate(MyGraph g) {
-		LinkedList<Pair<String, String>> test =  new LinkedList<Pair<String, String>>();
+		LinkedList<Pair<String, String>> test = new LinkedList<Pair<String, String>>();
 		test.add(new Pair<String, String>("Hi", "test"));
 		test.add(new Pair<String, String>("Hi2", "test2"));
 		return test;

+ 34 - 37
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ButtonManager.java

@@ -22,7 +22,8 @@ import javafx.scene.control.Button;
 /**
  * Manager to contain the various handlers for the buttons of the UI.
  * 
- * @author Jan Enders (jan.enders@stud.tu-darmstadt.de), Julian Ohl, Dominik Renkel
+ * @author Jan Enders (jan.enders@stud.tu-darmstadt.de), Julian Ohl, Dominik
+ *         Renkel
  * @version 1.2
  *
  */
@@ -93,14 +94,14 @@ public final class ButtonManager {
 
 			// show toolbox and hide VBox
 			controller.toolbox.setVisible(true);
-			
+
 			controller.topLeftAPane.getChildren().remove(controller.symbolToolVBox);
-			
+
 			controller.symbolToolVBox.setVisible(false);
-			
+
 			// make properties editable again
 			controller.propertiesObjectColumn.setEditable(true);
-			
+
 			// enabel context menu
 			controller.properties.setRowFactory(PropertiesManager.rightClickCallback);
 
@@ -115,14 +116,13 @@ public final class ButtonManager {
 			// make graph non mouse transparent
 			controller.pane.setMouseTransparent(false);
 			controller.swingNode.setMouseTransparent(false);
-			
+
 			// deselect graph element
 			PropertiesManager.showNewDataSet(null);
-			
+
 			// reset loaded images
 			MapViewFunctions.resetImageMap();
-			
-			
+
 		}
 	}
 
@@ -135,13 +135,13 @@ public final class ButtonManager {
 
 		GraphDisplayManager.setCurrentLayer(Layer.UNDERLAY);
 		GraphDisplayManager.switchActiveGraph();
-		
+
 		ToolboxManager.setUnderlayItems();
 		setBorderStyle((Button) arg0.getSource());
-		
+
 		controller.getOpenButton().setText("Open...");
-		
-		//hide metricbox/update button
+
+		// hide metricbox/update button
 		controller.rightSide.getChildren().remove(controller.updateButtonAPane);
 		controller.metricbox.setVisible(false);
 	}
@@ -155,13 +155,13 @@ public final class ButtonManager {
 
 		GraphDisplayManager.setCurrentLayer(Layer.OPERATOR);
 		GraphDisplayManager.switchActiveGraph();
-		
+
 		ToolboxManager.setOperatorItems();
 		setBorderStyle((Button) arg0.getSource());
 
 		controller.getOpenButton().setText("Open...");
-		
-		//hide metricbox/update button
+
+		// hide metricbox/update button
 		controller.rightSide.getChildren().remove(controller.updateButtonAPane);
 		controller.metricbox.setVisible(false);
 	}
@@ -170,25 +170,23 @@ public final class ButtonManager {
 	 * Handler for the Mapping Layer switch Button.
 	 */
 	public static void mappingAction(ActionEvent arg0) {
-		
-		//show metricbox/update button
-		if (!(GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING))){
+
+		// show metricbox/update button
+		if (!(GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING))) {
 			controller.rightSide.getChildren().add(2, controller.updateButtonAPane);
 			controller.metricbox.setVisible(true);
 		}
-				
+
 		switchfromSymbolLayer();
 
 		GraphDisplayManager.setCurrentLayer(Layer.MAPPING);
 		GraphDisplayManager.switchActiveGraph();
-		
+
 		ToolboxManager.setMappingItems();
 		setBorderStyle((Button) arg0.getSource());
 
 		controller.getOpenButton().setText("Open Mapping...");
-		
-		
-		
+
 	}
 
 	/**
@@ -205,27 +203,25 @@ public final class ButtonManager {
 			GraphDisplayManager.addGraph(gClone, true);
 			controller.topLeftAPane.getChildren().add(controller.symbolToolVBox);
 		}
-		
+
 		try {
-			// load world view 
+			// load world view
 			activateWorldView();
-			
-			
-			
-			
+
 		} catch (IOException e) {
-			
-			// problems with Internet connection, maybe host not reachable, maybe no Internet connection at all
+
+			// problems with Internet connection, maybe host not reachable,
+			// maybe no Internet connection at all
 			GraphDisplayManager.switchActiveGraph();
 			setBorderStyle((Button) arg0.getSource());
-			
+
 			// show "Connection Error" message
 			showConnectionErrorMsg();
-			
+
 			return;
 		}
-		
-		//hide metricbox/update button
+
+		// hide metricbox/update button
 		controller.rightSide.getChildren().remove(controller.updateButtonAPane);
 		controller.metricbox.setVisible(false);
 
@@ -249,7 +245,8 @@ public final class ButtonManager {
 
 	/**
 	 * Initializes the WorldView, sets data and paints them.
-	 * @throws IOException 
+	 * 
+	 * @throws IOException
 	 */
 	private static void activateWorldView() throws IOException {
 

+ 20 - 15
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ConsoleManager.java

@@ -14,39 +14,44 @@ public class ConsoleManager {
 	 * Reference to the GUI Controller for Access to various GUI Elements.
 	 */
 	private static GUIController controller;
-	
+
 	/**
 	 * Initialize console window by setting controller
 	 * 
-	 * @param c our GUIController 
+	 * @param c
+	 *            our GUIController
 	 */
-	public static void initialize(GUIController c){
+	public static void initialize(GUIController c) {
 		controller = c;
 	}
-	
+
 	/**
 	 * Add normal text to the console output
-	 * @param s the text, which should be displayed
+	 * 
+	 * @param s
+	 *            the text, which should be displayed
 	 */
-	public static void addNormalText(String s){
+	public static void addNormalText(String s) {
 		StringBuilder sb = new StringBuilder();
-		
+
 		sb.append(System.lineSeparator()).append(s);
-		
+
 		controller.consoleWindow.getChildren().add(new Text(sb.toString()));
 	}
-	
+
 	/**
 	 * Add error text to the console output
-	 * @param s the text, which should be displayed
+	 * 
+	 * @param s
+	 *            the text, which should be displayed
 	 */
-	public static void addErrorText(String s){
+	public static void addErrorText(String s) {
 		StringBuilder sb = new StringBuilder();
-		
+
 		sb.append(System.lineSeparator()).append(s);
-		
-		Text errorText = new Text(sb.toString()); 
-		
+
+		Text errorText = new Text(sb.toString());
+
 		errorText.setFill(Color.RED);
 		controller.consoleWindow.getChildren().add(errorText);
 	}

+ 42 - 47
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java

@@ -13,16 +13,13 @@ import org.jxmapviewer.input.PanKeyListener;
 import org.jxmapviewer.input.PanMouseInputListener;
 import org.jxmapviewer.input.ZoomMouseWheelListenerCursor;
 
-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.metrics.TestMetric;
 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.mapView.WorldView;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
 import javafx.collections.FXCollections;
-import javafx.collections.ObservableList;
 import javafx.embed.swing.SwingNode;
 import javafx.fxml.FXML;
 import javafx.fxml.Initializable;
@@ -130,16 +127,16 @@ public class GUIController implements Initializable {
 
 	// The columns of the metricbox
 	@FXML
-	public TableColumn<MetricRowData,String> metricBoxMetricColumn;
+	public TableColumn<MetricRowData, String> metricBoxMetricColumn;
 	@FXML
-	public TableColumn<MetricRowData,String> metricBoxValueColumn;
+	public TableColumn<MetricRowData, String> metricBoxValueColumn;
 	@FXML
 	public TableColumn metricBoxUpdateColumn;
 
 	@FXML
 	public Button updateMetricButton;
-	
-	//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
 	public VBox symbolToolVBox;
 	@FXML
@@ -150,21 +147,22 @@ public class GUIController implements Initializable {
 	public CheckBox edgeWeightCheckbox;
 	@FXML
 	public ChoiceBox<String> mapViewChoiceBox;
-	
+
 	@FXML
 	public TextFlow consoleWindow;
-	
+
 	@FXML
 	public VBox rightSide;
-	
-	//The anchorpane of the top left box (toolbox, symbol visualization layer box)
+
+	// The anchorpane of the top left box (toolbox, symbol visualization layer
+	// box)
 	@FXML
 	public AnchorPane topLeftAPane;
-	
-	//The anchorpane of the metric update button
+
+	// The anchorpane of the metric update button
 	@FXML
 	public AnchorPane updateButtonAPane;
-	
+
 	/**
 	 * Initializes all the references to the UI elements specified in the FXML
 	 * file. Gets called during FXML loading. Asserts the correct injection of
@@ -186,7 +184,7 @@ public class GUIController implements Initializable {
 		ToolboxManager.initializeItems();
 		PropertiesManager.initializeItems(properties);
 		ConsoleManager.initialize(this);
-		
+
 		GraphDisplayManager.init(this);
 
 		// Bind all the handlers to their corresponding UI elements
@@ -201,7 +199,7 @@ public class GUIController implements Initializable {
 
 		// Setup the Keyboard Shortcuts
 		KeyboardShortcuts.initialize(Main.getInstance().getPrimaryStage());
-		
+
 	}
 
 	private void initializeWorldView() {
@@ -262,7 +260,7 @@ public class GUIController implements Initializable {
 	private void initializeSymbolRepToolbox() {
 		// Hide SymbolRep Toolbox View
 		topLeftAPane.getChildren().remove(symbolToolVBox);
-		
+
 		edgesVisibleCheckbox.selectedProperty()
 				.addListener((ov, oldVal, newVal) -> ButtonManager.edgeVisibilitySwitcher(ov, oldVal, newVal));
 		nodeLabelCheckbox.selectedProperty()
@@ -274,9 +272,7 @@ public class GUIController implements Initializable {
 		mapViewChoiceBox.getSelectionModel().selectFirst();
 		mapViewChoiceBox.getSelectionModel().selectedItemProperty()
 				.addListener((ov, oldVal, newVal) -> ButtonManager.mapViewChoiceChange(ov, oldVal, newVal));
-		
-		
-		
+
 	}
 
 	/**
@@ -375,28 +371,27 @@ public class GUIController implements Initializable {
 		properties.getSelectionModel().clearSelection();
 
 	}
-	
+
 	/**
 	 * Initialize the metric box
 	 */
 	@SuppressWarnings("unchecked")
 	private void initializeMetricbox() {
-		
-		//TODO Möglicherweise auslagern
-		metricbox.setRowFactory( tv -> {
-		    TableRow<MetricRowData> row = new TableRow<>();
-		    row.setOnMouseClicked(event -> {
-		        if (event.getClickCount() == 2 && (! row.isEmpty()) ) {
-		        	
-		        	MetricRowData rowData = row.getItem();
-		        	if(rowData.getMetric().isSetupRequired()){
-		        		rowData.getMetric().setup();
-		        	}
-		            
-		            
-		        }   
-		    });
-		    return row ;
+
+		// TODO Möglicherweise auslagern
+		metricbox.setRowFactory(tv -> {
+			TableRow<MetricRowData> row = new TableRow<>();
+			row.setOnMouseClicked(event -> {
+				if (event.getClickCount() == 2 && (!row.isEmpty())) {
+
+					MetricRowData rowData = row.getItem();
+					if (rowData.getMetric().isSetupRequired()) {
+						rowData.getMetric().setup();
+					}
+
+				}
+			});
+			return row;
 		});
 
 		metricBoxMetricColumn.setResizable(true);
@@ -405,15 +400,15 @@ public class GUIController implements Initializable {
 		metricBoxMetricColumn.setCellValueFactory(new PropertyValueFactory<MetricRowData, String>("metricName"));
 		metricBoxValueColumn.setCellValueFactory(new PropertyValueFactory<MetricRowData, String>("value"));
 		metricBoxUpdateColumn.setCellValueFactory(new PropertyValueFactory<>("checked"));
-		
+
 		metricBoxUpdateColumn.setCellFactory(CheckBoxTableCell.forTableColumn(metricBoxUpdateColumn));
-		
+
 		metricbox.getColumns().setAll(metricBoxMetricColumn, metricBoxValueColumn, metricBoxUpdateColumn);
 		MetricboxManager.initialize(this);
-		
-		//Update button initialization
+
+		// Update button initialization
 		updateMetricButton.setOnAction((event) -> MetricboxManager.updateMetrics());
-		//TODO
+		// TODO
 		rightSide.getChildren().remove(updateButtonAPane);
 	}
 
@@ -480,22 +475,22 @@ public class GUIController implements Initializable {
 
 		assert rightSide != null : "fx:id=\"rightSide\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert consoleWindow != null : "fx:id=\"consoleWindow\" was not injected: check your FXML file 'MainWindow.fxml'.";
-		
+
 		assert metricBoxMetricColumn != null : "fx:id=\"metricBoxMetricColumn\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert metricBoxValueColumn != null : "fx:id=\"metricBoxValueColumn\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert metricBoxUpdateColumn != null : "fx:id=\"metricBoxUpdateColumn\" was not injected: check your FXML file 'MainWindow.fxml'.";
-		
+
 		assert updateMetricButton != null : "fx:id=\"updateMetricButton\" was not injected: check your FXML file 'MainWindow.fxml'.";
-		
+
 		assert topLeftAPane != null : "fx:id=\"topLeftAPane\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert updateButtonAPane != null : "fx:id=\"updateButton\" was not injected: check your FXML file 'MainWindow.fxml'.";
-		
+
 		assert symbolToolVBox != null : "fx:id=\"symbolToolVBox\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert edgesVisibleCheckbox != null : "fx:id=\"edgesVisibleCheckbox\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert nodeLabelCheckbox != null : "fx:id=\"nodeLabelCheckbox\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert edgeWeightCheckbox != null : "fx:id=\"egdeWeightCheckbox\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert mapViewChoiceBox != null : "fx:id=\"mapViewChoiceBox\" was not injected: check your FXML file 'MainWindow.fxml'.";
-		
+
 		assert stackPane != null : "fx:id=\"stackPane\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert swingNodeWorldView != null : "fx:id=\"swingNodeWorldView\" was not injected: check your FXML file 'MainWindow.fxml'.";
 	}

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

@@ -51,28 +51,34 @@ public final class GraphDisplayManager {
 
 	/** The currently active Layer. */
 	private static Layer currentLayer = Layer.UNDERLAY;
-	
-	
+
 	/**
-	 * Observable boolean value, true when currentLayer = symbol layer, false otherwise
+	 * Observable boolean value, true when currentLayer = symbol layer, false
+	 * otherwise
 	 */
-	private static BooleanProperty inSymbolLayer = new SimpleBooleanProperty(); 
-	
+	private static BooleanProperty inSymbolLayer = new SimpleBooleanProperty();
+
 	/**
 	 * set inSymbolLayer to true
 	 */
-	private static final void changeToSymbolLayer(){inSymbolLayer.set(true);};
-	
+	private static final void changeToSymbolLayer() {
+		inSymbolLayer.set(true);
+	};
+
 	/**
 	 * set inSymbolLayer to false
 	 */
-	private static final void changeToOtherLayer(){inSymbolLayer.set(false);};
-	
+	private static final void changeToOtherLayer() {
+		inSymbolLayer.set(false);
+	};
+
 	/**
 	 * 
-	 * @return inSymbolLayer property 
+	 * @return inSymbolLayer property
 	 */
-	public static BooleanProperty inSymbolLayerProperty(){return inSymbolLayer;};
+	public static BooleanProperty inSymbolLayerProperty() {
+		return inSymbolLayer;
+	};
 
 	/**
 	 * An empty GraphManager to use with Layers not yet filled with another
@@ -201,7 +207,7 @@ public final class GraphDisplayManager {
 			// set basic style
 			v.setStylesheet(StylesheetManager.DEFAULT_STYLESHEET);
 		} else {
-			//TODO: Testing new Merging code
+			// TODO: Testing new Merging code
 			v = new GraphManager(GraphHelper.newMerge(false, getGraphManager().getGraph(), g));
 			v.getGraph().addAttribute("layer", currentLayer);
 			v.getGraph().addAttribute("ui.antialias");
@@ -210,15 +216,16 @@ public final class GraphDisplayManager {
 			ret = count++;
 			// set basic style
 			v.setStylesheet(StylesheetManager.DEFAULT_STYLESHEET);
-			
-			
-			/*TODO: remove this OLD CODE
-			v = getGraphManager();
-			Debug.out(v.getGraph().toString() + " Nodes: " + v.getGraph().getNodeCount() + " Edges: " + v.getGraph().getEdgeCount());
-			GraphHelper.merge(v.getGraph(), g);
-			ret = currentGraphManager;
-			Debug.out(v.getGraph().toString() + " Nodes: " + v.getGraph().getNodeCount() + " Edges: " + v.getGraph().getEdgeCount());
-			*/
+
+			/*
+			 * TODO: remove this OLD CODE v = getGraphManager();
+			 * Debug.out(v.getGraph().toString() + " Nodes: " +
+			 * v.getGraph().getNodeCount() + " Edges: " +
+			 * v.getGraph().getEdgeCount()); GraphHelper.merge(v.getGraph(), g);
+			 * ret = currentGraphManager; Debug.out(v.getGraph().toString() +
+			 * " Nodes: " + v.getGraph().getNodeCount() + " Edges: " +
+			 * v.getGraph().getEdgeCount());
+			 */
 		}
 
 		// set ui.class
@@ -330,10 +337,10 @@ public final class GraphDisplayManager {
 			initMappingLayer();
 		}
 		GraphDisplayManager.currentLayer = currentLayer;
-		
-		if(currentLayer.equals(Layer.SYMBOL)){
+
+		if (currentLayer.equals(Layer.SYMBOL)) {
 			changeToSymbolLayer();
-		}else{
+		} else {
 			changeToOtherLayer();
 		}
 	}

+ 29 - 32
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/MetricboxManager.java

@@ -16,20 +16,21 @@ import javafx.collections.ObservableList;
  * @version 1.3.0.0
  */
 public class MetricboxManager {
-	
+
 	private static GUIController controller;
 	private static ObservableList<MetricRowData> metrics;
-	
+
 	/**
 	 * Private Constructor to prevent Instantiation.
 	 */
-	private MetricboxManager(){
+	private MetricboxManager() {
 	}
-	
+
 	/**
-	 * Initialize metricbox by setting controller, initializing all metrics and set them as items
+	 * Initialize metricbox by setting controller, initializing all metrics and
+	 * set them as items
 	 * 
-	 * @param guiController 
+	 * @param guiController
 	 */
 	public static void initialize(GUIController guiController) {
 		controller = guiController;
@@ -40,43 +41,39 @@ public class MetricboxManager {
 	/**
 	 * Initializes all metrics for employment
 	 * 
-	 * ****Central method to add a new metric*****
-	 * Add line: 
-	 * metrics.add(new MetricRowData(new YourMetric()));
-	 * for using it in the metricbox
+	 * ****Central method to add a new metric***** Add line: metrics.add(new
+	 * MetricRowData(new YourMetric())); for using it in the metricbox
 	 * **************************************************************
 	 * 
 	 */
-	private static void initializeMetrics(){
-		 metrics = FXCollections.observableArrayList();
-		 
-		 metrics.add(new MetricRowData(new TestMetric()));
-		 metrics.add(new MetricRowData(new PlacementCostMetric()));
-		 metrics.add(new MetricRowData(new CommunicationCostMetric()));
-		 metrics.add(new MetricRowData(new TaskFulfillmentMetric()));
+	private static void initializeMetrics() {
+		metrics = FXCollections.observableArrayList();
+
+		metrics.add(new MetricRowData(new TestMetric()));
+		metrics.add(new MetricRowData(new PlacementCostMetric()));
+		metrics.add(new MetricRowData(new CommunicationCostMetric()));
+		metrics.add(new MetricRowData(new TaskFulfillmentMetric()));
 	}
-	
-	
+
 	/**
-	 * if in mapping layer:
-	 * updates all values of all metrics that are checked and refreshes the metricbox
+	 * if in mapping layer: updates all values of all metrics that are checked
+	 * and refreshes the metricbox
 	 */
-	public static void updateMetrics(){
-		
-		if(GraphDisplayManager.getCurrentLayer() == Layer.MAPPING){
-			
-			for(MetricRowData d: metrics){
-				
-				if(d.getChecked()){
-					
+	public static void updateMetrics() {
+
+		if (GraphDisplayManager.getCurrentLayer() == Layer.MAPPING) {
+
+			for (MetricRowData d : metrics) {
+
+				if (d.getChecked()) {
+
 					d.updateMetric(Main.getInstance().getGraphManager().getGraph());
-					
+
 				}
 			}
 			controller.metricbox.refresh();
 		}
-		
+
 	}
-	
 
 }

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

@@ -2,11 +2,9 @@ package de.tu_darmstadt.informatik.tk.scopviz.ui;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
 
 import javafx.application.Platform;
 import javafx.collections.FXCollections;
-import javafx.collections.ObservableArray;
 import javafx.collections.ObservableList;
 import javafx.geometry.Insets;
 import javafx.scene.control.ButtonBar.ButtonData;
@@ -67,9 +65,10 @@ public final class OptionsManager {
 
 		ChoiceBox<String> nodeGraphicsSelector = new ChoiceBox<String>();
 		if (StylesheetManager.getAllNodeGraphics() != null) {
-		ObservableList<String> styles = FXCollections.observableArrayList(Arrays.asList(StylesheetManager.getAllNodeGraphics()));
-		nodeGraphicsSelector.setItems(FXCollections.observableArrayList(styles));
-		nodeGraphicsSelector.getSelectionModel().select(StylesheetManager.getNodeGraphics());
+			ObservableList<String> styles = FXCollections
+					.observableArrayList(Arrays.asList(StylesheetManager.getAllNodeGraphics()));
+			nodeGraphicsSelector.setItems(FXCollections.observableArrayList(styles));
+			nodeGraphicsSelector.getSelectionModel().select(StylesheetManager.getNodeGraphics());
 		}
 
 		TextField defaultLatitudeField = new TextField(Double.toString(defaultLat));
@@ -84,9 +83,9 @@ public final class OptionsManager {
 		grid.add(showWeightButton, 1, row);
 		row++;
 		if (StylesheetManager.getAllNodeGraphics().length > 1) {
-		grid.add(new Label("Node display:"), 0, row);
-		grid.add(nodeGraphicsSelector, 1, row);
-		row++;
+			grid.add(new Label("Node display:"), 0, row);
+			grid.add(nodeGraphicsSelector, 1, row);
+			row++;
 		}
 		grid.add(new Label("Default Coordinates of Nodes without Coordinates" + (coordinatesChanged ? ":" : ".")), 0,
 				row);

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

@@ -61,10 +61,12 @@ public final class PropertiesManager {
 	public static boolean valueSet;
 
 	public static HashSet<TableRow<KeyValuePair>> tableRows = new HashSet<TableRow<KeyValuePair>>();
-	
-	/** list for organizing items in the properties window in a specific order */
+
+	/**
+	 * list for organizing items in the properties window in a specific order
+	 */
 	private static LinkedList<String> itemOrderRules = new LinkedList<String>();
-	/** hashmap for filtering items out of the properties window  */
+	/** hashmap for filtering items out of the properties window */
 	private static HashMap<String, Integer> itemVisibilityRules = new HashMap<String, Integer>();
 
 	/**
@@ -86,17 +88,17 @@ public final class PropertiesManager {
 		setItemRules();
 
 	}
-	
+
 	/**
 	 * setting up the rules for the items displayed in the properties window
 	 * 
-	 * ******************************************************
-	 *  add properties here for grouping or filtering them out
+	 * ****************************************************** add properties
+	 * here for grouping or filtering them out
 	 * ******************************************************
 	 */
 	private static void setItemRules() {
 
-		//setting the order for specific properties
+		// setting the order for specific properties
 		itemOrderRules.add("ID");
 		itemOrderRules.add("typeofNode");
 		itemOrderRules.add("typeofDevice");
@@ -104,8 +106,8 @@ public final class PropertiesManager {
 		itemOrderRules.add("y");
 		itemOrderRules.add("lat");
 		itemOrderRules.add("long");
-		
-		//properties, which shall be filtered out of the properties window
+
+		// properties, which shall be filtered out of the properties window
 		itemVisibilityRules.put("layout.frozen", -1);
 		itemVisibilityRules.put("ui.style", -1);
 		itemVisibilityRules.put("ui.j2dsk", -1);
@@ -113,7 +115,8 @@ public final class PropertiesManager {
 		itemVisibilityRules.put("ui.map.selected", -1);
 		itemVisibilityRules.put("xyz", -1);
 
-		//properties, which shall be filtered out of the properties window , only if debug is disabled
+		// properties, which shall be filtered out of the properties window ,
+		// only if debug is disabled
 		itemVisibilityRules.put("mapping", -2);
 		itemVisibilityRules.put("mapping-parent", -2);
 		itemVisibilityRules.put("mapping-parent-id", -2);
@@ -313,10 +316,10 @@ public final class PropertiesManager {
 					newData.add(new KeyValuePair(key, selected.getAttribute(key).toString(), String.class));
 					break;
 				}
-			break;
+				break;
 			default:
 				Object actualAttribute = selected.getAttribute(key);
-				if(actualAttribute != null){
+				if (actualAttribute != null) {
 					newData.add(new KeyValuePair(key, String.valueOf(actualAttribute), actualAttribute.getClass()));
 				}
 				break;
@@ -361,32 +364,38 @@ public final class PropertiesManager {
 	}
 
 	/**
-	 * groups and filters a list of items according to the order and visibility rules
-	 * @param data a list of property items
+	 * groups and filters a list of items according to the order and visibility
+	 * rules
+	 * 
+	 * @param data
+	 *            a list of property items
 	 * @return the data with the rules applied
 	 */
 	private static ObservableList<KeyValuePair> groupProperties(ObservableList<KeyValuePair> data) {
-		ObservableList<KeyValuePair> newData = FXCollections.observableArrayList();;
+		ObservableList<KeyValuePair> newData = FXCollections.observableArrayList();
+		;
+
+		// adds all items in the order of the rules. Ordered items as an extra
+		// list, removed from data
+		for (String s : itemOrderRules) {
 
-		//adds all items in the order of the rules. Ordered items as an extra list, removed from data
-		for(String s: itemOrderRules){
-			
 			for (int i = 0; i < data.size(); i++) {
-				
+
 				KeyValuePair kvp = data.get(i);
 
 				if (kvp.getKey().equals(s)) {
-					
+
 					newData.add(kvp);
 					data.remove(kvp);
-					
+
 				}
-				
+
 			}
-			
+
 		}
-		
-		//filters items according to the rules. Filters on the data without the ordered items
+
+		// filters items according to the rules. Filters on the data without the
+		// ordered items
 		for (String key : itemVisibilityRules.keySet()) {
 
 			for (int i = 0; i < data.size(); i++) {
@@ -413,10 +422,11 @@ public final class PropertiesManager {
 
 			}
 		}
-		
-		//adds the filtered data without the ordered items behind the ordered items
+
+		// adds the filtered data without the ordered items behind the ordered
+		// items
 		newData.addAll(data);
-		
+
 		return newData;
 	}
 

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

@@ -15,7 +15,7 @@ public class StylesheetManager {
 	/**
 	 * all available graphic styles
 	 */
-	private static String[] allNodeGraphics = {"Shapes"};
+	private static String[] allNodeGraphics = { "Shapes" };
 	/**
 	 * The Stylesheet that is given to every graph that is added to display
 	 * everything correctly.
@@ -26,8 +26,8 @@ public class StylesheetManager {
 	 * Part of the stylesheet that styles the different Nodes with shapes.
 	 */
 	public static final String STYLE_NODES_SHAPES = "node.standard{shape: diamond;}" + "node.source{shape: triangle;}"
-			+ "node.procEn{shape: circle;}" + "node.sink{shape: box;}" + "node.operator{shape: circle;}";
-	
+			+ "node.procEn{shape: circle;}" + "node.sink{shape: box;}" + "node.operator{shape: diamond;}";
+
 	/**
 	 * Part of the stylesheet that styles the different Nodes with sprites.
 	 */

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

@@ -119,7 +119,7 @@ public final class ToolboxManager {
 
 			if (node instanceof TableRow) {
 				row = (TableRow<Pair<Object, String>>) node;
-			} else if (node.getParent() instanceof TableRow){
+			} else if (node.getParent() instanceof TableRow) {
 				// clicking on text part
 				row = (TableRow<Pair<Object, String>>) node.getParent();
 			} else {
@@ -152,6 +152,9 @@ public final class ToolboxManager {
 
 				} else if (rowString.equals("Undirected")) {
 					changeCreationMode(CreationMode.CREATE_UNDIRECTED_EDGE);
+
+				} else if (rowString.equals("Mapping Edge")) {
+					changeCreationMode(CreationMode.CREATE_DIRECTED_EDGE);
 				}
 
 				// Unselecet Rows if Creation Mode is None
@@ -179,6 +182,7 @@ public final class ToolboxManager {
 
 	/**
 	 * create a pair object under given picture and name
+	 * 
 	 * @param picture
 	 * @param name
 	 * @return
@@ -215,8 +219,9 @@ public final class ToolboxManager {
 	}
 
 	/**
-	 * The actual TableCell, that renders the images of nodes and edges. (Image, String)-Cell
-	 * additional support for (String, String), (Integer, String), (Boolean, String), ("N/A", String) table cells
+	 * The actual TableCell, that renders the images of nodes and edges. (Image,
+	 * String)-Cell additional support for (String, String), (Integer, String),
+	 * (Boolean, String), ("N/A", String) table cells
 	 *
 	 */
 	public static class PairValueCell extends TableCell<Pair<Object, String>, Object> {

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

@@ -23,7 +23,7 @@ public class MyAnimationTimer extends AnimationTimer {
 		if (Main.getInstance().getGraphManager() != null) {
 			Main.getInstance().getGraphManager().pumpIt();
 			GraphHelper.correctCoordinates(Main.getInstance().getGraphManager().getGraph());
-			GraphHelper.handleEdgeWeight(Main.getInstance().getGraphManager().getGraph());			
+			GraphHelper.handleEdgeWeight(Main.getInstance().getGraphManager().getGraph());
 		}
 	}
 

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

@@ -146,7 +146,7 @@ public class MyMouseManager extends DefaultMouseManager {
 	 *            the corresponding MouseEvent
 	 */
 	protected void mouseButtonRelease(MouseEvent event) {
-		// NOP
+		PropertiesManager.setItemsProperties();
 	}
 
 	/**
@@ -262,6 +262,7 @@ public class MyMouseManager extends DefaultMouseManager {
 			mouseButtonReleaseOffElement(curElement, event);
 			curElement = null;
 		} else {
+			mouseButtonRelease(event);
 		}
 	}
 

+ 0 - 4
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomTileFactory.java

@@ -1,7 +1,5 @@
 package de.tu_darmstadt.informatik.tk.scopviz.ui.mapView;
 
-import java.awt.Color;
-import java.awt.Graphics2D;
 import java.awt.image.BufferedImage;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -31,8 +29,6 @@ import org.jxmapviewer.viewer.TileCache;
 import org.jxmapviewer.viewer.TileFactoryInfo;
 import org.jxmapviewer.viewer.util.GeoUtil;
 
-import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
-
 /**
  * Custom tile factory for handling connection problems
  *