Class AwtUIRadioButton
public class AwtUIRadioButton extends AwtUIButton implements
IAwtUIItemSelectable
{
// Constructors
public AwtUIRadioButton();
public AwtUIRadioButton(String name);
public AwtUIRadioButton(String name, int style);
public AwtUIRadioButton(IUIComponent comp);
public AwtUIRadioButton(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 UIRadioButton object in an AWT-based control. An AwtUIRadioButton control is an AwtUIHost component whose associated root container holds a UIRadioButton object. By hosting this object, an AwtUIRadioButton control integrates AFC with AWT. Although an AwtUIRadioButton control is fully compatible with AWT, a UIRadioButton 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
|
+--AwtUIRadioButton
public AwtUIRadioButton();
Creates an AWT-based radio button control with no content.
Remarks:
By default, the button's style is set to TOGGLE.
public AwtUIRadioButton(String name);
Creates an AWT-based radio button control with the specified text.
Parameter | Description |
name
| The text to be displayed with the radio button 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 AwtUIRadioButton(String name, int style);
Creates an AWT-based radio button control using the specified text for content and the specified style.
Parameter | Description |
name
| The text to be displayed with the radio button 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 AwtUIRadioButton(IUIComponent comp);
Creates an AWT-based radio button control with the specified component.
Parameter | Description |
comp
| The component to be displayed with the radio button image.
|
Remarks:
Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. By default, the button's style is set to TOGGLE. For examples of how to construct buttons, see the UIButton overview.
public AwtUIRadioButton(IUIComponent comp, int style);
Creates an AWT-based radio button control with the specified component and style.
Parameter | Description |
comp
| The component to be displayed with the radio button image.
|
style
| The style of the button. Possible values include UIButton.TOGGLE or UIButton.TRITOGGLE.
|
Remarks:
Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.
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 UIRadioButton object associated with the button control.
Remarks:
When the AWT-based button is first created, it is associated with a UIRadioButton 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 the super method 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