|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
AbstractCommunicator
Field Summary | |
static int |
DEFAULT_ID
|
Method Summary | |
void |
addComponentListener(ComponentListener l)
Registers a ComponentListener. |
boolean |
getIsReceiver()
Gets whether or not this component will receive values. |
boolean |
getIsSender()
Gets whether or not this component will send values. |
int[] |
getTags()
The communicator uses this method to get all the tags used by this component. |
void |
putValue(double value,
int aTag,
double time,
int ID)
Sets the value of this component. |
void |
putValue(int value,
int aTag,
double time,
int ID)
Sets the value of this component. |
void |
putValue(java.lang.String value,
int aTag,
double time,
int ID)
Sets the value of this component. |
void |
registerCommunicator(AbstractCommunicator c,
int ID)
The communicator uses this method to alert this component of its presence. |
void |
removeComponentListener(ComponentListener l)
Deregisters the ComponentListener. |
void |
requestValues()
Called by the communicator to make this component send its value(s). |
void |
setIsReceiver(boolean value)
Sets whether or not this component should receive values. |
void |
setIsSender(boolean value)
Sets whether or not this component should send values. |
Field Detail |
public static final int DEFAULT_ID
Method Detail |
public boolean getIsReceiver()
true
if this component will receive values to the
communicator;
false
otherwise.public void setIsReceiver(boolean value)
value
- true
if this component should receive values
from the communicator;
false
otherwise.public boolean getIsSender()
true
if this component will send values to the
communicator;
false
otherwise.public void setIsSender(boolean value)
value
- true
if this component should send values
to the communicator;
false
otherwise.public void addComponentListener(ComponentListener l)
l
- the ComponentListener to register.public void removeComponentListener(ComponentListener l)
l
- the ComponentListener to remove.public void registerCommunicator(AbstractCommunicator c, int ID)
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.putValue(int, int, double, int)
,
putValue(double, int, double, int)
,
putValue(java.lang.String, int, double, int)
public int[] getTags()
public void putValue(int value, int aTag, double time, int ID)
value
- the value to be setaTag
- the tag of the componenttime
- a time tag for the valueID
- the ID of the componentregisterCommunicator(ControlBeans.AbstractCommunicator, int)
public void putValue(double value, int aTag, double time, int ID)
value
- the value to be setaTag
- the tag of the componenttime
- a time tag for the valueID
- the ID of the componentregisterCommunicator(ControlBeans.AbstractCommunicator, int)
public void putValue(java.lang.String value, int aTag, double time, int ID)
value
- the value to be setaTag
- the tag of the componenttime
- a time tag for the valueID
- the ID of the componentregisterCommunicator(ControlBeans.AbstractCommunicator, int)
public void requestValues()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |