org.robokind.api.motion.utils
Class RobotController

java.lang.Object
  extended by org.robokind.api.common.property.PropertyChangeNotifier
      extended by org.robokind.api.motion.utils.RobotController
All Implemented Interfaces:
PropertyChangeListener, EventListener, org.robokind.api.common.property.PropertyChangeSource

public class RobotController
extends org.robokind.api.common.property.PropertyChangeNotifier
implements PropertyChangeListener

Used by UI components to abstract away controlling a Robot.

Author:
Matthew Stevenson

Field Summary
static String PROP_ROBOT
          Property String for the RobotController's Robot Id.
 
Constructor Summary
RobotController(RobotManager manager)
          Creates a new RobotController.
 
Method Summary
 boolean connectRobot()
          Connects the robot
 boolean disableRobot()
          Disables the Robot.
 boolean disconnectRobot()
          Disconnects the Robot.
 boolean enableRobot()
          Enables the Robot.
 Robot getRobot()
          Returns the Robot being controlled, null if it is unavailable.
 void propertyChange(PropertyChangeEvent evt)
           
 boolean removeRobot()
          Stops controlling the Robot.
 boolean selectRobot()
          Unused
 boolean setDefaultPositions()
          Moves the Robot to its default positions.
 void setRobot(Robot robot)
          Sets the id of the Robot to control.
 void setRobotMover(PositionTargetFrameSource mover)
           
 
Methods inherited from class org.robokind.api.common.property.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, clearListeners, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_ROBOT

public static final String PROP_ROBOT
Property String for the RobotController's Robot Id.

See Also:
Constant Field Values
Constructor Detail

RobotController

public RobotController(RobotManager manager)
Creates a new RobotController.

Parameters:
manager - RobotManager to manage this RobotController
Method Detail

setRobot

public void setRobot(Robot robot)
Sets the id of the Robot to control.

Parameters:
robotId - id of the robot to control

getRobot

public Robot getRobot()
Returns the Robot being controlled, null if it is unavailable.

Returns:
Robot being controlled, null is it is unavailable

connectRobot

public boolean connectRobot()
Connects the robot

Returns:
true if successful

disconnectRobot

public boolean disconnectRobot()
Disconnects the Robot.

Returns:
true if successful

enableRobot

public boolean enableRobot()
Enables the Robot.

Returns:
true if successful

disableRobot

public boolean disableRobot()
Disables the Robot.

Returns:
true if successful

selectRobot

public boolean selectRobot()
Unused

Returns:

setDefaultPositions

public boolean setDefaultPositions()
Moves the Robot to its default positions.

Returns:
true if successful

removeRobot

public boolean removeRobot()
Stops controlling the Robot. setRobotId must be called for a new Robot to be set.

Returns:
true if successful

setRobotMover

public void setRobotMover(PositionTargetFrameSource mover)

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener


Copyright © 2011-2013. All Rights Reserved.