Packagecom.yworks.graph.drawing
Classpublic class IconLabelStyleRenderer
InheritanceIconLabelStyleRenderer Inheritance AbstractStyleRenderer Inheritance Object
Implements ILabelStyleRenderer

An IStyleRenderer that can handle IIconLabelStyleDecorator instances.

This implementation paints the label's text and an icon.

See also

IconLabelStyle
IconLabelStyleDecorator
IIconLabelStyleDecorator
com.yworks.graph.drawing.IStyleRenderer


Public Properties
 PropertyDefined By
 Inheriteditem : IModelItem
[read-only] Gets the currently configured item.
AbstractStyleRenderer
 Inheritedstyle : IVisualStyle
[read-only] Gets the currently configured style.
AbstractStyleRenderer
 InheritedstyleDescriptor : ICanvasObjectDescriptor
[read-only] Gets the ICanvasObjectDescriptor to use for new installations.
AbstractStyleRenderer
Public Methods
 MethodDefined By
  
Creates a new instance of this renderer.
IconLabelStyleRenderer
  
[override]
IconLabelStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
 Inherited
Configures the style and item parameters, does not call configure and returns this.
AbstractStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
  
Calculates the ILabel.preferredSize of a given label using the associated style.
IconLabelStyleRenderer
 Inherited
install(canvas:CanvasComponent, group:ICanvasObjectGroup, modelItem:IModelItem):Array
Installs the model in the canvas at the given group using the styleDescriptor.
AbstractStyleRenderer
  
isHit(x:Number, y:Number, ctx:ICanvasContext):Boolean
[override]
IconLabelStyleRenderer
  
[override]
IconLabelStyleRenderer
 Inherited
Calls configure and tests the item using the style for a visible intersection with the clip bounds.
AbstractStyleRenderer
  
lookup(type:Class):Object
[override]
IconLabelStyleRenderer
  
[override]
IconLabelStyleRenderer
Protected Methods
 MethodDefined By
  
configure():void
[override]
IconLabelStyleRenderer
  
[override]
IconLabelStyleRenderer
  
Factory method that creates the text renderer that draws the textual part of the label.
IconLabelStyleRenderer
  
paintContent(g:YGraphics, ctx:IPaintContext, width:Number, height:Number):void
Actually paints the content into <0,0> - <width, height>.
IconLabelStyleRenderer
  
paintIcon(g:YGraphics, ctx:IPaintContext, x:Number, y:Number):void
Paints the icon at the given location.
IconLabelStyleRenderer
 Inherited
setItem(item:IModelItem):void
Called by the various descriptor getters to initialize the item.
AbstractStyleRenderer
 Inherited
Called by the various descriptor getters to initialize the style.
AbstractStyleRenderer
Constructor Detail
IconLabelStyleRenderer()Constructor
public function IconLabelStyleRenderer()

Creates a new instance of this renderer.

Method Detail
calculateBounds()method
override public function calculateBounds(scratch:IMutableRectangle, ctx:ICanvasContext):IRectangle

Parameters

scratch:IMutableRectangle
 
ctx:ICanvasContext

Returns
IRectangle
configure()method 
override protected function configure():void

createStyleDescriptor()method 
override protected function createStyleDescriptor():ICanvasObjectDescriptor

Returns
ICanvasObjectDescriptor
createTextRenderer()method 
protected function createTextRenderer():ILabelStyleRenderer

Factory method that creates the text renderer that draws the textual part of the label.

Returns
ILabelStyleRenderer — A new SimpleLabelStyleRenderer

See also

getPreferredSize()method 
public function getPreferredSize(label:ILabel, style:ILabelStyle):ISize

Calculates the ILabel.preferredSize of a given label using the associated style.

Parameters

label:ILabel — The label to determine the preferred size for
 
style:ILabelStyle — The style instance that uses this instance as its ILabelStyle.styleRenderer.

Returns
ISize — A size that can be used as the ILabel.preferredSize if this renderer paints the label using the associated style. May return null if there is no such thing like a preferred size for this style.
isHit()method 
override public function isHit(x:Number, y:Number, ctx:ICanvasContext):Boolean

Parameters

x:Number
 
y:Number
 
ctx:ICanvasContext

Returns
Boolean
isInBox()method 
override public function isInBox(box:IRectangle, ctx:ICanvasContext):Boolean

Parameters

box:IRectangle
 
ctx:ICanvasContext

Returns
Boolean
lookup()method 
override public function lookup(type:Class):Object

Parameters

type:Class

Returns
Object
paint()method 
override public function paint(g:YGraphics, ctx:IPaintContext):void

Parameters

g:YGraphics
 
ctx:IPaintContext

paintContent()method 
protected function paintContent(g:YGraphics, ctx:IPaintContext, width:Number, height:Number):void

Actually paints the content into <0,0> - <width, height>.

Parameters

g:YGraphics — The preconfigured graphics context
 
ctx:IPaintContext — The paint context to use.
 
width:Number — The width of the painting area.
 
height:Number — The height of the painting area.

paintIcon()method 
protected function paintIcon(g:YGraphics, ctx:IPaintContext, x:Number, y:Number):void

Paints the icon at the given location.

Parameters

g:YGraphics — The preconfigured graphics context.
 
ctx:IPaintContext — The paint context to use.
 
x:Number — The x location where to paint the icon in the graphics context.
 
y:Number — The y location where to paint the icon in the graphics context.