JSci.instruments
Interface PositionControl

All Superinterfaces:
Control
All Known Implementing Classes:
PositionControlAdapter

public interface PositionControl
extends Control

Describes a mechanical device that can control the position of something


Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Adds a ChangeListener to the model's listener list.
 double getActualPosition()
          get the actual position of the device.
 javax.swing.event.ChangeListener[] getChangeListeners()
          Returns an array of all the ChangeListeners added to this PositionControl with addChangeListener().
 java.awt.Component getControlComponent()
          get a Component through which we can control the position
 java.util.EventListener[] getListeners(java.lang.Class listenerType)
          Return an array of all the listeners of the given type that were added to this PositionControl.
 double getMaximum()
          get the maximum position
 double getMinimum()
          get the minimum position
 double getPosition()
          get the position that must be reached.
 java.lang.String getUnit()
          get a String with the description of the units used for all the values.
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Removes a ChangeListener from the model's listener list.
 void setPosition(double p)
          set the position
 void sleep()
          sleeps for the time needed to stabilize the position.
 

Method Detail

setPosition

public void setPosition(double p)
set the position

Parameters:
p - the position

getPosition

public double getPosition()
get the position that must be reached. Since the mechanical device needs some time to reach the position, getPosition() can be different from getActualPosition()

Returns:
the position that must be reached

getActualPosition

public double getActualPosition()
get the actual position of the device. Since the mechanical device needs some time to reach the position, getPosition() can be different from getActualPosition()

Returns:
the actual position

getMinimum

public double getMinimum()
get the minimum position

Returns:
the minimum position

getMaximum

public double getMaximum()
get the maximum position

Returns:
the maximum position

sleep

public void sleep()
sleeps for the time needed to stabilize the position.


getControlComponent

public java.awt.Component getControlComponent()
get a Component through which we can control the position

Specified by:
getControlComponent in interface Control
Returns:
the Component with the controls for the position

getUnit

public java.lang.String getUnit()
get a String with the description of the units used for all the values.

Returns:
the unit

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)
Adds a ChangeListener to the model's listener list. The ChangeListeners must be notified when the models value changes.

Parameters:
l - the ChangeListener to add
See Also:
removeChangeListener(javax.swing.event.ChangeListener)

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener l)
Removes a ChangeListener from the model's listener list.

Parameters:
l - the ChangeListener to remove
See Also:
addChangeListener(javax.swing.event.ChangeListener)

getChangeListeners

public javax.swing.event.ChangeListener[] getChangeListeners()
Returns an array of all the ChangeListeners added to this PositionControl with addChangeListener().

Returns:
all of the ChangeListeners added or an empty array if no listeners have been added

getListeners

public java.util.EventListener[] getListeners(java.lang.Class listenerType)
Return an array of all the listeners of the given type that were added to this PositionControl. For example to find all of the ChangeListeners added to this model:

Parameters:
listenerType - the type of listeners to return, e.g. ChangeListener.class
Returns:
all of the objects receiving listenerType notifications from this model