Packageorg.aswing
Interfacepublic interface Icon extends Decorator
ImplementorsArrow, AssetIcon, CloseIcon, ColorRectIcon, DefaultEmptyDecoraterResource, EmptyIcon, MultipleAssetIcon, NoColorIcon, PreviewColorIcon, SimpleButtonIcon, SimpleButtonIconToggle, TreeFolderIcon, TreeLeafIcon

A small fixed size picture, typically used to decorate components.

You can either return a display object to be the icon or just return null and paint the picture in updateIcon method use the component g(Graphics).

But, you'd better to return a display object here, because if you just paint graphics to the target component graphics, there's a situation that your painted graphics maybe not eyeable, that is when the component has a background decorator with a display object, it will cover this graphics. If you return a display object here, it will be no problem of this case.



Public Methods
 MethodDefined by
 Inherited
getDisplay(c:Component):DisplayObject
Returns the display object which is used as the component decorator.
Decorator
  
Returns the icon height.
Icon
  
Returuns the icon width.
Icon
  
updateIcon(c:Component, g:Graphics2D, x:int, y:int):void
Updates the icon.
Icon
Method detail
getIconHeight()method
public function getIconHeight(c:Component):int

Returns the icon height.

For same component param, this method must return same value.

Parameters
c:Component — the component which owns the icon.

Returns
int — the height of the icon.
getIconWidth()method 
public function getIconWidth(c:Component):int

Returuns the icon width.

For same component param, this method must return same value.

Parameters
c:Component — the component which owns the icon.

Returns
int — the width of the icon.
updateIcon()method 
public function updateIcon(c:Component, g:Graphics2D, x:int, y:int):void

Updates the icon.

Parameters
c:Component — the component which owns the icon.
 
g:Graphics2D — the graphics of the component, you can paint picture onto it.
 
x:int — the x coordinates of the icon should be.
 
y:int — the y coordinates of the icon should be.