Packagecom.yworks.graph.drawing
Classpublic class TLFLabelStyle
InheritanceTLFLabelStyle Inheritance SimpleAbstractLabelStyle Inheritance Object

A label style which uses the Flex Text Engine and the Text Layout Framework to render the text.

This class is only available in the Flex 4 version of yFiles FLEX.



Public Properties
 PropertyDefined By
  backgroundFill : IFill
The fill which is used for the background.
TLFLabelStyle
  backgroundStroke : IStroke
The stroke which is used for the border.
TLFLabelStyle
  clipText : Boolean
Whether to clip the text at the label's bounds.
TLFLabelStyle
 InheritedstyleRenderer : IStyleRenderer
[read-only] Gets the renderer implementation that has been supplied to this instance upon creation.
SimpleAbstractLabelStyle
  textConverter : String
The text converter type which is used to create a TextFlow from the label's text.
TLFLabelStyle
  textFormat : TextLayoutFormat
The TextLayoutFormat which determines the styling of the text.
TLFLabelStyle
Public Methods
 MethodDefined By
  
TLFLabelStyle(textFormat:TextLayoutFormat = null, textConverter:String, backgroundStroke:IStroke = null, backgroundFill:IFill = null, clipText:Boolean = true)
Creates a new instance.
TLFLabelStyle
  
clone():Object
[override]
TLFLabelStyle
 Inherited
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.
SimpleAbstractLabelStyle
Protected Methods
 MethodDefined By
 Inherited
Calculates the bounds for the label in the given context.
SimpleAbstractLabelStyle
  
[override]
TLFLabelStyle
  
[override] Callback that returns the preferred size of the label.
TLFLabelStyle
 Inherited
Returns a transform according to the label's layout and isAutoFlip property.
SimpleAbstractLabelStyle
 Inherited
isAutoFlip():Boolean
Determines whether the label's style should automatically flip the painting contents if the layout is upside down.
SimpleAbstractLabelStyle
 Inherited
isHit(label:ILabel, x:Number, y:Number, ctx:ICanvasContext):Boolean
Determines whether the visual representation of the label has been hit at the given location.
SimpleAbstractLabelStyle
 Inherited
isInBox(label:ILabel, box:IRectangle, ctx:ICanvasContext):Boolean
Determines whether the visualization for the specified node is included in the marquee selection.
SimpleAbstractLabelStyle
 Inherited
isVisible(label:ILabel, clip:IRectangle, ctx:ICanvasContext):Boolean
Determines whether the visualization for the specified label is visible in the context.
SimpleAbstractLabelStyle
 Inherited
lookup(label:ILabel, type:Class):Object
Performs the lookup operation for the lookup calls to the renderer.
SimpleAbstractLabelStyle
 Inherited
updateDisplayObject(label:ILabel, oldDisplayObject:DisplayObject, ctx:IDisplayObjectContext):DisplayObject
This style's renderer delegates updating the display object to this method.
SimpleAbstractLabelStyle
Property Detail
backgroundFillproperty
backgroundFill:IFill

The fill which is used for the background. Default is null which means no background is drawn.

The default value is null.


Implementation
    public function get backgroundFill():IFill
    public function set backgroundFill(value:IFill):void
backgroundStrokeproperty 
backgroundStroke:IStroke

The stroke which is used for the border. Default is null which means no border is drawn.

The default value is null.


Implementation
    public function get backgroundStroke():IStroke
    public function set backgroundStroke(value:IStroke):void
clipTextproperty 
clipText:Boolean

Whether to clip the text at the label's bounds.

The default value is false.


Implementation
    public function get clipText():Boolean
    public function set clipText(value:Boolean):void
textConverterproperty 
textConverter:String

The text converter type which is used to create a TextFlow from the label's text. One of the constants provided by flashx.textLayout.conversion.TextConverter.

The default value is TextConverter.PLAIN_TEXT_FORMAT.


Implementation
    public function get textConverter():String
    public function set textConverter(value:String):void
textFormatproperty 
textFormat:TextLayoutFormat

The TextLayoutFormat which determines the styling of the text. If none is provided a new instance with default values will be created. Also, if no default padding is set the value of paddingTop will be set to 4, the values of paddingLeft, paddingRight, and paddingBottom will be set to 2. Also, if no value is set to textAlignLast the property will be set to textAlign or TextAlign.START if textAlign is set to TextAlign.JUSTIFY.


Implementation
    public function get textFormat():TextLayoutFormat
    public function set textFormat(value:TextLayoutFormat):void
Constructor Detail
TLFLabelStyle()Constructor
public function TLFLabelStyle(textFormat:TextLayoutFormat = null, textConverter:String, backgroundStroke:IStroke = null, backgroundFill:IFill = null, clipText:Boolean = true)

Creates a new instance.

Parameters
textFormat:TextLayoutFormat (default = null) — The TextLayoutFormat which determines the styling of the text. If none is provided a new instance with default values will be created. Also, if no default padding is set the value of paddingTop will be set to 4, the values of paddingLeft, paddingRight, and paddingBottom will be set to 2. Also, if no value is set to textAlignLast the property will be set to textAlign or TextAlign.START if textAlign is set to TextAlign.JUSTIFY.
 
textConverter:String (default = NaN) — The text converter type which is used to create a TextFlow from the label's text. One of the constants provided by flashx.textLayout.conversion.TextConverter.
 
backgroundStroke:IStroke (default = null) — The stroke which is used for the border. Default is null which means no border is drawn.
 
backgroundFill:IFill (default = null) — The fill which is used for the background. Default is null which means no background is drawn.
 
clipText:Boolean (default = true) — Whether to clip the text at the label's bounds.
Method Detail
clone()method
override public function clone():Object

Returns
Object
createDisplayObject()method 
override protected function createDisplayObject(label:ILabel, ctx:IDisplayObjectContext):DisplayObject

Parameters

label:ILabel
 
ctx:IDisplayObjectContext

Returns
DisplayObject
getPreferredSize()method 
override protected function getPreferredSize(label:ILabel):ISize

Callback that returns the preferred size of the label.

Subclasses have to override this method and return the preferred size for their style. The utility method YGraphics.getTextSize can be used to calculate the size of a given text and text format as described in our Custom Style tutorial.

Parameters

label:ILabel — The label to which this style instance is assigned.

Returns
ISize — The preferred size.