The interface for all UI delegate objects in the AsWing pluggable look and feel architecture.
The UI delegate object for a AsWing component is responsible for implementing
the aspects of the component that depend on the look and feel. The Component
class invokes methods from this class in order to delegate operations (painting,
layout calculations, etc.) that may vary depending on the look and feel installed.
Client programs should not invoke methods on this class directly.
public function getBoolean(key:String):BooleanParameters
Returns
public function getBorder(key:String):BorderParameters
Returns
public function getClass(key:String):ClassParameters
Returns
public function getColor(key:String):ASColorParameters
Returns
public function getDefault(key:String):*
Returns the default property for this UI of specified key.
Generally, the ui will search the key in self holder that was put by
putDefault first, if it contains, then return it. If not
then it will call UIManager.get to get it from LAF defaults.
Parameters
Returns
| * — the default property of specifiled key.
|
public function getFont(key:String):ASFontParameters
Returns
public function getGroundDecorator(key:String):GroundDecoratorParameters
Returns
public function getIcon(key:String):IconParameters
Returns
public function getInsets(key:String):InsetsParameters
Returns
public function getInstance(key:String):*Parameters
Returns
public function getInt(key:String):intParameters
Returns
public function getInternalFocusObject(c:Component):InteractiveObject
Returns the object to receive the focus for the component.
Parameters
Returns
| InteractiveObject — the object to receive the focus.
|
public function getMaximumSize(c:Component):IntDimension
Returns the specified component's maximum size appropriate for
the look and feel. If null is returned, the maximum
size will be calculated by the component's layout manager instead
(this is the preferred approach for any component with a specific
layout manager installed). The default implementation of this
method invokes getPreferredSize and returns that value.
Parameters
| c:Component — the component whose maximum size is being queried;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components
|
Returns
See also
public function getMinimumSize(c:Component):IntDimension
Returns the specified component's minimum size appropriate for
the look and feel. If null is returned, the minimum
size will be calculated by the component's layout manager instead
(this is the preferred approach for any component with a specific
layout manager installed). The default implementation of this
method invokes getPreferredSize and returns that value.
Parameters
| c:Component — the component whose minimum size is being queried;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components
|
Returns
See also
public function getNumber(key:String):NumberParameters
Returns
public function getPreferredSize(c:Component):IntDimension
Returns the specified component's preferred size appropriate for
the look and feel. If null is returned, the preferred
size will be calculated by the component's layout manager instead
(this is the preferred approach for any component with a specific
layout manager installed). The default implementation of this
method returns null.
Parameters
| c:Component — the component whose preferred size is being queried;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components
|
Returns
See also
public function getString(key:String):StringParameters
Returns
public function getUint(key:String):uintParameters
Returns
public function installUI(c:Component):void
Configures the specified component appropriate for the look and feel.
This method is invoked when the ComponentUI instance is being installed
as the UI delegate on the specified component. This method should
completely configure the component for the look and feel,
including the following:
- Install any default property values for color, fonts, borders,
icons, opacity, etc. on the component. Whenever possible,
property values initialized by the client program should not
be overridden.
- Install a
LayoutManager on the component if necessary.
- Create/add any required sub-components to the component.
- Create/install event listeners on the component.
- Install keyboard UI (mnemonics, traversal, etc.) on the component.
- Initialize any appropriate instance data.
Parameters
| c:Component — the component where this UI delegate is being installed
|
See also
public function paint(c:Component, g:Graphics2D, b:IntRectangle):void
Notifies this UI delegate that it's time to paint the specified
component. This method is invoked by Component
when the specified component is being painted.
In general this method need be overridden by subclasses;
all look-and-feel rendering code should reside in this method.
And there is a default background paint method, you should call
it in your overridden paint method.
Parameters
| c:Component — the component being painted;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components.
|
| |
| g:Graphics2D — the Graphics context in which to paint.
|
| |
| b:IntRectangle — the bounds to paint UI in.
|
See also
public function paintFocus(c:Component, g:Graphics2D, b:IntRectangle):void
Paints focus representation to the component.
Parameters
| c:Component — the component being painted;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components.
|
| |
| g:Graphics2D — the Graphics context in which to paint.
|
| |
| b:IntRectangle — the bounds to paint focus in.
|
public function putDefault(key:String, value:*):void
Puts a ui default value used to this UI instead of LAF defualt value.
The values should be put before installing then it can be used.
Parameters
| key:String — the key.
|
| |
| value:* — the value.
|
public function uninstallUI(c:Component):void
Reverses configuration which was done on the specified component during
installUI. This method is invoked when this
ComponentUI instance is being removed as the UI delegate
for the specified component. This method should undo the
configuration performed in installUI, being careful to
leave the Component instance in a clean state (no
extraneous listeners, look-and-feel-specific property objects, etc.).
This should include the following:
- Remove any UI-set borders from the component.
- Remove any UI-set layout managers on the component.
- Remove any UI-added sub-components from the component.
- Remove any UI-added event listeners from the component.
- Remove any UI-installed keyboard UI from the component.
- Remove any UI-added MCs from this component.
- Nullify any allocated instance data objects to allow for GC.
Parameters
| c:Component — the component from which this UI delegate is being removed;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components
|
See also