Packagecom.yworks.graph.drawing
Classpublic class IconLabelStyleDecorator
InheritanceIconLabelStyleDecorator Inheritance Object
Implements IIconLabelStyleDecorator

The default mutable implementation of the IIconLabelStyleDecorator interface.

See also

IIconLabelStyleDecorator


Public Properties
 PropertyDefined By
  autoFlip : Boolean
Whether the label should be flipped 180 degrees automatically, if it would be oriented downwards, otherwise.
IconLabelStyleDecorator
  icon : IIcon
The icon to paint for the label
IconLabelStyleDecorator
  iconPlacement : ILabelModelParameter
The icon placement model parameter.
IconLabelStyleDecorator
  innerStyle : ILabelStyle
The inner style that gets decorated by this decorator.
IconLabelStyleDecorator
  styleRenderer : IStyleRenderer
[read-only] Gets the renderer implementation that has been supplied to this instance upon creation.
IconLabelStyleDecorator
Public Methods
 MethodDefined By
  
IconLabelStyleDecorator(icon:IIcon, iconPlacement:ILabelModelParameter, innerStyle:ILabelStyle = null, renderer:ILabelStyleRenderer = null)
Creates a new instance.
IconLabelStyleDecorator
  
clone():Object
Creates a clone of this instance.
IconLabelStyleDecorator
  
install(canvas:CanvasComponent, group:ICanvasObjectGroup, modelItem:IModelItem):Array
Prepares the rendering of an IModelItem in a CanvasComponent by adding ICanvasObject's to the provided canvas.
IconLabelStyleDecorator
Protected Methods
 MethodDefined By
  
Callback that creates the cloned instance for the clone() method.
IconLabelStyleDecorator
Property Detail
autoFlipproperty
autoFlip:Boolean

Whether the label should be flipped 180 degrees automatically, if it would be oriented downwards, otherwise.


Implementation
    public function get autoFlip():Boolean
    public function set autoFlip(value:Boolean):void
iconproperty 
icon:IIcon

The icon to paint for the label


Implementation
    public function get icon():IIcon
    public function set icon(value:IIcon):void
iconPlacementproperty 
iconPlacement:ILabelModelParameter

The icon placement model parameter.

All valid node label model parameters can be used. The label's ILabel.layout will be interpreted as the node's layout and the icon will be placed relative to that layout as if it was a node's label.


Implementation
    public function get iconPlacement():ILabelModelParameter
    public function set iconPlacement(value:ILabelModelParameter):void
innerStyleproperty 
innerStyle:ILabelStyle

The inner style that gets decorated by this decorator.


Implementation
    public function get innerStyle():ILabelStyle
    public function set innerStyle(value:ILabelStyle):void
styleRendererproperty 
styleRenderer:IStyleRenderer  [read-only]

Gets the renderer implementation that has been supplied to this instance upon creation.


Implementation
    public function get styleRenderer():IStyleRenderer
Constructor Detail
IconLabelStyleDecorator()Constructor
public function IconLabelStyleDecorator(icon:IIcon, iconPlacement:ILabelModelParameter, innerStyle:ILabelStyle = null, renderer:ILabelStyleRenderer = null)

Creates a new instance.

Parameters
icon:IIcon — The icon to display.
 
iconPlacement:ILabelModelParameter — A ILabelModelParameter which describes the position of the icon relative to the label text.

All valid node label model parameters can be used. The label's ILabel.layout will be interpreted as the node's layout and the icon will be placed relative to that layout as if it was a node's label.

 
innerStyle:ILabelStyle (default = null) — The ILabelStyle which is decorated by this instance. If none is provided, a SimpleLabelStyle is used.
 
renderer:ILabelStyleRenderer (default = null) — The IStyleRenderer which renders the label. If none is provided a new IconLabelStyleRenderer instance is used.
Method Detail
clone()method
public function clone():Object

Creates a clone of this instance.

Returns
Object — A clone of this instance.
createClone()method 
protected function createClone():IconLabelStyleDecorator

Callback that creates the cloned instance for the clone() method.

Returns
IconLabelStyleDecorator — A clone of this instance.
install()method 
public function install(canvas:CanvasComponent, group:ICanvasObjectGroup, modelItem:IModelItem):Array

Prepares the rendering of an IModelItem in a CanvasComponent by adding ICanvasObject's to the provided canvas.

Implementations may add zero or more ICanvasObject instances to the given CanvasComponent. The group parameter can be used as a hint for implementations. They can add their newly created canvas objects to the given group. However they are not obliged to do that.

Parameters

canvas:CanvasComponent — The canvas to install the canvas objects in.
 
group:ICanvasObjectGroup — A hint that tells the implementation where to add the canvas objects.
 
modelItem:IModelItem — The item to install a visual representation for.

Returns
Array — An array of zero or more canvas objects that have been installed in the canvas by this method or null if nothing was installed.