diff options
| -rw-r--r-- | src/MyClass.java | 16 | ||||
| -rw-r--r-- | src/net/tuschhcm/routercontrol/Preset.java | 62 | ||||
| -rw-r--r-- | src/net/tuschhcm/routercontrol/router/Router.java | 44 | ||||
| -rw-r--r-- | src/net/tuschhcm/routercontrol/router/ShinyBow5544Router.java | 50 | ||||
| -rw-r--r-- | src/net/tuschhcm/routercontrol/ui/ConsoleUI.java | 54 | ||||
| -rw-r--r-- | src/net/tuschhcm/routercontrol/ui/UserInterface.java | 70 | 
6 files changed, 140 insertions, 156 deletions
| diff --git a/src/MyClass.java b/src/MyClass.java deleted file mode 100644 index 4fac53f..0000000 --- a/src/MyClass.java +++ /dev/null @@ -1,16 +0,0 @@ -import java.util.Enumeration;
 -
 -import gnu.io.CommPortIdentifier;
 -
 -public class MyClass {
 -	public static void main(String... args) {
 -		Enumeration ports = CommPortIdentifier.getPortIdentifiers();
 -	
 -        while (ports.hasMoreElements()) {
 -           CommPortIdentifier port = (CommPortIdentifier) ports.nextElement();
 -           
 -           System.out.println(port.getName());
 -        } 
 -	}
 -
 -}
\ No newline at end of file diff --git a/src/net/tuschhcm/routercontrol/Preset.java b/src/net/tuschhcm/routercontrol/Preset.java index e58fcf9..35ba8ab 100644 --- a/src/net/tuschhcm/routercontrol/Preset.java +++ b/src/net/tuschhcm/routercontrol/Preset.java @@ -5,35 +5,35 @@ package net.tuschhcm.routercontrol;   */
  public class Preset {
 -	/**
 -	 * Load a preset from the given file.
 -	 * 
 -	 * @param filename The file to load.
 -	 * @return the Preset object
 -	 */
 -	public static Preset loadPresetFile(String filename) {
 -		// TODO: Implement
 -		return null;
 -	}
 -	
 -	/**
 -	 * Get the name of the preset.
 -	 * 
 -	 * @return The preset name
 -	 */
 -	public String getName() {
 -		// TODO: Implement
 -		return null;
 -	}
 -	
 -	/**
 -	 * Get an input for the given output.
 -	 * 
 -	 * @param output
 -	 * @return Input number, or 0 if no change.
 -	 */
 -	public int getInputForOutput(final int output) {
 -		// TODO: Implement
 -		return 0;
 -	}
 +    /**
 +     * Load a preset from the given file.
 +     * 
 +     * @param filename The file to load.
 +     * @return the Preset object
 +     */
 +    public static Preset loadPresetFile(String filename) {
 +        // TODO: Implement
 +        return null;
 +    }
 +    
 +    /**
 +     * Get the name of the preset.
 +     * 
 +     * @return The preset name
 +     */
 +    public String getName() {
 +        // TODO: Implement
 +        return null;
 +    }
 +    
 +    /**
 +     * Get an input for the given output.
 +     * 
 +     * @param output
 +     * @return Input number, or 0 if no change.
 +     */
 +    public int getInputForOutput(final int output) {
 +        // TODO: Implement
 +        return 0;
 +    }
  }
 diff --git a/src/net/tuschhcm/routercontrol/router/Router.java b/src/net/tuschhcm/routercontrol/router/Router.java index d6fe2dd..7291bfd 100644 --- a/src/net/tuschhcm/routercontrol/router/Router.java +++ b/src/net/tuschhcm/routercontrol/router/Router.java @@ -4,26 +4,26 @@ package net.tuschhcm.routercontrol.router;   * Interface specification for a router
   */
  public interface Router {
 -	/**
 -	 * Send the given input to the given output.
 -	 * 
 -	 * @param output
 -	 * @param input
 -	 * 
 -	 * @throws IllegalArgumentException if input or output are out of range.
 -	 */
 -	public void switchInput(int output, int input) throws IllegalArgumentException;
 -	
 -	/**
 -	 * Power on or power off the router
 -	 * 
 -	 * @param True to turn on the router 
 -	 */
 -	public void setPower(boolean on);
 -	
 -	/**
 -	 * Enable or disable physical controls
 -	 * @param enabled true to disable the controls.
 -	 */
 -	public void setLockControls(boolean enabled);
 +    /**
 +     * Send the given input to the given output.
 +     * 
 +     * @param output
 +     * @param input
 +     * 
 +     * @throws IllegalArgumentException if input or output are out of range.
 +     */
 +    public void switchInput(int output, int input) throws IllegalArgumentException;
 +    
 +    /**
 +     * Power on or power off the router
 +     * 
 +     * @param True to turn on the router 
 +     */
 +    public void setPower(boolean on);
 +    
 +    /**
 +     * Enable or disable physical controls
 +     * @param enabled true to disable the controls.
 +     */
 +    public void setLockControls(boolean enabled);
  }
 diff --git a/src/net/tuschhcm/routercontrol/router/ShinyBow5544Router.java b/src/net/tuschhcm/routercontrol/router/ShinyBow5544Router.java index ee60bfc..7cca3f3 100644 --- a/src/net/tuschhcm/routercontrol/router/ShinyBow5544Router.java +++ b/src/net/tuschhcm/routercontrol/router/ShinyBow5544Router.java @@ -6,32 +6,32 @@ package net.tuschhcm.routercontrol.router;   */
  public class ShinyBow5544Router implements Router {
 -	/**
 -	 * Create a new ShinyBow router using the given comm port.
 -	 * 
 -	 * @param portName Com port name
 -	 */
 -	public ShinyBow5544Router(final String portName) {
 -		
 -	}
 -	
 -	@Override
 -	public void switchInput(int output, int input)
 -			throws IllegalArgumentException {
 -		// TODO Auto-generated method stub
 -		
 -	}
 +    /**
 +     * Create a new ShinyBow router using the given comm port.
 +     * 
 +     * @param portName Com port name
 +     */
 +    public ShinyBow5544Router(final String portName) {
 +        
 +    }
 +    
 +    @Override
 +    public void switchInput(int output, int input)
 +            throws IllegalArgumentException {
 +        // TODO Auto-generated method stub
 +        
 +    }
 -	@Override
 -	public void setPower(boolean on) {
 -		// TODO Auto-generated method stub
 -		
 -	}
 +    @Override
 +    public void setPower(boolean on) {
 +        // TODO Auto-generated method stub
 +        
 +    }
 -	@Override
 -	public void setLockControls(boolean enabled) {
 -		// TODO Auto-generated method stub
 -		
 -	}
 +    @Override
 +    public void setLockControls(boolean enabled) {
 +        // TODO Auto-generated method stub
 +        
 +    }
  }
 diff --git a/src/net/tuschhcm/routercontrol/ui/ConsoleUI.java b/src/net/tuschhcm/routercontrol/ui/ConsoleUI.java index 263b83e..51b3728 100644 --- a/src/net/tuschhcm/routercontrol/ui/ConsoleUI.java +++ b/src/net/tuschhcm/routercontrol/ui/ConsoleUI.java @@ -2,43 +2,43 @@ package net.tuschhcm.routercontrol.ui;  public class ConsoleUI implements UserInterface {
 -	@Override
 -	public void addPreset(int number, final String name) {
 -		// TODO Auto-generated method stub
 -		
 -	}
 -
 -	@Override
 -	public void setPresetSelectionAction(final Action action) {
 -		// TODO Auto-generated method stub
 -		
 -	}
 -
 -	@Override
 -	public int getSelectedPreset() {
 -		// TODO Auto-generated method stub
 -		return 0;
 -	}
 -
 -	@Override
 -	public void run() {
 -		// TODO Auto-generated method stub
 -		
 -	}
 +    @Override
 +    public void addPreset(int number, final String name) {
 +        // TODO Auto-generated method stub
 +        
 +    }
 +
 +    @Override
 +    public void setPresetSelectionAction(final Action action) {
 +        // TODO Auto-generated method stub
 +        
 +    }
 +
 +    @Override
 +    public int getSelectedPreset() {
 +        // TODO Auto-generated method stub
 +        return 0;
 +    }
 +
 +    @Override
 +    public void run() {
 +        // TODO Auto-generated method stub
 +        
 +    }
      @Override
 -	public void setToggleControlLockAction(final Action action) {
 -		// TODO Auto-generated method stub
 +    public void setToggleControlLockAction(final Action action) {
 +        // TODO Auto-generated method stub
      }
      @Override
      public boolean getControlLockStatus() {
 -		// TODO Auto-generated method stub
 +        // TODO Auto-generated method stub
          return false;
      }
      @Override
      public void setControlLockStatus(boolean enabled) {
 -		// TODO Auto-generated method stub
 +        // TODO Auto-generated method stub
      }
  }
 diff --git a/src/net/tuschhcm/routercontrol/ui/UserInterface.java b/src/net/tuschhcm/routercontrol/ui/UserInterface.java index 33b62b2..4650288 100644 --- a/src/net/tuschhcm/routercontrol/ui/UserInterface.java +++ b/src/net/tuschhcm/routercontrol/ui/UserInterface.java @@ -4,29 +4,29 @@ package net.tuschhcm.routercontrol.ui;   * Interface specification for the view.
   */
  public interface UserInterface {
 -	/**
 -	 * Tell the user interface about a preset.
 -	 * 
 -	 * @param number Preset number
 -	 * @param name Preset name
 -	 */
 -	public void addPreset(final int number, final String name);
 -	
 -	/**
 -	 * Set the action handler called when a preset is selected.
 -	 * @param action
 -	 */
 -	public void setPresetSelectionAction(final Action action);
 -	
 -	/**
 -	 * @return the selected preset.
 -	 */
 -	public int getSelectedPreset();
 -	
 -	/**
 -	 * Handle toggling the control lock
 -	 */
 -	public void setToggleControlLockAction(final Action action);
 +    /**
 +     * Tell the user interface about a preset.
 +     * 
 +     * @param number Preset number
 +     * @param name Preset name
 +     */
 +    public void addPreset(final int number, final String name);
 +    
 +    /**
 +     * Set the action handler called when a preset is selected.
 +     * @param action
 +     */
 +    public void setPresetSelectionAction(final Action action);
 +    
 +    /**
 +     * @return the selected preset.
 +     */
 +    public int getSelectedPreset();
 +    
 +    /**
 +     * Handle toggling the control lock
 +     */
 +    public void setToggleControlLockAction(final Action action);
      /**
       * Get the status of the control lock.
 @@ -39,16 +39,16 @@ public interface UserInterface {       * @param enabled true to set the controls lock.
       */
      public void setControlLockStatus(boolean enabled);
 -	
 -	/**
 -	 * Start the user interface.
 -	 */
 -	public void run();
 -	
 -	/**
 -	 * Interface specification for an action handler.
 -	 */
 -	public interface Action {
 -		public void onAction();
 -	}
 +    
 +    /**
 +     * Start the user interface.
 +     */
 +    public void run();
 +    
 +    /**
 +     * Interface specification for an action handler.
 +     */
 +    public interface Action {
 +        public void onAction();
 +    }
  }
 | 
