Переглянути джерело

Code Review Done, auto formatted everyhing

Jan Enders 8 роки тому
батько
коміт
36ea57c3c0

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

@@ -68,8 +68,8 @@ 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
-	 * Attributes that are not a String or (a Wrapper of) a primitive type
+	 * removing the ui.j2dsk and ui.class Attribute. also removes all Attributes
+	 * that are not a String or (a Wrapper of) a primitive type
 	 * 
 	 * @param g
 	 *            the Graph to clean up
@@ -81,7 +81,8 @@ 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?
+				// 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)) {

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

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

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

@@ -32,7 +32,7 @@ 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";
 
@@ -559,7 +559,8 @@ public class GraphManager {
 	/**
 	 * Create Edges based on CreateMode.
 	 * 
-	 * @param id The ID for the newly created Edge
+	 * @param id
+	 *            The ID for the newly created Edge
 	 */
 	public void createEdges(String id) {
 		switch (Main.getInstance().getCreationMode()) {
@@ -567,7 +568,7 @@ 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)) {

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

@@ -148,7 +148,7 @@ 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);
 			}
 

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

@@ -14,7 +14,7 @@ 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. */

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

@@ -269,12 +269,12 @@ public final class ButtonManager {
 	 */
 	public static void edgeWeightVisibilitySwitcher(ObservableValue<? extends Boolean> ov, Boolean oldVal,
 			Boolean newVal) {
-		
+
 		if (newVal) {
 			// Show Edges weights
 			WorldView.edgePainter.setShowWeights(true);
 			WorldView.internMapViewer.repaint();
-			
+
 		} else {
 			// Hide Edges weights
 			WorldView.edgePainter.setShowWeights(false);
@@ -304,9 +304,12 @@ public final class ButtonManager {
 	/**
 	 * update mapViewer if choiceBox item was changed.
 	 * 
-	 * @param ov The observed Value
-	 * @param oldVal Its old Value
-	 * @param newVal Its new Value
+	 * @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();

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

@@ -296,12 +296,12 @@ 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;
 			}
 		}

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

@@ -198,7 +198,7 @@ public final class PropertiesManager {
 			Edge selectedEdge = Main.getInstance().getGraphManager().getGraph().getEdge(eid);
 			showNewDataSet(selectedEdge);
 
-		} else{
+		} else {
 			return;
 		}
 	}
@@ -276,7 +276,7 @@ public final class PropertiesManager {
 			return viz.getGraph().getNode(nid);
 		} else if (eid != null) {
 			return viz.getGraph().getEdge(eid);
-		} else{
+		} else {
 			return null;
 		}
 	}
@@ -373,7 +373,7 @@ public final class PropertiesManager {
 				tmp.add(type.getValue());
 
 				return tmp;
-			} else{
+			} else {
 				return null;
 			}
 		});

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

@@ -35,7 +35,7 @@ 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. */
 	private static String nodeGraphics = allNodeGraphics[1];
 	/** The currently active Stylesheet. */
@@ -52,9 +52,9 @@ public class StylesheetManager {
 	private static String styleLayerSymbol = "";
 
 	/** Private Constructor to prevent instantiation. */
-	private StylesheetManager(){
+	private StylesheetManager() {
 	}
-	
+
 	/**
 	 * Changes the Stylesheet and updates all Nodes to use it.
 	 *