All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ControlBeans.CButton

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.AbstractButton
                                   |
                                   +----com.sun.java.swing.JButton
                                           |
                                           +----ControlBeans.CButton

public class CButton
extends JButton
implements ActionListener, ComponentInterface
This class implements a button as a control component. When clicked this component will send the value '1' to the communicator.
It has been implemented as a Javabean, meaning that it is well suited to use within visual programming tools such as NetBeans or JBuilder.

See Also:
AbstractCommunicator

Constructor Index

 o CButton()
Constructs a new CButton

Method Index

 o actionPerformed(ActionEvent)
Invoked when a user clicks this component.
 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 getTag()
Gets the tag of this component.
 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 for this component.
 o putValue(int, int, double, int)
Sets the value of this component.
 o putValue(String, int, double, int)
Sets the value for 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.
 o setTag(int)
Sets the tag of this component.

Constructors

 o CButton
 public CButton()
Constructs a new CButton

Methods

 o getIsReceiver
 public boolean getIsReceiver()
Gets whether or not this component will receive values.
NOTE: Implemented for compatibility reasons only. This component cannot receive values, hence this method will always return false.

Returns:
true if this component will receive values from the communicator; false otherwise.
 o setIsReceiver
 public void setIsReceiver(boolean value)
Sets whether or not this component should receive values.
NOTE: Implemented for compatibility reasons only. This component cannot receive values, hence calling this method will have no effect.

Parameters:
value - true if this component should receive values from the communicator; false otherwise.
 o getIsSender
 public 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 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 getTag
 public int getTag()
Gets the tag of this component. The tag is used to group different components within the communicator.

Returns:
the tag of this component
 o setTag
 public void setTag(int value)
Sets the tag of this component. The tag is used to group different components within the communicator.

Parameters:
value - the tag of this component
 o addComponentListener
 public void addComponentListener(ComponentListener l)
Registers a ComponentListener. By doing so the ComponentListener can receive component events from this component.
NOTE: This component can only hold one ComponentListener.

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

Parameters:
l - the ComponentListener to remove.
 o registerCommunicator
 public 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
ID - the ID number assigned to this component and is stored in myID
See Also:
putValue, putValue, putValue
 o getTags
 public 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 void putValue(int value,
                      int aTag,
                      double time,
                      int ID)
Sets the value of this component.
NOTE: Implemented for compatibility reasons only. This component cannot receive integer values, hence calling this method will have no effect.

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 void putValue(double value,
                      int aTag,
                      double time,
                      int ID)
Sets the value for this component.
NOTE: Implemented for compatibility reasons only. This component cannot receive double values, hence calling this method will have no effect.

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 void putValue(String value,
                      int aTag,
                      double time,
                      int ID)
Sets the value for this component.
NOTE: Implemented for compatibility reasons only. This component cannot receive string values, hence calling this method will have no effect.

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 actionPerformed
 public void actionPerformed(ActionEvent e)
Invoked when a user clicks this component. If a communicator has registered with it, it will result in the value '1' being sent to the communicator.
NOTE: This method is invoked by the AWT event handling and should therefore never be called directly by the user.

Parameters:
e - the event describing that someone clicked this component
See Also:
putValue
 o requestValues
 public void requestValues()
Called by the communicator to make this component send its value(s). This can be used for initialization.
NOTE: Implemented for compatibility reasons only. This component does not send values, hence calling this method will have no effect,


All Packages  Class Hierarchy  This Package  Previous  Next  Index