All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface ControlBeans.ComponentInterface

public interface ComponentInterface
This is the interface that all control components must implement. It provides the component with the methods needed for it to be stored in a communicator and have values being passed on to it. Components that wish to send values through the communicator should do so by first sending a registerComponentEvent to all its registered listeners (which normally consists of one communicator). This will alert the communicator to the components presence and it will in return alert the component of its presence by invoking registerCommunicator. After that, the component can send values to the communicator by invoking its putValue methods.

See Also:
AbstractCommunicator

Variable Index

 o DEFAULT_ID

Method Index

 o addComponentListener(ComponentListener)
Registers a ComponentListener.
 o getIsReceiver()
Gets whether or not this component will receive values.
 o getIsSender()
Gets whether or not this component will send values.
 o getTags()
The communicator uses this method to get all the tags used by this component.
 o putValue(double, int, double, int)
Sets the value of this component.
 o putValue(int, int, double, int)
Sets the value of this component.
 o putValue(String, int, double, int)
Sets the value of this component.
 o registerCommunicator(AbstractCommunicator, int)
The communicator uses this method to alert this component of its presence.
 o removeComponentListener(ComponentListener)
Deregisters the ComponentListener.
 o requestValues()
Called by the communicator to make this component send its value(s).
 o setIsReceiver(boolean)
Sets whether or not this component should receive values.
 o setIsSender(boolean)
Sets whether or not this component should send values.

Variables

 o DEFAULT_ID
 public static final int DEFAULT_ID

Methods

 o getIsReceiver
 public abstract boolean getIsReceiver()
Gets whether or not this component will receive values.

Returns:
true if this component will receive values to the communicator; false otherwise.
 o setIsReceiver
 public abstract void setIsReceiver(boolean value)
Sets whether or not this component should receive values.

Parameters:
value - true if this component should receive values from the communicator; false otherwise.
 o getIsSender
 public abstract boolean getIsSender()
Gets whether or not this component will send values.

Returns:
true if this component will send values to the communicator; false otherwise.
 o setIsSender
 public abstract void setIsSender(boolean value)
Sets whether or not this component should send values.

Parameters:
value - true if this component should send values to the communicator; false otherwise.
 o addComponentListener
 public abstract void addComponentListener(ComponentListener l)
Registers a ComponentListener. By doing so the ComponentListener can receive component events from this component.

Parameters:
l - the ComponentListener to register.
 o removeComponentListener
 public abstract void removeComponentListener(ComponentListener l)
Deregisters the ComponentListener.

Parameters:
l - the ComponentListener to remove.
 o registerCommunicator
 public abstract void registerCommunicator(AbstractCommunicator c,
                                           int ID)
The communicator uses this method to alert this component of its presence.
NOTE: This method is invoked by AbstractCommunicator and should therefore never be called directly by the user.

Parameters:
c - the communicator in question. Components implementing this interface should store the reference in order for the component to send values to the communicator.
ID - the ID number assigned to this component. Components implementing this interface should store the ID and use it each time they invoke putValue on a communicator.
See Also:
putValue, putValue, putValue
 o getTags
 public abstract int[] getTags()
The communicator uses this method to get all the tags used by this component.
NOTE: This method is invoked by AbstractCommunicator and should therefore never be called directly by the user.

Returns:
all tags used by this component
 o putValue
 public abstract void putValue(int value,
                               int aTag,
                               double time,
                               int ID)
Sets the value of this component. Typically invoked by a communicator that wishes to send a value to this component. Components implementing this interface should ignore the value if ID corresponds to the ID passed on to them when the communicator registered. This is to prevent unwanted "feedback-loops".

Parameters:
value - the value to be set
aTag - the tag of the component
time - a time tag for the value
ID - the ID of the component
See Also:
registerCommunicator
 o putValue
 public abstract void putValue(double value,
                               int aTag,
                               double time,
                               int ID)
Sets the value of this component. Typically invoked by a communicator that wishes to send a value to this component. Components implementing this interface should ignore the value if ID corresponds to the ID passed on to them when the communicator registered. This is to prevent unwanted "feedback-loops".

Parameters:
value - the value to be set
aTag - the tag of the component
time - a time tag for the value
ID - the ID of the component
See Also:
registerCommunicator
 o putValue
 public abstract void putValue(String value,
                               int aTag,
                               double time,
                               int ID)
Sets the value of this component. Typically invoked by a communicator that wishes to send a value to this component. Components implementing this interface should ignore the value if ID corresponds to the ID passed on to them when the communicator registered. This is to prevent unwanted "feedback-loops".

Parameters:
value - the value to be set
aTag - the tag of the component
time - a time tag for the value
ID - the ID of the component
See Also:
registerCommunicator
 o requestValues
 public abstract void requestValues()
Called by the communicator to make this component send its value(s). This can be used for initialization.


All Packages  Class Hierarchy  This Package  Previous  Next  Index