Packagecom.yworks.graph.model
Classpublic class DefaultGraph
InheritanceDefaultGraph Inheritance flash.events.EventDispatcher
Implements IGraph, IMutableLookup

Central implementation of the IGraph interface.

This class uses an instance of IGraphStructure to delegate the actual work of holding the structure of the graph to.

This implementation deals with the proper firing of events and handling default values.

This implementation has inherent support for undoability. If the undoEngineEnabled property is set to true, changes to the structure of the graph will automatically be recorded using the UndoEngine instance that can be queried from this instance's lookup method. Clients that wish to enqueue custom undo events or that need to make non-structural changes to the graph can use the IUndoSupport implementation to do so. An implementation of this interface can also be queried using the lookup method of this instance. Also there is an implementation of IGraphUndoUnitSupport in the lookup that will be used by this instance to create the actual undo units for structural changes in the graph's structure. If clients need to customize these events, they can decorate the lookup of this instance and wrap the provided implementation.

This implementation also carries an instance of IMapperRegistry in its ILookup. It can be used to register IMapper instances with the graph.



Public Properties
 PropertyDefined By
  autoAdjustPreferredLabelSize : Boolean
Whether to automatically adjust the preferred size of a label.
DefaultGraph
  autoCleanupPorts : Boolean
Determines whether unused ports should automatically be removed from their owners as soon as no further edge is connected to them.
DefaultGraph
  bends : ICollectionModel
[read-only] A collection view over the bends of the edges contained in this graph.
DefaultGraph
  collectionModel : ICollectionModel
[read-only] Offers a view over all elements that make up the graph.
DefaultGraph
  defaultEdgeLabelModel : ILabelModel
Gets or sets the DefaultEdgeLabelModel property.
DefaultGraph
  defaultEdgeLabelModelParameter : ILabelModelParameter
Gets or sets the default "ILabelModelParameter that will be used for newly created edge labels if no other parameter is specified.
DefaultGraph
  defaultEdgeLabelStyle : ILabelStyle
Gets or sets the DefaultEdgeLabelModel property.
DefaultGraph
  defaultEdgeStyle : IEdgeStyle
Gets or sets the defaultEdgeStyle property.
DefaultGraph
  defaultNodeLabelModel : ILabelModel
Gets or sets the DefaultNodeLabelModel property.
DefaultGraph
  defaultNodeLabelModelParameter : ILabelModelParameter
Gets or sets the default "ILabelModelParameter that will be used for newly created node labels if no other parameter is specified.
DefaultGraph
  defaultNodeLabelStyle : ILabelStyle
Gets or sets the defaultNodeLabelStyle property.
DefaultGraph
  defaultNodePortModelParameter : IPortLocationModelParameter
Gets or sets the defaultNodePortModelParameter property.
DefaultGraph
  defaultNodeSize : ISize
Gets or sets the default node size.
DefaultGraph
  defaultNodeStyle : INodeStyle
Gets or sets the defaultNodeStyle property.
DefaultGraph
  defaultPortStyle : IPortStyle
Gets or sets the defaultPortStyle property.
DefaultGraph
  edgeLabels : ICollectionModel
[read-only] A collection view over the labels attached to edges contained in this graph.
DefaultGraph
  edges : ICollectionModel
[read-only] A collection view over the edges contained in this graph.
DefaultGraph
  graphDecorator : GraphDecorator
[read-only] The graph decorator for this instance.
DefaultGraph
  groupingSupported : Boolean
Convenience method that enables or disables grouping capabilities for this instance.
DefaultGraph
  mapperRegistry : IMapperRegistry
[read-only] A registry that can be used to store and retrieve arbitrary information for items in this graph.
DefaultGraph
  nodeLabels : ICollectionModel
[read-only] A collection view over the labels attached to nodes contained in this graph.
DefaultGraph
  nodes : ICollectionModel
[read-only] A collection view over the nodes contained in this graph.
DefaultGraph
  ports : ICollectionModel
[read-only] A collection view over the ports contained in this graph.
DefaultGraph
  shareDefaultEdgeLabelModelParameter : Boolean
Gets or sets a property that determines whether newly created edge labels should share the currently set defaultEdgeLabelModelParameter instance.
DefaultGraph
  shareDefaultEdgeLabelStyleInstance : Boolean
Gets or sets a property that determines whether newly created ports should share the currently set defaultEdgeLabelStyle.
DefaultGraph
  shareDefaultEdgeStyleInstance : Boolean
Gets or sets a property that determines whether newly created edges should share the currently set defaultEdgeStyle.
DefaultGraph
  shareDefaultNodeLabelModelParameter : Boolean
Gets or sets a property that determines whether newly created node labels should share the currently set defaultNodeLabelModelParameter instance.
DefaultGraph
  shareDefaultNodeLabelStyleInstance : Boolean
Gets or sets a property that determines whether newly created ports should share the currently set defaultNodeLabelStyle.
DefaultGraph
  shareDefaultNodePortModelParameter : Boolean
Gets or sets a property that determines whether newly created ports at nodes should share the currently set defaultNodePortModelParameter instance.
DefaultGraph
  shareDefaultNodeStyleInstance : Boolean
Gets or sets a property that determines whether newly created edges labels should share the currently set defaultEdgeLabelStyle.
DefaultGraph
  shareDefaultPortStyleInstance : Boolean
Gets or sets a property that determines whether newly created ports should share the currently set defaultPortStyle.
DefaultGraph
  undoEngineEnabled : Boolean
Determines whether the UndoEngine used for this instance should be enabled.
DefaultGraph
  usePortCandidateProviders : Boolean
Gets or sets a property that determines whether createEdgeBetweenNodes should use IPortCandidateProvider implementations to find the ports to connect the newly created edge to.
DefaultGraph
Protected Properties
 PropertyDefined By
  graphStructure : IGraphStructure
[read-only] Gets the graphstructure instance used internally.
DefaultGraph
Public Methods
 MethodDefined By
  
DefaultGraph(graphStructure:IGraphStructure = null)
Creates a new instance of a graph that provides an ILookupDecorator for all of its entities.
DefaultGraph
  
addBend(edge:IEdge, index:int, x:Number, y:Number):IBend
Adds a bend at the given index to the given edge using the coordinates provided.
DefaultGraph
  
addLabel(item:ILabeledItem, text:String, parameter:ILabelModelParameter = null, style:ILabelStyle = null):ILabel
Add a label to the given item using the text as the initial label text and label model parameter and style.
DefaultGraph
  
Adds the chain element to the lookup for this instance.
DefaultGraph
  
addPort(portOwner:IPortOwner, x:Number, y:Number):IPort
Add a port to the given port owner using the coordinates as the new initial position of the port anchor.
DefaultGraph
  
Add a port to the given port owner using the model parameter to determine the coordinates of the port.
DefaultGraph
  
Adjusts the ILabel.preferredSize property of a label to fit the suggested size of its ILabelStyleRenderer.
DefaultGraph
  
clear():void
Clears this instance, removing all entities in proper order.
DefaultGraph
  
clearBends(edge:IEdge):void
Removes all bends from the given edge.
DefaultGraph
  
contains(item:IModelItem):Boolean
Determines whether this instance contains the given element.
DefaultGraph
  
createEdge(sourcePort:IPort, targetPort:IPort, style:IEdgeStyle = null):IEdge
Creates and returns an edge that connects to the given port instances.
DefaultGraph
  
createEdgeBetweenNodes(sourceNode:INode, targetNode:INode, style:IEdgeStyle = null):IEdge
Convenience method that creates and returns an edge that connects to the given node instances using the given style instance.
DefaultGraph
  
createNode(bounds:IRectangle = null, style:INodeStyle = null):INode
Creates and returns a node using default values for the style and the specified initial geometry.
DefaultGraph
  
createNodeAt(x:Number, y:Number):INode
Creates and returns a node using default values for the style and the specified initial geometry.
DefaultGraph
  
Returns an Iterable for all edges that are adjacent to the given port as a IEdge.sourcePort or IEdge.targetPort.
DefaultGraph
  
Returns an Iterable for all edges that have the given port owner as their IEdge.targetPort's or IEdge.sourcePort's.
DefaultGraph
  
Calculates the bounds of this graph using the INode.layout, source port and target port IPort.locations and the IBends.
DefaultGraph
  
Returns an Iterable for all edges that have the given port as a IEdge.targetPort.
DefaultGraph
  
Returns an Iterable for all edges that have the given port owner as their IEdge.targetPort's IPort.owner.
DefaultGraph
  
Triggers the displaysInvalidated event.
DefaultGraph
  
lookup(type:Class):Object
Returns an instance that implements the given type or null.
DefaultGraph
  
Returns an Iterable for all edges that have the given port as a IEdge.sourcePort.
DefaultGraph
  
Returns an Iterable for all edges that have the given port owner as their IEdge.sourcePort's IPort.owner.
DefaultGraph
  
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.
DefaultGraph
  
removeBend(bend:IBend):void
Removes the given bend instance from its edge.
DefaultGraph
  
removeEdge(edge:IEdge):void
Removes the given edge instance from this graph.
DefaultGraph
  
removeLabel(label:ILabel):void
Removes the given label from its owner.
DefaultGraph
  
Removes a previously added lookup chain element from the lookup of this.
DefaultGraph
  
removeNode(node:INode):void
Removes the given node instance from this graph.
DefaultGraph
  
removePort(port:IPort):void
Removes the port from its owner.
DefaultGraph
  
setBendLocation(bend:IBend, x:Number, y:Number):void
Modifies the location of the given bend.
DefaultGraph
  
setBounds(node:INode, x:Number, y:Number, width:Number, height:Number):void
Sets the bounds of the given node to the new values.
DefaultGraph
  
setEdgeStyle(edge:IEdge, style:IEdgeStyle):void
Assigns the given style instance by reference to the edge.
DefaultGraph
  
Sets the label model parameter for the given label.
DefaultGraph
  
setLabelStyle(label:ILabel, style:ILabelStyle):void
Assigns the given style instance by reference to the label.
DefaultGraph
  
setLabelText(label:ILabel, text:String):void
Sets the label text of the given label.
DefaultGraph
  
setNodeStyle(node:INode, style:INodeStyle):void
Assigns the given style instance by reference to the node.
DefaultGraph
  
setPortLocation(port:IPort, x:Number, y:Number):void
Sets the coordinates of the given port to the given values.
DefaultGraph
  
Sets the location model parameter of the given port to the given value.
DefaultGraph
  
setPorts(edge:IEdge, sourcePort:IPort, targetPort:IPort):void
Sets the ports of the given edge to the new values.
DefaultGraph
  
setPortStyle(port:IPort, style:IPortStyle):void
Assigns the given style instance by reference to the port.
DefaultGraph
  
setPreferredSize(label:ILabel, width:Number, height:Number):void
Sets the preferred size of the label.
DefaultGraph
Protected Methods
 MethodDefined By
  
Factory method for the defaultEdgeLabelModel property.
DefaultGraph
  
Factory method that obtains a ILabelModelParameter to use for a newly created edge label.
DefaultGraph
  
Factory method for the DefaultEdgeLabelStyle property.
DefaultGraph
  
Factory method for the defaultEdgeStyle property.
DefaultGraph
  
Factory method for the defaultNodeLabelModel property.
DefaultGraph
  
Factory method that obtains a ILabelModelParameter to use for a newly created node label.
DefaultGraph
  
Factory method for the DefaultNodeLabelStyle property.
DefaultGraph
  
Factory method for the DefaultNodePortModelParameter property.
DefaultGraph
  
Factory method for the DefaultNodeStyle property.
DefaultGraph
  
Factory method for the DefaultPortStyle property.
DefaultGraph
  
Factory method that creates and returns a label model parameter to use for newly created edge labels.
DefaultGraph
  
Factory callback that returns an ILabelStyle for newly created edge labels.
DefaultGraph
  
Factory callback that returns an IEdgeStyle for newly created edges.
DefaultGraph
  
Factory method that creates and returns a label model parameter to use for newly created node labels.
DefaultGraph
  
Factory callback that returns an ILabelStyle for newly created node labels.
DefaultGraph
  
Factory method that creates and returns a port model parameter to use for newly created node ports.
DefaultGraph
  
Factory callback that returns an INodeStyle for newly created nodes.
DefaultGraph
  
Factory callback that returns an IPortStyle for newly created ports.
DefaultGraph
  
Creates an UndoEngine instance that automatically triggers invalidateDisplays() upon each invocation of UndoEngine.undo() and UndoEngine.Redo.
DefaultGraph
  
Creates the IUndoSupport instance that can be found in the lookup of this instance.
DefaultGraph
  
Determines an IPort instance to use for the creation of a new edge that starts at the given node.
DefaultGraph
  
Determines a IPort instance to use for the creation of a new edge that ends at the given node.
DefaultGraph
  
onAddingBend(edge:IEdge, bend:IBend, index:int):void
Called when a bend is going to be added to an edge.
DefaultGraph
  
onAddingEdgeLabel(edge:IEdge, label:ILabel):void
Callback method that will be called just before an edge label is added to a edge.
DefaultGraph
  
onAddingNodeLabel(node:INode, label:ILabel):void
Callback method that will be called just before a node label is added to a node.
DefaultGraph
  
onAddingPort(node:INode, port:IPort):void
Called when a port is going to be added to a node.
DefaultGraph
  
onBendAdded(bend:IBend):void
Callback that is invoked after a bend has been added to this graph's structure.
DefaultGraph
  
onBendRemoved(owner:IEdge, bend:IBend):void
Callback method that is invoked just after a bend has been removed from its edge.
DefaultGraph
  
Callback that is invoked before an edge will change.
DefaultGraph
  
Callback that is invoked before a label will change.
DefaultGraph
  
Callback that is invoked before a node will change.
DefaultGraph
  
Callback that is invoked before a port is being changed.
DefaultGraph
  
Callback that is invoked before the edge is added to this graph's structure.
DefaultGraph
  
Callback that is invoked before the node is added to this graph's structure.
DefaultGraph
  
onEdgeChanged(edge:IEdge, oldSourcePort:IPort, oldTargetPort:IPort):void
Callback that is invoked after an edge has changed.
DefaultGraph
  
onEdgeCreated(edge:IEdge):void
Callback that triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.EDGE_CREATED type.
DefaultGraph
  
Called after a label has been added to an edge.
DefaultGraph
  
Called after a label has been removed from its edge.
DefaultGraph
  
onEdgeRemoved(edge:IEdge, oldSourcePort:IPort, oldTargetPort:IPort):void
Callback that triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.EDGE_REMOVED type.
DefaultGraph
  
Triggers the displaysInvalidated event.
DefaultGraph
  
Callback that is invoked after a label has changed.
DefaultGraph
  
onNodeChanged(node:INode):void
Callback that is invoked after a node has changed.
DefaultGraph
  
onNodeCreated(node:INode):void
Callback that triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.NODE_CREATED type.
DefaultGraph
  
Called after a label has been added to a node.
DefaultGraph
  
Called after a label has been removed from its node.
DefaultGraph
  
onNodeRemoved(node:INode):void
Callback that triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.NODE_REMOVED type.
DefaultGraph
  
onPortAdded(port:IPort):void
Called when a port has been added to a node.
DefaultGraph
  
onPortChanged(port:IPort):void
Callback that is invoked after a port has changed.
DefaultGraph
  
onPortRemoved(oldOwner:IPortOwner, port:IPort):void
Callback method that is called just after a port has been removed from its owner.
DefaultGraph
  
Callback method that is invoked just before a bend is removed.
DefaultGraph
  
Callback that is invoked before the edge is removed from this graph's structure.
DefaultGraph
  
Callback method that will be called just before an edge label is removed from its edge.
DefaultGraph
  
Callback that is invoked before the node is removed from this graph's structure.
DefaultGraph
  
Callback method that will be called just before a node label is removed from its node.
DefaultGraph
  
Callback method that is called just before a port will be removed.
DefaultGraph
Public Constants
 ConstantDefined By
  MAPPER_KEY_EDGE_2_ID : String = edge-2-id
[static] Key for an IMapper which maps the graph's edges to an ID
DefaultGraph
  MAPPER_KEY_NODE_2_ID : String = node-2-id
[static] Key for an IMapper which maps the graph's nodes to an ID
DefaultGraph
Property Detail
autoAdjustPreferredLabelSizeproperty
autoAdjustPreferredLabelSize:Boolean

Whether to automatically adjust the preferred size of a label.

On a call to setLabelText or setLabelStyle, the preferred size of the label will automatically be adjusted to the preferred size that is suggested by the label's style renderer, if this property is set to true.

The default value is true.


Implementation
    public function get autoAdjustPreferredLabelSize():Boolean
    public function set autoAdjustPreferredLabelSize(value:Boolean):void

See also

autoCleanupPortsproperty 
autoCleanupPorts:Boolean

Determines whether unused ports should automatically be removed from their owners as soon as no further edge is connected to them.

The default value is true.


Implementation
    public function get autoCleanupPorts():Boolean
    public function set autoCleanupPorts(value:Boolean):void

See also

bendsproperty 
bends:ICollectionModel  [read-only]

A collection view over the bends of the edges contained in this graph.

This is a readonly live view of the entities, i.e. the same reference will be returned for each invocation, that always represents the current state of the graph.

This property can be used as the source for data binding.


Implementation
    public function get bends():ICollectionModel
collectionModelproperty 
collectionModel:ICollectionModel  [read-only]

Offers a view over all elements that make up the graph. This is a combined view of all nodes, edges, labels, ports, and bends.

This property can be used as the source for data binding.


Implementation
    public function get collectionModel():ICollectionModel
defaultEdgeLabelModelproperty 
defaultEdgeLabelModel:ILabelModel

Gets or sets the DefaultEdgeLabelModel property.

If the field has not yet been initialized upon first access, the factory method createDefaultEdgeLabelModel will be called.

This property can be used as the source for data binding.


Implementation
    public function get defaultEdgeLabelModel():ILabelModel
    public function set defaultEdgeLabelModel(value:ILabelModel):void
defaultEdgeLabelModelParameterproperty 
defaultEdgeLabelModelParameter:ILabelModelParameter

Gets or sets the default "ILabelModelParameter that will be used for newly created edge labels if no other parameter is specified.

Depending on the setting of shareDefaultEdgeLabelModelParameter, this implementation will use the same instance for each newly created label or will create a clone of it.

This property can be used as the source for data binding.


Implementation
    public function get defaultEdgeLabelModelParameter():ILabelModelParameter
    public function set defaultEdgeLabelModelParameter(value:ILabelModelParameter):void
defaultEdgeLabelStyleproperty 
defaultEdgeLabelStyle:ILabelStyle

Gets or sets the DefaultEdgeLabelModel property.

If the field has not yet been initialized upon first access, the factory method createDefaultEdgeLabelModel will be called.

This property can be used as the source for data binding.


Implementation
    public function get defaultEdgeLabelStyle():ILabelStyle
    public function set defaultEdgeLabelStyle(value:ILabelStyle):void
defaultEdgeStyleproperty 
defaultEdgeStyle:IEdgeStyle

Gets or sets the defaultEdgeStyle property.

By default this field is populated with an instance of ISPolylineEdgeStyle. If the field has not yet been initialized upon first access, the factory method createDefaultEdgeStyle will be called.

This property can be used as the source for data binding.


Implementation
    public function get defaultEdgeStyle():IEdgeStyle
    public function set defaultEdgeStyle(value:IEdgeStyle):void
defaultNodeLabelModelproperty 
defaultNodeLabelModel:ILabelModel

Gets or sets the DefaultNodeLabelModel property.

If the field has not yet been initialized upon first access, the factory method createDefaultNodeLabelModel will be called.

This property can be used as the source for data binding.


Implementation
    public function get defaultNodeLabelModel():ILabelModel
    public function set defaultNodeLabelModel(value:ILabelModel):void
defaultNodeLabelModelParameterproperty 
defaultNodeLabelModelParameter:ILabelModelParameter

Gets or sets the default "ILabelModelParameter that will be used for newly created node labels if no other parameter is specified.

Depending on the setting of shareDefaultNodeLabelModelParameter, this implementation will use the same instance for each newly created label or will create a clone of it.

This property can be used as the source for data binding.


Implementation
    public function get defaultNodeLabelModelParameter():ILabelModelParameter
    public function set defaultNodeLabelModelParameter(value:ILabelModelParameter):void
defaultNodeLabelStyleproperty 
defaultNodeLabelStyle:ILabelStyle

Gets or sets the defaultNodeLabelStyle property.

If the field has not yet been initialized upon first access, the factory method createDefaultNodeLabelStyle will be called.

This property can be used as the source for data binding.


Implementation
    public function get defaultNodeLabelStyle():ILabelStyle
    public function set defaultNodeLabelStyle(value:ILabelStyle):void
defaultNodePortModelParameterproperty 
defaultNodePortModelParameter:IPortLocationModelParameter

Gets or sets the defaultNodePortModelParameter property.

If the field has not yet been initialized upon first access, the factory method createDefaultPortLocationModelParameter will be called.

This property can be used as the source for data binding.


Implementation
    public function get defaultNodePortModelParameter():IPortLocationModelParameter
    public function set defaultNodePortModelParameter(value:IPortLocationModelParameter):void
defaultNodeSizeproperty 
defaultNodeSize:ISize

Gets or sets the default node size.

The values of this size will be used by the createNode and createNodeAt methods.

This property can be used as the source for data binding.


Implementation
    public function get defaultNodeSize():ISize
    public function set defaultNodeSize(value:ISize):void
defaultNodeStyleproperty 
defaultNodeStyle:INodeStyle

Gets or sets the defaultNodeStyle property.

By default this field is populated with an instance of IShapeNodeStyle. If the field has not yet been initialized upon first access, the factory method createDefaultNodeStyle will be called.

This property can be used as the source for data binding.


Implementation
    public function get defaultNodeStyle():INodeStyle
    public function set defaultNodeStyle(value:INodeStyle):void
defaultPortStyleproperty 
defaultPortStyle:IPortStyle

Gets or sets the defaultPortStyle property.

If the field has not yet been initialized upon first access, the factory method createDefaultPortStyle will be called.

This property can be used as the source for data binding.


Implementation
    public function get defaultPortStyle():IPortStyle
    public function set defaultPortStyle(value:IPortStyle):void
edgeLabelsproperty 
edgeLabels:ICollectionModel  [read-only]

A collection view over the labels attached to edges contained in this graph.

This is a readonly live view of the entities, i.e. the same reference will be returned for each invocation, that always represents the current state if the graph.

This property can be used as the source for data binding.


Implementation
    public function get edgeLabels():ICollectionModel
edgesproperty 
edges:ICollectionModel  [read-only]

A collection view over the edges contained in this graph.

This is a readonly live view of the entities, i.e. the same reference will be returned for each invocation, that always represents the current state of the graph.

This property can be used as the source for data binding.


Implementation
    public function get edges():ICollectionModel
graphDecoratorproperty 
graphDecorator:GraphDecorator  [read-only]

The graph decorator for this instance.

The GraphDecorator allows to easily decorate graph items.


Implementation
    public function get graphDecorator():GraphDecorator

See also

graphStructureproperty 
graphStructure:IGraphStructure  [read-only]

Gets the graphstructure instance used internally.

This is a convenience for subclass implementations.


Implementation
    protected function get graphStructure():IGraphStructure
groupingSupportedproperty 
groupingSupported:Boolean

Convenience method that enables or disables grouping capabilities for this instance.

If this property is set to true, an instance of IGroupedGraph can be queried from this instance's lookup method.

This property can be used as the source for data binding.


Implementation
    public function get groupingSupported():Boolean
    public function set groupingSupported(value:Boolean):void

See also

mapperRegistryproperty 
mapperRegistry:IMapperRegistry  [read-only]

A registry that can be used to store and retrieve arbitrary information for items in this graph.


Implementation
    public function get mapperRegistry():IMapperRegistry
nodeLabelsproperty 
nodeLabels:ICollectionModel  [read-only]

A collection view over the labels attached to nodes contained in this graph.

This is a readonly live view of the entities, i.e. the same reference will be returned for each invocation, that always represents the current state if the graph.

This property can be used as the source for data binding.


Implementation
    public function get nodeLabels():ICollectionModel
nodesproperty 
nodes:ICollectionModel  [read-only]

A collection view over the nodes contained in this graph.

This is a readonly live view of the nodes, i.e. the same reference will be returned for each invocation, that always represents the current state of the graph.

This property can be used as the source for data binding.


Implementation
    public function get nodes():ICollectionModel
portsproperty 
ports:ICollectionModel  [read-only]

A collection view over the ports contained in this graph.

This is a readonly live view of the entities, i.e. the same reference will be returned for each invocation, that always represents the current state of the graph.

This property can be used as the source for data binding.


Implementation
    public function get ports():ICollectionModel
shareDefaultEdgeLabelModelParameterproperty 
shareDefaultEdgeLabelModelParameter:Boolean

Gets or sets a property that determines whether newly created edge labels should share the currently set defaultEdgeLabelModelParameter instance.

If this property is set to false, the factory method createEdgeLabelModelParameter used by the creational methods will try to clone the currently set parameter instance instead of returning it directly.

The default value is false.


Implementation
    public function get shareDefaultEdgeLabelModelParameter():Boolean
    public function set shareDefaultEdgeLabelModelParameter(value:Boolean):void
shareDefaultEdgeLabelStyleInstanceproperty 
shareDefaultEdgeLabelStyleInstance:Boolean

Gets or sets a property that determines whether newly created ports should share the currently set defaultEdgeLabelStyle.

If this property is set to false, the createEdgeLabelStyle factory method used by the creational method will try to clone the currently set style instance instead of returning it directly.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get shareDefaultEdgeLabelStyleInstance():Boolean
    public function set shareDefaultEdgeLabelStyleInstance(value:Boolean):void
shareDefaultEdgeStyleInstanceproperty 
shareDefaultEdgeStyleInstance:Boolean

Gets or sets a property that determines whether newly created edges should share the currently set defaultEdgeStyle.

If this property is set to false, the createEdgeStyle factory method used by the creational method will try to clone the currently set style instance instead of returning it directly.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get shareDefaultEdgeStyleInstance():Boolean
    public function set shareDefaultEdgeStyleInstance(value:Boolean):void
shareDefaultNodeLabelModelParameterproperty 
shareDefaultNodeLabelModelParameter:Boolean

Gets or sets a property that determines whether newly created node labels should share the currently set defaultNodeLabelModelParameter instance.

If this property is set to false, the factory method createNodeLabelModelParameter used by the creational methods will try to clone the currently set parameter instance instead of returning it directly.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get shareDefaultNodeLabelModelParameter():Boolean
    public function set shareDefaultNodeLabelModelParameter(value:Boolean):void
shareDefaultNodeLabelStyleInstanceproperty 
shareDefaultNodeLabelStyleInstance:Boolean

Gets or sets a property that determines whether newly created ports should share the currently set defaultNodeLabelStyle.

If this property is set to false, the createNodeLabelStyle factory method used by the creational method will try to clone the currently set style instance instead of returning it directly.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get shareDefaultNodeLabelStyleInstance():Boolean
    public function set shareDefaultNodeLabelStyleInstance(value:Boolean):void
shareDefaultNodePortModelParameterproperty 
shareDefaultNodePortModelParameter:Boolean

Gets or sets a property that determines whether newly created ports at nodes should share the currently set defaultNodePortModelParameter instance.

If this property is set to false, the factory method createNodePortModelParameter used by the creational methods will try to clone the currently set parameter instance instead of returning it directly.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get shareDefaultNodePortModelParameter():Boolean
    public function set shareDefaultNodePortModelParameter(value:Boolean):void
shareDefaultNodeStyleInstanceproperty 
shareDefaultNodeStyleInstance:Boolean

Gets or sets a property that determines whether newly created edges labels should share the currently set defaultEdgeLabelStyle.

If this property is set to false, the createEdgeLabelStyle factory method used by the creational method will try to clone the currently set style instance instead of returning it directly.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get shareDefaultNodeStyleInstance():Boolean
    public function set shareDefaultNodeStyleInstance(value:Boolean):void
shareDefaultPortStyleInstanceproperty 
shareDefaultPortStyleInstance:Boolean

Gets or sets a property that determines whether newly created ports should share the currently set defaultPortStyle.

If this property is set to false, the createPortStyle factory method used by the creational method will try to clone the currently set style instance instead of returning it directly.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get shareDefaultPortStyleInstance():Boolean
    public function set shareDefaultPortStyleInstance(value:Boolean):void
undoEngineEnabledproperty 
undoEngineEnabled:Boolean

Determines whether the UndoEngine used for this instance should be enabled.

In order to enable undoability for this instance, set this property to true and lookup the UndoEngine type.

The default value is false.


Implementation
    public function get undoEngineEnabled():Boolean
    public function set undoEngineEnabled(value:Boolean):void
usePortCandidateProvidersproperty 
usePortCandidateProviders:Boolean

Gets or sets a property that determines whether createEdgeBetweenNodes should use IPortCandidateProvider implementations to find the ports to connect the newly created edge to.

If this property is set to true the implementation in getNewSourcePort and getNewTargetPort will try to query an IPortCandidateProvider from the respective nodes in order to determine what ports to use. If no such provider can be found or no suitable candidate can be found this implementation will add a new portto the nodes.

The default value is false.


Implementation
    public function get usePortCandidateProviders():Boolean
    public function set usePortCandidateProviders(value:Boolean):void
Constructor Detail
DefaultGraph()Constructor
public function DefaultGraph(graphStructure:IGraphStructure = null)

Creates a new instance of a graph that provides an ILookupDecorator for all of its entities.

Parameters
graphStructure:IGraphStructure (default = null) — An IGraphStructure implementation this Graph is based on. If none is provided, a new instance will be created. Note that this instance is not an instance of DefaultGraphStructure
Method Detail
addBend()method
public function addBend(edge:IEdge, index:int, x:Number, y:Number):IBend

Adds a bend at the given index to the given edge using the coordinates provided. The added instance will be returned.

Parameters

edge:IEdge — The edge to which the bend will be added.
 
index:int — The index for the newly added bend.
 
x:Number — The x-coordinate to use for the newly created bend.
 
y:Number — The y-coordinate to use for the newly created bend.

Returns
IBend — A newly created live bend.
addLabel()method 
public function addLabel(item:ILabeledItem, text:String, parameter:ILabelModelParameter = null, style:ILabelStyle = null):ILabel

Add a label to the given item using the text as the initial label text and label model parameter and style.

Parameters

item:ILabeledItem — The item to add the label to.
 
text:String — The initial text of the label
 
parameter:ILabelModelParameter (default = null) — The label model parameter instance to use. If null, default label model parameters will be used.
 
style:ILabelStyle (default = null) — The style to use for the label. If null a default label style will be used.

Returns
ILabel — The newly created label.
addLookup()method 
public function addLookup(lookup:IContextLookupChainLink):void

Adds the chain element to the lookup for this instance.

Parameters

lookup:IContextLookupChainLink — The lookup to decorate the current instance with.

addPort()method 
public function addPort(portOwner:IPortOwner, x:Number, y:Number):IPort

Add a port to the given port owner using the coordinates as the new initial position of the port anchor.

Depending on the implementation this method may throw an IllegalOperationError if the type of the portOwner instance does not support adding of ports. If the port owner is an INode a new IPortLocationModelParameter is created using the model of the defaultNodePortLocationModelParameter and the specified coordinates. This will trigger the nodeChanged or edgeChanged event correspondingly.

Parameters

portOwner:IPortOwner — The owner to add the port instance to.
 
x:Number — the new absolute x coordinate in the world coordinate system.
 
y:Number — the new absolute y coordinate in the world coordinate system.

Returns
IPort — the newly created port
addPortWithParameter()method 
public function addPortWithParameter(portOwner:IPortOwner, modelParameter:IPortLocationModelParameter):IPort

Add a port to the given port owner using the model parameter to determine the coordinates of the port.

Depending on the implementation this method may throw an IllegalOperationError if the type of the portOwner instance does not support adding of ports. This will trigger the nodeChanged or edgeChanged event correspondingly.

Parameters

portOwner:IPortOwner — The owner to add the port instance to.
 
modelParameter:IPortLocationModelParameter — The model parameter to determine the location of the port.

Returns
IPort — the newly created port
adjustPreferredSize()method 
public function adjustPreferredSize(label:ILabel):void

Adjusts the ILabel.preferredSize property of a label to fit the suggested size of its ILabelStyleRenderer.

This implementation uses the style's renderer for the label to determine the preferred rendering size. This is useful after the label's content or style have been changed.

Parameters

label:ILabel — The label to adjust the size for.

See also

clear()method 
public function clear():void

Clears this instance, removing all entities in proper order.

clearBends()method 
public function clearBends(edge:IEdge):void

Removes all bends from the given edge.

The edge must be part of this graph at the time of the incovation. This will trigger the corresponding events.

Parameters

edge:IEdge — The edge whose bends will be removed.

contains()method 
public function contains(item:IModelItem):Boolean

Determines whether this instance contains the given element.

Parameters

item:IModelItem — the element.

Returns
Booleantrue if this instance contains the element.
createDefaultEdgeLabelModel()method 
protected function createDefaultEdgeLabelModel():ILabelModel

Factory method for the defaultEdgeLabelModel property. This method will be called upon first access to the defaultEdgeLabelModel property.

Returns
ILabelModel — A new instance of ILabelModel.
createDefaultEdgeLabelModelParameter()method 
protected function createDefaultEdgeLabelModelParameter():ILabelModelParameter

Factory method that obtains a ILabelModelParameter to use for a newly created edge label.

This implementation returns the default parameter for the current defaultEdgeLabelModel

Returns
ILabelModelParameter — A new instance of DefaultEdgeLabelModelParameter

See also

createDefaultEdgeLabelStyle()method 
protected function createDefaultEdgeLabelStyle():ILabelStyle

Factory method for the DefaultEdgeLabelStyle property. This method will be called upon first access to the defaultEdgeLabelStyle property.

Returns
ILabelStyle — A new instance of ILabelStyle.
createDefaultEdgeStyle()method 
protected function createDefaultEdgeStyle():IEdgeStyle

Factory method for the defaultEdgeStyle property. This method will be called upon first access to the defaultEdgeStyle property.

Returns
IEdgeStyle — A new instance of IEdgeStyle.
createDefaultNodeLabelModel()method 
protected function createDefaultNodeLabelModel():ILabelModel

Factory method for the defaultNodeLabelModel property. This method will be called upon first access to the defaultNodeLabelModel property.

Returns
ILabelModel — A new instance of ILabelModel.
createDefaultNodeLabelModelParameter()method 
protected function createDefaultNodeLabelModelParameter():ILabelModelParameter

Factory method that obtains a ILabelModelParameter to use for a newly created node label.

This implementation returns the default parameter for the current defaultNodeLabelModel

Returns
ILabelModelParameter — A new instance of DefaultNodeLabelModelParameter

See also

createDefaultNodeLabelStyle()method 
protected function createDefaultNodeLabelStyle():ILabelStyle

Factory method for the DefaultNodeLabelStyle property. This method will be called upon first access to the defaultNodeLabelStyle property.

Returns
ILabelStyle — A new instance of ILabelStyle.
createDefaultNodePortModelParameter()method 
protected function createDefaultNodePortModelParameter():IPortLocationModelParameter

Factory method for the DefaultNodePortModelParameter property. This method will be called upon first access to the defaultNodePortModelParameter property.

Returns
IPortLocationModelParameter — A new instance of IPortLocationModelParameter.
createDefaultNodeStyle()method 
protected function createDefaultNodeStyle():INodeStyle

Factory method for the DefaultNodeStyle property. This method will be called upon first access to the defaultNodeStyle property.

Returns
INodeStyle — A new instance of INodeStyle.
createDefaultPortStyle()method 
protected function createDefaultPortStyle():IPortStyle

Factory method for the DefaultPortStyle property. This method will be called upon first access to the defaultPortStyle property.

Returns
IPortStyle — A new instance of IPortStyle.
createEdge()method 
public function createEdge(sourcePort:IPort, targetPort:IPort, style:IEdgeStyle = null):IEdge

Creates and returns an edge that connects to the given port instances.

The ports must be part of this graph at the time of the invocation. The edge will be a part of this graph after the method returns. This will trigger the corresponding events.

Parameters

sourcePort:IPort — The source port the created edge will connect to.
 
targetPort:IPort — The target port the created edge will connect to.
 
style:IEdgeStyle (default = null) — The style instance that will be assigned to the newly created instance. If null, a default style will be used.

Returns
IEdge — A newly created edge instance
createEdgeBetweenNodes()method 
public function createEdgeBetweenNodes(sourceNode:INode, targetNode:INode, style:IEdgeStyle = null):IEdge

Convenience method that creates and returns an edge that connects to the given node instances using the given style instance.

The nodes must be part of this graph at the time of the invocation, and the implementation will choose the instances to which the edge will be connected. The edge will be a part of this graph after the method returns. This will trigger the corresponding events.

Parameters

sourceNode:INode — The source node the created edge will connect to. It is up to the implementation to decide which port to use at the given node. The implementation may create a new port of the edge.
 
targetNode:INode — he target node the created edge will connect to. It is up to the implementation to decide which port to use at the given node. The implementation may create a new port of the edge.
 
style:IEdgeStyle (default = null) — The style instance that will be assigned to the newly created instance. If null, a default style will be used.

Returns
IEdge — the newly created edge instance
createEdgeCore()method 
yworks_internal function createEdgeCore(edge:IEdge, sourcePort:IPort, targetPort:IPort, style:IEdgeStyle):void

Parameters

edge:IEdge
 
sourcePort:IPort
 
targetPort:IPort
 
style:IEdgeStyle

createEdgeLabelModelParameter()method 
protected function createEdgeLabelModelParameter():ILabelModelParameter

Factory method that creates and returns a label model parameter to use for newly created edge labels.

Depending on the value of the shareDefaultEdgeLabelModelParameter this method will simply return the defaultEdgeLabelModelParameter or create a ICloneable.clone of it.

Returns
ILabelModelParameter — A newly created label model parameter for edge labels
createEdgeLabelStyle()method 
protected function createEdgeLabelStyle():ILabelStyle

Factory callback that returns an ILabelStyle for newly created edge labels.

Depending on the value of the shareDefaultEdgeLabelStyleInstance this method will simply return the defaultEdgeLabelStyle or create a ICloneable.clone of it.

Returns
ILabelStyle — a label style for edge labels
createEdgeStyle()method 
protected function createEdgeStyle():IEdgeStyle

Factory callback that returns an IEdgeStyle for newly created edges.

Depending on the value of the shareDefaultEdgeStyleInstance this method will simply return the defaultEdgeStyle or create a ICloneable.clone of it.

Returns
IEdgeStyle — a style for edges
createNode()method 
public function createNode(bounds:IRectangle = null, style:INodeStyle = null):INode

Creates and returns a node using default values for the style and the specified initial geometry.

The node will be a part of this graph after the method returns. This will trigger the corresponding events.

Parameters

bounds:IRectangle (default = null) — The bounds to use initially. If null, some default bounds will be used.
 
style:INodeStyle (default = null) — The style instance that will be assigned to the newly created instance. If null, a default style will be used.

Returns
INode — A newly created node instance
createNodeAt()method 
public function createNodeAt(x:Number, y:Number):INode

Creates and returns a node using default values for the style and the specified initial geometry.

The node will be a part of this graph after the method returns. This will trigger the corresponding events.

Parameters

x:Number — the initial x coordinate of the center of the node's layout field
 
y:Number — the initial y coordinate of the center of the node's layout field

Returns
INode — A newly created node instance
createNodeCore()method 
yworks_internal function createNodeCore(node:INode, style:INodeStyle):void

Parameters

node:INode
 
style:INodeStyle

createNodeLabelModelParameter()method 
protected function createNodeLabelModelParameter():ILabelModelParameter

Factory method that creates and returns a label model parameter to use for newly created node labels.

Depending on the value of the shareDefaultNodeLabelModelParameter this method will simply return the defaultNodeLabelModelParameter or create a ICloneable.clone of it.

Returns
ILabelModelParameter — An ILabelModelParameter instance for node labels
createNodeLabelStyle()method 
protected function createNodeLabelStyle():ILabelStyle

Factory callback that returns an ILabelStyle for newly created node labels.

Depending on the value of the shareDefaultNodeLabelStyleInstance this method will simply return the defaultNodeLabelStyle or create a ICloneable.clone of it.

Returns
ILabelStyle — a label style for node labels
createNodePortModelParameter()method 
protected function createNodePortModelParameter():IPortLocationModelParameter

Factory method that creates and returns a port model parameter to use for newly created node ports.

Depending on the value of the shareDefaultNodePortModelParameter this method will simply return the defaultNodePortModelParameter or create a ICloneable.clone of it.

Returns
IPortLocationModelParameter — An IPortLocationModelParameter instance for node ports
createNodeStyle()method 
protected function createNodeStyle():INodeStyle

Factory callback that returns an INodeStyle for newly created nodes.

Depending on the value of the shareDefaultNodeStyleInstance this method will simply return the defaultNodeStyle or create a ICloneable.clone of it.

Returns
INodeStyle — The style to use for newly created nodes.
createPortStyle()method 
protected function createPortStyle():IPortStyle

Factory callback that returns an IPortStyle for newly created ports.

Depending on the value of the shareDefaultPortStyleInstance this method will simply return the defaultPortStyle or create a ICloneable.clone of it.

Returns
IPortStyle — the style to use for newly created ports
createUndoEngine()method 
protected function createUndoEngine():UndoEngine

Creates an UndoEngine instance that automatically triggers invalidateDisplays() upon each invocation of UndoEngine.undo() and UndoEngine.Redo.

Returns
UndoEngine — An UndoEngine instance.
createUndoSupport()method 
protected function createUndoSupport():IUndoSupport

Creates the IUndoSupport instance that can be found in the lookup of this instance.

The instance returned will automatically record state changes of all entities in the graph if IUndoSupport.beginCompoundEdit is called.

Returns
IUndoSupport — An undo support instance that enqueues IUndoUnits into this instance's UndoEngine.
edgesAtPort()method 
public function edgesAtPort(port:IPort):Iterable

Returns an Iterable for all edges that are adjacent to the given port as a IEdge.sourcePort or IEdge.targetPort.

Parameters

port:IPort — The port to check.

Returns
Iterable — An iterable of all adjacent edges.
edgesAtPortOwner()method 
public function edgesAtPortOwner(portOwner:IPortOwner):Iterable

Returns an Iterable for all edges that have the given port owner as their IEdge.targetPort's or IEdge.sourcePort's.

Parameters

portOwner:IPortOwner — The port owner to check

Returns
Iterable — Iterable of all adjacent edges
getBounds()method 
public function getBounds():IRectangle

Calculates the bounds of this graph using the INode.layout, source port and target port IPort.locations and the IBends.

Returns
IRectangle — A rectangle that is the union of all elements in the graph.
getNewSourcePort()method 
protected function getNewSourcePort(source:INode):IPort

Determines an IPort instance to use for the creation of a new edge that starts at the given node.

This implementation will either add a port using the defaultNodePortModelParameter to the node or, if usePortCandidateProviders is set to true, it will query the source for an IPortCandidateProvider to find a valid candidate.

Parameters

source:INode — The source node to find a port for.

Returns
IPort — The port to use for a newly created edge.
getNewTargetPort()method 
protected function getNewTargetPort(target:INode):IPort

Determines a IPort instance to use for the creation of a new edge that ends at the given node.

This implementation will either add a port using the defaultNodePortModelParameter to the node or, if usePortCandidateProviders is set to true, it will query the source for an IPortCandidateProvider to find a valid candidate.

Parameters

target:INode — The target node to find a port for.

Returns
IPort — The port to use for a newly created edge.
inEdgesAtPort()method 
public function inEdgesAtPort(port:IPort):Iterable

Returns an Iterable for all edges that have the given port as a IEdge.targetPort.

Parameters

port:IPort — The port to check.

Returns
Iterable — An iterable of all incoming edges.
inEdgesAtPortOwner()method 
public function inEdgesAtPortOwner(portOwner:IPortOwner):Iterable

Returns an Iterable for all edges that have the given port owner as their IEdge.targetPort's IPort.owner.

Parameters

portOwner:IPortOwner — The port owner to check.

Returns
Iterable — An iterable of all incoming edges.
invalidateDisplays()method 
public function invalidateDisplays():void

Triggers the displaysInvalidated event.

Clients can call this method to force an invalidation of the displays that show this graph instance. This implementation delegates to onInvalidateDisplays

lookup()method 
public 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
onAddingBend()method 
protected function onAddingBend(edge:IEdge, bend:IBend, index:int):void

Called when a bend is going to be added to an edge.

Parameters

edge:IEdge — The node.
 
bend:IBend — The port to be added.
 
index:int — The edge the bend will be added to.

onAddingEdgeLabel()method 
protected function onAddingEdgeLabel(edge:IEdge, label:ILabel):void

Callback method that will be called just before an edge label is added to a edge.

Parameters

edge:IEdge — The edge to which the label is about to be added.
 
label:ILabel — The label that is about to be added.

onAddingNodeLabel()method 
protected function onAddingNodeLabel(node:INode, label:ILabel):void

Callback method that will be called just before a node label is added to a node.

Parameters

node:INode — The node to which the label is about to be added.
 
label:ILabel — The label which is about to be added.

onAddingPort()method 
protected function onAddingPort(node:INode, port:IPort):void

Called when a port is going to be added to a node.

Parameters

node:INode — The node.
 
port:IPort — The port to be added.

onBendAdded()method 
protected function onBendAdded(bend:IBend):void

Callback that is invoked after a bend has been added to this graph's structure.

Parameters

bend:IBend — The bend that has been added

onBendRemoved()method 
protected function onBendRemoved(owner:IEdge, bend:IBend):void

Callback method that is invoked just after a bend has been removed from its edge.

Triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.BEND_REMOVED type.

Parameters

owner:IEdge — The old edge.
 
bend:IBend — The bend.

onChangingEdge()method 
protected function onChangingEdge(edge:IEdge):void

Callback that is invoked before an edge will change.

Parameters

edge:IEdge — An edge that is going to be changed.

onChangingLabel()method 
protected function onChangingLabel(label:ILabel):void

Callback that is invoked before a label will change.

Parameters

label:ILabel — A label that is going to be changed.

onChangingNode()method 
protected function onChangingNode(node:INode):void

Callback that is invoked before a node will change.

Parameters

node:INode — A node that is going to be changed.

onChangingPort()method 
protected function onChangingPort(port:IPort):void

Callback that is invoked before a port is being changed.

Parameters

port:IPort — The port that is going to be changed.

onCreatingEdge()method 
protected function onCreatingEdge(edge:IEdge):void

Callback that is invoked before the edge is added to this graph's structure.

Parameters

edge:IEdge — An edge that is not yet contained in this graph.

onCreatingNode()method 
protected function onCreatingNode(node:INode):void

Callback that is invoked before the node is added to this graph's structure.

Parameters

node:INode — A node that is not yet contained in this graph.

onEdgeChanged()method 
protected function onEdgeChanged(edge:IEdge, oldSourcePort:IPort, oldTargetPort:IPort):void

Callback that is invoked after an edge has changed.

Triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.EDGE_CHANGED type.

Parameters

edge:IEdge — The edge that has changed.
 
oldSourcePort:IPort — The source port of the edge before it was changed.
 
oldTargetPort:IPort — The target port of the edge before it was changed.

onEdgeCreated()method 
protected function onEdgeCreated(edge:IEdge):void

Callback that triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.EDGE_CREATED type.

Parameters

edge:IEdge — The edge that has been created.

onEdgeLabelAdded()method 
protected function onEdgeLabelAdded(label:ILabel):void

Called after a label has been added to an edge.

Triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.LABEL_ADDED type.

Parameters

label:ILabel — The label that has just been added.

onEdgeLabelRemoved()method 
protected function onEdgeLabelRemoved(owner:ILabeledItem, label:ILabel):void

Called after a label has been removed from its edge.

Triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.LABEL_REMOVED type.

Parameters

owner:ILabeledItem — The label that has just been removed.
 
label:ILabel — The old owner of the label.

onEdgeRemoved()method 
protected function onEdgeRemoved(edge:IEdge, oldSourcePort:IPort, oldTargetPort:IPort):void

Callback that triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.EDGE_REMOVED type.

Parameters

edge:IEdge — The edge that has been removed.
 
oldSourcePort:IPort — The source port of the edge before it was removed.
 
oldTargetPort:IPort — The target port of the edge before it was removed.

onInvalidateDisplays()method 
protected function onInvalidateDisplays():void

Triggers the displaysInvalidated event.

onLabelChanged()method 
protected function onLabelChanged(label:ILabel):void

Callback that is invoked after a label has changed.

Triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.LABEL_CHANGED type.

Parameters

label:ILabel — The label that has changed.

onNodeChanged()method 
protected function onNodeChanged(node:INode):void

Callback that is invoked after a node has changed.

Triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.NODE_CHANGED type.

Parameters

node:INode — The node that has changed.

onNodeCreated()method 
protected function onNodeCreated(node:INode):void

Callback that triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.NODE_CREATED type.

Parameters

node:INode — The node that has been created.

onNodeLabelAdded()method 
protected function onNodeLabelAdded(label:ILabel):void

Called after a label has been added to a node.

Triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.LABEL_ADDED type.

Parameters

label:ILabel — The label that has just been added.

onNodeLabelRemoved()method 
protected function onNodeLabelRemoved(owner:ILabeledItem, label:ILabel):void

Called after a label has been removed from its node.

Triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.LABEL_REMOVED type.

Parameters

owner:ILabeledItem — The label that has just been removed.
 
label:ILabel — The old owner of the label.

onNodeRemoved()method 
protected function onNodeRemoved(node:INode):void

Callback that triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.NODE_REMOVED type.

Parameters

node:INode — The node that has been removed.

onPortAdded()method 
protected function onPortAdded(port:IPort):void

Called when a port has been added to a node.

Triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.PORT_ADDED type.

Parameters

port:IPort — The port that has just been added to its owner.

onPortChanged()method 
protected function onPortChanged(port:IPort):void

Callback that is invoked after a port has changed.

Triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.PORT_CHANGED type.

Parameters

port:IPort — The port that has changed.

onPortRemoved()method 
protected function onPortRemoved(oldOwner:IPortOwner, port:IPort):void

Callback method that is called just after a port has been removed from its owner.

Triggers the GraphEvent.GRAPH_CHANGED event with the GraphEventKind.PORT_REMOVED type.

Parameters

oldOwner:IPortOwner — The previous owner of the port.
 
port:IPort — The port that has been removed.

onRemovingBend()method 
protected function onRemovingBend(bend:IBend):void

Callback method that is invoked just before a bend is removed.

Parameters

bend:IBend — The bend that will be removed.

onRemovingEdge()method 
protected function onRemovingEdge(edge:IEdge):void

Callback that is invoked before the edge is removed from this graph's structure.

Parameters

edge:IEdge — An edge that is being removed from this graph.

onRemovingEdgeLabel()method 
protected function onRemovingEdgeLabel(label:ILabel):void

Callback method that will be called just before an edge label is removed from its edge.

Parameters

label:ILabel

onRemovingNode()method 
protected function onRemovingNode(node:INode):void

Callback that is invoked before the node is removed from this graph's structure.

Parameters

node:INode — A node that is being removed from this graph.

onRemovingNodeLabel()method 
protected function onRemovingNodeLabel(label:ILabel):void

Callback method that will be called just before a node label is removed from its node.

Parameters

label:ILabel

onRemovingPort()method 
protected function onRemovingPort(port:IPort):void

Callback method that is called just before a port will be removed.

Parameters

port:IPort — The port that is about to be removed.

outEdgesAtPort()method 
public function outEdgesAtPort(port:IPort):Iterable

Returns an Iterable for all edges that have the given port as a IEdge.sourcePort.

Parameters

port:IPort — The port to check.

Returns
Iterable — An iterable of all outgoing edges.
outEdgesAtPortOwner()method 
public function outEdgesAtPortOwner(portOwner:IPortOwner):Iterable

Returns an Iterable for all edges that have the given port owner as their IEdge.sourcePort's IPort.owner.

Parameters

portOwner:IPortOwner — The port owner to check.

Returns
Iterable — An iterable of all outgoing edges.
registerLookup()method 
public function 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.

Parameters

type:Class — A type to register an implementation for
 
instance:Object — An implementation of type

removeBend()method 
public function removeBend(bend:IBend):void

Removes the given bend instance from its edge.

The edge must be part of this graph at the time of the incovation. This will trigger the corresponding events.

Parameters

bend:IBend — The bend to remove.

removeEdge()method 
public function removeEdge(edge:IEdge):void

Removes the given edge instance from this graph.

The edge must be a part of this graph. This will trigger the corresponding event. The implementation may decide to remove the corresponding ports from the node if no other edge connects to them after the given edge has been removed. Also this will trigger the removal of all labels and bends owned by this instance.

Parameters

edge:IEdge — The live edge to be removed from this graph instance

removeLabel()method 
public function removeLabel(label:ILabel):void

Removes the given label from its owner.

This will trigger the corresponding event.

Parameters

label:ILabel — The label to be removed.

removeLookup()method 
public function removeLookup(lookup:IContextLookupChainLink):void

Removes a previously added lookup chain element from the lookup of this.

Parameters

lookup:IContextLookupChainLink — The element to remove.

removeNode()method 
public function removeNode(node:INode):void

Removes the given node instance from this graph.

The node must be a part of this graph. This will trigger the corresponding event. This method will remove all adjacent edges and their corresponding ports in proper order before the node will be removed. Also this will trigger the removal of all labels owned by this instance.

Parameters

node:INode — The live node to be removed from this graph instance

removePort()method 
public function removePort(port:IPort):void

Removes the port from its owner.

The port must be part of this graph at the time of invocation. This will trigger the corresponding GraphEvents.

Parameters

port:IPort

setBendLocation()method 
public function setBendLocation(bend:IBend, x:Number, y:Number):void

Modifies the location of the given bend.

Parameters

bend:IBend — The bend whose location is to be modified.
 
x:Number — The new x-coordinate of the bend.
 
y:Number — Tthe new y-coordinate of the bend.

setBounds()method 
public function setBounds(node:INode, x:Number, y:Number, width:Number, height:Number):void

Sets the bounds of the given node to the new values.

Parameters

node:INode — A live node that belongs to this graph
 
x:Number — The new absolute x-coordinate of the upper left corner of the node
 
y:Number — The new absolute y-coordinate of the upper left corner of the node
 
width:Number — The new width of the node
 
height:Number — The new height of the node

setEdgeStyle()method 
public function setEdgeStyle(edge:IEdge, style:IEdgeStyle):void

Assigns the given style instance by reference to the edge.

Style instances can be shared.

Parameters

edge:IEdge — The edge that will be assigned the new style.
 
style:IEdgeStyle — The style instance that will be assigned to the edge.

setLabelModelParameter()method 
public function setLabelModelParameter(label:ILabel, parameter:ILabelModelParameter):void

Sets the label model parameter for the given label.

Parameters

label:ILabel — The label.
 
parameter:ILabelModelParameter — The new parameter.

setLabelStyle()method 
public function setLabelStyle(label:ILabel, style:ILabelStyle):void

Assigns the given style instance by reference to the label.

Style instances can be shared.

Parameters

label:ILabel — The label that will be assigned the new style.
 
style:ILabelStyle — The style instance that will be assigned to the label.

setLabelText()method 
public function setLabelText(label:ILabel, text:String):void

Sets the label text of the given label.

Parameters

label:ILabel — The label to modify.
 
text:String — The new text of the label.

setNodeStyle()method 
public function setNodeStyle(node:INode, style:INodeStyle):void

Assigns the given style instance by reference to the node.

Style instances can be shared.

Parameters

node:INode — The node that will be assigned the new style.
 
style:INodeStyle — The style instance that will be assigned to the node.

setPortLocation()method 
public function setPortLocation(port:IPort, x:Number, y:Number):void

Sets the coordinates of the given port to the given values.

Parameters

port:IPort — The port to modify.
 
x:Number — The new x coordinate of the port.
 
y:Number — The new y coordinate of the port

setPortLocationModelParameter()method 
public function setPortLocationModelParameter(port:IPort, modelParameter:IPortLocationModelParameter):void

Sets the location model parameter of the given port to the given value.

Parameters

port:IPort — The port to modify.
 
modelParameter:IPortLocationModelParameter — The new location model parameter for the given port.

setPorts()method 
public function setPorts(edge:IEdge, sourcePort:IPort, targetPort:IPort):void

Sets the ports of the given edge to the new values. This will trigger an EdgeChanged event if source or target ports differ from the current ones. Both ports and the edge must belong to the current graph instance.

Parameters

edge:IEdge — The edge to change the ports.
 
sourcePort:IPort — The new source port instance.
 
targetPort:IPort — The new target port instance.

setPortStyle()method 
public function setPortStyle(port:IPort, style:IPortStyle):void

Assigns the given style instance by reference to the port.

Style instances can be shared.

Parameters

port:IPort — The port that will be assigned the new style.
 
style:IPortStyle — The style instance that will be assigned to the port.

setPreferredSize()method 
public function setPreferredSize(label:ILabel, width:Number, height:Number):void

Sets the preferred size of the label.

Parameters

label:ILabel — The label.
 
width:Number — The new width.
 
height:Number — The new height.

Constant Detail
MAPPER_KEY_EDGE_2_IDConstant
public static const MAPPER_KEY_EDGE_2_ID:String = edge-2-id

Key for an IMapper which maps the graph's edges to an ID

MAPPER_KEY_NODE_2_IDConstant 
public static const MAPPER_KEY_NODE_2_ID:String = node-2-id

Key for an IMapper which maps the graph's nodes to an ID