Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.ui   Previous This
Package
Next

 


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

Constructors

AwtUIRadioButton

public AwtUIRadioButton();

Creates an AWT-based radio button control with no content.

Remarks:

By default, the button's style is set to TOGGLE.

AwtUIRadioButton

public AwtUIRadioButton(String name);

Creates an AWT-based radio button control with the specified text.

ParameterDescription
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.

AwtUIRadioButton

public AwtUIRadioButton(String name, int style);

Creates an AWT-based radio button control using the specified text for content and the specified style.

ParameterDescription
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.

AwtUIRadioButton

public AwtUIRadioButton(IUIComponent comp);

Creates an AWT-based radio button control with the specified component.

ParameterDescription
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.

AwtUIRadioButton

public AwtUIRadioButton(IUIComponent comp, int style);

Creates an AWT-based radio button control with the specified component and style.

ParameterDescription
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.

Methods

addItemListener

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.

ParameterDescription
l The item listener to be added.

See Also: removeItemListener

getBase

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.

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

ParameterDescription
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.

Event type Method called
item event processItemEvent
action event processActionEvent (inherited through AwtUIButton)
component event processComponentEvent (inherited through AwtUIHost)
container event processContainerEvent (inherited through AwtUIHost)
focus event processFocusEvent (inherited through AwtUIHost)
key event processKeyEvent (inherited through AwtUIHost)
mouse event processMouseEvent (inherited through AwtUIHost)
mouse motion event processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(ItemEvent e);

Processes item events.

Return Value:

No return value.

ParameterDescription
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

removeItemListener

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.

ParameterDescription
l The item listener to be removed.

See Also: addItemListener

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.