Packagecom.yworks.graph.model
Classpublic class DefaultEdge
InheritanceDefaultEdge Inheritance AbstractLabeledItem Inheritance AbstractModelItem
ImplementsIEdge, ITagOwner

A simple mutable implementation of the IEdge interface that can be used stand-alone.



Public Properties
 PropertyDefined by
  bends : IBendList
Provides access to a collection of IBends that describe the geometry of this edge.
DefaultEdge
 Inheritedlabels : ILabelCollection
The collection for the labels.
AbstractLabeledItem
  ports : IPortCollection
[read-only]
DefaultEdge
  sourcePort : IPort
Gets the source port instance this edge is connected to.
DefaultEdge
  style : IEdgeStyle
Returns the style that is responsible for the visual representation of this edge in a CanvasComponent.
DefaultEdge
  tag : Object
Gets or sets the tag associated with this instance.
DefaultEdge
  targetPort : IPort
Gets the target port instance this edge is connected to.
DefaultEdge
Protected Properties
 PropertyDefined by
 Inherited_lookupMap : IMapper
AbstractModelItem
Public Methods
 MethodDefined by
  
DefaultEdge(labelCollection:ILabelCollection, sourcePort:IPort = null, targetPort:IPort = null, bends:IBendList = null, lookup:ILookup = null)
Creates an edge using the given source and target ports, bend and label collections and lookup implementation.
DefaultEdge
 Inherited
Returns the currently set ILookup delegate.
AbstractModelItem
  
lookup(type:Class):Object
Returns an instance that implements the given type or null.
DefaultEdge
 Inherited
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
 Inherited
Sets the ILookup implementation used for lookup calls on this instance.
AbstractModelItem
  
toString():String
DefaultEdge
Property detail
bendsproperty
bends:IBendList  [read-write]

Provides access to a collection of IBends that describe the geometry of this edge.

This gives access to a read-only live view of the bends, i.e. the collection can change over time, as well as the bends contained in it. If a snapshot of the current state is needed, one needs to copy the collection.

In order to modify the bend collection of an edge, use the various methods in IGraph like IGraph.addBend

Implementation
    public function get bends():IBendList
    public function set bends(value:IBendList):void
portsproperty 
ports:IPortCollection  [read-only]

Implementation
    public function get ports():IPortCollection
sourcePortproperty 
sourcePort:IPort  [read-write]

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

Implementation
    public function get sourcePort():IPort
    public function set sourcePort(value:IPort):void
styleproperty 
style:IEdgeStyle  [read-write]

Returns the style that is responsible for the visual representation of this edge in a CanvasComponent.

In order to set the style on an instance, use the IGraph.setStyle( IEdge, IEdgeStyle ) method. 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.

Implementation
    public function get style():IEdgeStyle
    public function set style(value:IEdgeStyle):void
tagproperty 
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
targetPortproperty 
targetPort:IPort  [read-write]

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

Implementation
    public function get targetPort():IPort
    public function set targetPort(value:IPort):void
Constructor detail
DefaultEdge()constructor
public function DefaultEdge(labelCollection:ILabelCollection, sourcePort:IPort = null, targetPort:IPort = null, bends:IBendList = null, lookup:ILookup = null)

Creates an edge using the given source and target ports, bend and label collections and lookup implementation.

Parameters
labelCollection:ILabelCollection
 
sourcePort:IPort (default = null)
 
targetPort:IPort (default = null)
 
bends:IBendList (default = null)
 
lookup:ILookup (default = null)
Method detail
lookup()method
public override 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

Returns
Object — an instance that is assignable to type or null
toString()method 
public function toString():String

Returns
String