Browse Source

CODE REVIEW DONE

Jan Enders 8 years ago
parent
commit
807716b1f0

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

@@ -69,7 +69,7 @@ public class GraphMLExporter {
 	/**
 	 * Cleans up the Attributes of all Nodes and Edges of a given Graph,
 	 * removing the ui.j2dsk and ui.class Attribute. also removes all
-	 * Attributesthat are not a String or (a Wrapper of) a primitive type
+	 * Attributes that are not a String or (a Wrapper of) a primitive type
 	 * 
 	 * @param g
 	 *            the Graph to clean up
@@ -81,6 +81,7 @@ public class GraphMLExporter {
 			e.removeAttribute("ui.j2dsk");
 			for (String s : e.getEachAttributeKey()) {
 				Class<? extends Object> c = e.getAttribute(s).getClass();
+				//TODO: should something be done with the Attributes that do not fit?
 				if (!c.isPrimitive() && !(c == String.class) && !(c == Character.class) && !(c == Boolean.class)
 						&& !(c == Integer.class) && !(c == Long.class) && !(c == Short.class) && !(c == Byte.class)
 						&& !(c == Float.class) && !(c == Double.class)) {

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

@@ -52,7 +52,7 @@ public class GraphMLImporter {
 
 	/**
 	 * adds default values for typeofNode and typeofDevice to all Nodes and
-	 * converts yEd attributes to regular ones
+	 * converts yEd attributes to regular ones.
 	 * 
 	 * @param g
 	 *            the graph that the attributes will be added onto

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

@@ -28,6 +28,9 @@ public final class EdgeSelectionHelper {
 	 * Precalculates pi / 2.
 	 */
 	private static final double HALF_PI = Math.PI / 2;
+	
+	private EdgeSelectionHelper(){
+	}
 
 	// TODO optional: only update if view has changed
 	/**

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

@@ -32,6 +32,8 @@ import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.MyMouseManager;
  *
  */
 public class GraphManager {
+	
+	/** String for the processing enabled type of node. */
 	public static final String UI_CLASS_PROCESSING_ENABLED = "procEn";
 
 	/** The Graph this instance of GraphManager manages. */
@@ -130,7 +132,7 @@ public class GraphManager {
 	 * @param id
 	 *            the Id of the Node, whose Edges shall be removed
 	 */
-	public void deleteEdgesOfNode(final String id) {
+	protected void deleteEdgesOfNode(final String id) {
 		deselect();
 		Node node = g.getNode(id);
 		deletedEdges.removeAll(deletedEdges);
@@ -250,7 +252,7 @@ public class GraphManager {
 	 * Deselect any currently selected nodes or edges.
 	 */
 	// TODO call this before save
-	public void deselect() {
+	protected void deselect() {
 		// Set last selected Edge Color to Black
 		if (getSelectedEdgeID() != null) {
 			removeClass(getSelectedEdgeID(), "selected");
@@ -555,9 +557,9 @@ public class GraphManager {
 	}
 
 	/**
-	 * Create Edges based on CreateMode
+	 * Create Edges based on CreateMode.
 	 * 
-	 * @param id
+	 * @param id The ID for the newly created Edge
 	 */
 	public void createEdges(String id) {
 		switch (Main.getInstance().getCreationMode()) {
@@ -565,8 +567,9 @@ public class GraphManager {
 		case CREATE_UNDIRECTED_EDGE:
 			if (lastClickedID == null) {
 				lastClickedID = id;
-				if (!selectNodeForEdgeCreation(lastClickedID))
+				if (!selectNodeForEdgeCreation(lastClickedID)){
 					lastClickedID = null;
+				}
 			} else if (id.equals(lastClickedID) || createEdge(id, lastClickedID)) {
 				deselectNodesAfterEdgeCreation(lastClickedID);
 				lastClickedID = null;
@@ -576,13 +579,10 @@ public class GraphManager {
 			break;
 		}
 		PropertiesManager.setItemsProperties();
-
-		// controller.createModusText.setText(Main.getInstance().getCreationMode().toString());
-
 	}
 
 	/**
-	 * creates a edge between to nodes
+	 * creates a edge between two nodes.
 	 * 
 	 * @author MW
 	 * @param to
@@ -591,7 +591,7 @@ public class GraphManager {
 	 *            ID of the origin node
 	 * @return true if the edge was created. false otherwise
 	 */
-	public boolean createEdge(String to, String from) {
+	protected boolean createEdge(String to, String from) {
 		if (getGraph().getNode(from).hasEdgeBetween(to))
 			return false;
 		String newID = Main.getInstance().getUnusedID();
@@ -615,7 +615,7 @@ public class GraphManager {
 	 * @param nodeID
 	 *            the ID of the Node to select
 	 */
-	public boolean selectNodeForEdgeCreation(String nodeID) {
+	protected boolean selectNodeForEdgeCreation(String nodeID) {
 		deselect();
 		Node n = getGraph().getNode(nodeID);
 		String nodeType = n.getAttribute("ui.class");
@@ -634,7 +634,7 @@ public class GraphManager {
 	 * @param nodeID
 	 *            the Id of the node to deselect.
 	 */
-	public void deselectNodesAfterEdgeCreation(String nodeID) {
+	protected void deselectNodesAfterEdgeCreation(String nodeID) {
 		Node n = getGraph().getNode(nodeID);
 		if (!hasClass(n, UI_CLASS_PROCESSING_ENABLED) || !GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING)) {
 			String nodeType = n.getAttribute("ui.class");
@@ -643,7 +643,7 @@ public class GraphManager {
 		}
 	}
 
-	public boolean addClass(String id, String className) {
+	protected boolean addClass(String id, String className) {
 		Element e = getGraph().getEdge(id);
 		if (e == null)
 			e = getGraph().getNode(id);
@@ -661,7 +661,7 @@ public class GraphManager {
 		return true;
 	}
 
-	public boolean removeClass(String id, String className) {
+	protected boolean removeClass(String id, String className) {
 		Element e = getGraph().getEdge(id);
 		if (e == null)
 			e = getGraph().getNode(id);
@@ -678,7 +678,7 @@ public class GraphManager {
 		return true;
 	}
 
-	public boolean toggleClass(String id, String className) {
+	protected boolean toggleClass(String id, String className) {
 		Element e = getGraph().getEdge(id);
 		if (e == null)
 			e = getGraph().getNode(id);
@@ -691,7 +691,7 @@ public class GraphManager {
 		return removeClass(id, className);
 	}
 
-	public boolean hasClass(String id, String className) {
+	protected boolean hasClass(String id, String className) {
 		Element e = getGraph().getEdge(id);
 		if (e == null)
 			e = getGraph().getNode(id);
@@ -702,7 +702,7 @@ public class GraphManager {
 				|| eClass.contains(", ".concat(className))));
 	}
 
-	public boolean hasClass(Edge e, String className) {
+	protected boolean hasClass(Edge e, String className) {
 		if (e == null)
 			return false;
 		String eClass = e.getAttribute("ui.class");
@@ -710,7 +710,7 @@ public class GraphManager {
 				|| eClass.contains(", ".concat(className))));
 	}
 
-	public boolean hasClass(Node n, String className) {
+	protected boolean hasClass(Node n, String className) {
 		if (n == null)
 			return false;
 		String nClass = n.getAttribute("ui.class");

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

@@ -25,7 +25,7 @@ public final class Main {
 	private CreationMode creationMode = CreationMode.CREATE_NONE;
 
 	/**
-	 * The root window of the application
+	 * The root window of the application.
 	 */
 	private Stage primaryStage;
 

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

@@ -148,8 +148,9 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 			newNode.changeAttribute("x", x);
 			newNode.changeAttribute("y", y);
 
-			if (hasClass(newNode, UI_CLASS_PROCESSING_ENABLED))
+			if (hasClass(newNode, UI_CLASS_PROCESSING_ENABLED)){
 				initCapacity(newNode);
+			}
 
 		}
 
@@ -385,7 +386,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 	}
 
 	@Override
-	public boolean selectNodeForEdgeCreation(String nodeID) {
+	protected boolean selectNodeForEdgeCreation(String nodeID) {
 		Node n = g.getNode(nodeID);
 		String parent = n.getAttribute(ATTRIBUTE_KEY_MAPPING_PARENT);
 		if (parent == null)

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

@@ -14,7 +14,10 @@ import org.graphstream.graph.implementations.SingleGraph;
  * 
  */
 public class MyGraph extends SingleGraph {
+	
+	/** List of all Edge Creation listeners. */
 	private LinkedList<EdgeCreatedListener> allEdgeListeners = new LinkedList<EdgeCreatedListener>();
+	/** List of all Node Creation listeners. */
 	private LinkedList<NodeCreatedListener> allNodeListeners = new LinkedList<NodeCreatedListener>();
 
 	/**
@@ -72,7 +75,7 @@ public class MyGraph extends SingleGraph {
 
 	/**
 	 * adds the given Listener to the Graph all listeners will be notified when
-	 * an Edge is created
+	 * an Edge is created.
 	 * 
 	 * @param e
 	 *            the listener that has to be added
@@ -82,7 +85,7 @@ public class MyGraph extends SingleGraph {
 	}
 
 	/**
-	 * Notifies all added EdgeCreatedListener
+	 * Notifies all added EdgeCreatedListeners.
 	 * 
 	 * @param e
 	 *            the Edge that was just created
@@ -95,9 +98,9 @@ public class MyGraph extends SingleGraph {
 
 	/**
 	 * adds the given Listener to the Graph all listeners will be notified when
-	 * a Node is created
+	 * a Node is created.
 	 * 
-	 * @param e
+	 * @param n
 	 *            the listener that has to be added
 	 */
 	public void addNodeCreatedListener(NodeCreatedListener n) {
@@ -105,9 +108,9 @@ public class MyGraph extends SingleGraph {
 	}
 
 	/**
-	 * Notifies all added NodeCreatedListener
+	 * Notifies all added NodeCreatedListener.
 	 * 
-	 * @param e
+	 * @param n
 	 *            the Edge that was just created
 	 */
 	private void nodeCreatedNotify(Node n) {

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

@@ -9,7 +9,7 @@ import de.tu_darmstadt.informatik.tk.scopviz.main.MyGraph;
 public interface ScopvizGraphMetric {
 
 	/**
-	 * calculate the metric on the graph
+	 * calculate the metric on the graph.
 	 * 
 	 * @param g
 	 *            a MyGraph
@@ -18,12 +18,12 @@ public interface ScopvizGraphMetric {
 	public LinkedList<TableRow> calculate(MyGraph g);
 
 	/**
-	 * returns the name of the Metric which will be displayed above the values
+	 * returns the name of the Metric which will be displayed above the values.
 	 */
 	public String getName();
 
 	/**
-	 * sets up the metric for the first use
+	 * sets up the metric for the first use.
 	 */
 	public void setup();
 }

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

@@ -7,7 +7,7 @@ import de.tu_darmstadt.informatik.tk.scopviz.main.MyGraph;
 public interface ScopvizGraphOperator {
 
 	/**
-	 * calculates a new Version of the Graph using the given operator
+	 * calculates a new Version of the Graph using the given operator.
 	 * 
 	 * @param g
 	 *            a MyGraph
@@ -17,12 +17,12 @@ public interface ScopvizGraphOperator {
 	public LinkedList<MyGraph> calculate(MyGraph g);
 
 	/**
-	 * returns the name of the Metric
+	 * returns the name of the Metric.
 	 */
 	public String getName();
 
 	/**
-	 * sets up the metric for the first use
+	 * sets up the metric for the first use.
 	 */
 	public void setup();
 }

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

@@ -61,7 +61,7 @@ public final class ButtonManager {
 	/**
 	 * Handler for zoom in Button.
 	 */
-	public static final void zoomInAction(ActionEvent event) {
+	public static void zoomInAction(ActionEvent event) {
 		if (GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
 			WorldView.internMapViewer.setZoom(WorldView.internMapViewer.getZoom() - 1);
 		} else {
@@ -72,7 +72,7 @@ public final class ButtonManager {
 	/**
 	 * Handler for zoom out Button.
 	 */
-	public static final void zoomOutAction(ActionEvent event) {
+	public static void zoomOutAction(ActionEvent event) {
 		if (GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
 			WorldView.internMapViewer.setZoom(WorldView.internMapViewer.getZoom() + 1);
 		} else {
@@ -82,7 +82,7 @@ public final class ButtonManager {
 
 	/**
 	 * After switching from symbol-layer to other layer show toolbox and make
-	 * properties editable again
+	 * properties editable again.
 	 */
 	private static void switchfromSymbolLayer() {
 
@@ -113,7 +113,7 @@ public final class ButtonManager {
 	/**
 	 * Handler for the Underlay Layer switch Button.
 	 */
-	public static final void underlayAction(ActionEvent arg0) {
+	public static void underlayAction(ActionEvent arg0) {
 
 		switchfromSymbolLayer();
 
@@ -127,7 +127,7 @@ public final class ButtonManager {
 	/**
 	 * Handler for the Operator Layer switch Button.
 	 */
-	public static final void operatorAction(ActionEvent arg0) {
+	public static void operatorAction(ActionEvent arg0) {
 
 		switchfromSymbolLayer();
 
@@ -141,7 +141,7 @@ public final class ButtonManager {
 	/**
 	 * Handler for the Mapping Layer switch Button.
 	 */
-	public static final void mappingAction(ActionEvent arg0) {
+	public static void mappingAction(ActionEvent arg0) {
 
 		switchfromSymbolLayer();
 
@@ -155,7 +155,7 @@ public final class ButtonManager {
 	/**
 	 * Handler for the Symbol Representation Layer switch Button.
 	 */
-	public static final void symbolRepAction(ActionEvent arg0) {
+	public static void symbolRepAction(ActionEvent arg0) {
 
 		if (!(GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL))) {
 
@@ -174,7 +174,7 @@ public final class ButtonManager {
 	}
 
 	/**
-	 * Initializes the WorldView, sets data and paints them
+	 * Initializes the WorldView, sets data and paints them.
 	 */
 	private static void activateWorldView() {
 
@@ -208,7 +208,7 @@ public final class ButtonManager {
 	}
 
 	/**
-	 * Functionality for "edge visible" Checkbox
+	 * Functionality for "edge visible" Checkbox.
 	 * 
 	 * @param ov
 	 * @param oldVal
@@ -229,7 +229,7 @@ public final class ButtonManager {
 	}
 
 	/**
-	 * Functionality for "label visible" Checkbox
+	 * Functionality for "label visible" Checkbox.
 	 * 
 	 * @param ov
 	 * @param oldVal
@@ -242,8 +242,8 @@ public final class ButtonManager {
 		WaypointPainter<CustomWaypoint> waypointPainter = WorldView.waypointPainter;
 		CustomWaypointRenderer renderer = new CustomWaypointRenderer();
 
-		// Show node labels
 		if (newVal) {
+			// Show node labels
 			renderer.setShowLabels(true);
 			waypointPainter.clearCache();
 			waypointPainter.setRenderer(renderer);
@@ -259,7 +259,7 @@ public final class ButtonManager {
 	}
 
 	/**
-	 * Functionality for "edge weights visible" Checkbox
+	 * Functionality for "edge weights visible" Checkbox.
 	 * 
 	 * @param ov
 	 * @param oldVal
@@ -269,20 +269,21 @@ public final class ButtonManager {
 	 */
 	public static void edgeWeightVisibilitySwitcher(ObservableValue<? extends Boolean> ov, Boolean oldVal,
 			Boolean newVal) {
-
-		// Show Edges weights
+		
 		if (newVal) {
+			// Show Edges weights
 			WorldView.edgePainter.setShowWeights(true);
 			WorldView.internMapViewer.repaint();
-			// Hide Edges weights
+			
 		} else {
+			// Hide Edges weights
 			WorldView.edgePainter.setShowWeights(false);
 			WorldView.internMapViewer.repaint();
 		}
 	}
 
 	/**
-	 * Changes the border of the button that was pressed to red
+	 * Changes the border of the button that was pressed to red.
 	 * 
 	 * @param currentButton
 	 *            the button that was pressed
@@ -301,11 +302,11 @@ public final class ButtonManager {
 	}
 
 	/**
-	 * update mapViewer if choiceBox item was changed
+	 * update mapViewer if choiceBox item was changed.
 	 * 
-	 * @param ov
-	 * @param oldVal
-	 * @param newVal
+	 * @param ov The observed Value
+	 * @param oldVal Its old Value
+	 * @param newVal Its new Value
 	 */
 	public static void mapViewChoiceChange(ObservableValue<? extends String> ov, String oldVal, String newVal) {
 		MapViewFunctions.changeMapView();

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

@@ -199,8 +199,6 @@ public class GUIController implements Initializable {
 	 * Initializes the Menu Bar with all its contents.
 	 */
 	private void initializeMenuBar() {
-		// 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));

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

@@ -51,9 +51,9 @@ public final class GraphDisplayManager {
 	 * An empty GraphManager to use with Layers not yet filled with another
 	 * GraphManager.
 	 */
-	private final static GraphManager emptyLayer = new GraphManager(new MyGraph("g"));
+	private static final GraphManager emptyLayer = new GraphManager(new MyGraph("g"));
 
-	/** Importer for loading Graphs from Disk */
+	/** Importer for loading Graphs from Disk. */
 	private static GraphMLImporter importer = new GraphMLImporter();
 
 	/**
@@ -135,7 +135,7 @@ public final class GraphDisplayManager {
 	 * 
 	 * @param fileURL
 	 *            URL of the file
-	 * @param replaceCurrent
+	 * @param currentLayer
 	 *            if true the given graph will replace any preexisting graph in
 	 *            the current layer, if false they will be merged.
 	 * @return the id to access the specific Graph
@@ -169,7 +169,6 @@ public final class GraphDisplayManager {
 		// replacing the current graph or merging
 		if (replaceCurrent) {
 			removeAllCurrentGraphs();
-			;
 			ret = count++;
 		} else {
 			// TODO add code for multigraph
@@ -214,8 +213,6 @@ public final class GraphDisplayManager {
 	/**
 	 * Switches the active Graph to the one with the given id.
 	 * 
-	 * @param id
-	 *            the id of the graph to switch to
 	 */
 	public static void switchActiveGraph() {
 		Pane pane = guiController.pane;
@@ -299,13 +296,14 @@ public final class GraphDisplayManager {
 		GraphManager underlay = null, operator = null;
 		MappingGraphManager mapping = null;
 		for (GraphManager man : vList) {
-			if (man.getGraph().getAttribute("layer").equals(Layer.UNDERLAY))
+			if (man.getGraph().getAttribute("layer").equals(Layer.UNDERLAY)){
 				underlay = man;
-			else if (man.getGraph().getAttribute("layer").equals(Layer.OPERATOR))
+			}else if (man.getGraph().getAttribute("layer").equals(Layer.OPERATOR)){
 				operator = man;
-			else if (man.getGraph().getAttribute("layer").equals(Layer.MAPPING)
-					&& MappingGraphManager.class.isInstance(man))
+			}else if (man.getGraph().getAttribute("layer").equals(Layer.MAPPING)
+					&& MappingGraphManager.class.isInstance(man)){
 				mapping = (MappingGraphManager) man;
+			}
 		}
 		if (underlay == null) {
 			Debug.out("no Underlay found");

+ 12 - 11
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/PropertiesManager.java

@@ -67,7 +67,7 @@ public final class PropertiesManager {
 	 * Initializes the Manager by adding the List of properties to display into
 	 * the properties pane.
 	 * 
-	 * @param properties
+	 * @param propertiesInput
 	 *            The list of properties to display
 	 */
 	public static void initializeItems(TableView<KeyValuePair> propertiesInput) {
@@ -77,7 +77,7 @@ public final class PropertiesManager {
 	}
 
 	/**
-	 * Update Properties of selected Node/Edge, if a any Property was changed
+	 * Update Properties of selected Node/Edge, if a any Property was changed.
 	 */
 	public static final EventHandler<CellEditEvent<KeyValuePair, String>> setOnEditCommitHandler = new EventHandler<CellEditEvent<KeyValuePair, String>>() {
 
@@ -183,11 +183,10 @@ public final class PropertiesManager {
 	};
 
 	/**
-	 * Sets Property-TableView Elements to selected Node or Edge Properties
+	 * Sets Property-TableView Elements to selected Node or Edge Properties.
 	 */
 	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();
 
@@ -199,12 +198,13 @@ public final class PropertiesManager {
 			Edge selectedEdge = Main.getInstance().getGraphManager().getGraph().getEdge(eid);
 			showNewDataSet(selectedEdge);
 
-		} else
+		} else{
 			return;
+		}
 	}
 
 	/**
-	 * Add properties of selected Node or Edge to Properties TableView
+	 * Add properties of selected Node or Edge to Properties TableView.
 	 * 
 	 * @param selected
 	 *            selected Node or Edge
@@ -276,12 +276,13 @@ public final class PropertiesManager {
 			return viz.getGraph().getNode(nid);
 		} else if (eid != null) {
 			return viz.getGraph().getEdge(eid);
-		} else
+		} else{
 			return null;
+		}
 	}
 
 	/**
-	 * Delete a given Pair from the current Node or Edge
+	 * Delete a given Pair from the current Node or Edge.
 	 * 
 	 * @param pair
 	 *            selectedProperty
@@ -295,7 +296,7 @@ public final class PropertiesManager {
 	}
 
 	/**
-	 * contextMenu add button functionality
+	 * contextMenu add button functionality.
 	 */
 	private static void addPropFunctionality() {
 		Debug.out("Add Element");
@@ -372,9 +373,9 @@ public final class PropertiesManager {
 				tmp.add(type.getValue());
 
 				return tmp;
-			} else
+			} else{
 				return null;
-
+			}
 		});
 
 		Optional<ArrayList<String>> result = addPropDialog.showAndWait();

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

@@ -4,6 +4,12 @@ import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 
+/**
+ * Class to manage the various Stylesheets used by the Graph and UI Elements.
+ * 
+ * @author Jascha Bohne
+ *
+ */
 public class StylesheetManager {
 
 	/**
@@ -12,7 +18,7 @@ public class StylesheetManager {
 	private static String[] allNodeGraphics = { "Shapes", "Sprites" };
 	/**
 	 * The Stylesheet that is given to every graph that is added to display
-	 * everything correctly
+	 * everything correctly.
 	 */
 	public static final String DEFAULT_STYLESHEET = "node{text-alignment:at-right;} \n"
 			+ "edge{text-offset: 4px,-4px;} edge.selected{fill-color: #FF0000;}";
@@ -29,17 +35,26 @@ public class StylesheetManager {
 			+ "node.procEn{fill-mode: image-scaled; fill-image: url('src/main/resources/png/procEn.png'); }"
 			+ "node.sink{fill-mode: image-scaled; fill-image: url('src/main/resources/png/sink.png'); }"
 			+ "node.operator{fill-mode: image-scaled; fill-image: url('src/main/resources/png/operator.png'); }";
-	/** The currently selected Display Mode */
+	
+	/** The currently selected Display Mode. */
 	private static String nodeGraphics = allNodeGraphics[1];
 	/** The currently active Stylesheet. */
 	private static String nodeStylesheet = STYLE_NODES_SPRITES;
 
+	/** Layer specific Stylesheet for Underlay layer. */
 	private static String styleLayerUnderlay = "";
+	/** Layer specific Stylesheet for Operator layer. */
 	private static String styleLayerOperator = "";
+	/** Layer specific Stylesheet for Mapping layer. */
 	private static String styleLayerMapping = "edge.mapping {stroke-color: #33ff33; stroke-mode: dashes; fill-mode: none; size: 0px;}"
 			+ "node.procEn {fill-mode: plain; shape: pie-chart; fill-color: #555555, #cccc00, #32cd32, #8b0000; size: 20px;}";
+	/** Layer specific Stylesheet for Symbol layer. */
 	private static String styleLayerSymbol = "";
 
+	/** Private Constructor to prevent instantiation. */
+	private StylesheetManager(){
+	}
+	
 	/**
 	 * Changes the Stylesheet and updates all Nodes to use it.
 	 * 
@@ -89,7 +104,7 @@ public class StylesheetManager {
 	}
 
 	/**
-	 * Returns the styleSheet for a given Layer
+	 * Returns the styleSheet for a given Layer.
 	 * 
 	 * @param l
 	 *            the Layer
@@ -112,7 +127,7 @@ public class StylesheetManager {
 	}
 
 	/**
-	 * Sets the Stylesheet for a given Layer
+	 * Sets the Stylesheet for a given Layer.
 	 * 
 	 * @param l
 	 *            the Layer