Browse Source

Reviewed and Refactored, added lots of documentation, renamed
Auxilfunctions to EdgeSelectionHelper.

Jan Enders 8 years ago
parent
commit
e4b82f8e8e
22 changed files with 364 additions and 258 deletions
  1. 19 5
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/debug/Debug.java
  2. 7 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/GraphMLExporter.java
  3. 11 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/GraphMLImporter.java
  4. 22 16
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MyFileSourceGraphML.java
  5. 92 26
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MySourceBase.java
  6. 16 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/CreationMode.java
  7. 15 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/EdgeCreatedListener.java
  8. 11 8
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/EdgeSelectionHelper.java
  9. 10 16
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/GraphManager.java
  10. 17 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/Layer.java
  11. 1 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/MyGraph.java
  12. 14 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/NodeCreatedListener.java
  13. 13 10
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ButtonManager.java
  14. 20 17
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java
  15. 10 4
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GraphDisplayManager.java
  16. 50 128
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/MenuBarManager.java
  17. 16 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/OptionsManager.java
  18. 0 2
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/PropertiesManager.java
  19. 1 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ToolboxManager.java
  20. 3 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/KeyboardShortcuts.java
  21. 7 17
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/MyAnimationTimer.java
  22. 9 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/MyMouseManager.java

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

@@ -9,14 +9,20 @@ import de.tu_darmstadt.informatik.tk.scopviz.io.MyFileSourceGraphML;
  * Debug class to allow easy, static access to console output.
  * 
  * @author Matthias Wilhelm
- * @version 1.0
+ * @version 1.1
  *
  */
-public class Debug {
+public final class Debug {
+
+	/**
+	 * Private Constructor to prevent instantiation.
+	 */
+	private Debug() {
+	}
 
 	/**
 	 * Flag that determines whether to start the program in Debug Mode, loading
-	 * a Graph for testing on startup and enabling Debug output to the Console
+	 * a Graph for testing on startup and enabling Debug output to the Console.
 	 */
 	public static final boolean DEBUG_ENABLED = true;
 
@@ -49,8 +55,9 @@ public class Debug {
 	 *            String to be printed on the console
 	 */
 	public static void out(String s) {
-		if (DEBUG_ENABLED)
+		if (DEBUG_ENABLED) {
 			System.out.println(s);
+		}
 	}
 
 	/**
@@ -60,10 +67,17 @@ public class Debug {
 	 *            Integer to be printed on the console
 	 */
 	public static void out(int s) {
-		if (DEBUG_ENABLED)
+		if (DEBUG_ENABLED) {
 			System.out.println(s);
+		}
 	}
 
+	/**
+	 * Prints out an XML event.
+	 * 
+	 * @param e
+	 *            the event to print out
+	 */
 	public static void out(XMLEvent e) {
 		MyFileSourceGraphML t = new MyFileSourceGraphML();
 		switch (e.getEventType()) {

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

@@ -64,6 +64,13 @@ public class GraphMLExporter {
 		}
 	}
 
+	/**
+	 * Cleans up the Attributes of all Nodes and Edges of a given Graph,
+	 * removing the ui.j2dsk Attribute.
+	 * 
+	 * @param g
+	 *            the Graph to clean up
+	 */
 	private void clearAttributes(Graph g) {
 		Iterator<? extends Edge> edges = g.getEdgeIterator();
 		while (edges.hasNext()) {

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

@@ -19,6 +19,10 @@ import javafx.stage.Stage;
  * @version 1.1
  */
 public class GraphMLImporter {
+
+	/**
+	 * Filesource from which to read the Graph Data.
+	 */
 	private MyFileSourceGraphML fs = new MyFileSourceGraphML();
 
 	/**
@@ -47,6 +51,8 @@ public class GraphMLImporter {
 	 * Imports a GraphML file. Opens a open dialog. Returns null if the process
 	 * is aborted.
 	 * 
+	 * @param id
+	 *            the id to use for the new Graph
 	 * @param stage
 	 *            the parent window of the open file window
 	 * @return the imported Graphstream-Graph
@@ -86,6 +92,11 @@ public class GraphMLImporter {
 		return g;
 	}
 
+	/**
+	 * Returns a List of all the Subgraphs within the FileSource.
+	 * 
+	 * @return the list of subgraphs
+	 */
 	public LinkedList<SingleGraph> subGraphs() {
 		return fs.getSubGraphs();
 	}

+ 22 - 16
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MyFileSourceGraphML.java

@@ -80,61 +80,67 @@ import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
  */
 public class MyFileSourceGraphML extends MySourceBase implements FileSource, XMLStreamConstants {
 
-	protected static enum ReaderState {
+	/**
+	 * An Enum of the various States the reader can be in.
+	 */
+	protected enum ReaderState {
 		START, DESC, KEYS, NEW_GRAPH, NODES_EDGES, GRAPH_END, END
 	}
 
+	/**
+	 * The currently held Reader state.
+	 */
 	private ReaderState currentReaderState = ReaderState.START;
 
-	protected static enum Balise {
+	protected enum Balise {
 		GRAPHML, GRAPH, NODE, EDGE, HYPEREDGE, DESC, DATA, LOCATOR, PORT, KEY, DEFAULT
 	}
 
-	protected static enum GraphAttribute {
+	protected enum GraphAttribute {
 		ID, EDGEDEFAULT
 	}
 
-	protected static enum LocatorAttribute {
+	protected enum LocatorAttribute {
 		XMLNS_XLINK, XLINK_HREF, XLINK_TYPE
 	}
 
-	protected static enum NodeAttribute {
+	protected enum NodeAttribute {
 		ID
 	}
 
-	protected static enum EdgeAttribute {
+	protected enum EdgeAttribute {
 		ID, SOURCE, SOURCEPORT, TARGET, TARGETPORT, DIRECTED
 	}
 
-	protected static enum DataAttribute {
+	protected enum DataAttribute {
 		KEY, ID
 	}
 
-	protected static enum PortAttribute {
+	protected enum PortAttribute {
 		NAME
 	}
 
-	protected static enum EndPointAttribute {
+	protected enum EndPointAttribute {
 		ID, NODE, PORT, TYPE
 	}
 
-	protected static enum EndPointType {
+	protected enum EndPointType {
 		IN, OUT, UNDIR
 	}
 
-	protected static enum HyperEdgeAttribute {
+	protected enum HyperEdgeAttribute {
 		ID
 	}
 
-	protected static enum KeyAttribute {
+	protected enum KeyAttribute {
 		ID, FOR, ATTR_NAME, ATTR_TYPE, YFILES_TYPE
 	}
 
-	protected static enum KeyDomain {
+	protected enum KeyDomain {
 		GRAPHML, GRAPH, NODE, EDGE, HYPEREDGE, PORT, ENDPOINT, ALL
 	}
 
-	protected static enum KeyAttrType {
+	protected enum KeyAttrType {
 		BOOLEAN, INT, LONG, FLOAT, DOUBLE, STRING
 	}
 
@@ -242,8 +248,8 @@ public class MyFileSourceGraphML extends MySourceBase implements FileSource, XML
 	public MyFileSourceGraphML() {
 		init();
 	}
-	
-	private void init(){
+
+	private void init() {
 		events = new Stack<XMLEvent>();
 		keys = new HashMap<String, Key>();
 		datas = new LinkedList<Data>();

+ 92 - 26
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/io/MySourceBase.java

@@ -71,6 +71,9 @@ import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 public class MySourceBase implements Source {
 	// Attribute
 
+	/**
+	 * Enum of the different possible Types of Elements.
+	 */
 	public enum ElementType {
 		NODE, EDGE, GRAPH
 	};
@@ -108,27 +111,36 @@ public class MySourceBase implements Source {
 	protected SourceTime sourceTime;
 
 	/**
-	 * a List of all inner Graphs of a multigraphFile
+	 * a List of all inner Graphs of a multigraphFile.
 	 */
 	protected LinkedList<SingleGraph> subGraphs = new LinkedList<>();
 
 	/**
-	 * all inner graphs that are currently being edited
+	 * all inner graphs that are currently being edited.
 	 */
 	protected Stack<SingleGraph> usedSubGraphs = new Stack<>();
 
 	/**
-	 * the ID of the (last added) outer Graph;
+	 * the ID of the (last added) outer Graph.
 	 */
 	protected String superID = "";
 
 	// Construction
 
+	/**
+	 * Creates a new MySourceBase Object with a random ID.
+	 */
 	protected MySourceBase() {
 		this(String.format("sourceOnThread#%d_%d", Thread.currentThread().getId(),
 				System.currentTimeMillis() + ((int) (Math.random() * 1000))));
 	}
 
+	/**
+	 * Creates a new MySourceBase Object with a given ID.
+	 * 
+	 * @param sourceId
+	 *            the ID to use
+	 */
 	protected MySourceBase(String sourceId) {
 		this.sourceId = sourceId;
 		this.sourceTime = new SourceTime(sourceId);
@@ -136,10 +148,20 @@ public class MySourceBase implements Source {
 
 	// Access
 
+	/**
+	 * Returns an Iterable over all the attribute sinks.
+	 * 
+	 * @return the Iterable
+	 */
 	public Iterable<AttributeSink> attributeSinks() {
 		return attrSinks;
 	}
 
+	/**
+	 * Returns an Iterable over all the element sinks.
+	 * 
+	 * @return the Iterable
+	 */
 	public Iterable<ElementSink> elementSinks() {
 		return eltsSinks;
 	}
@@ -157,6 +179,12 @@ public class MySourceBase implements Source {
 		}
 	}
 
+	/**
+	 * Adds a new Sink that works with SubGraphs.
+	 * 
+	 * @param sink
+	 *            the Sink to add
+	 */
 	private void addSubGraphSink(Sink sink) {
 		addAttributeSink(sink);
 		addElementSink(sink);
@@ -278,9 +306,9 @@ public class MySourceBase implements Source {
 			eventProcessing = true;
 			manageEvents();
 
-			for (int i = 0; i < eltsSinks.size(); i++)
+			for (int i = 0; i < eltsSinks.size(); i++) {
 				eltsSinks.get(i).graphCleared(sourceId, timeId);
-
+			}
 			manageEvents();
 			eventProcessing = false;
 		} else {
@@ -313,9 +341,9 @@ public class MySourceBase implements Source {
 			eventProcessing = true;
 			manageEvents();
 
-			for (int i = 0; i < eltsSinks.size(); i++)
+			for (int i = 0; i < eltsSinks.size(); i++) {
 				eltsSinks.get(i).stepBegins(sourceId, timeId, step);
-
+			}
 			manageEvents();
 			eventProcessing = false;
 		} else {
@@ -349,9 +377,9 @@ public class MySourceBase implements Source {
 			eventProcessing = true;
 			manageEvents();
 
-			for (int i = 0; i < eltsSinks.size(); i++)
+			for (int i = 0; i < eltsSinks.size(); i++) {
 				eltsSinks.get(i).nodeAdded(sourceId, timeId, nodeId);
-
+			}
 			manageEvents();
 			eventProcessing = false;
 		} else {
@@ -385,9 +413,9 @@ public class MySourceBase implements Source {
 			eventProcessing = true;
 			manageEvents();
 
-			for (int i = 0; i < eltsSinks.size(); i++)
+			for (int i = 0; i < eltsSinks.size(); i++) {
 				eltsSinks.get(i).nodeRemoved(sourceId, timeId, nodeId);
-
+			}
 			manageEvents();
 			eventProcessing = false;
 		} else {
@@ -434,9 +462,9 @@ public class MySourceBase implements Source {
 			eventProcessing = true;
 			manageEvents();
 
-			for (int i = 0; i < eltsSinks.size(); i++)
+			for (int i = 0; i < eltsSinks.size(); i++) {
 				eltsSinks.get(i).edgeAdded(sourceId, timeId, edgeId, fromNodeId, toNodeId, directed);
-
+			}
 			manageEvents();
 			eventProcessing = false;
 		} else {
@@ -470,9 +498,9 @@ public class MySourceBase implements Source {
 			eventProcessing = true;
 			manageEvents();
 
-			for (int i = 0; i < eltsSinks.size(); i++)
+			for (int i = 0; i < eltsSinks.size(); i++) {
 				eltsSinks.get(i).edgeRemoved(sourceId, timeId, edgeId);
-
+			}
 			manageEvents();
 			eventProcessing = false;
 		} else {
@@ -606,6 +634,7 @@ public class MySourceBase implements Source {
 	 * @param sourceId
 	 *            The source identifier.
 	 * @param timeId
+	 *            The time identifier.
 	 * @param attribute
 	 *            The attribute name.
 	 * @param value
@@ -639,6 +668,7 @@ public class MySourceBase implements Source {
 	 * @param sourceId
 	 *            The source identifier.
 	 * @param timeId
+	 *            The time identifier.
 	 * @param attribute
 	 *            The attribute name.
 	 * @param oldValue
@@ -671,6 +701,7 @@ public class MySourceBase implements Source {
 	 * @param sourceId
 	 *            The source identifier.
 	 * @param timeId
+	 *            The time identifier.
 	 * @param attribute
 	 *            The attribute name.
 	 */
@@ -701,6 +732,7 @@ public class MySourceBase implements Source {
 	 * @param sourceId
 	 *            The source identifier.
 	 * @param timeId
+	 *            The time identifier.
 	 * @param nodeId
 	 *            The node identifier.
 	 * @param attribute
@@ -739,6 +771,7 @@ public class MySourceBase implements Source {
 	 * @param sourceId
 	 *            The source identifier.
 	 * @param timeId
+	 *            The time identifier.
 	 * @param nodeId
 	 *            The node identifier.
 	 * @param attribute
@@ -812,6 +845,29 @@ public class MySourceBase implements Source {
 				newValue);
 	}
 
+	/**
+	 * Send a add/change/remove attribute event on an element. This method is a
+	 * generic way of notifying of an attribute change and is equivalent to
+	 * individual send*Attribute*() methods.
+	 * 
+	 * @param sourceId
+	 *            The source identifier.
+	 * @param timeId
+	 *            The time identifier.
+	 * @param eltId
+	 *            The changed element identifier.
+	 * @param eltType
+	 *            The changed element type.
+	 * @param attribute
+	 *            The changed attribute.
+	 * @param event
+	 *            The add/change/remove action.
+	 * @param oldValue
+	 *            The old attribute value (null if the attribute is removed or
+	 *            added).
+	 * @param newValue
+	 *            The new attribute value (null if removed).
+	 */
 	public void sendAttributeChangedEvent(String sourceId, long timeId, String eltId, ElementType eltType,
 			String attribute, AttributeChangeEvent event, Object oldValue, Object newValue) {
 		if (!eventProcessing) {
@@ -820,36 +876,45 @@ public class MySourceBase implements Source {
 
 			if (event == AttributeChangeEvent.ADD) {
 				if (eltType == ElementType.NODE) {
-					for (int i = 0; i < attrSinks.size(); i++)
+					for (int i = 0; i < attrSinks.size(); i++) {
 						attrSinks.get(i).nodeAttributeAdded(sourceId, timeId, eltId, attribute, newValue);
+					}
 				} else if (eltType == ElementType.EDGE) {
-					for (int i = 0; i < attrSinks.size(); i++)
+					for (int i = 0; i < attrSinks.size(); i++) {
 						attrSinks.get(i).edgeAttributeAdded(sourceId, timeId, eltId, attribute, newValue);
+					}
 				} else {
-					for (int i = 0; i < attrSinks.size(); i++)
+					for (int i = 0; i < attrSinks.size(); i++) {
 						attrSinks.get(i).graphAttributeAdded(sourceId, timeId, attribute, newValue);
+					}
 				}
 			} else if (event == AttributeChangeEvent.REMOVE) {
 				if (eltType == ElementType.NODE) {
-					for (int i = 0; i < attrSinks.size(); i++)
+					for (int i = 0; i < attrSinks.size(); i++) {
 						attrSinks.get(i).nodeAttributeRemoved(sourceId, timeId, eltId, attribute);
+					}
 				} else if (eltType == ElementType.EDGE) {
-					for (int i = 0; i < attrSinks.size(); i++)
+					for (int i = 0; i < attrSinks.size(); i++) {
 						attrSinks.get(i).edgeAttributeRemoved(sourceId, timeId, eltId, attribute);
+					}
 				} else {
-					for (int i = 0; i < attrSinks.size(); i++)
+					for (int i = 0; i < attrSinks.size(); i++) {
 						attrSinks.get(i).graphAttributeRemoved(sourceId, timeId, attribute);
+					}
 				}
 			} else {
 				if (eltType == ElementType.NODE) {
-					for (int i = 0; i < attrSinks.size(); i++)
+					for (int i = 0; i < attrSinks.size(); i++) {
 						attrSinks.get(i).nodeAttributeChanged(sourceId, timeId, eltId, attribute, oldValue, newValue);
+					}
 				} else if (eltType == ElementType.EDGE) {
-					for (int i = 0; i < attrSinks.size(); i++)
+					for (int i = 0; i < attrSinks.size(); i++) {
 						attrSinks.get(i).edgeAttributeChanged(sourceId, timeId, eltId, attribute, oldValue, newValue);
+					}
 				} else {
-					for (int i = 0; i < attrSinks.size(); i++)
+					for (int i = 0; i < attrSinks.size(); i++) {
 						attrSinks.get(i).graphAttributeChanged(sourceId, timeId, attribute, oldValue, newValue);
+					}
 				}
 			}
 
@@ -868,8 +933,9 @@ public class MySourceBase implements Source {
 	 */
 	protected void manageEvents() {
 		if (eventProcessing) {
-			while (!eventQueue.isEmpty())
+			while (!eventQueue.isEmpty()) {
 				eventQueue.remove().trigger();
+			}
 		}
 	}
 
@@ -877,7 +943,7 @@ public class MySourceBase implements Source {
 
 	/**
 	 * Interface that provide general purpose classification for evens involved
-	 * in graph modifications
+	 * in graph modifications.
 	 */
 	abstract class GraphEvent {
 		String sourceId;

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

@@ -9,5 +9,20 @@ package de.tu_darmstadt.informatik.tk.scopviz.main;
  *
  */
 public enum CreationMode {
-	CREATE_STANDARD_NODE, CREATE_SOURCE_NODE, CREATE_SINK_NODE, CREATE_PROC_NODE, CREATE_OPERATOR_NODE, CREATE_UNDIRECTED_EDGE, CREATE_DIRECTED_EDGE, CREATE_NONE
+	/** Mode for creating Standard Underlay Nodes. */
+	CREATE_STANDARD_NODE,
+	/** Mode for creating Source Nodes on the Operator Graph. */
+	CREATE_SOURCE_NODE,
+	/** Mode for creating Sink Nodes on the Operator Graph. */
+	CREATE_SINK_NODE,
+	/** Mode for creating Processing Enabled Nodes on the Underlay Graph. */
+	CREATE_PROC_NODE,
+	/** Mode for creating Operator Nodes on the Operator Graph. */
+	CREATE_OPERATOR_NODE,
+	/** Mode for creating undirected Edges. */
+	CREATE_UNDIRECTED_EDGE,
+	/** Mode for creating directed Edges. */
+	CREATE_DIRECTED_EDGE,
+	/** Default Mode when not trying to create anything. */
+	CREATE_NONE
 }

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

@@ -2,7 +2,22 @@ package de.tu_darmstadt.informatik.tk.scopviz.main;
 
 import org.graphstream.graph.Edge;
 
+/**
+ * Interface for listeners on new Edges being created.
+ * 
+ * @author Jascha Bohne
+ * @version 1.0
+ *
+ */
 public interface EdgeCreatedListener {
 
+	/**
+	 * Should be called whenever a new Edge has been created.
+	 * 
+	 * @param e
+	 *            the newly created Edge
+	 * @param graphID
+	 *            the ID of the Graph that had the Edge added to it
+	 */
 	public void edgeCreated(Edge e, String graphID);
 }

+ 11 - 8
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/AuxilFunctions.java → scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/EdgeSelectionHelper.java

@@ -12,17 +12,20 @@ import org.graphstream.ui.view.Camera;
  * This class contains helpful static functions.
  * 
  * @author Matthias Wilhelm
- *
+ * @version 1.0
  */
-public class AuxilFunctions {
+public final class EdgeSelectionHelper {
 
 	/**
-	 * Width in pixels for which the edge selection triggers
+	 * Private Constructor to prevent instantiation. private
+	 * EdgeSelectionHelper(){}
+	 * 
+	 * /** Width in pixels for which the edge selection triggers.
 	 */
 	private static final int EDGE_SELECTION_WIDTH = 5;
 
 	/**
-	 * Precalculates pi / 2
+	 * Precalculates pi / 2.
 	 */
 	private static final double HALF_PI = Math.PI / 2;
 
@@ -55,7 +58,7 @@ public class AuxilFunctions {
 
 	/**
 	 * Returns the closest Edge in the current Graph to a given position within
-	 * the given maxDistance
+	 * the given maxDistance.
 	 * 
 	 * @param pos
 	 *            The position. Expects a <b>Point3</b>, but only uses the x and
@@ -130,7 +133,7 @@ public class AuxilFunctions {
 	}
 
 	/**
-	 * Calculates the distance between two given Nodes
+	 * Calculates the distance between two given Nodes.
 	 * 
 	 * @param a
 	 *            Node 1
@@ -146,7 +149,7 @@ public class AuxilFunctions {
 	}
 
 	/**
-	 * Calculates the distance between a x,y position and a Node
+	 * Calculates the distance between a x,y position and a Node.
 	 * 
 	 * @param x0
 	 *            x cord of the position
@@ -163,7 +166,7 @@ public class AuxilFunctions {
 	}
 
 	/**
-	 * Calculates the distance between two x,y positions
+	 * Calculates the distance between two x,y positions.
 	 * 
 	 * @param x0
 	 *            x cord of the first position

+ 10 - 16
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/GraphManager.java

@@ -39,7 +39,7 @@ public class GraphManager {
 
 	/** The last Node that was deleted. */
 	protected Node deletedNode;
-	/** The last Edge that was deleted */
+	/** The last Edge that was deleted. */
 	protected LinkedList<Edge> deletedEdges = new LinkedList<>();
 
 	/** The currently selected Node, mutually exclusive with selectedEdgeID. */
@@ -53,7 +53,7 @@ public class GraphManager {
 	/** The Path on Disk the Graph will be saved to. */
 	protected String currentPath;
 
-	/** The Viewer the Graph provides, grants Access to Camera Manipulation */
+	/** The Viewer the Graph provides, grants Access to Camera Manipulation. */
 	protected Viewer viewer;
 	/**
 	 * The Pipe that notifies the underlying Graph of any Changes within the
@@ -84,8 +84,6 @@ public class GraphManager {
 	 * ElementNotFoundException, when the Node is not Found Will also remove all
 	 * Edges connected to the given Node
 	 * 
-	 * @param g
-	 *            the Graph with the Node that shall be removed
 	 * @param id
 	 *            the ID of the node that will be removed
 	 */
@@ -104,8 +102,6 @@ public class GraphManager {
 	 * referenced Graph is modified directly. Will throw an
 	 * ElementNotFoundException, when the Edge is not Found
 	 * 
-	 * @param g
-	 *            the Graph with the Edge that shall be removed
 	 * @param id
 	 *            the ID of the Edge that will be removed
 	 */
@@ -119,9 +115,7 @@ public class GraphManager {
 	 * Deletes all Edges connected to the given Node. The referenced Graph is
 	 * modified directly. Will throw an ElementNotFoundException if the Node is
 	 * not Found
-	 * 
-	 * @param g
-	 *            the Graph containing the Node
+	 *
 	 * @param id
 	 *            the Id of the Node, whose Edges shall be removed
 	 */
@@ -146,9 +140,6 @@ public class GraphManager {
 	 * operations are: deleteNode, deleteEdge and deleteEdgesOfNode. Only undoes
 	 * the last deleting operation even if that operation didn't change the
 	 * Graph
-	 * 
-	 * @param g
-	 *            the Graph, whose Elements shall be undeleted
 	 */
 	public void undelete() {
 		// System.out.println("test-undel");
@@ -347,7 +338,7 @@ public class GraphManager {
 	 * Adds a <b>Copy</b> of the given Node to the graph. The Copy retains the
 	 * ID and all attributes.
 	 * 
-	 * @param e
+	 * @param n
 	 *            the Node to be added to the graph
 	 */
 	public void addNode(Node n) {
@@ -502,7 +493,7 @@ public class GraphManager {
 
 	/**
 	 * adds the given listener to the underlying graph the listener will be
-	 * notified, when an Edge is added
+	 * notified, when an Edge is added.
 	 * 
 	 * @param e
 	 *            the EdgeCreatedListener
@@ -513,15 +504,18 @@ public class GraphManager {
 
 	/**
 	 * adds the given listener to the underlying graph the listener will be
-	 * notified, when a Node is added
+	 * notified, when a Node is added.
 	 * 
-	 * @param e
+	 * @param n
 	 *            the NodeCreatedListener
 	 */
 	public void addNodeCreatedListener(NodeCreatedListener n) {
 		((MyGraph) g).addNodeCreatedListener(n);
 	}
 
+	/**
+	 * Updates the Stylesheet, causing any changes to it to come into effect.
+	 */
 	public void updateStylesheet() {
 		setStylesheet(this.stylesheet);
 	}

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

@@ -1,5 +1,21 @@
 package de.tu_darmstadt.informatik.tk.scopviz.main;
 
+/**
+ * Enum for the different Display Layers.
+ * 
+ * @author Julian Ohl
+ * @version 1.0
+ */
 public enum Layer {
-	UNDERLAY, OPERATOR, MAPPING, SYMBOL
+	/** Layer for the Graph representing the Network. */
+	UNDERLAY,
+	/** Layer for the Operator Graph. */
+	OPERATOR,
+	/** Layer for Mapping the Operation onto the Network. */
+	MAPPING,
+	/**
+	 * Symbol Representation Layer, displaying the Network Graph with Images
+	 * representing the corresponding Devices.
+	 */
+	SYMBOL
 }

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

@@ -10,7 +10,7 @@ import org.graphstream.graph.implementations.SingleGraph;
  * Our own Class to extend GraphStreams Graph with our own Functionality.
  * 
  * @author Jan Enders (jan.enders@stud.tu-darmstadt.de)
- * @version 0.1
+ * @version 1.1
  * 
  */
 public class MyGraph extends SingleGraph {

+ 14 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/NodeCreatedListener.java

@@ -2,7 +2,21 @@ package de.tu_darmstadt.informatik.tk.scopviz.main;
 
 import org.graphstream.graph.Node;
 
+/**
+ * Interface for Listeners on new Nodes being created.
+ * 
+ * @author Jascha Bohne
+ * @version 1.0
+ */
 public interface NodeCreatedListener {
 
+	/**
+	 * Should be called whenever a new Node was created.
+	 * 
+	 * @param n
+	 *            the newly created Node
+	 * @param graphID
+	 *            the Id of the Graph the Node was added to.
+	 */
 	public void nodeCreated(Node n, String graphID);
 }

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

@@ -19,17 +19,17 @@ 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)
- * @version 1.0
+ * @version 1.2
  *
  */
 public final class ButtonManager {
 
-	/** Flag for creating more then one Edge at a time mode */
-	public static final Boolean CREATE_MORE_THEN_ONE = true;
-
-	/** List of the Buttons for Layer switching */
+	/** List of the Buttons for Layer switching. */
 	private static ArrayList<Button> layerButtons;
 
+	/**
+	 * Reference to the GUI Controller for Access to various GUI Elements.
+	 */
 	private static GUIController controller;
 
 	/**
@@ -43,6 +43,12 @@ public final class ButtonManager {
 	 * 
 	 * @param nList
 	 *            the Layer switching Buttons
+	 * @param guiController
+	 *            a Reference to the GUI Controller for Access
+	 * @param uButton
+	 *            a Reference to the Underlay switch Button for marking it as
+	 *            active on startup
+	 * 
 	 */
 	public static void initialize(ArrayList<Button> nList, GUIController guiController, Button uButton) {
 		layerButtons = nList;
@@ -52,14 +58,14 @@ public final class ButtonManager {
 	}
 
 	/**
-	 * Handler for zoom in Button
+	 * Handler for zoom in Button.
 	 */
 	public static final void zoomInAction(ActionEvent event) {
 		Main.getInstance().getGraphManager().zoomIn();
 	}
 
 	/**
-	 * Handler for zoom out Button
+	 * Handler for zoom out Button.
 	 */
 	public static final void zoomOutAction(ActionEvent event) {
 		Main.getInstance().getGraphManager().zoomOut();
@@ -171,7 +177,6 @@ public final class ButtonManager {
 	}
 
 	/**
-<<<<<<< HEAD
 	 * replaces all node sprites with symbol sprites corresponding with the
 	 * device/hardware type
 	 * 
@@ -197,8 +202,6 @@ public final class ButtonManager {
 	}
 
 	/**
-=======
->>>>>>> branch 'dominik' of https://git.tk.informatik.tu-darmstadt.de/julien.gedeon/bp-scopviz.git
 	 * Functionality for "edge visible" Checkbox
 	 * 
 	 * @param ov

+ 20 - 17
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java

@@ -8,7 +8,6 @@ import javax.swing.JPanel;
 
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.KeyboardShortcuts;
-import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.MyAnimationTimer;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.ResizeListener;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
@@ -129,9 +128,6 @@ public class GUIController implements Initializable {
 		// Assert the correct injection of all references from FXML
 		assertFXMLInjections();
 
-		// Give the AnimationTimer access to UI elements
-		MyAnimationTimer.setGUIController(this);
-
 		initializeToolbox();
 		initializeProperties();
 
@@ -159,17 +155,18 @@ public class GUIController implements Initializable {
 	 * Initializes the Menu Bar with all its contents.
 	 */
 	private void initializeMenuBar() {
-
-		newItem.setOnAction(MenuBarManager.newHandler);
-		open.setOnAction(MenuBarManager.openHandler);
-		add.setOnAction(MenuBarManager.addHandler);
-		save.setOnAction(MenuBarManager.saveHandler);
-		saveAs.setOnAction(MenuBarManager.saveAsHandler);
-		preferences.setOnAction(MenuBarManager.preferencesHandler);
-		quit.setOnAction(MenuBarManager.quitHandler);
-		delete.setOnAction(MenuBarManager.deleteHandler);
-		undelete.setOnAction(MenuBarManager.undeleteHandler);
-		about.setOnAction(MenuBarManager.aboutHandler);
+		// TODO: Replace these with Lambdas
+		// newItem.setOnAction(MenuBarManager.newHandler);
+		newItem.setOnAction((event) -> MenuBarManager.newAction(event));
+		open.setOnAction((event) -> MenuBarManager.openAction(event));
+		add.setOnAction((event) -> MenuBarManager.addAction(event));
+		save.setOnAction((event) -> MenuBarManager.saveAction(event));
+		saveAs.setOnAction((event) -> MenuBarManager.saveAsAction(event));
+		preferences.setOnAction((event) -> MenuBarManager.preferencesAction(event));
+		quit.setOnAction((event) -> MenuBarManager.quitAction(event));
+		delete.setOnAction((event) -> MenuBarManager.deleteAction(event));
+		undelete.setOnAction((event) -> MenuBarManager.undeleteAction(event));
+		about.setOnAction((event) -> MenuBarManager.aboutAction(event));
 
 	}
 
@@ -181,6 +178,9 @@ public class GUIController implements Initializable {
 		zoomOut.setOnAction((event) -> ButtonManager.zoomOutAction(event));
 	}
 
+	/**
+	 * Initializes the special Toolbox for the Symbol Representation Layer.
+	 */
 	private void initializeSymbolRepToolbox() {
 		// Hide SymbolRep Toolbox View
 		symbolToolVBox.setVisible(false);
@@ -214,8 +214,9 @@ public class GUIController implements Initializable {
 	 * Sets the minimum size and adds the handlers to the graph display.
 	 */
 	private void initializeDisplayPane() {
-		pane.heightProperty().addListener(new ResizeListener(swingNode, pane));
-		pane.widthProperty().addListener(new ResizeListener(swingNode, pane));
+		ResizeListener rLis = new ResizeListener(swingNode, pane);
+		pane.heightProperty().addListener(rLis);
+		pane.widthProperty().addListener(rLis);
 		pane.setOnScroll(GraphDisplayManager.scrollHandler);
 		swingNode.setContent((JPanel) Main.getInstance().getGraphManager().getView());
 		pane.setMinSize(200, 200);
@@ -224,6 +225,7 @@ public class GUIController implements Initializable {
 	/**
 	 * Initialize the Toolbox.
 	 */
+	@SuppressWarnings("unchecked")
 	private void initializeToolbox() {
 
 		ToolboxManager.initialize(this);
@@ -252,6 +254,7 @@ public class GUIController implements Initializable {
 	/**
 	 * Initialize the Properties Window.
 	 */
+	@SuppressWarnings("unchecked")
 	private void initializeProperties() {
 
 		propertiesObjectColumn.setResizable(true);

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

@@ -24,26 +24,29 @@ import javafx.stage.Stage;
  * corresponding GraphManagers.
  * 
  * @author Matthias Wilhelm
- * @version 1.0
+ * @version 1.1
  *
  */
 public final class GraphDisplayManager {
 
-	public static int counter = 0;
-
 	/** Prefix to add to the Name of the Graphs. */
 	private static final String GRAPH_STRING_ID_PREFIX = "graph";
 
 	/** A List of all GraphManagers managed by this class. */
 	private static ArrayList<GraphManager> vList = new ArrayList<GraphManager>();
+
 	/** The number of GraphManagers currently being managed. */
 	private static int count = 0;
+
 	/** Reference to the GUI Controller for Access to UI Elements. */
 	private static GUIController guiController;
+
 	/** The number of the currently used GraphManager. */
 	private static int currentGraphManager = 0;
+
 	/** The currently active Layer. */
 	private static Layer currentLayer = Layer.UNDERLAY;
+
 	/**
 	 * An empty GraphManager to use with Layers not yet filled with another
 	 * GraphManager.
@@ -288,6 +291,9 @@ public final class GraphDisplayManager {
 		GraphDisplayManager.currentLayer = currentLayer;
 	}
 
+	/**
+	 * Sets up the Mapping Layer.
+	 */
 	private static void initMappingLayer() {
 		GraphManager underlay = null, operator = null;
 		MappingGraphManager mapping = null;
@@ -336,7 +342,7 @@ public final class GraphDisplayManager {
 		@Override
 		public void handle(ScrollEvent event) {
 			double deltaY = event.getDeltaY();
-			getCurrentGraphManager().zoom(deltaY / -100);
+			Main.getInstance().getGraphManager().zoom(deltaY / -100);
 		}
 
 	};

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

@@ -4,7 +4,6 @@ import de.tu_darmstadt.informatik.tk.scopviz.io.GraphMLExporter;
 import de.tu_darmstadt.informatik.tk.scopviz.main.GraphManager;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
 import javafx.scene.control.Alert;
 import javafx.scene.control.Alert.AlertType;
 import javafx.scene.control.Label;
@@ -14,7 +13,7 @@ import javafx.scene.layout.Region;
  * Manager Class for the Menu Bar.
  * 
  * @author Jascha Bohne
- * @version 1.0
+ * @version 1.1
  *
  */
 public final class MenuBarManager {
@@ -28,169 +27,92 @@ public final class MenuBarManager {
 	/**
 	 * Handler for the "new" MenuItem.
 	 */
-	public static final EventHandler<ActionEvent> newHandler = new EventHandler<ActionEvent>() {
-
-		/**
-		 * Handle method gets called when the button is pressed.
-		 * 
-		 * @param arg0
-		 *            the event that occurred to the button
-		 */
-		@Override
-		public void handle(ActionEvent arg0) {
-			GraphDisplayManager.addGraph();
-		}
-	};
+	public static final void newAction(ActionEvent event) {
+		GraphDisplayManager.addGraph();
+	}
 
-	// TODO: Make Open and Add two different things
 	/**
 	 * Handler for the "open" MenuItem.
 	 */
-	public static final EventHandler<ActionEvent> openHandler = new EventHandler<ActionEvent>() {
-
-		/**
-		 * Handle method gets called when the button is pressed.
-		 * 
-		 * @param arg0
-		 *            the event that occurred to the button
-		 */
-		@Override
-		public void handle(ActionEvent arg0) {
-			GraphDisplayManager.addGraph(Main.getInstance().getPrimaryStage(), true);
-		}
-	};
+	public static final void openAction(ActionEvent event) {
+		GraphDisplayManager.addGraph(Main.getInstance().getPrimaryStage(), true);
+	}
 
 	/**
 	 * Handler for the "add" MenuItem.
 	 */
-	public static final EventHandler<ActionEvent> addHandler = new EventHandler<ActionEvent>() {
-
-		/**
-		 * Handle method gets called when the button is pressed.
-		 * 
-		 * @param arg0
-		 *            the event that occurred to the button
-		 */
-		@Override
-		public void handle(ActionEvent arg0) {
-			GraphDisplayManager.addGraph(Main.getInstance().getPrimaryStage(), false);
-		}
-	};
+	public static final void addAction(ActionEvent event) {
+		GraphDisplayManager.addGraph(Main.getInstance().getPrimaryStage(), false);
+	}
 
 	/**
 	 * Handler for the "save" button.
 	 */
-	public static final EventHandler<ActionEvent> saveHandler = new EventHandler<ActionEvent>() {
-
-		/**
-		 * Handle method gets called when the button is pressed.
-		 * 
-		 * @param arg0
-		 *            the event that occurred to the button
-		 */
-		@Override
-		public void handle(ActionEvent arg0) {
-			GraphManager v = Main.getInstance().getGraphManager();
-			if (v.getCurrentPath() != null) {
-				new GraphMLExporter().writeGraph(v.getGraph(), v.getCurrentPath());
-			} else {
-				new GraphMLExporter().writeGraph(v.getGraph(), Main.getInstance().getPrimaryStage());
-			}
+	public static void saveAction(ActionEvent event) {
+		GraphManager v = Main.getInstance().getGraphManager();
+		if (v.getCurrentPath() != null) {
+			new GraphMLExporter().writeGraph(v.getGraph(), v.getCurrentPath());
+		} else {
+			new GraphMLExporter().writeGraph(v.getGraph(), Main.getInstance().getPrimaryStage());
 		}
-	};
+	}
 
 	/**
 	 * Handler for the "save as..." button.
 	 */
-	public static final EventHandler<ActionEvent> saveAsHandler = new EventHandler<ActionEvent>() {
-		public void handle(ActionEvent evt) {
-			GraphManager v = Main.getInstance().getGraphManager();
-			new GraphMLExporter().writeGraph(v.getGraph(), Main.getInstance().getPrimaryStage());
-		}
-	};
+	public static void saveAsAction(ActionEvent event) {
+		GraphManager v = Main.getInstance().getGraphManager();
+		new GraphMLExporter().writeGraph(v.getGraph(), Main.getInstance().getPrimaryStage());
+	}
 
 	/**
 	 * Handler for the "quit" button.
 	 */
-	public static final EventHandler<ActionEvent> quitHandler = new EventHandler<ActionEvent>() {
-		public void handle(ActionEvent evt) {
-			System.exit(0);
-		}
-	};
+	public static void quitAction(ActionEvent event) {
+		System.exit(0);
+	}
 
 	/**
 	 * Handler for the "delete" button.
 	 */
-	public static final EventHandler<ActionEvent> deleteHandler = new EventHandler<ActionEvent>() {
-
-		/**
-		 * Handle method gets called whenever the menuItem is presser
-		 * 
-		 * @param event
-		 *            the event that occurred to the menuItem
-		 */
-		@Override
-		public void handle(ActionEvent event) {
-			GraphManager v = Main.getInstance().getGraphManager();
-			if (v.getSelectedEdgeID() != null) {
-				v.deleteEdge(v.getSelectedEdgeID());
-			}
-			if (v.getSelectedNodeID() != null) {
-				v.deleteNode(v.getSelectedNodeID());
-			}
+	public static void deleteAction(ActionEvent event) {
+		GraphManager v = Main.getInstance().getGraphManager();
+		if (v.getSelectedEdgeID() != null) {
+			v.deleteEdge(v.getSelectedEdgeID());
 		}
-	};
+		if (v.getSelectedNodeID() != null) {
+			v.deleteNode(v.getSelectedNodeID());
+		}
+	}
 
 	/**
 	 * Handler for the "undelete" button.
 	 */
-	public static final EventHandler<ActionEvent> undeleteHandler = new EventHandler<ActionEvent>() {
-		public void handle(ActionEvent evt) {
-			Main.getInstance().getGraphManager().undelete();
-		}
-	};
+	public static void undeleteAction(ActionEvent event) {
+		Main.getInstance().getGraphManager().undelete();
+	}
 
 	/**
 	 * Handler for the "preferences" MenuItem.
 	 */
-	public static final EventHandler<ActionEvent> preferencesHandler = new EventHandler<ActionEvent>() {
-
-		/**
-		 * Handle method gets called when the button is pressed.
-		 * 
-		 * @param arg0
-		 *            the event that occurred to the button
-		 */
-		@Override
-		public void handle(ActionEvent arg0) {
-			OptionsManager.openOptionsDialog();
-		}
-	};
+	public static void preferencesAction(ActionEvent event) {
+		OptionsManager.openOptionsDialog();
+	}
 
 	/**
 	 * Handler for the "about" MenuItem.
 	 */
-	public static final EventHandler<ActionEvent> aboutHandler = new EventHandler<ActionEvent>() {
-
-		/**
-		 * Handle method gets called when the button is pressed.
-		 * 
-		 * @param arg0
-		 *            the event that occurred to the button
-		 */
-		@Override
-		public void handle(ActionEvent arg0) {
-			Alert alert = new Alert(AlertType.INFORMATION);
-			alert.setTitle("About this programm");
-			alert.setHeaderText(null);
-			alert.setContentText("" + "Visualization Software of the Telecooperation group, \n"
-					+ "Department of Computer Science, \n" + "Technische Universität Darmstadt. \n" + "\n"
-					+ "Created by: \n" + "Jan Enders, Jascha Bohne, Dominik Renkel, \n"
-					+ "Julian Ohl und Matthias Wilhelm \n" + "comissioned by Julien Gedeon");
-			alert.getDialogPane().getChildren().stream().filter(node -> node instanceof Label)
-					.forEach(node -> ((Label) node).setMinHeight(Region.USE_PREF_SIZE));
-			alert.showAndWait();
-		}
-	};
+	public static void aboutAction(ActionEvent event) {
+		Alert alert = new Alert(AlertType.INFORMATION);
+		alert.setTitle("About this programm");
+		alert.setHeaderText(null);
+		alert.setContentText("" + "Visualization Software of the Telecooperation group, \n"
+				+ "Department of Computer Science, \n" + "Technische Universität Darmstadt. \n" + "\n"
+				+ "Created by: \n" + "Jan Enders, Jascha Bohne, Dominik Renkel, \n"
+				+ "Julian Ohl und Matthias Wilhelm \n" + "comissioned by Julien Gedeon");
+		alert.getDialogPane().getChildren().stream().filter(node -> node instanceof Label)
+				.forEach(node -> ((Label) node).setMinHeight(Region.USE_PREF_SIZE));
+		alert.showAndWait();
+	}
 
 }

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

@@ -20,7 +20,7 @@ import javafx.scene.layout.GridPane;
 /**
  * manages the settings of the program also stores the constants
  * 
- * @author jascha-b
+ * @author Jascha Bohne
  * @version 1.0.0.0
  */
 public final class OptionsManager {
@@ -216,6 +216,13 @@ public final class OptionsManager {
 		OptionsManager.nodeStylesheet = nodeGraphics;
 	}
 
+	/**
+	 * Returns the styleSheet for a given Layer
+	 * 
+	 * @param l
+	 *            the Layer
+	 * @return the Stylesheet
+	 */
 	public static String getLayerStyle(Layer l) {
 		switch (l) {
 		case UNDERLAY:
@@ -232,6 +239,14 @@ public final class OptionsManager {
 		}
 	}
 
+	/**
+	 * Sets the Stylesheet for a given Layer
+	 * 
+	 * @param l
+	 *            the Layer
+	 * @param newStyle
+	 *            the Stylesheet
+	 */
 	public static void setLayerStyle(Layer l, String newStyle) {
 		switch (l) {
 		case UNDERLAY:

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

@@ -15,7 +15,6 @@ import javafx.application.Platform;
 import javafx.beans.binding.Bindings;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
 import javafx.geometry.Insets;
 import javafx.scene.control.ButtonBar.ButtonData;
@@ -287,7 +286,6 @@ public final class PropertiesManager {
 
 		selected.removeAttribute(pair.getKey());
 
-		Debug.out(String.valueOf(properties.getPrefWidth()));
 	}
 
 	/**

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

@@ -24,7 +24,7 @@ import javafx.util.Pair;
  * Manager for the Toolbox pane.
  * 
  * @author Dominik Renkel
- * @version 0.9
+ * @version 1.1
  *
  */
 public final class ToolboxManager {

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

@@ -40,7 +40,9 @@ public final class KeyboardShortcuts {
 
 	}
 
-	// a general EventHandler for all key combinations
+	/**
+	 * A general Handler for any Button presses.
+	 */
 	private static EventHandler<KeyEvent> buttonsPressed = new EventHandler<KeyEvent>() {
 
 		@Override

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

@@ -1,15 +1,17 @@
 package de.tu_darmstadt.informatik.tk.scopviz.ui.handlers;
 
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
-import de.tu_darmstadt.informatik.tk.scopviz.ui.GUIController;
 import javafx.animation.AnimationTimer;
 
+/**
+ * Handler that is called once every Frame.
+ * 
+ * @author Jan Enders
+ * @version 1.1
+ *
+ */
 public class MyAnimationTimer extends AnimationTimer {
 
-	/**
-	 * Reference to the GUI Controller for access to UI elements.
-	 */
-	private static GUIController guiController;
 	/**
 	 * Starting time to prevent Exceptions.
 	 */
@@ -17,23 +19,11 @@ public class MyAnimationTimer extends AnimationTimer {
 
 	@Override
 	public void handle(long now) {
-
 		if (Main.getInstance().getGraphManager() != null) {
 			Main.getInstance().getGraphManager().pumpIt();
 			Main.getInstance().getGraphManager().correctCoordinates();
 			Main.getInstance().getGraphManager().handleEdgeWeight();
-
 		}
 	}
 
-	/**
-	 * Sets the reference to the GUI Controller.
-	 * 
-	 * @param con
-	 *            the reference to the Controller
-	 */
-	public static void setGUIController(GUIController con) {
-		guiController = con;
-	}
-
 }

+ 9 - 3
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/MyMouseManager.java

@@ -11,12 +11,18 @@ import org.graphstream.ui.view.Camera;
 import org.graphstream.ui.view.util.DefaultMouseManager;
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
-import de.tu_darmstadt.informatik.tk.scopviz.main.AuxilFunctions;
 import de.tu_darmstadt.informatik.tk.scopviz.main.CreationMode;
+import de.tu_darmstadt.informatik.tk.scopviz.main.EdgeSelectionHelper;
 import de.tu_darmstadt.informatik.tk.scopviz.main.GraphManager;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.PropertiesManager;
 
+/**
+ * Mouse Manager to handle all Mouse based Interaction on the Graph Display
+ * 
+ * @author Jan Enders
+ * @version 1.0
+ */
 public class MyMouseManager extends DefaultMouseManager {
 
 	/**
@@ -70,7 +76,7 @@ public class MyMouseManager extends DefaultMouseManager {
 		Graph graph = graphManager.getGraph();
 		Point3 cursorPos = graphManager.getView().getCamera().transformPxToGu(event.getX(), event.getY());
 		Node n;
-		Edge selectedEdge = AuxilFunctions.getClosestEdge(cursorPos);
+		Edge selectedEdge = EdgeSelectionHelper.getClosestEdge(cursorPos);
 
 		switch (Main.getInstance().getCreationMode()) {
 
@@ -327,7 +333,7 @@ public class MyMouseManager extends DefaultMouseManager {
 	 *            the ID of the Node to select
 	 */
 	private void selectNodeForEdgeCreation(String nodeID) {
-		Node n = graphManager.getGraph().getNode(nodeID);		
+		Node n = graphManager.getGraph().getNode(nodeID);
 		String nodeType = n.getAttribute("ui.class");
 		nodeType = nodeType.split("_")[0];
 		n.changeAttribute("ui.style", "fill-mode: image-scaled; fill-image: url('src/main/resources/png/" + nodeType