Jan Enders 8 éve
szülő
commit
3c3776e199
17 módosított fájl, 338 hozzáadás és 262 törlés
  1. 11 10
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphHelper.java
  2. 2 6
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MyGraph.java
  3. 31 17
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/GraphMLExporter.java
  4. 13 12
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/GraphMLImporter.java
  5. 72 57
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MyFileSinkGraphML.java
  6. 3 4
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MyFileSourceGraphML.java
  7. 30 5
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MySourceBase.java
  8. 1 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/Main.java
  9. 2 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/MainWindow.fxml
  10. 31 31
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ButtonManager.java
  11. 7 8
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ConsoleManager.java
  12. 30 27
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java
  13. 7 6
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GraphDisplayManager.java
  14. 64 39
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/OptionsManager.java
  15. 4 10
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/PropertiesManager.java
  16. 14 15
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ToolboxManager.java
  17. 16 14
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/KeyboardShortcuts.java

+ 11 - 10
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphHelper.java

@@ -10,7 +10,6 @@ import org.graphstream.graph.Node;
 import org.graphstream.ui.geom.Point3;
 
 import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
-import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.OptionsManager;
 
 public class GraphHelper {
@@ -157,6 +156,9 @@ public class GraphHelper {
 	 * Removes all labels if that option is set
 	 */
 	public static void handleEdgeWeight(MyGraph g) {
+		if (!Layer.UNDERLAY.equals(g.getAttribute("layer"))) {
+			return;
+		}
 		Edge e = null;
 		Iterator<Edge> allEdges = g.getEdgeIterator();
 
@@ -172,17 +174,16 @@ public class GraphHelper {
 			}
 		}
 	}
-	
+
 	/**
-	 * adds default to all Nodes and
-	 * converts yEd attributes to regular ones.
+	 * adds default to all Nodes and converts yEd attributes to regular ones.
 	 * 
 	 * @param g
 	 *            the graph that the attributes will be added onto
 	 */
-	public static void setAllDefaults(MyGraph g){
+	public static void setAllDefaults(MyGraph g) {
 		for (Node n : g.getNodeSet()) {
-			//general defaults
+			// general defaults
 			if (!n.hasAttribute("ui.label")) {
 				n.addAttribute("ui.label", "");
 			}
@@ -190,8 +191,8 @@ public class GraphHelper {
 				n.addAttribute("typeofNode", "standard");
 			}
 
-			//underlay defaults
-			if(Layer.UNDERLAY.equals(g.getAttribute("layer"))){
+			// underlay defaults
+			if (Layer.UNDERLAY.equals(g.getAttribute("layer"))) {
 				if (!n.hasAttribute("typeofDevice") || n.getAttribute("typeofDevice").equals("")) {
 					n.addAttribute("typeofDevice", "unknown");
 				}
@@ -206,8 +207,8 @@ public class GraphHelper {
 				}
 			}
 
-			//operator defaults
-			if(Layer.OPERATOR.equals(g.getAttribute("layer"))){
+			// operator defaults
+			if (Layer.OPERATOR.equals(g.getAttribute("layer"))) {
 				if (!n.hasAttribute("process-need") || n.getAttribute("process-need").equals("")) {
 					n.addAttribute("process-need", 0.0);
 				}

+ 2 - 6
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MyGraph.java

@@ -2,16 +2,13 @@ package de.tu_darmstadt.informatik.tk.scopviz.graphs;
 
 import java.util.Iterator;
 import java.util.LinkedList;
-import java.util.Optional;
 
 import org.graphstream.graph.Edge;
 import org.graphstream.graph.Node;
 import org.graphstream.graph.implementations.SingleGraph;
 
 import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
-import de.tu_darmstadt.informatik.tk.scopviz.ui.OptionsManager;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.ToolboxManager;
-import javafx.scene.control.TextInputDialog;
 
 /**
  * Our own Class to extend GraphStreams Graph with our own Functionality.
@@ -102,7 +99,7 @@ public class MyGraph extends SingleGraph {
 	 *            the Edge that was just created
 	 */
 	private void edgeCreatedNotify(Edge e) {
-		if(Layer.UNDERLAY.equals(this.getAttribute("layer"))){
+		if (Layer.UNDERLAY.equals(this.getAttribute("layer"))) {
 			ToolboxManager.createWeighDialog(e);
 		}
 		for (EdgeCreatedListener list : allEdgeListeners) {
@@ -122,8 +119,7 @@ public class MyGraph extends SingleGraph {
 	}
 
 	/**
-	 * Notifies all added NodeCreatedListener.
-	 * also sets defaults
+	 * Notifies all added NodeCreatedListener. also sets defaults
 	 * 
 	 * @param n
 	 *            the Edge that was just created

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

@@ -2,14 +2,7 @@ package de.tu_darmstadt.informatik.tk.scopviz.io;
 
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.util.Iterator;
 
-import org.graphstream.graph.Edge;
-import org.graphstream.graph.Graph;
-import org.graphstream.graph.Node;
-import org.graphstream.stream.file.FileSinkGraphML;
-
-import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyGraph;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import javafx.stage.FileChooser;
@@ -33,15 +26,14 @@ public class GraphMLExporter {
 	 *            The Location on disk the File will be saved on
 	 */
 	public void writeGraph(final MyGraph g, final String fileName) {
-		FileSinkGraphML writer = new MyFileSinkGraphML();
-		if(g.isComposite()){
-			for(int i = 0; i < g.getChildren().toArray().length; i++){
-				writeGraph(g.getChildren().toArray(new MyGraph[0])[i], fileName +  "children"+i);
-			}
-			return;
+		MyFileSinkGraphML writer = new MyFileSinkGraphML();
+		String newFileName = fileName;
+		if (g.isComposite()) {
+			writer.exportGraphs(g.getAllSubGraphs(), fileNameAppend(fileName, "appended"));
+			newFileName = fileNameAppend(fileName, "merged");
 		}
 		try {
-			writer.writeAll(g, new FileOutputStream(fileName));
+			writer.writeAll(g, new FileOutputStream(newFileName));
 		} catch (IOException e) {
 			System.out.println("cannot Acces File or invalid path");
 			e.printStackTrace();
@@ -65,13 +57,35 @@ public class GraphMLExporter {
 			fileName = fileChooser.showSaveDialog(stage).getPath();
 			Main.getInstance().getGraphManager().setCurrentPath(fileName);
 			if (fileName != null) {
-				for(int i = 0; i < g.getChildren().toArray().length; i++){
-					writeGraph(g.getChildren().toArray(new MyGraph[0])[i], fileName + "children"+i);
-				}
 				writeGraph(g, fileName);
 			}
 		} catch (NullPointerException e) {
 
 		}
 	}
+
+	/**
+	 * Appends a string to the fileName before the fileExtension
+	 * 
+	 * @param fileName
+	 *            the fileName
+	 * @param append
+	 *            the string that will be appended
+	 */
+	public String fileNameAppend(String fileName, String append) {
+		String[] parts = fileName.split(".");
+		if (parts.length < 2) {
+			fileName = fileName.concat(append);
+		} else {
+			fileName = "";
+			int i = 0;
+			for (; i < parts.length - 1; i++) {
+				fileName = fileName.concat(parts[0]);
+			}
+			fileName.concat(append);
+			fileName.concat(parts[i]);
+		}
+
+		return fileName;
+	}
 }

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

@@ -5,12 +5,11 @@ import java.net.URL;
 import java.util.LinkedList;
 
 import org.graphstream.graph.Node;
-import org.graphstream.graph.implementations.SingleGraph;
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.GraphHelper;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyGraph;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
-import de.tu_darmstadt.informatik.tk.scopviz.ui.OptionsManager;
 import javafx.stage.FileChooser;
 import javafx.stage.Stage;
 
@@ -46,15 +45,17 @@ public class GraphMLImporter {
 			System.out.println("GraphML File doesn't exist or can't be opened");
 			e.printStackTrace();
 		}
+		if (fs.wasMultiGraph()) {
+			g = GraphHelper.newMerge(false, fs.getSubGraphs().toArray(new MyGraph[0]));
+		}
 		fs.removeSink(g);
-		for(Node n : g.getNodeSet()){
+		for (Node n : g.getNodeSet()) {
 			n.removeAttribute("ui.class");
 		}
 		yEdConversion(g);
 		return g;
 	}
 
-
 	/**
 	 * Imports a GraphML file. Opens a open dialog. Returns null if the process
 	 * is aborted.
@@ -72,7 +73,7 @@ public class GraphMLImporter {
 			String fileName = fileChooser.showOpenDialog(stage).getPath();
 			Main.getInstance().getGraphManager().setCurrentPath(fileName);
 			return readGraph(id, fileName);
-		} catch (IllegalArgumentException e) {
+		} catch (NullPointerException e) {
 			return null;
 		}
 	}
@@ -97,7 +98,7 @@ public class GraphMLImporter {
 			e.printStackTrace();
 		}
 		fs.removeSink(g);
-		for(Node n : g.getNodeSet()){
+		for (Node n : g.getNodeSet()) {
 			n.removeAttribute("ui.class");
 		}
 		yEdConversion(g);
@@ -109,23 +110,23 @@ public class GraphMLImporter {
 	 * 
 	 * @return the list of subgraphs
 	 */
-	public LinkedList<SingleGraph> subGraphs() {
+	public LinkedList<MyGraph> subGraphs() {
 		return fs.getSubGraphs();
 	}
 
-	public void yEdConversion(MyGraph g){
-		for(Node n : g.getNodeSet()) {
-			//yed conversion
+	public void yEdConversion(MyGraph g) {
+		for (Node n : g.getNodeSet()) {
+			// yed conversion
 			if (!n.hasAttribute("ui.label") && n.hasAttribute("yEd.label")) {
 				n.addAttribute("ui.label", n.getAttribute("yEd.label").toString());
 				n.removeAttribute("yEd.label");
-			} else if(n.hasAttribute("ui.label")) {
+			} else if (n.hasAttribute("ui.label")) {
 				n.removeAttribute("yEd.label");
 			}
 			if (n.hasAttribute("yEd.x") && !n.getAttribute("yEd.x").equals("")) {
 				n.addAttribute("x", Main.getInstance().convertAttributeTypes(n.getAttribute("yEd.x"), new Double(0.0)));
 				n.removeAttribute("yEd.x");
-			} else{
+			} else {
 				n.removeAttribute("yEd.x");
 			}
 			if (n.hasAttribute("yEd.y") && !n.getAttribute("yEd.y").equals("")) {

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

@@ -2,6 +2,7 @@ package de.tu_darmstadt.informatik.tk.scopviz.io;
 
 import java.io.IOException;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.LinkedList;
 
 import org.graphstream.graph.Edge;
@@ -12,8 +13,7 @@ import org.graphstream.stream.file.FileSinkGraphML;
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyGraph;
 
-
-public class MyFileSinkGraphML extends FileSinkGraphML{
+public class MyFileSinkGraphML extends FileSinkGraphML {
 	public boolean isWritingMultigraph = false;
 
 	private void print(String format, Object... args) throws IOException {
@@ -21,7 +21,7 @@ public class MyFileSinkGraphML extends FileSinkGraphML{
 	}
 
 	@Override
-	protected void exportGraph(Graph g){
+	protected void exportGraph(Graph g) {
 		try {
 			int attribute = 0;
 			HashMap<String, String> nodeAttributes = new HashMap<String, String>();
@@ -53,26 +53,27 @@ public class MyFileSinkGraphML extends FileSinkGraphML{
 
 					graphAttributes.put(j, gId);
 
-					print("\t<key id=\"%s\" for=\"graph\" attr.name=\"%s\" attr.type=\"%s\"/>\n",
-							gId, escapeXmlString(j), gType);
+					print("\t<key id=\"%s\" for=\"graph\" attr.name=\"%s\" attr.type=\"%s\"/>\n", gId,
+							escapeXmlString(j), gType);
 				}
 			}
 
 			for (Node n : g.getEachNode()) {
 				for (String k : n.getAttributeKeySet()) {
-					//AttributeFiltering
-					if(k.equals("ui.j2dsk") || k.equals("ui.class") || k.equals("ui.pie-values")){
+					// AttributeFiltering
+					if (k.equals("ui.j2dsk") || k.equals("ui.class") || k.equals("ui.pie-values")) {
 						continue;
-						}
+					}
 					Class<? extends Object> c = n.getAttribute(k).getClass();
 					if (!c.isPrimitive() && !(c == String.class) && !(c == Character.class) && !(c == Boolean.class)
 							&& !(c == Integer.class) && !(c == Long.class) && !(c == Short.class) && !(c == Byte.class)
 							&& !(c == Float.class) && !(c == Double.class)) {
 						Debug.out("Could not parse an Attribute because it is not Primitive or a String \n\t"
-								+ "(Attribute: " + k + ", Value: " + n.getAttribute(k) + ", from Node: " + n + ", Type: "
-								+ c + ") ", 2);
+								+ "(Attribute: " + k + ", Value: " + n.getAttribute(k) + ", from Node: " + n
+								+ ", Type: " + c + ") ", 2);
+						continue;
 					}
-					
+
 					if (!nodeAttributes.containsKey(k)) {
 						Object value = n.getAttribute(k);
 						String type;
@@ -97,16 +98,16 @@ public class MyFileSinkGraphML extends FileSinkGraphML{
 
 						nodeAttributes.put(k, id);
 
-						print("\t<key id=\"%s\" for=\"node\" attr.name=\"%s\" attr.type=\"%s\"/>\n",
-								id, escapeXmlString(k), type);
+						print("\t<key id=\"%s\" for=\"node\" attr.name=\"%s\" attr.type=\"%s\"/>\n", id,
+								escapeXmlString(k), type);
 					}
 				}
 			}
 
 			for (Edge n : g.getEachEdge()) {
 				for (String k : n.getAttributeKeySet()) {
-					//AttributeFiltering
-					if(k.equals("ui.j2dsk")){
+					// AttributeFiltering
+					if (k.equals("ui.j2dsk")) {
 						continue;
 					}
 					Class<? extends Object> c = n.getAttribute(k).getClass();
@@ -114,10 +115,11 @@ public class MyFileSinkGraphML extends FileSinkGraphML{
 							&& !(c == Integer.class) && !(c == Long.class) && !(c == Short.class) && !(c == Byte.class)
 							&& !(c == Float.class) && !(c == Double.class)) {
 						Debug.out("Could not parse an Attribute because it is not Primitive or a String \n\t"
-								+ "(Attribute: " + k + ", Value: " + n.getAttribute(k) + ", from Edge: " + n + ", Type: "
-								+ c + ") ", 2);
-					}	
-					
+								+ "(Attribute: " + k + ", Value: " + n.getAttribute(k) + ", from Edge: " + n
+								+ ", Type: " + c + ") ", 2);
+						continue;
+					}
+
 					if (!edgeAttributes.containsKey(k)) {
 						Object value = n.getAttribute(k);
 						String type;
@@ -141,38 +143,54 @@ public class MyFileSinkGraphML extends FileSinkGraphML{
 							type = "string";
 
 						edgeAttributes.put(k, id);
-						print("\t<key id=\"%s\" for=\"edge\" attr.name=\"%s\" attr.type=\"%s\"/>\n",
-								id, escapeXmlString(k), type);
+						print("\t<key id=\"%s\" for=\"edge\" attr.name=\"%s\" attr.type=\"%s\"/>\n", id,
+								escapeXmlString(k), type);
 					}
 				}
 			}
 
 			print("\t<graph id=\"%s\" edgedefault=\"undirected\">\n", escapeXmlString(g.getId()));
 			for (String k : g.getAttributeKeySet()) {
-				print("\t\t\t<data key=\"%s\">%s</data>\n", graphAttributes
-						.get(k), escapeXmlString(g.getAttribute(k).toString()));
+				print("\t\t\t<data key=\"%s\">%s</data>\n", graphAttributes.get(k),
+						escapeXmlString(g.getAttribute(k).toString()));
 			}
-			
+
 			for (Node n : g.getEachNode()) {
 				print("\t\t<node id=\"%s\">\n", n.getId());
 				for (String k : n.getAttributeKeySet()) {
-					print("\t\t\t<data key=\"%s\">%s</data>\n", nodeAttributes
-							.get(k), escapeXmlString(n.getAttribute(k).toString()));
+					if (k.equals("ui.j2dsk") || k.equals("ui.class") || k.equals("ui.pie-values")) {
+						continue;
+					}
+					Class<? extends Object> c = n.getAttribute(k).getClass();
+					if (!c.isPrimitive() && !(c == String.class) && !(c == Character.class) && !(c == Boolean.class)
+							&& !(c == Integer.class) && !(c == Long.class) && !(c == Short.class) && !(c == Byte.class)
+							&& !(c == Float.class) && !(c == Double.class)) {
+						continue;
+					}
+
+					print("\t\t\t<data key=\"%s\">%s</data>\n", nodeAttributes.get(k),
+							escapeXmlString(n.getAttribute(k).toString()));
 				}
 				print("\t\t</node>\n");
 			}
 			for (Edge e : g.getEachEdge()) {
-				print(
-						"\t\t<edge id=\"%s\" source=\"%s\" target=\"%s\" directed=\"%s\">\n",
-						e.getId(), e.getSourceNode().getId(), e.getTargetNode()
-						.getId(), e.isDirected());
+				print("\t\t<edge id=\"%s\" source=\"%s\" target=\"%s\" directed=\"%s\">\n", e.getId(),
+						e.getSourceNode().getId(), e.getTargetNode().getId(), e.isDirected());
 				for (String k : e.getAttributeKeySet()) {
-					print("\t\t\t<data key=\"%s\">%s</data>\n", edgeAttributes
-							.get(k), escapeXmlString(e.getAttribute(k).toString()));
-				}
-				if(!isWritingMultigraph){
-					print("\t\t</edge>\n");
+					if (k.equals("ui.j2dsk") || k.equals("ui.class") || k.equals("ui.pie-values")) {
+						continue;
+					}
+					Class<? extends Object> c = e.getAttribute(k).getClass();
+					if (!c.isPrimitive() && !(c == String.class) && !(c == Character.class) && !(c == Boolean.class)
+							&& !(c == Integer.class) && !(c == Long.class) && !(c == Short.class) && !(c == Byte.class)
+							&& !(c == Float.class) && !(c == Double.class)) {
+						continue;
+					}
+
+					print("\t\t\t<data key=\"%s\">%s</data>\n", edgeAttributes.get(k),
+							escapeXmlString(e.getAttribute(k).toString()));
 				}
+				print("\t\t</edge>\n");
 			}
 			print("\t</graph>\n");
 		} catch (IOException e) {
@@ -180,37 +198,34 @@ public class MyFileSinkGraphML extends FileSinkGraphML{
 		}
 	}
 
-	private static String escapeXmlString(String s){
-		//why do you make me do this graphstream???
-		return s
-				.replace("&", "&amp;")
-				.replace("<", "&lt;")
-				.replace(">", "&gt;")
-				.replace("\"", "&quot;")
-				.replace("'", "&apos;");
+	private static String escapeXmlString(String s) {
+		// why do you make me do this graphstream???
+		return s.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot;").replace("'",
+				"&apos;");
 	}
-	
+
 	/**
 	 * 
 	 * @param graphs
 	 */
-	public void exportGraphs(LinkedList<MyGraph> graphs){
-		for(MyGraph g : graphs){
-			if(g.isComposite()){
-				graphs.remove(g);
+	public void exportGraphs(LinkedList<MyGraph> graphs, String fileName) {
+		Iterator<MyGraph> graphIter = graphs.iterator();
+		while (graphIter.hasNext()) {
+			if (graphIter.next().isComposite()) {
+				graphIter.remove();
 			}
 		}
-		//TODO setup
-		isWritingMultigraph = true;
-		for(MyGraph g : graphs){
-			exportGraph(g);
-		}
-		isWritingMultigraph = false;
 		try {
-		print("\t</graph>\n");
-		} catch(IOException e){
+			begin(fileName);
+			isWritingMultigraph = true;
+			for (MyGraph g : graphs) {
+				exportGraph(g);
+			}
+			isWritingMultigraph = false;
+			end();
+		} catch (IOException e) {
 			e.printStackTrace();
 		}
 	}
-	
+
 }

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

@@ -679,6 +679,7 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 					currentReaderState = ReaderState.END;
 				} else if (isEvent(e, XMLEvent.START_ELEMENT, "key")) {
 					currentReaderState = ReaderState.KEYS;
+
 				} else if (isEvent(e, XMLEvent.START_ELEMENT, "node") || isEvent(e, XMLEvent.START_ELEMENT, "edge")) {
 					currentReaderState = ReaderState.NODES_EDGES;
 				} else if (isEvent(e, XMLEvent.START_ELEMENT, "data")) {
@@ -1327,7 +1328,6 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 
 		if (id == null)
 			throw newParseError(e, "node requires an id");
-
 		sendNodeAdded(sourceId, id);
 
 		e = getNextEvent();
@@ -1378,7 +1378,6 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 						pushback(yEd);
 						pushback(e);
 						data = __data();
-
 						sendNodeAttributeAdded(sourceId, id, data.key.name, getValue(data));
 
 						sentAttributes.add(data.key);
@@ -1395,8 +1394,8 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 		if (isEvent(e, XMLEvent.START_ELEMENT, "graph")) {
 			Location loc = e.getLocation();
 
-			System.err.printf("[WARNING] %d:%d graph inside node is not implemented", loc.getLineNumber(),
-					loc.getColumnNumber());
+			Debug.out(String.format("[WARNING] %d:%d graph inside node is not implemented", loc.getLineNumber(),
+					loc.getColumnNumber()), 2);
 
 			pushback(e);
 			__graph();

+ 30 - 5
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MySourceBase.java

@@ -48,6 +48,7 @@ import org.graphstream.stream.Source;
 import org.graphstream.stream.sync.SourceTime;
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
+import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyGraph;
 
 /**
  * Base implementation of an input that provide basic sink handling.
@@ -74,6 +75,23 @@ import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 public class MySourceBase implements Source {
 	// Attribute
 
+	/**
+	 * if the programm is currently reading a multigraph
+	 */
+	protected boolean multiGraph = false;
+
+	/**
+	 * @return if the last read Graph was a multigraph
+	 */
+	public boolean wasMultiGraph() {
+		return multiGraph;
+	}
+
+	/**
+	 * the sink of the complete Graph
+	 */
+	protected Sink originalSink;
+
 	/**
 	 * Enum of the different possible Types of Elements.
 	 */
@@ -116,12 +134,12 @@ public class MySourceBase implements Source {
 	/**
 	 * a List of all inner Graphs of a multigraphFile.
 	 */
-	protected LinkedList<SingleGraph> subGraphs = new LinkedList<>();
+	protected LinkedList<MyGraph> subGraphs = new LinkedList<>();
 
 	/**
 	 * all inner graphs that are currently being edited.
 	 */
-	protected Stack<SingleGraph> usedSubGraphs = new Stack<>();
+	protected Stack<MyGraph> usedSubGraphs = new Stack<>();
 
 	/**
 	 * the ID of the (last added) outer Graph.
@@ -172,6 +190,8 @@ public class MySourceBase implements Source {
 	// Command
 
 	public void addSink(Sink sink) {
+		multiGraph = false;
+		originalSink = sink;
 		addAttributeSink(sink);
 		addElementSink(sink);
 		resetSubGraphs();
@@ -1175,7 +1195,12 @@ public class MySourceBase implements Source {
 	 * called
 	 */
 	protected void newSubGraph() {
-		SingleGraph g = new SingleGraph(superID + "sub" + subGraphCounter);
+		if (subGraphCounter > 1) {
+			Debug.out(originalSink.toString());
+			removeSink(originalSink);
+			multiGraph = true;
+		}
+		MyGraph g = new MyGraph(superID + "sub" + subGraphCounter);
 		subGraphCounter++;
 		addSubGraphSink(g);
 		usedSubGraphs.push(g);
@@ -1186,7 +1211,7 @@ public class MySourceBase implements Source {
 	 * sinkLists
 	 */
 	protected void subGraphFinished() {
-		SingleGraph g = usedSubGraphs.pop();
+		MyGraph g = usedSubGraphs.pop();
 		removeSink(g);
 		subGraphs.add(g);
 	}
@@ -1198,7 +1223,7 @@ public class MySourceBase implements Source {
 	 * 
 	 * @return all subGraphs
 	 */
-	public LinkedList<SingleGraph> getSubGraphs() {
+	public LinkedList<MyGraph> getSubGraphs() {
 		return subGraphs;
 	}
 

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

@@ -157,7 +157,7 @@ public final class Main {
 	// don't worry I checked all the conversions
 	@SuppressWarnings("unchecked")
 	public <T extends Number> T convertAttributeTypes(Object attribute, T result) {
-		if(attribute == null){
+		if (attribute == null) {
 			return null;
 		}
 		String currentType = attribute.getClass().getSimpleName().toLowerCase();

+ 2 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/MainWindow.fxml

@@ -44,6 +44,8 @@
             <MenuItem fx:id="delete" accelerator="DELETE" mnemonicParsing="false" text="Delete" />
             <MenuItem fx:id="undelete" accelerator="Shortcut+Z" mnemonicParsing="false" text="Undelete" />
             <SeparatorMenuItem mnemonicParsing="false" />
+            <MenuItem fx:id="operators" mnemonicParsing="false" text="Graph Operators" />
+            <MenuItem fx:id="resetMapping" mnemonicParsing="false" text="Reset Mapping" />
             <MenuItem fx:id="updateMetricMI" accelerator="Shortcut+R" mnemonicParsing="false" text="Update metrics" />
           </items>
         </Menu>

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

@@ -4,11 +4,9 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashSet;
 
-import org.graphstream.graph.implementations.Graphs;
 import org.jxmapviewer.viewer.GeoPosition;
 import org.jxmapviewer.viewer.WaypointPainter;
 
-import de.tu_darmstadt.informatik.tk.scopviz.graphs.MyGraph;
 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.mapView.CustomMapClickListener;
@@ -86,17 +84,18 @@ public final class ButtonManager {
 			Main.getInstance().getGraphManager().zoomOut();
 		}
 	}
-	
+
 	/**
 	 * Handler for center map Button
+	 * 
 	 * @param event
 	 */
 	public static void centerMapAction(ActionEvent event) {
 		HashSet<GeoPosition> positions = new HashSet<GeoPosition>(WorldView.waypoints.size());
 		WorldView.waypoints.forEach((w) -> positions.add(w.getPosition()));
-		
+
 		WorldView.showAllWaypoints(positions);
-		
+
 	}
 
 	/**
@@ -131,7 +130,7 @@ public final class ButtonManager {
 			// make graph non mouse transparent
 			controller.pane.setMouseTransparent(false);
 			controller.swingNode.setMouseTransparent(false);
-			
+
 			// dont show symbol layer Button
 			controller.centerMap.setVisible(false);
 			controller.defaultMapView.setVisible(false);
@@ -140,13 +139,13 @@ public final class ButtonManager {
 			controller.hybridMapView.setVisible(false);
 			controller.previousWaypoint.setVisible(false);
 			controller.nextWaypoint.setVisible(false);
-			
+
 			// dont show properties of selected node or edge
 			PropertiesManager.showNewDataSet(null);
 
 			// deselect current selected node or edge
 			CustomMapClickListener.deselectAll();
-			
+
 			// reset loaded images
 			MapViewFunctions.resetImageMap();
 
@@ -158,7 +157,7 @@ public final class ButtonManager {
 	 */
 	public static void underlayAction(ActionEvent arg0) {
 		Main.getInstance().getGraphManager().deselectEdgeCreationNodes();
-		
+
 		switchfromSymbolLayer();
 
 		GraphDisplayManager.setCurrentLayer(Layer.UNDERLAY);
@@ -181,8 +180,8 @@ public final class ButtonManager {
 		// hide metricbox/update button
 		controller.rightSide.getChildren().remove(controller.updateButtonAPane);
 		controller.metricbox.setVisible(false);
-		
-		//Hide operator graph selection box
+
+		// Hide operator graph selection box
 		controller.opGraphSelectionBox.setVisible(false);
 	}
 
@@ -191,7 +190,7 @@ public final class ButtonManager {
 	 */
 	public static void operatorAction(ActionEvent arg0) {
 		Main.getInstance().getGraphManager().deselectEdgeCreationNodes();
-		
+
 		switchfromSymbolLayer();
 
 		GraphDisplayManager.setCurrentLayer(Layer.OPERATOR);
@@ -214,8 +213,8 @@ public final class ButtonManager {
 		// hide metricbox/update button
 		controller.rightSide.getChildren().remove(controller.updateButtonAPane);
 		controller.metricbox.setVisible(false);
-		
-		//show operator graph selection box
+
+		// show operator graph selection box
 		controller.opGraphSelectionBox.setVisible(true);
 	}
 
@@ -224,10 +223,10 @@ public final class ButtonManager {
 	 */
 	public static void mappingAction(ActionEvent arg0) {
 		Main.getInstance().getGraphManager().deselectEdgeCreationNodes();
-		
+
 		// show metricbox/update button
 		if (!(GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING))) {
-			controller.rightSide.getChildren().add(2,controller.updateButtonAPane);
+			controller.rightSide.getChildren().add(2, controller.updateButtonAPane);
 			controller.metricbox.setVisible(true);
 		}
 
@@ -249,8 +248,8 @@ public final class ButtonManager {
 		controller.delete.disableProperty().set(false);
 		controller.undelete.disableProperty().set(false);
 		controller.updateMetricMI.disableProperty().set(false);
-		
-		//Hide operator graph selection box
+
+		// Hide operator graph selection box
 		controller.opGraphSelectionBox.setVisible(false);
 
 	}
@@ -260,17 +259,18 @@ public final class ButtonManager {
 	 */
 	public static void symbolRepAction(ActionEvent arg0) {
 		Main.getInstance().getGraphManager().deselectEdgeCreationNodes();
-		
+
 		if (!(GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL))) {
-			
+
 			GraphDisplayManager.setCurrentLayer(Layer.SYMBOL);
 			controller.topLeftAPane.getChildren().add(controller.symbolToolVBox);
-			
+
 		}
 
-		// load world view 
-		if(!activateWorldView()){
-			// show "Connection Error" message, because of problems during connecting attempt to server
+		// load world view
+		if (!activateWorldView()) {
+			// show "Connection Error" message, because of problems during
+			// connecting attempt to server
 			showConnectionErrorMsg();
 		}
 
@@ -278,9 +278,9 @@ public final class ButtonManager {
 		controller.rightSide.getChildren().remove(controller.updateButtonAPane);
 		controller.metricbox.setVisible(false);
 
-		//Hide operator graph selection box
+		// Hide operator graph selection box
 		controller.opGraphSelectionBox.setVisible(false);
-				
+
 		GraphDisplayManager.switchActiveGraph();
 		setBorderStyle((Button) arg0.getSource());
 
@@ -333,7 +333,7 @@ public final class ButtonManager {
 
 		// show VBox for map options
 		controller.symbolToolVBox.setVisible(true);
-		
+
 		// show symbol layer Button
 		controller.centerMap.setVisible(true);
 		controller.defaultMapView.setVisible(true);
@@ -345,15 +345,14 @@ public final class ButtonManager {
 
 		// standard server connection status is true
 		Boolean serverConnection = true;
-		
+
 		try {
-			
+
 			WorldView.loadWorldView();
 		} catch (IOException e) {
 			// problems with server connection -> show error message
 			serverConnection = false;
 		}
-		
 
 		MapViewFunctions.checkVBoxChanged();
 
@@ -362,7 +361,7 @@ public final class ButtonManager {
 		// set content to UI Element
 		controller.swingNodeWorldView.setContent(WorldView.internMapViewer);
 		controller.swingNodeWorldView.setVisible(true);
-		
+
 		return serverConnection;
 	}
 
@@ -476,6 +475,7 @@ public final class ButtonManager {
 
 	/**
 	 * select the given MapType in the ChoiceBox and change Map View
+	 * 
 	 * @param mapType
 	 */
 	public static void switchToMap(String mapType) {

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

@@ -25,14 +25,13 @@ public class ConsoleManager {
 	 */
 	public static void initialize(GUIController c) {
 		controller = c;
-		
-		//behaviour for autoscrolling of the console window
-		controller.consoleWindow.getChildren().addListener(
-                (ListChangeListener<Node>) ((change) -> {
-                	controller.consoleWindow.layout();
-                	controller.consoleScrollPane.layout();
-                	controller.consoleScrollPane.setVvalue(1.0f);
-                }));
+
+		// behaviour for autoscrolling of the console window
+		controller.consoleWindow.getChildren().addListener((ListChangeListener<Node>) ((change) -> {
+			controller.consoleWindow.layout();
+			controller.consoleScrollPane.layout();
+			controller.consoleScrollPane.setVvalue(1.0f);
+		}));
 	}
 
 	/**

+ 30 - 27
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java

@@ -120,6 +120,10 @@ public class GUIController implements Initializable {
 	@FXML
 	public MenuItem undelete;
 	@FXML
+	public MenuItem operators;
+	@FXML
+	public MenuItem resetMapping;
+	@FXML
 	public MenuItem updateMetricMI;
 	@FXML
 	public MenuItem about;
@@ -170,21 +174,18 @@ public class GUIController implements Initializable {
 	@FXML
 	public ChoiceBox<String> mapViewChoiceBox;
 
-	
 	@FXML
 	public VBox rightSide;
-	
+
 	@FXML
 	public ComboBox<String> opGraphSelectionBox;
-	
-	//The elements needed for the console window
+
+	// The elements needed for the console window
 	@FXML
 	public ScrollPane consoleScrollPane;
 	@FXML
 	public TextFlow consoleWindow;
 
-	
-
 	// The anchorpane of the top left box (toolbox, symbol visualization layer
 	// box)
 	@FXML
@@ -279,6 +280,8 @@ public class GUIController implements Initializable {
 		quit.setOnAction((event) -> MenuBarManager.quitAction(event));
 		delete.setOnAction((event) -> MenuBarManager.deleteAction(event));
 		undelete.setOnAction((event) -> MenuBarManager.undeleteAction(event));
+		operators.setOnAction((event) -> MenuBarManager.undeleteAction(event));
+		resetMapping.setOnAction((event) -> GraphDisplayManager.initMappingLayer(true));
 		updateMetricMI.setOnAction((event) -> MetricboxManager.updateMetrics());
 		updateMetricMI.setDisable(true);
 		about.setOnAction((event) -> MenuBarManager.aboutAction(event));
@@ -478,36 +481,34 @@ public class GUIController implements Initializable {
 		updateMetricButton.setOnAction((event) -> MetricboxManager.updateMetrics());
 		rightSide.getChildren().remove(updateButtonAPane);
 	}
-	
+
 	/**
 	 * Initialize the operator graph combo box
 	 */
-	private void initializeOpGraphComboBox(){
-		
+	private void initializeOpGraphComboBox() {
+
 		opGraphSelectionBox.setVisible(false);
-		
-		//initialization of the values of the box
+
+		// initialization of the values of the box
 		String firstOpGraph = GraphDisplayManager.getGraphManager(Layer.OPERATOR).getGraph().getId();
-		opGraphSelectionBox.getItems().addAll(
-				firstOpGraph,
-				"Add..."
-	        );
+		opGraphSelectionBox.getItems().addAll(firstOpGraph, "Add...");
 		Platform.runLater(() -> opGraphSelectionBox.setValue(firstOpGraph));
-		
-		
+
 		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, "");
+			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
-				
+			} else {
+
+				// wechselt auf Operatorgraph mit diesem Namen
+
 			}
-			});
+		});
 	}
 
 	/**
@@ -566,6 +567,8 @@ public class GUIController implements Initializable {
 		assert quit != null : "fx:id=\"quit\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert delete != null : "fx:id=\"delete\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert undelete != null : "fx:id=\"undelete\" was not injected: check your FXML file 'MainWindow.fxml'.";
+		assert operators != null : "fx:id=\"operators\" was not injected: check your FXML file 'MainWindow.fxml'.";
+		assert resetMapping != null : "fx:id=\"resetMapping\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert updateMetricMI != null : "fx:id=\"updateMetricMI\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert about != null : "fx:id=\"about\" was not injected: check your FXML file 'MainWindow.fxml'.";
 
@@ -584,7 +587,7 @@ public class GUIController implements Initializable {
 		assert opGraphSelectionBox != null : "fx:id=\"opGraphSelectionBox\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert consoleScrollPane != null : "fx:id=\"consoleScrollPane\" 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'.";

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

@@ -194,14 +194,14 @@ public final class GraphDisplayManager {
 		if (g == null) {
 			throw new NullArgumentException();
 		}
-				
+
 		GraphManager v;
 		int ret = 0;
 		// replacing the current graph or merging
 		if (replaceCurrent) {
 			v = new GraphManager(g);
 			v.getGraph().addAttribute("layer", currentLayer);
-			//set default values
+			// set default values
 			GraphHelper.setAllDefaults(g);
 			v.getGraph().addAttribute("ui.antialias");
 			removeAllCurrentGraphs();
@@ -328,7 +328,7 @@ public final class GraphDisplayManager {
 	 */
 	public static void setCurrentLayer(Layer currentLayer) {
 		if (currentLayer.equals(Layer.MAPPING)) {
-			initMappingLayer();
+			initMappingLayer(false);
 		}
 		GraphDisplayManager.currentLayer = currentLayer;
 
@@ -342,7 +342,7 @@ public final class GraphDisplayManager {
 	/**
 	 * Sets up the Mapping Layer.
 	 */
-	private static void initMappingLayer() {
+	public static void initMappingLayer(boolean force) {
 		GraphManager underlay = null, operator = null;
 		MappingGraphManager mapping = null;
 		for (GraphManager man : vList) {
@@ -363,8 +363,8 @@ public final class GraphDisplayManager {
 			Debug.out("ERROR: no Operator found", 3);
 			return;
 		}
-		if (mapping == null || !mapping.hasGraphManagerAsParent(underlay)
-				|| !mapping.hasGraphManagerAsParent(operator)) {
+		if (mapping == null || !mapping.hasGraphManagerAsParent(underlay) || !mapping.hasGraphManagerAsParent(operator)
+				|| force) {
 			if (mapping == null)
 				Debug.out("WARNING: no Mapping found", 2);
 			else {
@@ -386,6 +386,7 @@ public final class GraphDisplayManager {
 			operator.addNodeCreatedListener(mapping);
 		}
 		mapping.activated();
+		switchActiveGraph();
 	}
 
 	/**

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

@@ -3,6 +3,7 @@ package de.tu_darmstadt.informatik.tk.scopviz.ui;
 import java.util.ArrayList;
 import java.util.Arrays;
 
+import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.mapView.CustomWaypointRenderer;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.mapView.EdgePainter;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.mapView.MapViewFunctions;
@@ -75,33 +76,40 @@ public final class OptionsManager {
 			nodeGraphicsSelector.getSelectionModel().select(StylesheetManager.getNodeGraphics());
 		}
 
+		ChoiceBox<Integer> loggingLevelSelector = new ChoiceBox<Integer>(FXCollections.observableArrayList(1, 2, 3));
+		loggingLevelSelector.getSelectionModel().select(new Integer(Debug.getLogLevel()));
+
 		TextField defaultLatitudeField = new TextField(Double.toString(defaultLat));
 		TextField defaultLongitudeField = new TextField(Double.toString(defaultLong));
-		
-		
+
 		// Symbol Layer options
 		ChoiceBox<String> edgeSelectedColorSymbolLayer = new ChoiceBox<String>();
-		edgeSelectedColorSymbolLayer.setItems(FXCollections.observableArrayList("Red", "Black", "Blue", "Green", "Yellow", "Orange", "Gray"));
+		edgeSelectedColorSymbolLayer.setItems(
+				FXCollections.observableArrayList("Red", "Black", "Blue", "Green", "Yellow", "Orange", "Gray"));
 		edgeSelectedColorSymbolLayer.getSelectionModel().select(EdgePainter.getClickedColor());
-		
+
 		ChoiceBox<String> edgePlacementColorSymbolLayer = new ChoiceBox<String>();
-		edgePlacementColorSymbolLayer.setItems(FXCollections.observableArrayList("Blue", "Black", "Red", "Green", "Yellow", "Orange", "Gray"));
+		edgePlacementColorSymbolLayer.setItems(
+				FXCollections.observableArrayList("Blue", "Black", "Red", "Green", "Yellow", "Orange", "Gray"));
 		edgePlacementColorSymbolLayer.getSelectionModel().select(EdgePainter.getPlacementColor());
-		
+
 		ChoiceBox<String> edgeStandardColorSymbolLayer = new ChoiceBox<String>();
-		edgeStandardColorSymbolLayer.setItems(FXCollections.observableArrayList("Black", "Red", "Blue", "Green", "Yellow", "Orange", "Gray"));
+		edgeStandardColorSymbolLayer.setItems(
+				FXCollections.observableArrayList("Black", "Red", "Blue", "Green", "Yellow", "Orange", "Gray"));
 		edgeStandardColorSymbolLayer.getSelectionModel().select(EdgePainter.getStandardColor());
-		
+
 		ChoiceBox<String> waypointStandardColorSymbolLayer = new ChoiceBox<String>();
-		waypointStandardColorSymbolLayer.setItems(FXCollections.observableArrayList("Black", "Red", "Blue", "Green", "Yellow", "Orange", "Gray"));
+		waypointStandardColorSymbolLayer.setItems(
+				FXCollections.observableArrayList("Black", "Red", "Blue", "Green", "Yellow", "Orange", "Gray"));
 		waypointStandardColorSymbolLayer.getSelectionModel().select(CustomWaypointRenderer.getStandardColor());
-		
+
 		ChoiceBox<String> waypointSelectedColorSymbolLayer = new ChoiceBox<String>();
-		waypointSelectedColorSymbolLayer.setItems(FXCollections.observableArrayList("Red", "Black", "Blue", "Green", "Yellow", "Orange", "Gray"));
+		waypointSelectedColorSymbolLayer.setItems(
+				FXCollections.observableArrayList("Red", "Black", "Blue", "Green", "Yellow", "Orange", "Gray"));
 		waypointSelectedColorSymbolLayer.getSelectionModel().select(CustomWaypointRenderer.getClickedColor());
-		
+
 		TextField edgeThickness = new TextField(Integer.toString(EdgePainter.getThickness()));
-		
+
 		TextField waypointSize = new TextField(Integer.toString(CustomWaypointRenderer.getWaypointSize()));
 
 		// position elements on grid
@@ -127,33 +135,47 @@ public final class OptionsManager {
 		grid.add(new Label("Longitude:"), 0, row);
 		grid.add(defaultLongitudeField, 1, row);
 		row++;
-		
+
 		// symbol layer stuff
-		grid.add(new Label(""), 1, row); row++;
-		grid.add(new Label("Symbol-Layer Options"), 1, row); row++;
+		grid.add(new Label(""), 1, row);
+		row++;
+		grid.add(new Label("Symbol-Layer Options"), 1, row);
+		row++;
 		grid.add(new Label("Waypoint Size (int):"), 0, row);
-		grid.add(waypointSize, 1, row); row++;
-		
+		grid.add(waypointSize, 1, row);
+		row++;
+
 		grid.add(new Label("Edge thickness (int):"), 0, row);
-		grid.add(edgeThickness, 1, row); row++;
-		
-		grid.add(new Label("Edge Colors"), 1, row); row++;
+		grid.add(edgeThickness, 1, row);
+		row++;
+
+		grid.add(new Label("Edge Colors"), 1, row);
+		row++;
 		grid.add(new Label("Standard Edge Color"), 0, row);
-		grid.add(edgeStandardColorSymbolLayer, 1, row); row++;
-		
+		grid.add(edgeStandardColorSymbolLayer, 1, row);
+		row++;
+
 		grid.add(new Label("Clicked Edge Color"), 0, row);
-		grid.add(edgeSelectedColorSymbolLayer, 1, row); row++;
-		
+		grid.add(edgeSelectedColorSymbolLayer, 1, row);
+		row++;
+
 		grid.add(new Label("Placement Edge Color"), 0, row);
-		grid.add(edgePlacementColorSymbolLayer, 1, row); row++;
-		
-		grid.add(new Label("Waypoint Colors"), 1, row); row++;
+		grid.add(edgePlacementColorSymbolLayer, 1, row);
+		row++;
+
+		grid.add(new Label("Waypoint Colors"), 1, row);
+		row++;
 		grid.add(new Label("Standard Waypoint Color"), 0, row);
-		grid.add(waypointStandardColorSymbolLayer, 1, row); row++;
-		
+		grid.add(waypointStandardColorSymbolLayer, 1, row);
+		row++;
+
 		grid.add(new Label("Clicked Waypoint Color"), 0, row);
 		grid.add(waypointSelectedColorSymbolLayer, 1, row);
 
+		grid.add(new Label("Logging level"), 0, row);
+		grid.add(loggingLevelSelector, 1, row);
+		row++;
+
 		// set dialog
 		addPropDialog.getDialogPane().setContent(grid);
 
@@ -170,29 +192,32 @@ public final class OptionsManager {
 						defaultLat = Double.parseDouble(defaultLatitudeField.getText());
 						defaultLong = Double.parseDouble(defaultLongitudeField.getText());
 					}
-					
+
 					// symbol layer edge thickness
-					if(Integer.parseInt(edgeThickness.getText()) != EdgePainter.getThickness()) {
+					if (Integer.parseInt(edgeThickness.getText()) != EdgePainter.getThickness()) {
 						EdgePainter.setEdgeThickness(Integer.parseInt(edgeThickness.getText()));
 					}
 					// symbol layer waypoint size
-					if(Integer.parseInt(waypointSize.getText()) != CustomWaypointRenderer.getWaypointSize()) {
+					if (Integer.parseInt(waypointSize.getText()) != CustomWaypointRenderer.getWaypointSize()) {
 						CustomWaypointRenderer.setScaleSize(Integer.parseInt(waypointSize.getText()));
 						MapViewFunctions.resetImageMap();
 						MapViewFunctions.initializeWaypointImages();
 					}
-					
+
 				} catch (NumberFormatException e) {
 				}
 				showWeight = showWeightButton.isSelected();
 				StylesheetManager.adjustNodeGraphics(nodeGraphicsSelector.getValue());
-				
+
 				// color types of waypoints and edges
-				EdgePainter.setColor(edgeStandardColorSymbolLayer.getValue(), edgePlacementColorSymbolLayer.getValue(), edgeSelectedColorSymbolLayer.getValue());
-				CustomWaypointRenderer.setColor(waypointStandardColorSymbolLayer.getValue(), waypointSelectedColorSymbolLayer.getValue());
-				
+				EdgePainter.setColor(edgeStandardColorSymbolLayer.getValue(), edgePlacementColorSymbolLayer.getValue(),
+						edgeSelectedColorSymbolLayer.getValue());
+				CustomWaypointRenderer.setColor(waypointStandardColorSymbolLayer.getValue(),
+						waypointSelectedColorSymbolLayer.getValue());
+
 				WorldView.internMapViewer.repaint();
-				
+
+				Debug.setLogLevel(loggingLevelSelector.getValue());
 				return null;
 			} else
 				return null;

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

@@ -219,7 +219,6 @@ public final class PropertiesManager {
 			});
 
 			// Disable MenuItem in symbol layer
-			// TODO
 			onlyAddPropMenuItem.disableProperty().bind(GraphDisplayManager.inSymbolLayerProperty());
 			addPropMenuItem.disableProperty().bind(GraphDisplayManager.inSymbolLayerProperty());
 			deletePropMenuItem.disableProperty().bind(GraphDisplayManager.inSymbolLayerProperty());
@@ -293,31 +292,26 @@ public final class PropertiesManager {
 				break;
 			case "weight":
 				if (selected instanceof Edge
-						&& Layer.UNDERLAY == Main.getInstance().getGraphManager().getGraph().getAttribute("layer")) {
-					newData.add(new KeyValuePair(key, selected.getAttribute(key).toString(), Double.class));
+						&& Layer.OPERATOR == Main.getInstance().getGraphManager().getGraph().getAttribute("layer")) {
 					break;
 				}
 				break;
 			case "process-need":
 				if (selected instanceof Node
-						&& Layer.OPERATOR == Main.getInstance().getGraphManager().getGraph().getAttribute("layer")) {
-					newData.add(new KeyValuePair(key, selected.getAttribute(key).toString(), Double.class));
+						&& Layer.UNDERLAY == Main.getInstance().getGraphManager().getGraph().getAttribute("layer")) {
 					break;
 				}
 				break;
 			case "process-max":
 				if (selected instanceof Node
-						&& Layer.UNDERLAY == Main.getInstance().getGraphManager().getGraph().getAttribute("layer")) {
-					newData.add(new KeyValuePair(key, selected.getAttribute(key).toString(), Double.class));
+						&& Layer.OPERATOR == Main.getInstance().getGraphManager().getGraph().getAttribute("layer")) {
 					break;
 				}
 			case "typeOfDevice":
 				if (selected instanceof Node
-						&& Layer.UNDERLAY == Main.getInstance().getGraphManager().getGraph().getAttribute("layer")) {
-					newData.add(new KeyValuePair(key, selected.getAttribute(key).toString(), String.class));
+						&& Layer.OPERATOR == Main.getInstance().getGraphManager().getGraph().getAttribute("layer")) {
 					break;
 				}
-				break;
 			default:
 				Object actualAttribute = selected.getAttribute(key);
 				if (actualAttribute != null) {

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

@@ -4,7 +4,6 @@ import java.util.Optional;
 
 import org.graphstream.graph.Edge;
 
-import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.main.CreationMode;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.main.MainApp;
@@ -13,7 +12,6 @@ import javafx.beans.property.ReadOnlyObjectWrapper;
 import javafx.beans.value.ObservableValue;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
-import javafx.event.EventHandler;
 import javafx.scene.Node;
 import javafx.scene.control.CheckBox;
 import javafx.scene.control.TableCell;
@@ -134,7 +132,7 @@ public final class ToolboxManager {
 		controller.toolbox.getItems().setAll(data);
 
 	}
-	
+
 	/**
 	 * fired when the selected item in the Toolbox was changed
 	 * 
@@ -172,7 +170,7 @@ 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);
 			}
@@ -258,20 +256,21 @@ public final class ToolboxManager {
 	private static Pair<Object, String> pair(Object picture, String name) {
 		return new Pair<>(picture, name);
 	}
-	
+
 	/**
 	 * the last edge that was created
 	 */
 	private static Edge lastCreatedEdge = null;
-	
+
 	/**
-	 * opens a dialog that asks for a weight for a newly created Edge. 
-	 * The default value is Optionsmanager.getDefaultWeight()
-	 *   
-	 * @param e the new Edge that needs a weight
+	 * opens a dialog that asks for a weight for a newly created Edge. The
+	 * default value is Optionsmanager.getDefaultWeight()
+	 * 
+	 * @param e
+	 *            the new Edge that needs a weight
 	 */
-	public static void createWeighDialog(Edge e){
-		if(e.equals(lastCreatedEdge)){
+	public static void createWeighDialog(Edge e) {
+		if (e.equals(lastCreatedEdge)) {
 			return;
 		}
 		lastCreatedEdge = e;
@@ -281,7 +280,7 @@ public final class ToolboxManager {
 			weightDialog.setHeaderText("Please enter the weight of the Edge");
 			weightDialog.setContentText("Edge Weight");
 			Optional<String> result = weightDialog.showAndWait();
-			if(result.isPresent()){
+			if (result.isPresent()) {
 				e.addAttribute("weight", result.get());
 			}
 		});
@@ -292,7 +291,7 @@ public final class ToolboxManager {
 	 *
 	 */
 	public static class PairKeyFactory
-	implements Callback<TableColumn.CellDataFeatures<Pair<Object, String>, String>, ObservableValue<String>> {
+			implements Callback<TableColumn.CellDataFeatures<Pair<Object, String>, String>, ObservableValue<String>> {
 		@Override
 		public ObservableValue<String> call(TableColumn.CellDataFeatures<Pair<Object, String>, String> data) {
 			return new ReadOnlyObjectWrapper<>(data.getValue().getValue());
@@ -304,7 +303,7 @@ public final class ToolboxManager {
 	 *
 	 */
 	public static class PairValueFactory
-	implements Callback<TableColumn.CellDataFeatures<Pair<Object, String>, Object>, ObservableValue<Object>> {
+			implements Callback<TableColumn.CellDataFeatures<Pair<Object, String>, Object>, ObservableValue<Object>> {
 		@SuppressWarnings("unchecked")
 		@Override
 		public ObservableValue<Object> call(TableColumn.CellDataFeatures<Pair<Object, String>, Object> data) {

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

@@ -52,20 +52,21 @@ public final class KeyboardShortcuts {
 
 		@Override
 		public void handle(KeyEvent event) {
-			
-			if(event.getCode() == KeyCode.CONTROL){
-				
-				//for functionality of holding down ctrl for creating mapping edges
-				if(Main.getInstance().getGraphManager().getGraph().getAttribute("layer") == Layer.MAPPING){
+
+			if (event.getCode() == KeyCode.CONTROL) {
+
+				// for functionality of holding down ctrl for creating mapping
+				// edges
+				if (Main.getInstance().getGraphManager().getGraph().getAttribute("layer") == Layer.MAPPING) {
 					Main.getInstance().setCreationMode(CreationMode.CREATE_DIRECTED_EDGE);
 					Debug.out("Ctrl pressed");
 				}
-				
+
 			}
 
 		}
 	};
-	
+
 	/**
 	 * A general Handler for any Button releases
 	 */
@@ -73,7 +74,7 @@ public final class KeyboardShortcuts {
 
 		@Override
 		public void handle(KeyEvent event) {
-			
+
 			if (mShift.match(event)) {
 				Debug.out("M+Shift released");
 			}
@@ -81,16 +82,17 @@ public final class KeyboardShortcuts {
 			else if (rAltShift.match(event)) {
 				Debug.out("Alt+Shift+R released");
 			}
-			
-			else if(event.getCode() == KeyCode.CONTROL){
-				
-				//for functionality of holding down ctrl for creating mapping edges
-				if(Main.getInstance().getGraphManager().getGraph().getAttribute("layer") == Layer.MAPPING){
+
+			else if (event.getCode() == KeyCode.CONTROL) {
+
+				// for functionality of holding down ctrl for creating mapping
+				// edges
+				if (Main.getInstance().getGraphManager().getGraph().getAttribute("layer") == Layer.MAPPING) {
 					Main.getInstance().setCreationMode(CreationMode.CREATE_NONE);
 					Main.getInstance().getGraphManager().deselectEdgeCreationNodes();
 					Debug.out("Ctrl released");
 				}
-				
+
 			}
 
 		}