jaron.gui
Class Axis

java.lang.Object
  extended by jaron.components.Signal
      extended by jaron.gui.Axis
All Implemented Interfaces:
SignalListener, java.util.EventListener

public class Axis
extends Signal

The Axis class represents an axis that can be used in an actuator (see ActuatorXY).
Its main purpose is the conversion of a signal value into a value that is used in a coordinate system.

Since:
1.0
Version:
1.2
Author:
jarontec gmail com

Constructor Summary
Axis(int start, int path)
          Creates an new Axis object.
 
Method Summary
 int getPath()
          Returns the path of the axis.
 int getPosition()
          Returns the current position of the axis' actuator.
 Signal getPowerSignal()
          Returns a reference to a Signal object containing a value that represents the current status of the axis.
 int getStart()
          Returns the starting position of the axis.
 void setLocation(int location)
          Moves the axis to the specified location.
 void setPath(int path)
          Sets a new value for the axis' path.
 void setPosition(int position)
          Sets the position of the axis' actuator.
 void setStart(int start)
          Sets the starting position of the axis.
 void setValue(double value)
          Sets the value of the axis' signal.
 
Methods inherited from class jaron.components.Signal
addSignalListener, getBandwidth, getHigh, getLow, getValue, removeSignalListener, setBandwidth, setHigh, setLow, signalChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Axis

public Axis(int start,
            int path)
Creates an new Axis object.

Parameters:
start - the starting position
path - the path (distance between start and end)
Method Detail

getPath

public int getPath()
Returns the path of the axis.

Returns:
the path (distance between start and end)

getPosition

public int getPosition()
Returns the current position of the axis' actuator.

Returns:
the current position of the actuator

getPowerSignal

public Signal getPowerSignal()
Returns a reference to a Signal object containing a value that represents the current status of the axis. The stauts is either on (getSignal equals getHigh) or off (getSignal equals getLow).
In its off status the axis doesn't react on inputs.

Returns:
a Signal object containing the current axis status
See Also:
Signal

getStart

public int getStart()
Returns the starting position of the axis.

Returns:
the starting position

setLocation

public void setLocation(int location)
Moves the axis to the specified location.

Parameters:
location - the new starting position

setPath

public void setPath(int path)
Sets a new value for the axis' path.

Parameters:
path - a new value for the path (distance between start and end)

setPosition

public void setPosition(int position)
Sets the position of the axis' actuator.

Parameters:
position - the actuator's new position

setStart

public void setStart(int start)
Sets the starting position of the axis.

Parameters:
start - the new starting position

setValue

public void setValue(double value)
Sets the value of the axis' signal. If the axis' power is set to off then the value won't be changed.

Specified by:
setValue in interface SignalListener
Overrides:
setValue in class Signal
Parameters:
value - a new value of axis
See Also:
Signal