Class AwtUICheckButton
public class AwtUICheckButton extends AwtUIButton implements
IAwtUIItemSelectable
{
// Constructors
public AwtUICheckButton();
public AwtUICheckButton(String name);
public AwtUICheckButton(String name, int style);
public AwtUICheckButton(IUIComponent comp);
public AwtUICheckButton(IUIComponent comp, int style);
// Methods
public void addItemListener(ItemListener l);
public IUIComponent getBase();
protected void processHostEvent(AWTEvent e);
protected void processItemEvent(ItemEvent e);
public void removeItemListener(ItemListener l);
}
This class implements the functionality of a UICheckButton object in an AWT-based control. An AwtUICheckButton control is an AwtUIHost component whose associated root container holds a UICheckButton object. By hosting this object, an AwtUICheckButton control integrates AFC with AWT. Although an AwtUICheckButton control is fully compatible with AWT, a UICheckButton control is optimized for performance and size.
Note The hot-track color is the same color as the button text color. As a result, hot-tracking does not appear to be functional.
Panel
|
+--AwtUIHost
|
+--AwtUIControl
|
+--AwtUIButton
|
+--AwtUICheckButton
public AwtUICheckButton();
Creates an AWT-based check box button with no content.
Remarks:
By default, the button's style is set to TOGGLE.
public AwtUICheckButton(String name);
Creates an AWT-based check box button with the specified text.
Parameter | Description |
name
| The text to be displayed with the check box image.
|
Remarks:
By default, the button is hot-tracked and its style is set to TOGGLE. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.
public AwtUICheckButton(String name, int style);
Creates an AWT-based check box button with the specified text and style.
Parameter | Description |
name
| The text to be displayed with the check box image.
|
style
| The style of the button. Possible values include UIButton.TOGGLE or UIButton.TRITOGGLE.
|
Remarks:
By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.
Exceptions:
IllegalArgumentException
if an undefined style was specified.
public AwtUICheckButton(IUIComponent comp);
Creates an AWT-based check box button with the specified component.
Parameter | Description |
comp
| The component to be displayed with the check box image.
|
Remarks:
Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. By default, the button's style is set to TOGGLE.
public AwtUICheckButton(IUIComponent comp, int style);
Creates an AWT-based check box button with the specified component and style.
Parameter | Description |
comp
| The component to be displayed with the check box image.
|
style
| The style of the button. Possible values include UIButton.TOGGLE or UIButton.TRITOGGLE.
|
Remarks:
Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component.
Exceptions:
IllegalArgumentException
if an undefined style was specified.
public void addItemListener(ItemListener l);
Adds the specified item listener. The listener receives all item events generated for the control.
Return Value:
No return value.
Parameter | Description |
l
| The item listener to be added.
|
See Also: removeItemListener
public IUIComponent getBase();
Retrieves the UI component that the button is based on.
Return Value:
Returns the UICheckButton object associated with the button control.
Remarks:
When the AWT-based button is first created, it is associated with a UICheckButton object.
protected void processHostEvent(AWTEvent e);
Processes the specified event.
Return Value:
No return value.
Parameter | Description |
e
| The event.
|
Remarks:
This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.
When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.
protected void processItemEvent(ItemEvent e);
Processes item events.
Return Value:
No return value.
Parameter | Description |
e
| The item event.
|
Remarks:
This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call processItemEvent to ensure the default event processing continues normally.
See Also: addItemListener
public void removeItemListener(ItemListener l);
Removes the specified item listener. The listener no longer receives the control's item events.
Return Value:
No return value.
Parameter | Description |
l
| The item listener to be removed.
|
See Also: addItemListener