Pārlūkot izejas kodu

Documented and formatted EVERYTHING. Code Review Report created,
uploaded to Trello.

Jan Enders 8 gadi atpakaļ
vecāks
revīzija
25533261d8
16 mainītis faili ar 467 papildinājumiem un 166 dzēšanām
  1. 6 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/debug/Debug.java
  2. 3 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/AuxilFunctions.java
  3. 69 61
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/GraphManager.java
  4. 26 14
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/Main.java
  5. 4 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/MainApp.java
  6. 36 12
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ButtonManager.java
  7. 62 50
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java
  8. 75 8
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GraphDisplayManager.java
  9. 34 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/KeyValuePair.java
  10. 36 3
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/MenuBarManager.java
  11. 37 7
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/OptionsManager.java
  12. 23 2
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/PropertiesManager.java
  13. 9 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ToolboxManager.java
  14. 17 5
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/KeyboardShortcuts.java
  15. 13 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/MyAnimationTimer.java
  16. 17 2
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/MyViewerListener.java

+ 6 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/debug/Debug.java

@@ -8,9 +8,15 @@ package de.tu_darmstadt.informatik.tk.scopviz.debug;
  *
  */
 public class 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
+	 */
 	public static final boolean DEBUG_ENABLED = true;
 
 	/**
+	 * Returns the Location of the File for the testing Graph.
 	 * 
 	 * @return a sample graph for the Program
 	 */

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

@@ -15,10 +15,12 @@ import org.graphstream.ui.view.Camera;
  *
  */
 public class AuxilFunctions {
+
 	/**
-	 * Width in pixel for which the edge selection triggers
+	 * Width in pixels for which the edge selection triggers
 	 */
 	private static final int EDGE_SELECTION_WIDTH = 5;
+
 	/**
 	 * Precalculates pi / 2
 	 */

+ 69 - 61
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/GraphManager.java

@@ -27,32 +27,42 @@ import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.MyViewerListener;
  *
  */
 public class GraphManager {
-	// The graph of this Visualizer
-	private Graph g;
 
-	// The stylesheet of this Graph - this excludes parts that can be set by
-	// NodeGraphics
-	private String stylesheet;
+	/** The Graph this instance of GraphManager manages. */
+	protected Graph g;
 
-	// last deleted elements for undelete
-	private Node deletedNode;
-	private LinkedList<Edge> deletedEdges = new LinkedList<>();
+	/**
+	 * The Stylesheet for this Graph, excluding parts that can be set by
+	 * NodeGraphics.
+	 */
+	protected String stylesheet;
 
-	// Currently selected Edge or Node at least on of these is always null
-	private String selectedNodeID = null;
-	private String selectedEdgeID = null;
+	/** The last Node that was deleted. */
+	protected Node deletedNode;
+	/** The last Edge that was deleted */
+	protected LinkedList<Edge> deletedEdges = new LinkedList<>();
 
-	// View Panel of the Graph
-	private ViewPanel view;
+	/** The currently selected Node, mutually exclusive with selectedEdgeID. */
+	protected String selectedNodeID = null;
+	/** The currently selected Edge, mutually exclusive with selectedNodeID. */
+	protected String selectedEdgeID = null;
 
-	// The location the graph will be saved to
-	private String currentPath;
+	/** The ViewPanel the Graph is drawn in. */
+	protected ViewPanel view;
 
-	private Viewer viewer;
-	private ViewerPipe fromViewer;
+	/** The Path on Disk the Graph will be saved to. */
+	protected String currentPath;
 
+	/** The Viewer the Graph provides, grants Access to Camera Manipulation */
+	protected Viewer viewer;
 	/**
-	 * Creates a new visualizer for the given graph.
+	 * The Pipe that notifies the underlying Graph of any Changes within the
+	 * graphic Representation.
+	 */
+	protected ViewerPipe fromViewer;
+
+	/**
+	 * Creates a new Manager for the given graph.
 	 * 
 	 * @param graph
 	 *            the graph this visualizer should handle
@@ -162,7 +172,7 @@ public class GraphManager {
 	}
 
 	/**
-	 * returns a View of the Graph. The View is in the Swing Thread and the
+	 * returns a View of the Graph. The View lives in the Swing Thread and the
 	 * Graph in the Main thread.
 	 * 
 	 * 
@@ -181,17 +191,6 @@ public class GraphManager {
 		return selectedNodeID;
 	}
 
-	/**
-	 * Sets the ID for the currently selected node, effectively selecting the
-	 * node with that ID.
-	 * 
-	 * @param selectedNodeID
-	 *            the ID of the node to select
-	 */
-	private void setSelectedNodeID(String selectedNodeID) {
-		this.selectedNodeID = selectedNodeID;
-	}
-
 	/**
 	 * Returns the ID of the currently selected Edge.
 	 * 
@@ -201,17 +200,6 @@ public class GraphManager {
 		return selectedEdgeID;
 	}
 
-	/**
-	 * Sets the ID for the currently selected edge, effectively selecting the
-	 * edge with that ID.
-	 * 
-	 * @param selectedEdgeID
-	 *            the ID of the edge to select
-	 */
-	private void setSelectedEdgeID(String selectedEdgeID) {
-		this.selectedEdgeID = selectedEdgeID;
-	}
-
 	/**
 	 * Selects the Node with the given ID, resets Edge selection.
 	 * 
@@ -229,8 +217,8 @@ public class GraphManager {
 			else if (getSelectedEdgeID() != null)
 				g.getEdge(getSelectedEdgeID()).changeAttribute("ui.style", "fill-color: #000000;");
 
-			setSelectedNodeID(nodeID);
-			setSelectedEdgeID(null);
+			this.selectedNodeID = nodeID;
+			this.selectedEdgeID = null;
 
 			// set selected node color to red
 			g.getNode(nodeID).changeAttribute("ui.style", "fill-color: #FF0000; size: 15px;");
@@ -253,8 +241,8 @@ public class GraphManager {
 			else if (getSelectedNodeID() != null)
 				g.getNode(getSelectedNodeID()).changeAttribute("ui.style", "fill-color: #000000; size: 10px;");
 
-			setSelectedNodeID(null);
-			setSelectedEdgeID(edgeID);
+			this.selectedNodeID = null;
+			this.selectedEdgeID = edgeID;
 
 			// set selected edge color to red
 			g.getEdge(getSelectedEdgeID()).changeAttribute("ui.style", "fill-color: #FF0000;");
@@ -264,8 +252,16 @@ public class GraphManager {
 	/**
 	 * Deselect any currently selected nodes or edges.
 	 */
-	// TODO remove selection style & call this before save
+	// TODO call this before save
 	public void deselect() {
+		// Set last selected Edge Color to Black
+		if (getSelectedEdgeID() != null)
+			g.getEdge(getSelectedEdgeID()).changeAttribute("ui.style", "fill-color: #000000;");
+
+		// Set last selected Node color to black
+		else if (getSelectedNodeID() != null)
+			g.getNode(getSelectedNodeID()).changeAttribute("ui.style", "fill-color: #000000; size: 10px;");
+
 		this.selectedNodeID = null;
 		this.selectedEdgeID = null;
 	}
@@ -305,10 +301,10 @@ public class GraphManager {
 		view.getCamera().setViewPercent(view.getCamera().getViewPercent() * (1 + amount));
 	}
 
-	public ViewerPipe getFromViewer() {
-		return fromViewer;
-	}
-
+	/**
+	 * Pumps the Pipe from the graphical Representation to the underlying Graph,
+	 * propagating all Changes made.
+	 */
 	public void pumpIt() {
 		fromViewer.pump();
 	}
@@ -319,15 +315,19 @@ public class GraphManager {
 	}
 
 	/**
-	 * @return the currentPath
+	 * Returns the current Save Path on Disk for the Graph.
+	 * 
+	 * @return the current Path
 	 */
 	public String getCurrentPath() {
 		return currentPath;
 	}
 
 	/**
+	 * Sets the Save Path.
+	 * 
 	 * @param currentPath
-	 *            the currentPath to set
+	 *            the new Path to set
 	 */
 	public void setCurrentPath(String currentPath) {
 		this.currentPath = currentPath;
@@ -368,8 +368,9 @@ public class GraphManager {
 	}
 
 	/**
+	 * Returns the smallest X Coordinate of any Node in the Graph.
 	 * 
-	 * @return the minimum X-Coordinate in the Graph
+	 * @return the smallest X Coordinate in the Graph
 	 */
 	public double getMinX() {
 		double currentMin = Double.MAX_VALUE;
@@ -388,8 +389,9 @@ public class GraphManager {
 	}
 
 	/**
+	 * Returns the biggest X Coordinate of any Node in the Graph.
 	 * 
-	 * @return the maximum X-Coordinate in the Graph
+	 * @return the biggest X Coordinate in the Graph
 	 */
 	public double getMaxX() {
 		double currentMax = Double.MAX_VALUE;
@@ -408,8 +410,9 @@ public class GraphManager {
 	}
 
 	/**
+	 * Returns the smallest Y Coordinate of any Node in the Graph.
 	 * 
-	 * @return the minimum Y-Coordinate in the Graph
+	 * @return the smallest Y Coordinate in the Graph
 	 */
 	public double getMinY() {
 		double currentMin = Double.MAX_VALUE;
@@ -428,8 +431,9 @@ public class GraphManager {
 	}
 
 	/**
+	 * Returns the biggest Y Coordinate of any Node in the Graph.
 	 * 
-	 * @return the maximum Y-Coordinate in the Graph
+	 * @return the biggest Y Coordinate in the Graph
 	 */
 	public double getMaxY() {
 		double currentMax = Double.MAX_VALUE;
@@ -448,7 +452,7 @@ public class GraphManager {
 	}
 
 	/**
-	 * Converts the coordinates of the Nodes to a saveable and uniform way
+	 * Converts the Coordinates of all Nodes into a saveable and uniform Format.
 	 */
 	public void correctCoordinates() {
 		Point3 coords;
@@ -467,8 +471,8 @@ public class GraphManager {
 	}
 
 	/**
-	 * converts the weight property into a label to display on the Graph removes
-	 * all labels if that option is set
+	 * Converts the weight property into a label to display on the Graph.
+	 * Removes all labels if that option is set
 	 */
 	public void handleEdgeWeight() {
 		Edge e = null;
@@ -488,15 +492,19 @@ public class GraphManager {
 	}
 
 	/**
-	 * @return the stylesheet
+	 * Returns the Stylesheet used by the Graph.
+	 * 
+	 * @return the Stylesheet in use
 	 */
 	public String getStylesheet() {
 		return stylesheet;
 	}
 
 	/**
+	 * Sets the Stylesheet to be used by the Graph.
+	 * 
 	 * @param stylesheet
-	 *            the stylesheet to set
+	 *            the new stylesheet to use
 	 */
 	public void setStylesheet(String stylesheet) {
 		this.stylesheet = stylesheet;

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

@@ -29,14 +29,14 @@ public final class Main {
 	private SelectionMode selectionMode = SelectionMode.SELECT_NODES;
 
 	/**
-	 * the root window of the application
+	 * The root window of the application
 	 */
 	private Stage primaryStage;
 
 	/**
 	 * Private constructor to prevent initialization, facilitates Singleton
-	 * pattern. Loads a Graph from a GraphML file and creates a visualizer to
-	 * manage it
+	 * pattern. Initializes an AnimationTimer to call all Functionality that
+	 * needs to be executed every Frame.
 	 */
 	private Main() {
 		AnimationTimer alwaysPump = new MyAnimationTimer();
@@ -64,7 +64,7 @@ public final class Main {
 	}
 
 	/**
-	 * Returns a reference to the visualizer object used by the app.
+	 * Returns a reference to the GraphManager object currently used by the app.
 	 * 
 	 * @return the visualizer in use
 	 */
@@ -73,7 +73,7 @@ public final class Main {
 	}
 
 	/**
-	 * Returns a unique id for a new node not yet used by the graph.
+	 * Returns a unique id for a new Node or Edge not yet used by the graph.
 	 * 
 	 * @return a new unused id as a String
 	 */
@@ -91,48 +91,60 @@ public final class Main {
 	}
 
 	/**
-	 * @return the primaryStage
+	 * Returns the primary Stage for the Application Window.
+	 * 
+	 * @return the primary Stage
 	 */
 	public Stage getPrimaryStage() {
 		return primaryStage;
 	}
 
 	/**
+	 * Sets the Reference to the primary Stage of the Application Window.
+	 * 
 	 * @param primaryStage
-	 *            the primaryStage to set
+	 *            the primary Stage of the Window.
 	 */
 	public void setPrimaryStage(Stage primaryStage) {
 		this.primaryStage = primaryStage;
 	}
 
 	/**
-	 * @return the createModus
+	 * Returns the current Creation Mode.
+	 * 
+	 * @return the current creationMode
 	 */
 	public CreationMode getCreationMode() {
 		return creationMode;
 	}
 
 	/**
+	 * Switches the App to a given Creation Mode.
+	 * 
 	 * @param creationMode
-	 *            the createModus to set
+	 *            the creationMode to switch to
 	 */
 	public void setCreationMode(CreationMode creationMode) {
 		this.creationMode = creationMode;
 	}
 
 	/**
-	 * @return the selectModus
+	 * Returns the current Selection Mode.
+	 * 
+	 * @return the current selectionMode
 	 */
 	public SelectionMode getSelectionMode() {
 		return selectionMode;
 	}
 
 	/**
-	 * @param selectModus
-	 *            the selectModus to set
+	 * Switches the App to a given Selection Mode.
+	 * 
+	 * @param selectionMode
+	 *            the selectionMode to switch to
 	 */
-	public void setSelectionMode(SelectionMode selectModus) {
-		this.selectionMode = selectModus;
+	public void setSelectionMode(SelectionMode selectionMode) {
+		this.selectionMode = selectionMode;
 	}
 
 }

+ 4 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/MainApp.java

@@ -28,6 +28,7 @@ public class MainApp extends Application {
 	 * Primary Stage for the UI Scene.
 	 */
 	private Stage primaryStage;
+
 	/**
 	 * Root Object of the Scene Graph.
 	 */
@@ -55,6 +56,9 @@ public class MainApp extends Application {
 
 	/**
 	 * Starts the Application by initializing the UI Layout.
+	 * 
+	 * @param stage
+	 *            the Stage of the Application Window
 	 */
 	@Override
 	public void start(final Stage stage) {

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

@@ -26,20 +26,28 @@ import javafx.scene.input.MouseEvent;
  * @version 1.0
  *
  */
-public class ButtonManager {
+public final class ButtonManager {
 
-	/**
-	 * Create more then one Edge at a time mode
-	 */
+	/** Flag for creating more then one Edge at a time mode */
 	public static final Boolean CREATE_MORE_THEN_ONE = true;
 
-	// Test
-	private static GUIController guiController;
-	private static ArrayList<Button> list;
+	/** List of the Buttons for Layer switching */
+	private static ArrayList<Button> layerButtons;
+
+	/**
+	 * Private Constructor to prevent Instantiation.
+	 */
+	private ButtonManager() {
+	}
 
-	public static void setGuiController(GUIController guiController, ArrayList<Button> nList) {
-		ButtonManager.guiController = guiController;
-		list = nList;
+	/**
+	 * Initializes the ButtonManager with a List of Buttons for Layer switching.
+	 * 
+	 * @param nList
+	 *            the Layer switching Buttons
+	 */
+	public static void initialize(ArrayList<Button> nList) {
+		layerButtons = nList;
 	}
 
 	/**
@@ -63,7 +71,6 @@ public class ButtonManager {
 	/**
 	 * Handler for clicks on the graph viewer.
 	 */
-
 	public static final EventHandler<MouseEvent> clickedHandler = new EventHandler<MouseEvent>() {
 
 		/**
@@ -80,6 +87,9 @@ public class ButtonManager {
 			Point3 cursorPos = graphManager.getView().getCamera().transformPxToGu(event.getX(), event.getY());
 			Node n;
 			Edge selectedEdge = AuxilFunctions.getClosestEdge(cursorPos);
+
+			// If not trying to create any Nodes or Edges, select the Edges that
+			// was clicked on
 			if (Main.getInstance().getCreationMode().equals(CreationMode.CREATE_NONE)
 					&& Main.getInstance().getSelectionMode() == SelectionMode.SELECT_EDGES && selectedEdge != null) {
 				Main.getInstance().getGraphManager().selectEdge(selectedEdge.getId());
@@ -124,6 +134,8 @@ public class ButtonManager {
 				break;
 			}
 
+			// update the properties window to show the attributes of the newly
+			// created Node or selected Edge
 			PropertiesManager.setItemsProperties();
 
 			if (!CREATE_MORE_THEN_ONE) {
@@ -132,6 +144,9 @@ public class ButtonManager {
 		}
 	};
 
+	/**
+	 * Handler for the Underlay Layer switch Button.
+	 */
 	public static final EventHandler<ActionEvent> underlayHandler = new EventHandler<ActionEvent>() {
 
 		@Override
@@ -144,6 +159,9 @@ public class ButtonManager {
 
 	};
 
+	/**
+	 * Handler for the Operator Layer switch Button.
+	 */
 	public static final EventHandler<ActionEvent> operatorHandler = new EventHandler<ActionEvent>() {
 
 		@Override
@@ -156,6 +174,9 @@ public class ButtonManager {
 
 	};
 
+	/**
+	 * Handler for the Mapping Layer switch Button.
+	 */
 	public static final EventHandler<ActionEvent> mappingHandler = new EventHandler<ActionEvent>() {
 
 		@Override
@@ -168,6 +189,9 @@ public class ButtonManager {
 
 	};
 
+	/**
+	 * Handler for the Symbol Representation Layer switch Button.
+	 */
 	public static final EventHandler<ActionEvent> symbolRepHandler = new EventHandler<ActionEvent>() {
 
 		@Override
@@ -188,7 +212,7 @@ public class ButtonManager {
 	 */
 	private static void setBorderStyle(Button currentButton) {
 
-		for (Button j : list) {
+		for (Button j : layerButtons) {
 			if (j.equals(currentButton)) {
 				j.setStyle(
 						"-fx-background-color: red, red, red, -fx-faint-focus-color, -fx-body-color; -fx-background-insets: -0.2, 1, 2, -1.4, 2.6; -fx-background-radius: 3, 2, 1, 4, 1;");

+ 62 - 50
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java

@@ -125,45 +125,9 @@ public class GUIController implements Initializable {
 	@Override
 	public void initialize(URL arg0, ResourceBundle arg1) {
 		// Assert the correct injection of all references from FXML
-		assert swingNode != null : "fx:id=\"swingNode\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert pane != null : "fx:id=\"pane\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-
-		assert zoomIn != null : "fx:id=\"zoomIn\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert zoomOut != null : "fx:id=\"zoomOut\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-
-		assert underlayButton != null : "fx:id=\"underlayButton\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert operatorButton != null : "fx:id=\"operatorButton\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert mappingButton != null : "fx:id=\"mappingButton\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert symbolRepButton != null : "fx:id=\"symbolRepButton\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-
-		assert newItem != null : "fx:id=\"newItem\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert open != null : "fx:id=\"open\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert add != null : "fx:id=\"add\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert save != null : "fx:id=\"save\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert saveAs != null : "fx:id=\"saveAs\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert preferences != null : "fx:id=\"preferences\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert quit != null : "fx:id=\"quit\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert delete != null : "fx:id=\"delete\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert undelete != null : "fx:id=\"undelete\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert selectMode != null : "fx:id=\"selectMode\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert about != null : "fx:id=\"about\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-
-		assert layerListView != null : "fx:id=\"layerListView\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-
-		assert toolbox != null : "fx:id=\"toolbox\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert properties != null : "fx:id=\"properties\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert metricListView != null : "fx:id=\"metricListView\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-
-		assert toolboxStringColumn != null : "fx:id=\"toolboxString\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert toolboxObjectColumn != null : "fx:id=\"toolboxObject\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-
-		assert propertiesStringColumn != null : "fx:id=\"propertiesString\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert propertiesObjectColumn != null : "fx:id=\"propertiesObject\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-
-		assert createModusText != null : "fx:id=\"createModusText\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert selectModusText != null : "fx:id=\"selectModusText\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert actualLayerText != null : "fx:id=\"actualLayerText\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assertFXMLInjections();
 
+		// Give the AnimationTimer access to UI elements
 		MyAnimationTimer.setGUIController(this);
 
 		initializeToolbox();
@@ -173,23 +137,28 @@ public class GUIController implements Initializable {
 		removeHeaderTableView(toolbox);
 		removeHeaderTableView(properties);
 
-		// Initialize the Managers for the various managers for UI elements
+		// Initialize the Managers for the various for UI elements
 		ToolboxManager.initializeItems(toolbox);
 		PropertiesManager.initializeItems(properties);
 		GraphDisplayManager.setGuiController(this);
 
 		// Bind all the handlers to their corresponding UI elements
 		initializeZoomButtons();
-		initializeCreateButtons();
 		initializeLayerButton();
 		initializeDisplayPane();
 		initializeMenuBar();
 
+		// Initialize the Text Labels for displaying the current state of the
+		// Application
 		initializeTextFields();
 
-		new KeyboardShortcuts(Main.getInstance().getPrimaryStage());
+		// Setup the Keyboard Shortcuts
+		KeyboardShortcuts.initialize(Main.getInstance().getPrimaryStage());
 	}
 
+	/**
+	 * Initializes the Menu Bar with all its contents.
+	 */
 	private void initializeMenuBar() {
 		MenuBarManager.setGUIController(this);
 
@@ -216,12 +185,8 @@ public class GUIController implements Initializable {
 	}
 
 	/**
-	 * Sets the Handlers for the create node and create edge buttons.
+	 * Set the Handlers for the Layer switch Buttons.
 	 */
-	private void initializeCreateButtons() {
-		swingNode.setOnMouseClicked(ButtonManager.clickedHandler);
-	}
-
 	private void initializeLayerButton() {
 		underlayButton.setOnAction(ButtonManager.underlayHandler);
 		operatorButton.setOnAction(ButtonManager.operatorHandler);
@@ -233,7 +198,7 @@ public class GUIController implements Initializable {
 		layerButtons.add(operatorButton);
 		layerButtons.add(mappingButton);
 		layerButtons.add(symbolRepButton);
-		ButtonManager.setGuiController(this, layerButtons);
+		ButtonManager.initialize(layerButtons);
 	}
 
 	/**
@@ -244,6 +209,7 @@ public class GUIController implements Initializable {
 		pane.widthProperty().addListener(new ResizeListener(swingNode, pane));
 		pane.setOnScroll(GraphDisplayManager.scrollHandler);
 		swingNode.setContent((JPanel) Main.getInstance().getGraphManager().getView());
+		swingNode.setOnMouseClicked(ButtonManager.clickedHandler);
 		swingNode.setOnMousePressed(GraphDisplayManager.rememberLastClickedPosHandler);
 		swingNode.setOnMouseDragged(GraphDisplayManager.mouseDraggedHandler);
 
@@ -251,7 +217,7 @@ public class GUIController implements Initializable {
 	}
 
 	/**
-	 * 
+	 * Initialize the Toolbox.
 	 */
 	private void initializeToolbox() {
 
@@ -285,11 +251,10 @@ public class GUIController implements Initializable {
 	}
 
 	/**
-	 * 
+	 * Initialize the Properties Window.
 	 */
 	private void initializeProperties() {
 
-		// removeHeaderTableView(properties);
 		propertiesObjectColumn.setResizable(true);
 		propertiesStringColumn.setResizable(true);
 
@@ -308,6 +273,9 @@ public class GUIController implements Initializable {
 
 	}
 
+	/**
+	 * Initialize the Text Labels for displaying the State of the Application.
+	 */
 	private void initializeTextFields() {
 		createModusText.setText(Main.getInstance().getCreationMode().toString());
 		selectModusText.setText(Main.getInstance().getSelectionMode().toString());
@@ -335,4 +303,48 @@ public class GUIController implements Initializable {
 			}
 		});
 	}
+
+	/**
+	 * Asserts the correct Injection of all Elements from the FXML File.
+	 */
+	private void assertFXMLInjections() {
+		assert swingNode != null : "fx:id=\"swingNode\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert pane != null : "fx:id=\"pane\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+
+		assert zoomIn != null : "fx:id=\"zoomIn\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert zoomOut != null : "fx:id=\"zoomOut\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+
+		assert underlayButton != null : "fx:id=\"underlayButton\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert operatorButton != null : "fx:id=\"operatorButton\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert mappingButton != null : "fx:id=\"mappingButton\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert symbolRepButton != null : "fx:id=\"symbolRepButton\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+
+		assert newItem != null : "fx:id=\"newItem\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert open != null : "fx:id=\"open\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert add != null : "fx:id=\"add\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert save != null : "fx:id=\"save\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert saveAs != null : "fx:id=\"saveAs\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert preferences != null : "fx:id=\"preferences\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert quit != null : "fx:id=\"quit\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert delete != null : "fx:id=\"delete\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert undelete != null : "fx:id=\"undelete\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert selectMode != null : "fx:id=\"selectMode\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert about != null : "fx:id=\"about\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+
+		assert layerListView != null : "fx:id=\"layerListView\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+
+		assert toolbox != null : "fx:id=\"toolbox\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert properties != null : "fx:id=\"properties\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert metricListView != null : "fx:id=\"metricListView\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+
+		assert toolboxStringColumn != null : "fx:id=\"toolboxString\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert toolboxObjectColumn != null : "fx:id=\"toolboxObject\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+
+		assert propertiesStringColumn != null : "fx:id=\"propertiesString\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert propertiesObjectColumn != null : "fx:id=\"propertiesObject\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+
+		assert createModusText != null : "fx:id=\"createModusText\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert selectModusText != null : "fx:id=\"selectModusText\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert actualLayerText != null : "fx:id=\"actualLayerText\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+	}
 }

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

@@ -24,28 +24,60 @@ import javafx.scene.layout.Pane;
 import javafx.stage.Stage;
 
 /**
- * This class holds all Visualizers, provides Functions to add Graphs and get
- * corresponding Visualizers.
+ * This class holds all GraphManagers, provides Functions to add Graphs and get
+ * corresponding GraphManagers.
  * 
  * @author Matthias Wilhelm
  * @version 1.0
  *
  */
-public class GraphDisplayManager {
+public final class GraphDisplayManager {
+
+	/** Prefix to add to the Name of the Graphs. */
 	private static final String GRAPH_STRING_ID_PREFIX = "graph";
 
+	/**
+	 * Last saved Mouse Position from the Time of the last Mouse Button Press.
+	 */
 	private static Point3 oldMousePos;
+	/**
+	 * Last saved Camera view Center from the time of the last Mouse Button
+	 * Press.
+	 */
 	private static Point3 oldViewCenter;
 
+	/** 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.
+	 */
 	private final static GraphManager emptyLayer = new GraphManager(new SingleGraph("g"));
 
+	/** Importer for loading Graphs from Disk */
 	private static GraphMLImporter importer = new GraphMLImporter();
 
+	/**
+	 * Private Constructor to prevent initialization.
+	 */
+	private GraphDisplayManager() {
+	}
+
+	/**
+	 * Sets the Reference to the GUI Controller to use for accessing UI
+	 * Elements.
+	 * 
+	 * @param guiController
+	 *            a Reference to the GUI Controller
+	 */
 	public static void setGuiController(GUIController guiController) {
 		GraphDisplayManager.guiController = guiController;
 	}
@@ -145,13 +177,16 @@ public class GraphDisplayManager {
 			// return theIdOfTheMergedGraph;
 		}
 
-		// show the graph
+		// display the graph
 		vList.add(v);
 		switchActiveGraph();
 		OptionsManager.adjustNodeGraphics(OptionsManager.getAllNodeGraphics()[0]);
 		return ret;
 	}
 
+	/**
+	 * Removes all GraphManagers from the current Layer.
+	 */
 	private static void removeAllCurrentGraphs() {
 		// TODO weird multithread behavior
 		for (int i = 0; i < vList.size(); i++) {
@@ -163,17 +198,23 @@ public class GraphDisplayManager {
 		}
 	}
 
+	/**
+	 * Returns a Graph Id to have a name for Graphs.
+	 * 
+	 * @param id
+	 *            the number of the Graph
+	 * @return the new String ID
+	 */
 	private static String getGraphStringID(int id) {
 		return GRAPH_STRING_ID_PREFIX + id;
 	}
 
 	/**
-	 * Switches the active Graph to the give id.
+	 * Switches the active Graph to the one with the given id.
 	 * 
 	 * @param id
-	 *            of the graph which to switch to
+	 *            the id of the graph to switch to
 	 */
-
 	public static void switchActiveGraph() {
 		Pane pane = guiController.pane;
 		Main.getInstance().getGraphManager().getView()
@@ -184,7 +225,7 @@ public class GraphDisplayManager {
 	}
 
 	/**
-	 * get the current Visualizer. To get change it call
+	 * Returns a reference to the current Visualizer. To change it call
 	 * {@link #switchActiveGraph(int)}
 	 * 
 	 * @return the current Visualizer
@@ -194,6 +235,12 @@ public class GraphDisplayManager {
 		return vList.get(currentGraphManager);
 	}
 
+	/**
+	 * Returns the GraphManager for the current Layer.
+	 * 
+	 * @return the GraphManager for the current Layer, or an empty GraphManager
+	 *         if none is found
+	 */
 	public static GraphManager getGraphManager() {
 		for (GraphManager man : vList) {
 			if (man.getGraph().getAttribute("layer").equals(currentLayer)) {
@@ -203,14 +250,28 @@ public class GraphDisplayManager {
 		return emptyLayer;
 	}
 
+	/**
+	 * Returns the currently active Layer.
+	 * 
+	 * @return the currently active Layer.
+	 */
 	public static Layer getCurrentLayer() {
 		return currentLayer;
 	}
 
+	/**
+	 * Sets the active Layer to a given one.
+	 * 
+	 * @param currentLayer
+	 *            the layer to switch to
+	 */
 	public static void setCurrentLayer(Layer currentLayer) {
 		GraphDisplayManager.currentLayer = currentLayer;
 	}
 
+	/**
+	 * Handler for Scrolling while the Mouse is over the Graph Display Window.
+	 */
 	public static final EventHandler<ScrollEvent> scrollHandler = new EventHandler<ScrollEvent>() {
 
 		@Override
@@ -221,6 +282,8 @@ public class GraphDisplayManager {
 
 	};
 
+	// TODO: Fix Mouse Camera control
+	/** Handler for remembering the Mouse Position on Mouse Button Press */
 	public static final EventHandler<MouseEvent> rememberLastClickedPosHandler = new EventHandler<MouseEvent>() {
 
 		@Override
@@ -232,6 +295,10 @@ public class GraphDisplayManager {
 		}
 	};
 
+	/**
+	 * Handler for panning the Camera on Mouse Movement with pressed Mouse
+	 * Button
+	 */
 	public static final EventHandler<MouseEvent> mouseDraggedHandler = new EventHandler<MouseEvent>() {
 
 		@Override

+ 34 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/KeyValuePair.java

@@ -10,33 +10,67 @@ import javafx.beans.property.SimpleStringProperty;
  */
 public class KeyValuePair {
 
+	/** The Key. */
 	private final SimpleStringProperty key;
+	/** The Value */
 	private final SimpleStringProperty value;
 
+	/** The Class type. */
 	private final Object classType;
 
+	/**
+	 * Creates a new KeyValuePair from a given Key and Value with a given Class
+	 * Type
+	 */
 	public KeyValuePair(String key, String value, Object classType) {
 		this.key = new SimpleStringProperty(key);
 		this.value = new SimpleStringProperty(value);
 		this.classType = classType;
 	}
 
+	/**
+	 * Returns the Key.
+	 * 
+	 * @return the Key.
+	 */
 	public String getKey() {
 		return key.get();
 	}
 
+	/**
+	 * Sets the Key.
+	 * 
+	 * @param fName
+	 *            the new Key to set
+	 */
 	public void setKey(String fName) {
 		key.set(fName);
 	}
 
+	/**
+	 * Returns the Value.
+	 * 
+	 * @return the Value
+	 */
 	public String getValue() {
 		return value.get();
 	}
 
+	/**
+	 * Sets the Value.
+	 * 
+	 * @param fName
+	 *            the new Value to set
+	 */
 	public void setValue(String fName) {
 		value.set(fName);
 	}
 
+	/**
+	 * Returns the Class Type.
+	 * 
+	 * @return the Class Type
+	 */
 	public Object getClassType() {
 		return classType;
 	}

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

@@ -13,10 +13,24 @@ import javafx.scene.control.Label;
 import javafx.scene.control.MenuItem;
 import javafx.scene.layout.Region;
 
-public class MenuBarManager {
-
+/**
+ * Manager Class for the Menu Bar.
+ * 
+ * @author Jascha Bohne
+ * @version 1.0
+ *
+ */
+public final class MenuBarManager {
+
+	/** Reference to the GUI Controller. */
 	private static GUIController controller;
 
+	/**
+	 * Private Constructor to prevent Instantiation.
+	 */
+	private MenuBarManager() {
+	}
+
 	/**
 	 * Handler for the "new" MenuItem.
 	 */
@@ -34,6 +48,7 @@ public class MenuBarManager {
 		}
 	};
 
+	// TODO: Make Open and Add two different things
 	/**
 	 * Handler for the "open" MenuItem.
 	 */
@@ -90,6 +105,9 @@ public class MenuBarManager {
 		}
 	};
 
+	/**
+	 * 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();
@@ -97,6 +115,9 @@ public class MenuBarManager {
 		}
 	};
 
+	/**
+	 * Handler for the "quit" button.
+	 */
 	public static final EventHandler<ActionEvent> quitHandler = new EventHandler<ActionEvent>() {
 		public void handle(ActionEvent evt) {
 			System.exit(0);
@@ -104,7 +125,7 @@ public class MenuBarManager {
 	};
 
 	/**
-	 * Handler for the "save" button.
+	 * Handler for the "delete" button.
 	 */
 	public static final EventHandler<ActionEvent> deleteHandler = new EventHandler<ActionEvent>() {
 
@@ -126,12 +147,18 @@ public class MenuBarManager {
 		}
 	};
 
+	/**
+	 * Handler for the "undelete" button.
+	 */
 	public static final EventHandler<ActionEvent> undeleteHandler = new EventHandler<ActionEvent>() {
 		public void handle(ActionEvent evt) {
 			Main.getInstance().getGraphManager().undelete();
 		}
 	};
 
+	/**
+	 * Handler for the "change select mode" button.
+	 */
 	public static final EventHandler<ActionEvent> selectModeHandler = new EventHandler<ActionEvent>() {
 		public void handle(ActionEvent evt) {
 			MenuItem src = (MenuItem) evt.getSource();
@@ -202,6 +229,12 @@ public class MenuBarManager {
 		}
 	};
 
+	/**
+	 * Sets the Reference to the GUI Controller for Access to UI Elements.
+	 * 
+	 * @param con
+	 *            the GUI Controller to use.
+	 */
 	public static void setGUIController(GUIController con) {
 		controller = con;
 	}

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

@@ -23,7 +23,7 @@ import javafx.scene.layout.GridPane;
  * @author jascha-b
  * @version 1.0.0.0
  */
-public class OptionsManager {
+public final class OptionsManager {
 	/**
 	 * all available graphic styles
 	 */
@@ -47,11 +47,20 @@ public class OptionsManager {
 			+ "node.procEn{fill-mode: image-scaled; fill-image: url('src/main/resources/png/enProc.png'); }"
 			+ "node.sink{fill-mode: image-scaled; fill-image: url('src/main/resources/png/sink.png'); }";
 
-	// settings
+	// SETTINGS
+	/** The Default Weight for all new Edges. */
 	private static int defaultWeight = 0;
+	/** Flag whether to show the weight labels on Edges. */
 	private static boolean showWeight = true;
+	/** The currently active Stylesheet. */
 	private static String nodeGraphics = null;
 
+	/**
+	 * Private Constructor to prevent Instantiation.
+	 */
+	private OptionsManager() {
+	}
+
 	/**
 	 * opens a dialog that can be used to edit options
 	 */
@@ -109,10 +118,17 @@ public class OptionsManager {
 
 		});
 
+		// TODO: Is this line necessary?
 		Optional<ArrayList<String>> result = addPropDialog.showAndWait();
 
 	}
 
+	/**
+	 * Changes the Stylesheet and updates all Nodes to use it.
+	 * 
+	 * @param newGraphics
+	 *            the new Stylesheet to use
+	 */
 	public static void adjustNodeGraphics(String newGraphics) {
 		if (!newGraphics.equalsIgnoreCase(nodeGraphics)) {
 			nodeGraphics = newGraphics;
@@ -131,20 +147,26 @@ public class OptionsManager {
 	}
 
 	/**
-	 * @return the allNodeGraphics
+	 * Returns all available Stylesheets as Strings.
+	 * 
+	 * @return all the StyleSheets
 	 */
 	public static String[] getAllNodeGraphics() {
 		return allNodeGraphics;
 	}
 
 	/**
-	 * @return the defaultWeight
+	 * Returns the default weight for new Edges.
+	 * 
+	 * @return the default weight
 	 */
 	public static int getDefaultWeight() {
 		return defaultWeight;
 	}
 
 	/**
+	 * Sets the default weight for new Edges.
+	 * 
 	 * @param defaultWeight
 	 *            the defaultWeight to set
 	 */
@@ -153,13 +175,17 @@ public class OptionsManager {
 	}
 
 	/**
-	 * @return the showWeight
+	 * Returns whether Edge weight should be displayed as labels.
+	 * 
+	 * @return true if weight should be shown, false otherwise
 	 */
 	public static boolean isWeightShown() {
 		return showWeight;
 	}
 
 	/**
+	 * Sets the Flag whether Edge weight should be displayed as labels.
+	 * 
 	 * @param showWeight
 	 *            the showWeight to set
 	 */
@@ -168,15 +194,19 @@ public class OptionsManager {
 	}
 
 	/**
-	 * @return the nodeGraphics
+	 * Returns the currently active StyleSheet.
+	 * 
+	 * @return the currently active StyleSheet as a String
 	 */
 	public static String getNodeGraphics() {
 		return nodeGraphics;
 	}
 
 	/**
+	 * Sets the current Stylesheet.
+	 * 
 	 * @param nodeGraphics
-	 *            the nodeGraphics to set
+	 *            the Stylesheet to use
 	 */
 	public static void setNodeGraphics(String nodeGraphics) {
 		OptionsManager.nodeGraphics = nodeGraphics;

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

@@ -39,17 +39,31 @@ import javafx.util.Callback;
  * @version 1.0
  *
  */
-public class PropertiesManager {
+public final class PropertiesManager {
 
+	/** Regex for detecting whether a String represent an Integer. */
 	public static final String IS_INT = "^(-)?\\d+$";
+	/** Regex for detecting whether a String represents a Boolean. */
 	public static final String IS_BOOL = "^true$|^false$";
+	/**
+	 * Regex for detecting whether a String represents a floating point number.
+	 */
 	public static final String IS_FLOAT = "^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$";
 
+	/** The Table of Attributes. */
 	private static TableView<KeyValuePair> properties;
 
+	/** Flag whether the name has been set. */
 	public static boolean nameSet;
+	/** Flag whether the value has been set. */
 	public static boolean valueSet;
 
+	/**
+	 * Private Constructor to prevent Instantiation.
+	 */
+	private PropertiesManager() {
+	}
+
 	/**
 	 * Initializes the Manager by adding the List of properties to display into
 	 * the properties pane.
@@ -89,6 +103,7 @@ public class PropertiesManager {
 
 			Element selected = getSelected();
 
+			// Type-Check the input
 			if (classType.equals(Integer.class) && newValue.matches(IS_INT)) {
 				selected.changeAttribute(key, Integer.valueOf(newValue));
 				editedPair.setValue(newValue);
@@ -126,6 +141,9 @@ public class PropertiesManager {
 		}
 	};
 
+	/**
+	 * Callback to be executed when a right click occurs on the table.
+	 */
 	public static Callback<TableView<KeyValuePair>, TableRow<KeyValuePair>> rightClickCallback = new Callback<TableView<KeyValuePair>, TableRow<KeyValuePair>>() {
 		@Override
 		public TableRow<KeyValuePair> call(TableView<KeyValuePair> tableView) {
@@ -167,6 +185,7 @@ public class PropertiesManager {
 	 */
 	public static void setItemsProperties() {
 
+		// TODO: eliminate need for separate handling of nodes and edges
 		String nid = Main.getInstance().getGraphManager().getSelectedNodeID();
 		String eid = Main.getInstance().getGraphManager().getSelectedEdgeID();
 
@@ -197,6 +216,8 @@ public class PropertiesManager {
 		ObservableList<KeyValuePair> newData = FXCollections.observableArrayList();
 		for (String key : selected.getAttributeKeySet()) {
 			switch (key) {
+			// filter out or change attributes added by graphstream that are of
+			// no use to the user
 			case "ui.label":
 				if (selected instanceof Node) {
 					Object actualAttribute = selected.getAttribute(key);
@@ -233,7 +254,7 @@ public class PropertiesManager {
 	}
 
 	/**
-	 * Get the selceted node or edge
+	 * Get the selected node or edge from the GraphManager.
 	 * 
 	 * @return selected node or egde
 	 */

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

@@ -27,13 +27,19 @@ import javafx.util.Pair;
  * @version 0.9
  *
  */
-public class ToolboxManager {
+public final class ToolboxManager {
 
 	/**
 	 * GUIController reference
 	 */
 	private static GUIController controller;
 
+	/**
+	 * private constructor to prevent Instantiation.
+	 */
+	private ToolboxManager() {
+	}
+
 	/**
 	 * Initialize Toolbox, set controller
 	 * 
@@ -136,6 +142,8 @@ public class ToolboxManager {
 
 	};
 
+	// TODO: Create Documentation for this, together with Dominik, ich versteh
+	// das zeug hier net.
 	private static Pair<Object, String> pair(Object picture, String name) {
 		return new Pair<>(picture, name);
 	}

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

@@ -15,21 +15,33 @@ import javafx.stage.Stage;
  * @version 1.0
  *
  */
-public class KeyboardShortcuts {
+public final class KeyboardShortcuts {
 
 	// example of keycombinations
-	final KeyCombination rCtrl = new KeyCodeCombination(KeyCode.R, KeyCombination.CONTROL_DOWN);
-	final KeyCombination rCtrlShift = new KeyCodeCombination(KeyCode.R, KeyCombination.CONTROL_DOWN,
+	final static KeyCombination rCtrl = new KeyCodeCombination(KeyCode.R, KeyCombination.CONTROL_DOWN);
+	final static KeyCombination rCtrlShift = new KeyCodeCombination(KeyCode.R, KeyCombination.CONTROL_DOWN,
 			KeyCombination.SHIFT_DOWN);
 
-	public KeyboardShortcuts(Stage primaryStage) {
+	/**
+	 * Private constructor to prevent Instantiation.
+	 */
+	private KeyboardShortcuts() {
+	}
+
+	/**
+	 * Initialize the Keyboard Shortcuts, add them to the Stage.
+	 * 
+	 * @param primaryStage
+	 *            the Stage
+	 */
+	public static void initialize(Stage primaryStage) {
 
 		primaryStage.addEventFilter(KeyEvent.KEY_RELEASED, buttonsPressed);
 
 	}
 
 	// a general EventHandler for all key combinations
-	private EventHandler<KeyEvent> buttonsPressed = new EventHandler<KeyEvent>() {
+	private static EventHandler<KeyEvent> buttonsPressed = new EventHandler<KeyEvent>() {
 
 		@Override
 		public void handle(KeyEvent event) {

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

@@ -7,7 +7,13 @@ import javafx.animation.AnimationTimer;
 
 public class MyAnimationTimer extends AnimationTimer {
 
+	/**
+	 * Reference to the GUI Controller for access to UI elements.
+	 */
 	private static GUIController guiController;
+	/**
+	 * Starting time to prevent Exceptions.
+	 */
 	long time = -1;
 
 	@Override
@@ -24,9 +30,16 @@ public class MyAnimationTimer extends AnimationTimer {
 				// TODO find a better soultion for the null pointer that pops up
 				// on startup
 			}
+
 		}
 	}
 
+	/**
+	 * Sets the reference to the GUI Controller.
+	 * 
+	 * @param con
+	 *            the reference to the Controller
+	 */
 	public static void setGUIController(GUIController con) {
 		guiController = con;
 	}

+ 17 - 2
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/MyViewerListener.java

@@ -19,7 +19,7 @@ import de.tu_darmstadt.informatik.tk.scopviz.ui.PropertiesManager;
 public class MyViewerListener implements ViewerListener {
 
 	/**
-	 * Create more then one Edge at a time mode
+	 * Create more then one Edge at a time mode.
 	 */
 	public static final Boolean CREATE_MORE_THEN_ONE = true;
 
@@ -28,10 +28,13 @@ public class MyViewerListener implements ViewerListener {
 	 */
 	private GraphManager graphManager;
 
+	/**
+	 * The Id of the Node that was last clicked.
+	 */
 	private String lastClickedID;
 
 	/**
-	 * GUIController reference
+	 * GUIController reference.
 	 */
 	private static GUIController controller;
 
@@ -137,10 +140,22 @@ public class MyViewerListener implements ViewerListener {
 		}
 	}
 
+	/**
+	 * Selects a Node as the starting point for creating a new Edge.
+	 * 
+	 * @param nodeID
+	 *            the ID of the Node to select
+	 */
 	private void selectNodeForEdgeCreation(String nodeID) {
 		graphManager.getGraph().getNode(nodeID).changeAttribute("ui.style", "fill-color: #00FF00; size: 15px;");
 	}
 
+	/**
+	 * Reset the Selection of the Node after Edge has been successfully created.
+	 * 
+	 * @param nodeID
+	 *            the Id of the node to deselect.
+	 */
 	private void deselectNodesAfterEdgeCreation(String nodeID) {
 		String uiStyle = "fill-color: #000000; size: 10px;";
 		graphManager.getGraph().getNode(nodeID).changeAttribute("ui.style", uiStyle);