Преглед на файлове

Fixes JavaDoc comments ("gradlew javadoc" - to generate doc)

Andreas T. Meyer-Berg преди 5 години
родител
ревизия
474ad3a99c
променени са 22 файла, в които са добавени 51 реда и са изтрити 51 реда
  1. 1 1
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/Controller.java
  2. 2 2
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/ImportController.java
  3. 2 2
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/LinkColorController.java
  4. 8 8
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/NetworkController.java
  5. 7 7
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/NetworkTreeSettingsController.java
  6. 1 1
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/SettingsController.java
  7. 7 4
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/SimulationController.java
  8. 1 1
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/Connection.java
  9. 0 3
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/PrecisionLink.java
  10. 3 4
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/SimulationManager.java
  11. 3 3
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/configuration/LinkColorManager.java
  12. 1 1
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/configuration/NetworkTreeNodeStatus.java
  13. 2 1
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/protocols/packets/Ping_packet.java
  14. 0 3
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/simpleImplementation/SimpleLink.java
  15. 2 2
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/util/ICMPv6Checksum.java
  16. 0 1
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/MainFrame.java
  17. 0 1
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/MenuBar.java
  18. 7 3
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/popups/ConnectionCreationPanel.java
  19. 1 0
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/popups/NetworkTreeCellRenderer.java
  20. 1 1
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/popups/NetworkTreePanel.java
  21. 1 1
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/popups/NetworkTreeWindow.java
  22. 1 1
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/util/Utility.java

+ 1 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/Controller.java

@@ -77,7 +77,7 @@ public class Controller {
 	
 	/**
 	 * Return the simulation controller, to manage the simulation
-	 * @return
+	 * @return {@link SimulationController}
 	 */
 	public SimulationController getSimulationController(){
 		return simulationController;

+ 2 - 2
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/ImportController.java

@@ -296,9 +296,9 @@ public class ImportController {
 	/**
 	 * Imports the given .java File, compiles it and returns the 
 	 * 
-	 * @param javaFilenew File(path)
+	 * @param javaFile File(path)
 	 * @return Class which was compiled
-	 * @throws ClassImportException if an problem occured during import
+	 * @throws ClassImportException if an problem occurred during import
 	 */
 	public static Class<?> importJavaClass(File javaFile) throws ClassImportException{
 		/**

+ 2 - 2
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/LinkColorController.java

@@ -40,9 +40,9 @@ public class LinkColorController {
 	}
 	
 	/**
-	 * Returns the color & index of the given Link
+	 * Returns the color and index of the given Link
 	 * @param link link which should be looked up
-	 * @return Index & Color
+	 * @return Pair of Index and Color of the Link
 	 */
 	public Pair<Integer,Color> getColorOfLink(Link link){
 		Pair<Integer,Color> pair =  linkColorManager.getColorOfLink(link);

+ 8 - 8
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/NetworkController.java

@@ -34,8 +34,8 @@ public class NetworkController {
 	private NetworkTreeSettingsController networkTreeSettings;
 	/**
 	 * Creates a new NetworkController, which may manipulate the given model and use the controller
-	 * @param model
-	 * @param controller
+	 * @param model Model which can be manipulated
+	 * @param controller main controller for updates etc
 	 */
 	public NetworkController(Model model, Controller controller) {
 		this.model = model;
@@ -128,8 +128,8 @@ public class NetworkController {
 		model.getDevices().remove(toDelete);
 	}
 	/**
-	 * Returns smartDevices of the model
-	 * @return
+	 * Returns smartDevices of the model, which are not hidden
+	 * @return all SmartDevices which are not hidden
 	 */
 	public Collection<SmartDevice> getVisibleSmartDevices(){
 		LinkedList<SmartDevice> devices = new LinkedList<SmartDevice>(model.getDevices());
@@ -138,7 +138,7 @@ public class NetworkController {
 	}
 	/**
 	 * Returns smartDevices of the model
-	 * @return
+	 * @return all SmartDevices of the model
 	 */
 	public Collection<SmartDevice> getSmartDevices(){
 		return model.getDevices();
@@ -323,7 +323,7 @@ public class NetworkController {
 	}
 
 	/**
-	 * Removes Device p from the Connection & Protocol
+	 * Removes Device p from the Connection and Protocol
 	 * @param p Port/Device to remove
 	 * @param connection connection, which should remove the device
 	 */
@@ -342,7 +342,7 @@ public class NetworkController {
 	}
 	
 	/**
-	 * Removes Device p from the Connection & Protocol
+	 * Removes Device p from the Connection and Protocol
 	 * @param p Port/Device to remove
 	 * @param connection connection, which should remove the device
 	 */
@@ -401,7 +401,7 @@ public class NetworkController {
 	 * Changes the link of the given connection to the new link. Returns true if it was successfully changed, false if it could not be changed.
 	 * @param connection connection which should be edited
 	 * @param link new link
-	 * @return true on successful change, false on failure & restore
+	 * @return true on successful change, false on failure and restore
 	 */
 	public boolean changeLinkOfConnection(Connection connection, Link link) {
 		if(connection !=null && link != null){

+ 7 - 7
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/NetworkTreeSettingsController.java

@@ -9,7 +9,7 @@ import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.configuration.NetworkTreeNode
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.configuration.NetworkTreeSettings;
 
 /**
- * Controller which allows simple manipulation of the NetworkTreePanel, changing visibility of single or multiple Links/Connections & Devices
+ * Controller which allows simple manipulation of the NetworkTreePanel, changing visibility of single or multiple links/connections and Devices
  * 
  *
  * @author Andreas T. Meyer-Berg
@@ -39,7 +39,7 @@ public class NetworkTreeSettingsController {
 	}
 	
 	/**
-	 * Toggles visibilty of the given object and all of its descendants
+	 * Toggles visibility of the given object and all of its descendants
 	 * @param o Object to be shown/hidden
 	 */
 	public void toggleVisibilityOf(Object o){
@@ -53,7 +53,7 @@ public class NetworkTreeSettingsController {
 	/**
 	 * Sets the visibility of Object {@code o} to {@code visible}, will also change visibility of all descendants
 	 * @param o Object which should be set visible/hidden
-	 * @param visible true -> object will be shown, false -> will not be shown
+	 * @param visible true then object will be shown, false then object will not be shown
 	 */
 	public void setVisibilityOf(Object o, boolean visible){
 		if(o instanceof String){
@@ -119,7 +119,7 @@ public class NetworkTreeSettingsController {
 	}
 
 	/**
-	 * Set visibility of Link, and all its connections & Devices
+	 * Set visibility of Link, and all its connections and devices
 	 * @param link link, which should be shown/hidden
 	 * @param visible whether it should be visible
 	 */
@@ -182,10 +182,10 @@ public class NetworkTreeSettingsController {
 	/**
 	 * Set Visibility of the object
 	 * @param o object to be shown/hidden
-	 * @param b
+	 * @param visible true if visible
 	 */
-	public void setVisibilityNonRecursive(Object o, boolean b) {
-		getStatusOfObject(o).setVisible(b);
+	public void setVisibilityNonRecursive(Object o, boolean visible) {
+		getStatusOfObject(o).setVisible(visible);
 		controller.notifyObservers();
 	}
 	

+ 1 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/SettingsController.java

@@ -30,8 +30,8 @@ public class SettingsController {
 	 */
 	private LinkColorController linkColors;
 	/**
-	 * 
 	 * @param model model which stores the configuration
+	 * @param controller Main Controller for updates etc.
 	 */
 	public SettingsController(Model model, Controller controller) {
 		this.model = model;

+ 7 - 4
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/SimulationController.java

@@ -29,8 +29,8 @@ public class SimulationController {
 	private SimulationManager sim;
 	/**
 	 * Creates a new Simulation
-	 * @param model
-	 * @param controller
+	 * @param model Model to simulate
+	 * @param controller Main Controller which should be used for updates etc.
 	 */
 	public SimulationController(Model model, Controller controller) {
 		this.model = model;
@@ -112,13 +112,16 @@ public class SimulationController {
 		sim.stopSimulation();
 	}
 	
+	/**
+	 * Resets the simulation to the startTime
+	 */
 	public void resetSimulation(){
 		sim.resetSimulation();
 	}
 	
 	/**
 	 * Returns true if the simulation is running, false if not
-	 * @return
+	 * @return true if running
 	 */
 	public boolean isRunning(){
 		return sim.isRunning();
@@ -150,7 +153,7 @@ public class SimulationController {
 	
 	/**
 	 * Sets the new startTime
-	 * @return true on success
+	 * @param endTime new EndTime
 	 */
 	public void setEndTime(long endTime){
 		sim.setEndTime(endTime);;

+ 1 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/Connection.java

@@ -170,7 +170,7 @@ public interface Connection {
 	
 	/**
 	 * Returns the Name of the connection if set
-	 * @return
+	 * @return name of the connection
 	 */
 	public String getName();
 	

+ 0 - 3
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/PrecisionLink.java

@@ -63,9 +63,6 @@ public class PrecisionLink implements Link {
 	
 	/**
 	 * Initializes a simple Link with default name and an empty devices list.
-	 * 
-	 * @param name
-	 *            Name the Link should have
 	 */
 	public PrecisionLink() {
 		this.name = "link name";

+ 3 - 4
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/SimulationManager.java

@@ -306,7 +306,7 @@ public class SimulationManager extends Observable {
 	/**
 	 * Reset Simulation
 	 * 
-	 * @param timestep
+	 * @param timestep new timestep of ports after the reset
 	 */
 	public void resetSimulation(long timestep) {
 		for (SmartDevice d : model.getDevices())
@@ -318,7 +318,7 @@ public class SimulationManager extends Observable {
 	/**
 	 * Returns true if the simulation is running, false if not
 	 * 
-	 * @return
+	 * @return true if running
 	 */
 	public boolean isRunning() {
 		return timer.isRunning();
@@ -355,8 +355,7 @@ public class SimulationManager extends Observable {
 
 	/**
 	 * Sets the new startTime
-	 * 
-	 * @return true on success
+	 * @param endTime new EndTime
 	 */
 	public void setEndTime(long endTime) {
 		this.endTime = endTime;

+ 3 - 3
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/configuration/LinkColorManager.java

@@ -30,9 +30,9 @@ public class LinkColorManager {
 	}
 	
 	/**
-	 * Returns the color & index of the given Link
+	 * Returns the color and index of the given Link
 	 * @param link link which should be looked up
-	 * @return Index & Color
+	 * @return Index and Color
 	 */
 	public Pair<Integer,Color> getColorOfLink(Link link){
 		return linkColors.get(link);
@@ -49,7 +49,7 @@ public class LinkColorManager {
 	/**
 	 * Adds a link with the given Color
 	 * @param link link to be added
-	 * @param pair Index&Color of the link
+	 * @param pair Index and Color of the link
 	 */
 	public void addLinkColor(Link link, Pair<Integer, Color> pair) {
 		linkColors.put(link, pair);

+ 1 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/configuration/NetworkTreeNodeStatus.java

@@ -24,7 +24,7 @@ public class NetworkTreeNodeStatus {
 	
 	/**
 	 * Creates a new NetorkTreeNodeStatus for the object o, which is visible and not expanded 
-	 * @param o
+	 * @param o Object for the new status
 	 */
 	public NetworkTreeNodeStatus(Object o) {
 		nodeObject = o;

+ 2 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/protocols/packets/Ping_packet.java

@@ -6,7 +6,8 @@ import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.util.ICMPv6Checksum;
 /**
  * IcMPv6 Ping Packages
  * 
- * @see http://www.networksorcery.com/enp/protocol/icmpv6.htm http://www.networksorcery.com/enp/rfc/rfc4443.txt
+ * @see <a href="http://www.networksorcery.com/enp/protocol/icmpv6.htm">http://www.networksorcery.com/enp/protocol/icmpv6.htm</a>
+ * @see <a href="http://www.networksorcery.com/enp/rfc/rfc4443.txt">RFC4443</a>
  * @author Andreas T. Meyer-Berg
  */
 public class Ping_packet extends Packet {

+ 0 - 3
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/simpleImplementation/SimpleLink.java

@@ -58,9 +58,6 @@ public class SimpleLink implements Link {
 	
 	/**
 	 * Initializes a simple Link with default name and an empty devices list.
-	 * 
-	 * @param name
-	 *            Name the Link should have
 	 */
 	public SimpleLink() {
 		this.name = "link name";

+ 2 - 2
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/util/ICMPv6Checksum.java

@@ -21,8 +21,8 @@ public class ICMPv6Checksum {
 	 * @param buf
 	 *            The message
 	 * @return The checksum
-	 * @author Gary Rowe (https://stackoverflow.com/users/396747/gary-rowe)
-	 * @see https://stackoverflow.com/questions/4113890/how-to-calculate-the-internet-checksum-from-a-byte-in-java
+	 * @author <a href="https://stackoverflow.com/users/396747/gary-rowe">Gary Rowe</a>
+	 * @see <a href="https://stackoverflow.com/questions/4113890/how-to-calculate-the-internet-checksum-from-a-byte-in-java">https://stackoverflow.com/questions/4113890/how-to-calculate-the-internet-checksum-from-a-byte-in-java</a>
 	 */
 	public static long calculateChecksum(byte[] buf) {
 		int length = buf.length;

+ 0 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/MainFrame.java

@@ -32,7 +32,6 @@ public class MainFrame extends JFrame {
 	public final VisualisationPanel panel; 
 	/**
 	 * Creates a new Frame for the program, which is the most outer frame of the application
-	 * @param m Model which is represented
 	 * @param c Controller which handles the user interaction
 	 */
 	public MainFrame(Controller c) {

+ 0 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/MenuBar.java

@@ -51,7 +51,6 @@ public class MenuBar extends JMenuBar {
 	
 	/**
 	 * Initialize the Menu Bar, add all the items and add the different actions
-	 * @param model Model
 	 * @param controller Controller
 	 */
 	public MenuBar(Controller controller) {

+ 7 - 3
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/popups/ConnectionCreationPanel.java

@@ -139,7 +139,7 @@ public class ConnectionCreationPanel extends JScrollPane {
 	 */
 	private NetworkController network;
 	/**
-	 * List of available protocols -> should be moved to the Model and accessed
+	 * List of available protocols: should be moved to the Model and accessed
 	 * via controller
 	 */
 	private LinkedList<Class<? extends Protocol>> availableProtocols;
@@ -157,9 +157,13 @@ public class ConnectionCreationPanel extends JScrollPane {
 	 */
 	private boolean mutex = true;
 
+
 	/**
-	 * @wbp.parser.constructor
-	 */
+	 * Creates a new ConnectionCreation panel
+	 * @param connection connection which should be edited
+	 * @param controller controller for manipulation
+	 * @param frame parent frame
+	 */// @wbp.parser.constructor for Eclipse:WindowBuilder
 	public ConnectionCreationPanel(Connection connection, Controller controller, Window frame) {
 		this.controller = controller;
 		this.connection = connection;

+ 1 - 0
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/popups/NetworkTreeCellRenderer.java

@@ -31,6 +31,7 @@ public class NetworkTreeCellRenderer implements TreeCellRenderer {
 	private Controller controller;
 	/**
 	 * Creates a new NetworkTreeCellRenderer
+	 * @param controller Controller for manipulation
 	 */
 	public NetworkTreeCellRenderer(Controller controller) {
 		this.controller = controller;

+ 1 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/popups/NetworkTreePanel.java

@@ -83,7 +83,7 @@ public class NetworkTreePanel extends JScrollPane implements Observer {
 	private JPopupMenu rightClick;
 	
 	/**
-	 * MenuItem for editing of Links, Connections & Devices
+	 * MenuItem for editing of Links, Connections and Devices
 	 */
 	private JMenuItem mntmEdit = new JMenuItem("Edit");
 	/**

+ 1 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/popups/NetworkTreeWindow.java

@@ -22,7 +22,7 @@ public class NetworkTreeWindow extends JFrame {
 
 	/**
 	 * Frame which contains the Network Tree
-	 * @param controller controller which should be used to get & edit the Model
+	 * @param controller controller which should be used to get and edit the Model
 	 */
 	public NetworkTreeWindow(Controller controller) {
 		setBounds(new Rectangle(0, 0, 800, 600));

+ 1 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/util/Utility.java

@@ -18,7 +18,7 @@ public class Utility {
 
 	/**
 	 * Multiple distinct colors for various purposes, like {@link VisualisationPanel}'s link coloring.
-	 * This array is taken from {@link https://stackoverflow.com/questions/2328339/how-to-generate-n-different-colors-for-any-natural-number-n}
+	 * This array is taken from <a href="https://stackoverflow.com/questions/2328339/how-to-generate-n-different-colors-for-any-natural-number-n">https://stackoverflow.com/questions/2328339/how-to-generate-n-different-colors-for-any-natural-number-n</a>
 	 */
 	public static final String[] indexcolors = new String[]{
         "#000000", "#FFFF00", "#1CE6FF", "#FF34FF", "#FF4A46", "#008941", "#006FA6", "#A30059",