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
-
DEFAULT_ID
-
-
addComponentListener(ComponentListener)
- Registers a ComponentListener.
-
getIsReceiver()
- Gets whether or not this component will receive values.
-
getIsSender()
- Gets whether or not this component will send values.
-
getTags()
- The communicator uses this method to get all the tags used by this
component.
-
putValue(double, int, double, int)
- Sets the value of this component.
-
putValue(int, int, double, int)
- Sets the value of this component.
-
putValue(String, int, double, int)
- Sets the value of this component.
-
registerCommunicator(AbstractCommunicator, int)
- The communicator uses this method to alert this component of its
presence.
-
removeComponentListener(ComponentListener)
- Deregisters the ComponentListener.
-
requestValues()
- Called by the communicator to make this component send its value(s).
-
setIsReceiver(boolean)
- Sets whether or not this component should receive values.
-
setIsSender(boolean)
- Sets whether or not this component should send values.
DEFAULT_ID
public static final int DEFAULT_ID
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.
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.
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.
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.
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.
removeComponentListener
public abstract void removeComponentListener(ComponentListener l)
- Deregisters the ComponentListener.
- Parameters:
- l - the ComponentListener to remove.
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
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
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
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
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
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