Packages
 In this topic

*Constructors

*Methods

 

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

 


Class AwtUIControl

public abstract class AwtUIControl extends AwtUIHost
{
  // Constructors
  public AwtUIControl();
  public AwtUIControl(IUIComponent comp);

  // Methods
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(IUIComponent comp, int index);
  public IUIComponent add(String name, IUIComponent comp);
  public IUIComponent add(IUIComponent comp, Object constraints);
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public Component add(Component comp);
  public Component add(Component comp, int index);
  public Component add(String name, Component comp);
  public void add(Component comp, Object constraints);
  public void add(Component comp, Object constraints, int index);
  public void addNotify();
  public abstract IUIComponent getBase();
  public int getID();
  public String getName();
  public boolean isChecked();
  public boolean isFocused();
  public boolean isHot();
  public boolean isIndeterminate();
  public boolean isKeyable();
  public boolean isPressed();
  public boolean isSelectable();
  public boolean isSelected();
  public boolean postEvent(Event evt);
  public void remove(IUIComponent comp);
  public void removeAll();
  public void setChecked(boolean on);
  public void setFocused(boolean on);
  public void setHot(boolean on);
  public void setID(int id);
  public void setIndeterminate(boolean on);
  public void setLayout(LayoutManager mgr);
  public void setName(String name);
  public void setPressed(boolean on);
  public void setSelected(boolean on);
}

This class implements an abstract AWT-based control that hosts a UI control. The following classes extend AwtUIControl and allow you to integrate AFC with AWT.

AwtUIBand AwtUIBandBox AwtUIButton
AwtUICheckButton AwtUIChoice AwtUIColumnViewer
AwtUIDrawText AwtUIEdit AwtUIGraphic
AwtUIList AwtUIMarquee AwtUIMenuList
AwtUIPanel AwtUIProgress AwtUIPushButton
AwtUIRadioButton AwtUIRepeatButton AwtUIScrollBar
AwtUIScrollViewer AwtUISplitViewer AwtUIStatus
AwtUITabList AwtUITabViewer AwtUIText
AwtUITree

Although an AwtUI control is completely compatibile with AWT, a UI control is smaller in size and provides better performance.

For more information about how AWT-based controls in AFC host other components, see the AwtUIHost overview.

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

Constructors

AwtUIControl

public AwtUIControl();

Creates an abstract AWT-based control.

AwtUIControl

public AwtUIControl(IUIComponent comp);

Creates an abstract AWT-based control using the specified component.

ParameterDescription
comp The component to be displayed by the control.

Methods

add

public IUIComponent add(IUIComponent comp);

Adds the specified UI component to the control.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

ParameterDescription
comp The UI component to be added.

Overrides:

add(IUIComponent) in AwtUIHost.

add

public IUIComponent add(IUIComponent comp, int index);

Adds the specified UI component to the control at the specified index.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

ParameterDescription
comp The UI component to be added.
index The zero-based index at which to insert the component, or -1 to add the component at the end.

Overrides:

add(IUIComponent,int) in AwtUIHost.

add

public IUIComponent add(String name, IUIComponent comp);

Adds the specified UI component to the control, according to the specified layout location.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

ParameterDescription
name The layout name identifying where to add the component. This value depends on the layout manager of the component.
comp The UI component to be added.

Overrides:

add(String,IUIComponent) in AwtUIHost.

add

public IUIComponent add(IUIComponent comp, Object constraints);

Adds the specified UI component to the control, according to the specified layout constraints.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

ParameterDescription
comp The UI component to be added.
constraints The layout constraints identifying where to add the component. This value depends on the layout manager of the component.

Overrides:

add(IUIComponent,Object) in AwtUIHost.

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds the specified UI component to the control, according to the specified layout constraints and index.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

ParameterDescription
comp The UI component to be added.
constraints The layout constraints identifying where to add the component. This value depends on the layout manager of the component.
index The zero-based index at which to insert the component, or -1 to add the component at the end.

Overrides:

add(IUIComponent,Object,int) in AwtUIHost.

add

public Component add(Component comp);

Adds the specified AwtUI component to the control. Pure AWT components cannot be added.

Return Value:

Returns the control itself.

ParameterDescription
comp The AwtUI component to be added.

Exceptions:

IllegalArgumentException if a pure AWT component was added.

add

public Component add(Component comp, int index);

Adds the specified AwtUI component to the control at the specified index. Pure AWT components cannot be added.

Return Value:

Returns the control itself.

ParameterDescription
comp The AwtUI component to be added.
index The zero-based index at which to insert the component, or -1 to add the component at the end.

Exceptions:

IllegalArgumentException if a pure AWT component was added.

add

public Component add(String name, Component comp);

Adds the specified AwtUI component to the control, according to the specified layout location. Pure AWT components cannot be added.

Return Value:

Returns the control itself.

ParameterDescription
name The layout name identifying where to add the component. This value depends on the layout manager of the underlying UI object.
comp The AwtUI component to be added.

Exceptions:

IllegalArgumentException if a pure AWT component was added.

add

public void add(Component comp, Object constraints);

Adds the specified AwtUI component to the control, according to the specified layout constraints. Pure AWT components cannot be added.

Return Value:

No return value.

ParameterDescription
comp The AwtUI component to be added.
constraints The layout constraints identifying where to add the component. This value depends on the layout manager of the underlying UI object.

Exceptions:

IllegalArgumentException if a pure AWT component was added.

add

public void add(Component comp, Object constraints, int index);

Adds the specified AwtUI component to the control, according to the specified layout constraints and index. Pure AWT components cannot be added.

Return Value:

No return value.

ParameterDescription
comp The AwtUI component to be added.
constraints The layout constraints identifying where to add the component. This value depends on the layout manager of the underlying UI object.
index The zero-based index at which to insert the component, or -1 to add the component at the end.

Exceptions:

IllegalArgumentException if a pure AWT component was added.

addNotify

public void addNotify();

Determines whether the control's reparent state is set, and if so, clears this state. (A control is reparented if its underlying UI component has been extracted.)

Return Value:

No return value.

Overrides:

addNotify() in AwtUIHost.

See Also: isReparent

getBase

public abstract IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UI object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UI object.

getID

public int getID();

Retrieves the control's identifier.

Return Value:

Returns the integer associated with the control.

getName

public String getName();

Retrieves the identifying name of the component.

Return Value:

Returns the string name.

isChecked

public boolean isChecked();

Determines whether the control's checked state is set.

Return Value:

Returns true if the control is checked; otherwise, returns false.

isFocused

public boolean isFocused();

Determines whether the component's focus state is set.

Return Value:

Returns true if the component has focus; otherwise, returns false.

See Also: setFocused

isHot

public boolean isHot();

Determines whether the control's hot-tracked state is set.

Return Value:

Returns true if the control is hot-tracked; otherwise, returns false.

isIndeterminate

public boolean isIndeterminate();

Determines whether the control's indeterminate state is set.

Return Value:

Returns true if the control is indeterminate; otherwise, returns false.

isKeyable

public boolean isKeyable();

Determines whether the control can receive keyboard input.

Return Value:

Returns true if the control can receive keyboard input; otherwise, returns false.

isPressed

public boolean isPressed();

Determines whether the control's pressed state is set.

Return Value:

Returns true if the control is pressed; otherwise, returns false.

isSelectable

public boolean isSelectable();

Determines whether the control's selected state can be set.

Return Value:

Returns true if the control can be selected; otherwise, returns false.

isSelected

public boolean isSelected();

Determines whether the control's selected state is set.

Return Value:

Returns true if the control is selected; otherwise, returns false.

postEvent

public boolean postEvent(Event evt);

Posts the specified event.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event.

Overrides:

postEvent(Event) in AwtUIHost.

remove

public void remove(IUIComponent comp);

Removes the specified component from the associated root container.

Return Value:

No return value.

ParameterDescription
comp The component to be removed.

Overrides:

remove(IUIComponent) in AwtUIHost.

See Also: removeAll, add

removeAll

public void removeAll();

Removes all components from the container, including the header component.

Return Value:

No return value.

Overrides:

removeAll() in AwtUIHost.

setChecked

public void setChecked(boolean on);

Sets or clears the checked state of the control.

Return Value:

No return value.

ParameterDescription
on If true, the checked state is set; otherwise, it is cleared.

setFocused

public void setFocused(boolean on);

Sets or clears the focus state of the component.

Return Value:

No return value.

ParameterDescription
on If true, the focus state is set; otherwise, it is cleared.

Remarks:

This method is automatically invoked when the component receives or loses focus.

See Also: isFocused

setHot

public void setHot(boolean on);

Sets or clears the hot-tracked state of the control.

Return Value:

No return value.

ParameterDescription
on If true, the hot-tracked state is set; otherwise, it is cleared.

setID

public void setID(int id);

Set the control's identifier.

Return Value:

No return value.

ParameterDescription
id The value to be associated with the control.

setIndeterminate

public void setIndeterminate(boolean on);

Sets or clears the indeterminate state of the control.

Return Value:

No return value.

ParameterDescription
on If true, the indeterminate state is set; otherwise, it is cleared.

setLayout

public void setLayout(LayoutManager mgr);

Sets the control's layout manager.

Return Value:

No return value.

ParameterDescription
mgr The new layout manager to be used.

setName

public void setName(String name);

Sets the name of the control.

Return Value:

No return value.

ParameterDescription
name The name to be associated with the control.

setPressed

public void setPressed(boolean on);

Sets or clears the pressed state of the control.

Return Value:

No return value.

ParameterDescription
on If true, the pressed state is set; otherwise, it is cleared.

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the control.

Return Value:

No return value.

ParameterDescription
on If true, the selected state is set; otherwise, it is cleared.

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