Package | com.yworks.graph.drawing |
Class | public class TLFLabelStyle |
Inheritance | TLFLabelStyle SimpleAbstractLabelStyle Object |
This class is only available in the Flex 4 version of yFiles FLEX.
Property | Defined 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 | ||
styleRenderer : 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 |
Method | Defined 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 | ||
Prepares the rendering of an IModelItem in a CanvasComponent by
adding ICanvasObject's to the provided canvas. | SimpleAbstractLabelStyle |
Method | Defined By | ||
---|---|---|---|
Calculates the bounds for the label in the given context. | SimpleAbstractLabelStyle | ||
[override] | TLFLabelStyle | ||
[override]
Callback that returns the preferred size of the label. | TLFLabelStyle | ||
Returns a transform according to the label's layout and isAutoFlip property. | SimpleAbstractLabelStyle | ||
isAutoFlip():Boolean
Determines whether the label's style should automatically flip the painting contents if the
layout is upside down. | SimpleAbstractLabelStyle | ||
Determines whether the visual representation of the label has been hit at the given location. | SimpleAbstractLabelStyle | ||
Determines whether the visualization for the specified node is included in the marquee selection. | SimpleAbstractLabelStyle | ||
Determines whether the visualization for the specified label is visible in the context. | SimpleAbstractLabelStyle | ||
Performs the lookup operation for the lookup calls to the renderer. | SimpleAbstractLabelStyle | ||
updateDisplayObject(label:ILabel, oldDisplayObject:DisplayObject, ctx:IDisplayObjectContext):DisplayObject
This style's renderer delegates updating the display object to this method. | SimpleAbstractLabelStyle |
backgroundFill | property |
backgroundFill:IFill
The fill which is used for the background. Default is null
which means no background is drawn.
The default value is null
.
public function get backgroundFill():IFill
public function set backgroundFill(value:IFill):void
backgroundStroke | property |
backgroundStroke:IStroke
The stroke which is used for the border. Default is null
which means no border is drawn.
The default value is null
.
public function get backgroundStroke():IStroke
public function set backgroundStroke(value:IStroke):void
clipText | property |
clipText:Boolean
Whether to clip the text at the label's bounds.
The default value is false
.
public function get clipText():Boolean
public function set clipText(value:Boolean):void
textConverter | property |
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
.
public function get textConverter():String
public function set textConverter(value:String):void
textFormat | property |
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
.
public function get textFormat():TextLayoutFormat
public function set textFormat(value:TextLayoutFormat):void
TLFLabelStyle | () | Constructor |
public function TLFLabelStyle(textFormat:TextLayoutFormat = null, textConverter:String, backgroundStroke:IStroke = null, backgroundFill:IFill = null, clipText:Boolean = true)
Creates a new instance.
ParameterstextFormat: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.
|
clone | () | method |
override public function clone():Object
ReturnsObject |
createDisplayObject | () | method |
override protected function createDisplayObject(label:ILabel, ctx:IDisplayObjectContext):DisplayObject
Parameters
label:ILabel | |
ctx:IDisplayObjectContext |
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.
|
ISize — The preferred size.
|