C

SimplePort

A mutable implementation of the IPort 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 IPorts and casting them to SimplePort 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 port into a graphics context: Simply create a SimplePort, associate a style with it and use the style's renderer instance to obtain a rendering for the port.

Members

Show:

Constructors

Creates a port with a default lookup using the given location and owner.
While technically the owner can be null here, this can cause issues, e.g. with port location models that position the port relative to its owner.

Parameters

owner?: IPortOwner
The port's owner.
locationParameter?: IPortLocationModelParameter
The port's location model parameter. By default, the port is placed at ORIGIN.

Properties

Gets a live view of the location of the port in world coordinates.
The location is the anchor for the edges that connect to this port. However, it is up to the visualization logic where exactly the visual part of an edge will end. As this will yield a live view, it is up to the client to copy the values if a snapshot of the state is needed. In order to modify the location of a port, use the setPortLocationParameter in IGraph.
readonly

See Also

API
locationParameter, getLocation
Gets or sets the collection of labels that are owned by this instance.
conversionfinal
Gets a snapshot of the current location of the port.
Unlike dynamicLocation this does not return a dynamic point that always refers to the current location.
readonly

See Also

API
locationParameter, getLocation

Defined in

IPort.location
Gets or sets the IPortLocationModelParameter that is used to determine the location of this port.

The port location can be calculated using the model's getLocation method or methods location and dynamicLocation.

Note that parameters may be shared across port instances.

final

See Also

API
setPortLocationParameter, location, dynamicLocation
Gets or sets the owner of this port.
final

Implements

IPort.owner
Gets or sets the style that is responsible for the visual representation of this port in a CanvasComponent.
Note that the style instance associated with a port instance may be shared between multiple port instances and that the modification of this style will result in a change of the appearance of all ports that are associated with the same style instance.
final

Implements

IPort.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

Methods

Gets a PortDecorator to modify the ports ILookup.
final

Return Value

PortDecorator
A PortDecorator 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
Sets the location of this port.
Changes the IMutablePoint if one is found in this port's ILookup. Creates an appropriate locationParameter, otherwise.
final

Parameters

location: Point
The location to set the port to.