Package | com.yworks.graph.model |
Class | public class DefaultLabel |
Inheritance | DefaultLabel AbstractModelItem Object |
Implements | ILabel, ITagOwner, com.yworks.graph.model.IZOrderOwner, IMarkupExtensionFactory |
ILabel
interface that can be used stand-alone.
Property | Defined By | ||
---|---|---|---|
labelModelParameter : ILabelModelParameter
Gets the label model's parameter that determines the positioning of this label. | DefaultLabel | ||
layout : IOrientedRectangle [read-only]
Provides access to the layout of a label. | DefaultLabel | ||
owner : ILabeledItem
Gets the owner of this label. | DefaultLabel | ||
preferredSize : ISize
Gets the preferred size of the label with respect to its current
contents and the implementation of the visualization. | DefaultLabel | ||
style : ILabelStyle
Returns the style that is responsible for the visual representation
of this label. | DefaultLabel | ||
tag : Object
Gets or sets the tag associated with this instance. | DefaultLabel | ||
text : String
Gets the text string associated with this label. | DefaultLabel | ||
zOrder : int
The z-order of a model item which determines its render order in comparison to other model items. | DefaultLabel |
Method | Defined By | ||
---|---|---|---|
DefaultLabel(modelParameter:ILabelModelParameter, text:String, lookup:ILookup = null, preferredSize:ISize = null)
Initializes a new instance of the DefaultLabel class
using the provided parameter and text. | DefaultLabel | ||
Creates a markup extension that can be used instead of the original class. | DefaultLabel | ||
Returns the currently set ILookup delegate. | AbstractModelItem | ||
lookup(type:Class):Object [override]
Returns an instance that implements the given type or null. | DefaultLabel | ||
registerLookup(type:Class, instance:Object):void
Register an implementation for the given type that should be returned
when lookup is called with this given type. | AbstractModelItem | ||
setLookupImplementation(newLookup:ILookup):void
Sets the ILookup implementation used for
lookup calls on this instance. | AbstractModelItem | ||
toString():String
Returns a String representation of this instance. | DefaultLabel |
labelModelParameter | property |
labelModelParameter:ILabelModelParameter
Gets the label model's parameter that determines the positioning of this label.
In order to set a different parameter for this label, use IGraph
's setLabelModelParameter
method.
public function get labelModelParameter():ILabelModelParameter
public function set labelModelParameter(value:ILabelModelParameter):void
layout | property |
layout:IOrientedRectangle
[read-only] Provides access to the layout of a label.
Labels have a ISize
and are anchored at
a given location in world coordinate space. The anchor is
the point around which the oriented rectangle is rotated in the world coordinate system.
If the oriented rectangle has default orientation, i.e. its up vector points north (<0,-1>
),
it coincides with its lower left corner.
The positioning of the label is determined using a pair of ILabelModel
and ILabelModelParameter
.
In order to modify the layout of a label instance, set another LabelModelParameter
for this label or modify its associated instance.
public function get layout():IOrientedRectangle
owner | property |
owner:ILabeledItem
Gets the owner of this label.
Typically this will yield an instance of INode
or IEdge
.
public function get owner():ILabeledItem
public function set owner(value:ILabeledItem):void
preferredSize | property |
preferredSize:ISize
Gets the preferred size of the label with respect to its current contents and the implementation of the visualization.
Often times the Layout
size will be the same
as the preferred size, but it's up to the implementation of the ILabelModel
to interpret it differently.
In order to set a different preferred size for this label instance use IGraph
's
setPreferredSize
method.
public function get preferredSize():ISize
public function set preferredSize(value:ISize):void
style | property |
style:ILabelStyle
Returns the style that is responsible for the visual representation of this label.
In order to set the style on an instance, use the IGraph
's setStyle
method.
public function get style():ILabelStyle
public function set style(value:ILabelStyle):void
tag | property |
tag:Object
Gets or sets the tag associated with this instance.
The implementation itself does not normally depend on the tag associated with it. It serves as storage for the object only.
public function get tag():Object
public function set tag(value:Object):void
text | property |
text:String
Gets the text string associated with this label.
It is up to the visualization engine to interpret this property for the
visualization of the label. Normally it will render the text into the
layout
of this instance.
public function get text():String
public function set text(value:String):void
zOrder | property |
zOrder:int
The z-order of a model item which determines its render order in comparison to other model items.
public function get zOrder():int
public function set zOrder(value:int):void
DefaultLabel | () | Constructor |
public function DefaultLabel(modelParameter:ILabelModelParameter, text:String, lookup:ILookup = null, preferredSize:ISize = null)
Initializes a new instance of the DefaultLabel
class
using the provided parameter and text.
modelParameter:ILabelModelParameter — The model parameter.
| |
text:String — The text.
| |
lookup:ILookup (default = null ) — The lookup delegate used by lookup() .
| |
preferredSize:ISize (default = null ) — The label's preferred size
If null , a DefaultBendLookup instance is used.
|
createMarkupExtension | () | method |
public function createMarkupExtension(context:ILookup):MarkupExtension
Creates a markup extension that can be used instead of the original class.
Parameters
context:ILookup — The context that shall be considered when creating the markup extension.
|
MarkupExtension |
lookup | () | method |
override public function lookup(type:Class):Object
Returns an instance that implements the given type or null
.
Typically, this method will be called in order to obtain a different view or
aspect of the current instance. This is quite similar to casting or using
a super type or interface of this instance, but is not limited to inheritance or
compile time constraints. An instance implementing this method is not
required to return non-null
implementations for the types, nor does it
have to return the same instance any time. Also it depends on the
type and context whether the instance returned stays up to date or needs to
be reobtained for subsequent use.
Parameters
type:Class — the type for which an instance shall be returned
|
Object — an instance that is assignable to type or null
|
toString | () | method |
public function toString():String
Returns a String representation of this instance.
ReturnsString — A String representation of this instance.
|