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.
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
public AwtUIControl();
Creates an abstract AWT-based control.
public AwtUIControl(IUIComponent comp);
Creates an abstract AWT-based control using the specified component.
Parameter | Description |
comp
| The component to be displayed by the control.
|
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.
Parameter | Description |
comp
| The UI component to be added.
|
Overrides:
add(IUIComponent) in AwtUIHost.
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.
Parameter | Description |
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.
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.
Parameter | Description |
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.
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.
Parameter | Description |
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.
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.
Parameter | Description |
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.
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.
Parameter | Description |
comp
| The AwtUI component to be added.
|
Exceptions:
IllegalArgumentException
if a pure AWT component was added.
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.
Parameter | Description |
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.
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.
Parameter | Description |
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.
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.
Parameter | Description |
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.
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.
Parameter | Description |
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.
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
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.
public int getID();
Retrieves the control's identifier.
Return Value:
Returns the integer associated with the control.
public String getName();
Retrieves the identifying name of the component.
Return Value:
Returns the string name.
public boolean isChecked();
Determines whether the control's checked state is set.
Return Value:
Returns true if the control is checked; otherwise, returns false.
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
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.
public boolean isIndeterminate();
Determines whether the control's indeterminate state is set.
Return Value:
Returns true if the control is indeterminate; otherwise, returns false.
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.
public boolean isPressed();
Determines whether the control's pressed state is set.
Return Value:
Returns true if the control is pressed; otherwise, returns false.
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.
public boolean isSelected();
Determines whether the control's selected state is set.
Return Value:
Returns true if the control is selected; otherwise, returns false.
public boolean postEvent(Event evt);
Posts the specified event.
Return Value:
Returns true if the event was handled; otherwise, returns false.
Parameter | Description |
evt
| The event.
|
Overrides:
postEvent(Event) in AwtUIHost.
public void remove(IUIComponent comp);
Removes the specified component from the associated root container.
Return Value:
No return value.
Parameter | Description |
comp
| The component to be removed.
|
Overrides:
remove(IUIComponent) in AwtUIHost.
See Also: removeAll, add
public void removeAll();
Removes all components from the container, including the header component.
Return Value:
No return value.
Overrides:
removeAll() in AwtUIHost.
public void setChecked(boolean on);
Sets or clears the checked state of the control.
Return Value:
No return value.
Parameter | Description |
on
| If true, the checked state is set; otherwise, it is cleared.
|
public void setFocused(boolean on);
Sets or clears the focus state of the component.
Return Value:
No return value.
Parameter | Description |
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
public void setHot(boolean on);
Sets or clears the hot-tracked state of the control.
Return Value:
No return value.
Parameter | Description |
on
| If true, the hot-tracked state is set; otherwise, it is cleared.
|
public void setID(int id);
Set the control's identifier.
Return Value:
No return value.
Parameter | Description |
id
| The value to be associated with the control.
|
public void setIndeterminate(boolean on);
Sets or clears the indeterminate state of the control.
Return Value:
No return value.
Parameter | Description |
on
| If true, the indeterminate state is set; otherwise, it is cleared.
|
public void setLayout(LayoutManager mgr);
Sets the control's layout manager.
Return Value:
No return value.
Parameter | Description |
mgr
| The new layout manager to be used.
|
public void setName(String name);
Sets the name of the control.
Return Value:
No return value.
Parameter | Description |
name
| The name to be associated with the control.
|
public void setPressed(boolean on);
Sets or clears the pressed state of the control.
Return Value:
No return value.
Parameter | Description |
on
| If true, the pressed state is set; otherwise, it is cleared.
|
public void setSelected(boolean on);
Sets or clears the selected state of the control.
Return Value:
No return value.
Parameter | Description |
on
| If true, the selected state is set; otherwise, it is cleared.
|