Packageorg.aswing.plaf
Interfacepublic interface ComponentUI
SubinterfacesAdjusterUI, ColorSwatchesUI, ComboBoxUI, FrameUI, MenuElementUI, SliderUI, TableUI
ImplementorsBaseComponentUI

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 Methods
 MethodDefined by
  
getBoolean(key:String):Boolean
ComponentUI
  
getBorder(key:String):Border
ComponentUI
  
getClass(key:String):Class
ComponentUI
  
getColor(key:String):ASColor
ComponentUI
  
getDefault(key:String):*
Returns the default property for this UI of specified key.
ComponentUI
  
getFont(key:String):ASFont
ComponentUI
  
ComponentUI
  
getIcon(key:String):Icon
ComponentUI
  
getInsets(key:String):Insets
ComponentUI
  
getInstance(key:String):*
ComponentUI
  
getInt(key:String):int
ComponentUI
  
getInternalFocusObject(c:Component):InteractiveObject
Returns the object to receive the focus for the component.
ComponentUI
  
Returns the specified component's maximum size appropriate for the look and feel.
ComponentUI
  
Returns the specified component's minimum size appropriate for the look and feel.
ComponentUI
  
getNumber(key:String):Number
ComponentUI
  
Returns the specified component's preferred size appropriate for the look and feel.
ComponentUI
  
getString(key:String):String
ComponentUI
  
getUint(key:String):uint
ComponentUI
  
Configures the specified component appropriate for the look and feel.
ComponentUI
  
Notifies this UI delegate that it's time to paint the specified component.
ComponentUI
  
Paints focus representation to the component.
ComponentUI
  
putDefault(key:String, value:*):void
Puts a ui default value used to this UI instead of LAF defualt value.
ComponentUI
  
Reverses configuration which was done on the specified component during installUI.
ComponentUI
Method detail
getBoolean()method
public function getBoolean(key:String):BooleanParameters
key:String

Returns
Boolean
getBorder()method 
public function getBorder(key:String):BorderParameters
key:String

Returns
Border
getClass()method 
public function getClass(key:String):ClassParameters
key:String

Returns
Class
getColor()method 
public function getColor(key:String):ASColorParameters
key:String

Returns
ASColor
getDefault()method 
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
key:String

Returns
* — the default property of specifiled key.
getFont()method 
public function getFont(key:String):ASFontParameters
key:String

Returns
ASFont
getGroundDecorator()method 
public function getGroundDecorator(key:String):GroundDecoratorParameters
key:String

Returns
GroundDecorator
getIcon()method 
public function getIcon(key:String):IconParameters
key:String

Returns
Icon
getInsets()method 
public function getInsets(key:String):InsetsParameters
key:String

Returns
Insets
getInstance()method 
public function getInstance(key:String):*Parameters
key:String

Returns
*
getInt()method 
public function getInt(key:String):intParameters
key:String

Returns
int
getInternalFocusObject()method 
public function getInternalFocusObject(c:Component):InteractiveObject

Returns the object to receive the focus for the component.

Parameters
c:Component — the component

Returns
InteractiveObject — the object to receive the focus.
getMaximumSize()method 
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
IntDimension — a IntDimension object or null

See also

getMinimumSize()method 
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
IntDimension — a IntDimension object or null

See also

getNumber()method 
public function getNumber(key:String):NumberParameters
key:String

Returns
Number
getPreferredSize()method 
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
IntDimension

See also

getString()method 
public function getString(key:String):StringParameters
key:String

Returns
String
getUint()method 
public function getUint(key:String):uintParameters
key:String

Returns
uint
installUI()method 
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:

  1. 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.
  2. Install a LayoutManager on the component if necessary.
  3. Create/add any required sub-components to the component.
  4. Create/install event listeners on the component.
  5. Install keyboard UI (mnemonics, traversal, etc.) on the component.
  6. Initialize any appropriate instance data.

Parameters
c:Component — the component where this UI delegate is being installed

See also

paint()method 
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

paintFocus()method 
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.
putDefault()method 
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.
uninstallUI()method 
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:

  1. Remove any UI-set borders from the component.
  2. Remove any UI-set layout managers on the component.
  3. Remove any UI-added sub-components from the component.
  4. Remove any UI-added event listeners from the component.
  5. Remove any UI-installed keyboard UI from the component.
  6. Remove any UI-added MCs from this component.
  7. 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