| Package | com.yworks.graph.model |
| Class | public class DefaultLabel |
| Inheritance | DefaultLabel AbstractModelItem |
| Implements | ILabel, ITagOwner |
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 | ||
| Method | Defined by | ||
|---|---|---|---|
|
Initializes a new instance of the
DefaultLabel class
using the provided parameter and text. | DefaultLabel | ||
![]() |
Returns the currently set
ILookup delegate. | AbstractModelItem | |
|
lookup(type:Class):Object
Simple lookup implementation that tries to find a registered lookup.
| 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 | |
| labelModelParameter | property |
labelModelParameter:ILabelModelParameter [read-write]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 [read-write]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 [read-write]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 [read-write]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 [read-write]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.
Implementation public function get tag():Object
public function set tag(value:Object):void
| text | property |
text:String [read-write]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
| DefaultLabel | () | constructor |
public function DefaultLabel(modelParameter:ILabelModelParameter, text:String, lookup:ILookup = 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().
If null, a DefaultBendLookup instance is used.
|
| lookup | () | method |
public override function lookup(type:Class):Object
Simple lookup implementation that tries to find a registered lookup. If no such lookup is registered,
returns this if this is assignable to the provided type.
This implementation tries to find an implementation of the given type in the following order:
registerLookup.this is returned if it can be casted to the given type.null is returned.type:Class — The query type
|
Object — An implementation of type or null.
|