C

SimpleEdge

A mutable implementation of the IEdge interface that can be used without an IGraph.

Remarks

Note that this class is not the one used as the default implementation of a Graph's IEdges and casting them to SimpleEdge 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 an edge into a graphics context: Simply create a SimpleEdge, associate a style with it and use the style's renderer instance to obtain a rendering for the edge.

Members

Show:

Constructors

Creates an edge with a default lookup, and, optionally, the given source and target ports.
While technically the source and target port can be null here, this will cause all kinds of issues, e.g. with styles or label models that require the ports to be non-null to work properly.

Parameters

sourcePort?: IPort
The source port for the edge.
targetPort?: IPort
The target port for the edge.

Properties

Gets or sets the collection of bends that describe the geometry of this edge.
conversionfinal

Implements

IEdge.bends
Determines whether an edge is a self-loop, that is, it starts and ends at the same port owner.
readonly

See Also

Developer's Guide
API
sourceNode, targetNode
Gets or sets the collection of labels that are owned by this instance.
conversionfinal
Gets or sets the collection of ports that are owned by this instance.
conversionfinal
Gets the source node for the given edge or null.
readonly

Throws

Exception ({ name: 'InvalidOperationError' })
If the edge's sourcePort is not set or its owner is not an INode.
Gets or sets the source port instance this edge is connected to.
Although the notion of source and target port is used for directed edges, it is still up to the client to decide whether the edge should be treated as such.
final
Gets or sets the style that is responsible for the visual representation of this edge in a CanvasComponent.
Note that the style instance associated with an edge instance may be shared between multiple edge instances and that the modification of this style will result in a change of the appearance of all edges that are associated with the same style instance.
final

Implements

IEdge.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 the target node for the given edge or null.
readonly

Throws

Exception ({ name: 'InvalidOperationError' })
If the edge's targetPort is not set or its owner is not an INode.
Gets or sets the target port instance this edge is connected to.
Although the notion of source and target port is used for directed edges, it is still up to the client to decide whether the edge should be treated as such.
final

Methods

Gets a EdgeDecorator to modify the ports ILookup.
final

Return Value

EdgeDecorator
A EdgeDecorator 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
Gets the opposite port owner of an IEdge.

Parameters

owner: IPortOwner
The owner of the port that the IEdge is connected to.

Return Value

IPortOwner
The owner of the opposite port.

Throws

Exception ({ name: 'ArgumentError' })
If owner is neither the source nor target of the edge.

See Also

API
sourcePort, targetPort

Defined in

IEdge.opposite
Gets the opposite port of an IEdge.

Parameters

port: IPort
The port that the IEdge is connected to.

Return Value

IPort
The opposite port.

Throws

Exception ({ name: 'ArgumentError' })
If port is neither the source nor target of the edge.

See Also

API
sourcePort, targetPort

Defined in

IEdge.opposite