C

SimpleLabel

A mutable implementation of the ILabel interface that can be used without an IGraph.
ImplementsInheritance Hierarchy

Remarks

Note that this class is not the one used as the default implementation of a Graph's ILabels and casting them to SimpleLabel will fail. Instances of this class can be used without an accompanying graph instance. All the properties are mutable. An example of a possible use case would be the rendering of a label into a graphics context: Simply create a SimpleLabel, associate a style with it and use the style's renderer instance to obtain a rendering for the label.

Members

Show:

Constructors

Creates an instance of the SimpleLabel class with default lookup, VOID_LABEL_STYLE as style, and the given parameter, text, and owner.
While technically the owner can be null here, this can cause issues, e.g. with styles that require the owners to be non-null to work properly.

Parameters

owner?: ILabelOwner
The label's owner. The default value is null.
text?: string
The label's text. The default value is an empty string.
layoutParameter?: ILabelModelParameter
The parameter that describes the label's layout. The default value places the label at ORIGIN with the FreeLabelModel.

Properties

Gets the index of the label at its owner.
readonly

Defined in

ILabel.index
Gets a snapshot of the current layout of the label.
Labels have a size 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 up (<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 layoutParameter for this label or modify its associated instance.
readonly

See Also

Developer's Guide
API
layoutParameter, getGeometry

Defined in

ILabel.layout
Gets or sets the label model's parameter that determines the positioning of this label.
Note that the label model parameter instance associated with a label instance may be shared between multiple label instances and that the modification of this instance or its model will result in a change of the positioning of all labels that are associated with the same parameter or model instance.
final
Gets or sets the owner of this label.
final

Implements

ILabel.owner
Gets or sets the preferred size of the label with respect to its current contents and the implementation of the visualization.
Often times the layout's size will be the same as the preferred size, but it's up to the implementation of the ILabelModel to interpret it differently.
conversionfinal
Gets or sets the style that is responsible for the visual representation of this node in a CanvasComponent.
Note that the style instance associated with a label instance may be shared between multiple label instances and that the modification of this style will result in a change of the appearance of all labels that are associated with the same style instance.
final

Implements

ILabel.style
Gets or sets the tag object associated with this item instance.
The tag is an optional user-defined object which can be used to store arbitrary data related to this item. The item itself just provides the storage for the object.
final

Implements

ITagOwner.tag
Gets or sets 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.
final

Implements

ILabel.text

Methods

Gets the getPreferredSize from the label's style and sets the preferredSize to that value.
final
Gets a LabelDecorator to modify the ports ILookup.
final

Return Value

LabelDecorator
A LabelDecorator for this instance.
Returns an instance that implements the given type or null.
Typically, this method will be called 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 re-obtained for further use.
final

Parameters

type: Constructor<T>
the type for which an instance shall be returned

Return Value

T
an instance that is assignable to the type or null

Implements

ILookup.lookup