Eren Yilmaz 6 rokov pred
rodič
commit
315c17375a

+ 8 - 1
src/Algorithms/Animated/Action.java

@@ -1,7 +1,14 @@
 package Algorithms.Animated;
 
+/**
+ * An action some kind of command that can be send to the {@link AnimatedAlgorithm} from the {@link AnimationController}.
+ * {@code FORWARD} tells the {@link AnimatedAlgorithm} to perform one more step in the layout process.
+ * {@code BACKWARD} tells the {@link AnimatedAlgorithm} to undo the last step in the layout process.
+ * 
+ * @author kolja
+ *
+ */
 public enum Action {
-
 	FORWARD,
 	BACKWARD
 }

+ 9 - 0
src/IO/Reader.java

@@ -13,6 +13,11 @@ import Model.LayeredGraphEdge;
 import Model.LayeredGraphNode;
 import Model.LayeredNode;
 
+/**
+ * reads a {@link LayeredGraphNode} from a JSON file
+ * @author kolja
+ *
+ */
 public class Reader {
 
 	private String fileName;
@@ -22,6 +27,10 @@ public class Reader {
 		fileName = inputFileName;
 	}
 	
+	/**
+	 * read the JSON file and return its contents as a {@link LayeredGraphNode}
+	 * @return the read {@link LayeredGraphNode}
+	 */
 	public LayeredGraphNode readInputGraph()
 	{
 		String file = "";

+ 11 - 2
src/IO/Writer.java

@@ -12,6 +12,11 @@ import org.json.JSONObject;
 import Model.LayeredGraphEdge;
 import Model.LayeredGraphNode;
 
+/**
+ * Writes a {@link LayeredGraphNode} to a JSON file.
+ * @author kolja
+ *
+ */
 public class Writer {
 
     private String file;
@@ -21,6 +26,10 @@ public class Writer {
         file = outputFileName;
     }
     
+    /**
+     * Writes the given {@link LayeredGraphNode} to a JSON file.
+     * @param graph the graph that is to be saved.
+     */
     public void writeOutputGraph( LayeredGraphNode graph )
     {
         try {
@@ -32,7 +41,7 @@ public class Writer {
         }        
     }
     
-    public JSONObject parseNode( LayeredGraphNode graph ) throws JSONException
+    private JSONObject parseNode( LayeredGraphNode graph ) throws JSONException
     {
         JSONObject node = new JSONObject();
         JSONArray layers = new JSONArray();
@@ -58,7 +67,7 @@ public class Writer {
         return node;
     }
     
-    public JSONObject parseEdge( LayeredGraphEdge e ) throws JSONException
+    private JSONObject parseEdge( LayeredGraphEdge e ) throws JSONException
     {
         JSONObject edge = new JSONObject();
         edge.put( "source", e.getSources().get( 0 ).getName() );

+ 5 - 0
src/Main.java

@@ -4,6 +4,11 @@ import Algorithms.SweepCrossingMinimizer;
 import Model.LayeredGraphNode;
 import View.MainView;
 
+/**
+ * The main executable class. Starts the application.
+ * @author kolja
+ *
+ */
 public class Main {
 
 	public static void main(String[] args) {