Packagecom.yworks.yfiles.layout
Classpublic class LayoutGraph
InheritanceLayoutGraph Inheritance Graph Inheritance YObject Inheritance Object
Implements GraphLayout
Subclasses CopiedLayoutGraph, DefaultLayoutGraph

This class represents a drawing of a graph.



Public Properties
 PropertyDefined By
 InheriteddataProviderKeys : Vector.<Object>
[read-only] Returns an array of all data provider look-up keys that are registered with this graph.
Graph
  edgeList : EdgeList
[read-only] Returns a list, which contains the edges of the graph.
LayoutGraph
 Inheritedempty : Boolean
[read-only] Returns true if this graph contains no nodes.
Graph
 InheritedgraphCopyFactory : GraphCopier_CopyFactory
Specifies the copy factory that is associated with this instance.
Graph
 InheritedgraphListeners : Iterator
[read-only] Returns an iterator that grants access to all registered graph listeners.
Graph
 InheritedregisteredEdgeMaps : Vector.<Object>
[read-only] Returns all edge maps that have been created by this graph but have not yet been disposed.
Graph
 InheritedregisteredNodeMaps : Vector.<Object>
[read-only] Returns all node maps that have been created by this graph but have not yet been disposed.
Graph
Public Methods
 MethodDefined By
  
LayoutGraph(init:Boolean = true)
Creates a new Layout Graph
LayoutGraph
 Inherited
addDataProvider(providerKey:Object, data:DataProvider):void
Registers the given data provider using the given look-up key.
Graph
 Inherited
Registers the given graph listener with this graph.
Graph
 Inherited
changeEdgeTo(e:Edge, e1:Edge, e2:Edge, d1:int, d2:int):void
Redefines an edge's end points and fires corresponding notification events to inform registered listeners.
Graph
 Inherited
clear():void
Removes all nodes and edges from this graph and fires corresponding notification events to inform registered listeners.
Graph
 Inherited
containsEdge(e:Edge):Boolean
Whether or not this graph contains the given edge.
Graph
 Inherited
containsEdgeBetweenNodes(source:Node, target:Node):Boolean
Returns whether or not this graph contains an edge that connects the given nodes.
Graph
 Inherited
containsNode(v:Node):Boolean
Whether or not this graph contains the given node.
Graph
 Inherited
Creates a copy of this graph.
Graph
 Inherited
Creates a new edge in this graph and fires a corresponding notification event to inform registered listeners.
Graph
 Inherited
createEdgeAt(v:Node, e1:Edge, w:Node, e2:Edge, d1:int, d2:int):Edge
Creates a new edge in this graph to be ordered before or after a given edge and fires a corresponding notification event to inform registered listeners.
Graph
 Inherited
Returns a newly created edge map that is valid for the edges in this graph.
Graph
 Inherited
Creates an empty base object of the same type as this graph.
Graph
 Inherited
Creates a new node in this graph and fires a corresponding notification event to inform registered listeners.
Graph
 Inherited
Returns a newly created node map that is valid for the nodes in this graph.
Graph
 Inherited
Informs the graph that the given edge map is no longer needed.
Graph
 Inherited
Informs the graph that the given node map is no longer needed.
Graph
 Inherited
E():int
Returns the number of edges in this graph.
Graph
 Inherited
edgeCount():int
Returns the number of edges in this graph.
Graph
 Inherited
Returns an iterator that provides access to all edges residing in this graph.
Graph
 Inherited
Provides access to the edges of the graph.
Graph
 Inherited
equals(o:Object):Boolean
YObject
 Inherited
Propagates a so-called POST event to all registered graph listeners.
Graph
 Inherited
firePostEventWithId(id:Object):void
Like firePostEvent().
Graph
 Inherited
Propagates a so-called PRE event to all registered graph listeners.
Graph
 Inherited
firePreEventWithId(id:Object):void
Like firePreEvent().
Graph
 Inherited
Returns the first edge in this graph.
Graph
 Inherited
Returns the first node in this graph.
Graph
  
Returns the bounding box of the diagram.
LayoutGraph
  
Returns the position of a node in a drawing.
LayoutGraph
  
getCenterX(v:Node):Number
Returns the center x-coordinate of the given node.
LayoutGraph
  
getCenterY(v:Node):Number
Returns the center y-coordinate of the given node.
LayoutGraph
  
getClass():Class
[override]
LayoutGraph
 Inherited
getDataProvider(providerKey:Object):DataProvider
Returns the data provider that is registered with the graph using the given look-up key.
Graph
 Inherited
getEdgeArray():Vector.<Object>
Returns an array containing all edges of this graph.
Graph
  
Returns the edge which is described by a given label layout.
LayoutGraph
  
getEdgeLabelLayout(edge:Object):Vector.<Object>
Returns EdgeLabelLayout objects which describe the layouts of the labels that belong to the given edge.
LayoutGraph
  
getEdgeLabelLayoutForEdge(edge:Edge):Vector.<Object>
Returns EdgeLabelLayout objects which describe the layouts of the labels that belong to the given edge.
LayoutGraph
  
Returns the layout information for an edge in the drawing.
LayoutGraph
  
Returns the layout information for an edge in the drawing.
LayoutGraph
  
getHeight(v:Node):Number
Returns the height of the given node
LayoutGraph
  
Returns the position of the node in a drawing.
LayoutGraph
 Inherited
getNodeArray():Vector.<Object>
Returns an array containing all nodes of this graph.
Graph
  
Returns the node which is described by a given label layout.
LayoutGraph
  
getNodeLabelLayout(node:Object):Vector.<Object>
Returns NodeLabelLayout objects which describe the layouts of the labels that belong to the given node.
LayoutGraph
  
getNodeLabelLayoutForNode(node:Node):Vector.<Object>
Returns NodeLabelLayout objects which describe the layouts of the labels that belong to the given node.
LayoutGraph
  
Returns the layout information for a node in the drawing.
LayoutGraph
  
Returns the layout information for a node in the drawing.
LayoutGraph
  
Returns the path of an edge.
LayoutGraph
  
Returns the path of an edge.
LayoutGraph
  
Returns the control points of an edge.
LayoutGraph
  
Returns the control points of an edge.
LayoutGraph
  
Returns the bounding box of a node.
LayoutGraph
  
Returns the size of the node in a drawing.
LayoutGraph
 Inherited
getSource(edge:Object):Object
Returns the source node associated with the given edge.
Graph
  
Returns the coordinates of the source end point of an edge in absolute coordinates.
LayoutGraph
  
Returns the coordinates of the source end point of an edge in relative coordinates to the center of the source node.
LayoutGraph
 Inherited
getTarget(edge:Object):Object
Returns the target node associated with the given edge.
Graph
  
Returns the coordinates of the target end point of an edge in absolute coordinates.
LayoutGraph
  
Returns the coordinates of the target end point of an edge in relative coordinates to the center of the target node.
LayoutGraph
  
getWidth(v:Node):Number
Returns the width of the given node.
LayoutGraph
  
getX(v:Node):Number
Returns the upper left x-coordinate of the given node.
LayoutGraph
  
getY(v:Node):Number
Returns the upper left y-coordinate of the given node.
LayoutGraph
 Inherited
hashCode():int
YObject
 Inherited
hideEdge(e:Edge):void
Hides the given edge from this graph.
Graph
 Inherited
hideNode(v:Node):void
Hides the given node from this graph.
Graph
 Inherited
Returns the last edge in this graph.
Graph
 Inherited
Returns the last node in this graph.
Graph
  
moveBy(node:Node, dx:Number, dy:Number):void
Moves the location of a node by a given vector
LayoutGraph
 Inherited
moveEdge(e:Edge, newSource:Node, newTarget:Node):void
Redefines an edge's end points and fires corresponding notification events to inform registered listeners.
Graph
 Inherited
moveEdgeTo(e:Edge, newSource:Node, sourceReference:Edge, sourceD:int, newTarget:Node, targetReference:Edge, targetD:int):void
Redefines an edge's end points and fires corresponding notification events to inform registered listeners.
Graph
 Inherited
Moves the given edge to the first position within the sequence of edges in this graph.
Graph
 Inherited
Moves the given edge to the last position within the sequence of edges in this graph.
Graph
 Inherited
Moves the given node to the first position within the sequence of nodes in this graph.
Graph
 Inherited
Moves the given node to the last position within the sequence of nodes in this graph.
Graph
 Inherited
moveSubGraph(subNodes:NodeList, targetGraph:Graph):EdgeList
Moves an induced subgraph to another graph.
Graph
 Inherited
N():int
Returns the number of nodes in this graph.
Graph
 Inherited
[static] Instantiates an empty Graph object.
Graph
 Inherited
[static] Instantiates a new Graph object as a copy of the given graph.
Graph
 Inherited
newGraph3(graph:Graph, subNodes:YCursor):Graph
[static] Instantiates a new Graph object as a partial copy of the given graph.
Graph
 Inherited
nodeCount():int
Returns the number of nodes in this graph.
Graph
 Inherited
Returns an iterator that provides access to all nodes residing in this graph.
Graph
 Inherited
Provides access to the nodes of the graph.
Graph
 Inherited
For internal debugging purposes only.
Graph
 Inherited
Reinserts a formerly removed edge into this graph and fires a corresponding notification event to inform registered listeners.
Graph
 Inherited
Reinserts a formerly removed node into this graph and fires a corresponding notification event to inform registered listeners.
Graph
 Inherited
removeDataProvider(providerKey:Object):void
Removes the data provider that is registered using the given look-up key.
Graph
 Inherited
Removes the given edge from this graph and fires a corresponding notification event to inform registered listeners.
Graph
 Inherited
Removes the given graph listener from this graph.
Graph
 Inherited
Removes the given node from this graph.
Graph
 Inherited
Reverses the given edge and fires corresponding notification events to inform registered listeners.
Graph
  
setCenter(v:Node, x:Number, y:Number):void
Sets the center coordinates of the given node.
LayoutGraph
  
setCenter2(node:Node, position:YPoint):void
Sets the position of a node in a drawing.
LayoutGraph
  
setEndPointsAbs(edge:Edge, source:YPoint, target:YPoint):void
Set the two end points of an edge in absolute coordinates.
LayoutGraph
  
setLocation(v:Node, x:Number, y:Number):void
Sets the upper left coordinates of the given node.
LayoutGraph
  
setLocationToPoint(node:Node, position:YPoint):void
Set the position of the node in a drawing.
LayoutGraph
  
setPath(edge:Edge, path:YList):void
Sets the path of an edge.
LayoutGraph
  
setPath2(edge:Edge, path:YPointPath):void
Sets the path of an edge.
LayoutGraph
  
setPoints(edge:Edge, points:YPointPath):void
Sets the control points of an edge.
LayoutGraph
  
setPointsFromList(edge:Edge, points:YList):void
Sets the control points of an edge.
LayoutGraph
  
setSize(v:Node, w:Number, h:Number):void
Sets the size of the given node.
LayoutGraph
  
setSize2(node:Node, size:YDimension):void
Set the size of the node in a drawing.
LayoutGraph
  
setSourcePointAbs(edge:Edge, point:YPoint):void
Sets the coordinates of the source end point of an edge in absolute coordinates.
LayoutGraph
  
setSourcePointRel(edge:Edge, point:YPoint):void
Sets the coordinates of the source end point of an edge in relative coordinates to the center of the source node.
LayoutGraph
  
setTargetPointAbs(edge:Edge, point:YPoint):void
Sets the coordinates of the target end point of an edge in absolute coordinates.
LayoutGraph
  
setTargetPointRel(edge:Edge, point:YPoint):void
Sets the coordinates of the target end point of an edge in relative coordinates to the center of the target node.
LayoutGraph
 Inherited
sortEdges(inComp:Comparator, outComp:Comparator):void
Sorts incoming and outgoing edges at each node of the graph.
Graph
 Inherited
Sorts the internally held list of edges.
Graph
 Inherited
Sorts the internally held list of nodes.
Graph
 Inherited
toString():String
Returns a String representation of this graph.
Graph
 Inherited
Unhides the given edge in this graph.
Graph
 Inherited
Unhides the given node in this graph.
Graph
Protected Methods
 MethodDefined By
  
[override]
LayoutGraph
  
Creates a new com.yworks.yfiles.layout.LabelLayoutFactory.
LayoutGraph
 Inherited
Propagates the given graph event to all registered graph listeners.
Graph
 Inherited
[static] Low-level iteration support for adjacent edges.
Graph
 Inherited
hasListeners():Boolean
Determines whether there are listeners registered with this instance.
Graph
 Inherited
initGraph1():void
Initializes this object.
Graph
 Inherited
initGraph2(argGraph:Graph):void
Initializes this object.
Graph
 Inherited
initGraph3(graph:Graph, subNodes:YCursor):void
Initializes this object.
Graph
  
LayoutGraph
  
LayoutGraph
  
initLayoutGraph3(graph:LayoutGraph, nodeSubset:YCursor):void
LayoutGraph
Public Constants
 ConstantDefined By
 InheritedAFTER : int = 0
[static] Object insertion specifier.
Graph
 InheritedBEFORE : int = 1
[static] Object insertion specifier.
Graph
Property Detail
edgeListproperty
edgeList:EdgeList  [read-only]

Returns a list, which contains the edges of the graph.


Implementation
    public function get edgeList():EdgeList
Constructor Detail
LayoutGraph()Constructor
public function LayoutGraph(init:Boolean = true)

Creates a new Layout Graph

Parameters
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.
Method Detail
createGraphCopyFactory()method
override protected function createGraphCopyFactory():GraphCopier_CopyFactory

Returns
GraphCopier_CopyFactory
createLabelFactory()method 
protected function createLabelFactory():LabelLayoutFactory

Creates a new com.yworks.yfiles.layout.LabelLayoutFactory.

Returns
LabelLayoutFactory

See also

getBoundingBox()method 
public function getBoundingBox():Rectangle

Returns the bounding box of the diagram. This is the smallest rectangle containing the entire diagram. If the graph does not contain any nodes (and therefore no edges either), the bounding box will have negative width and/or height.

Returns
Rectangle
getCenter()method 
public function getCenter(node:Node):YPoint

Returns the position of a node in a drawing. The position is defined by the center of the node.

Parameters

node:Node — a node in the graph

Returns
YPoint — the center of the node in the drawing of the node
getCenterX()method 
public function getCenterX(v:Node):Number

Returns the center x-coordinate of the given node.

Parameters

v:Node

Returns
Number
getCenterY()method 
public function getCenterY(v:Node):Number

Returns the center y-coordinate of the given node.

Parameters

v:Node

Returns
Number
getClass()method 
override public function getClass():Class

Returns
Class
getEdgeFeature()method 
public function getEdgeFeature(labelLayout:EdgeLabelLayout):Edge

Returns the edge which is described by a given label layout.

Parameters

labelLayout:EdgeLabelLayout

Returns
Edge
getEdgeLabelLayout()method 
public function getEdgeLabelLayout(edge:Object):Vector.<Object>

Returns EdgeLabelLayout objects which describe the layouts of the labels that belong to the given edge.

Parameters

edge:Object — an edge in the drawing.

Returns
Vector.<Object> — the edge label layout information for edge.
getEdgeLabelLayoutForEdge()method 
public function getEdgeLabelLayoutForEdge(edge:Edge):Vector.<Object>

Returns EdgeLabelLayout objects which describe the layouts of the labels that belong to the given edge.

Parameters

edge:Edge — an edge in the drawing.

Returns
Vector.<Object> — the edge label layout information for edge.
getEdgeLayout()method 
public function getEdgeLayout(edge:Object):EdgeLayout

Returns the layout information for an edge in the drawing.

Parameters

edge:Object — a edge in the drawing.

Returns
EdgeLayout — the layout information for edge.
getEdgeLayoutForEdge()method 
public function getEdgeLayoutForEdge(edge:Edge):EdgeLayout

Returns the layout information for an edge in the drawing.

Parameters

edge:Edge — a edge in the drawing.

Returns
EdgeLayout — the layout information for edge.
getHeight()method 
public function getHeight(v:Node):Number

Returns the height of the given node

Parameters

v:Node

Returns
Number
getLocation()method 
public function getLocation(node:Node):YPoint

Returns the position of the node in a drawing. The position is defined by the upper left corner of the node.

Parameters

node:Node — a node in the graph

Returns
YPoint — the upper left corner of the drawing of the node
getNodeFeature()method 
public function getNodeFeature(labelLayout:NodeLabelLayout):Node

Returns the node which is described by a given label layout.

Parameters

labelLayout:NodeLabelLayout

Returns
Node
getNodeLabelLayout()method 
public function getNodeLabelLayout(node:Object):Vector.<Object>

Returns NodeLabelLayout objects which describe the layouts of the labels that belong to the given node.

Parameters

node:Object — a node in the drawing.

Returns
Vector.<Object> — the node label layout information for node.
getNodeLabelLayoutForNode()method 
public function getNodeLabelLayoutForNode(node:Node):Vector.<Object>

Returns NodeLabelLayout objects which describe the layouts of the labels that belong to the given node.

Parameters

node:Node — a node in the drawing.

Returns
Vector.<Object> — the node label layout information for node.
getNodeLayout()method 
public function getNodeLayout(node:Object):NodeLayout

Returns the layout information for a node in the drawing.

Parameters

node:Object — a node in the drawing.

Returns
NodeLayout — the layout information for node.
getNodeLayoutForNode()method 
public function getNodeLayoutForNode(node:Node):NodeLayout

Returns the layout information for a node in the drawing.

Parameters

node:Node — a node in the drawing.

Returns
NodeLayout — the layout information for node.
getPath()method 
public function getPath(edge:Edge):YPointPath

Returns the path of an edge. The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position of the target port.

Parameters

edge:Edge — an edge in the graph

Returns
YPointPath — the path
getPathList()method 
public function getPathList(edge:Edge):YList

Returns the path of an edge. The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position of the target port.

Parameters

edge:Edge — an edge in the graph

Returns
YList — the path as a YList
getPointList()method 
public function getPointList(edge:Edge):YList

Returns the control points of an edge.

Parameters

edge:Edge — an edge in the graph

Returns
YList — the sequence of control points as a YList
getPoints()method 
public function getPoints(edge:Edge):YPointPath

Returns the control points of an edge.

Parameters

edge:Edge — an edge in the graph

Returns
YPointPath — the sequence of control points.
getRectangle()method 
public function getRectangle(node:Node):YRectangle

Returns the bounding box of a node.

Parameters

node:Node — a node in the graph.

Returns
YRectangle — a box.
getSize()method 
public function getSize(node:Node):YDimension

Returns the size of the node in a drawing.

Parameters

node:Node — a node in the graph.

Returns
YDimension — the size of the node.
getSourcePointAbs()method 
public function getSourcePointAbs(edge:Edge):YPoint

Returns the coordinates of the source end point of an edge in absolute coordinates.

Parameters

edge:Edge — an edge in the graph

Returns
YPoint
getSourcePointRel()method 
public function getSourcePointRel(edge:Edge):YPoint

Returns the coordinates of the source end point of an edge in relative coordinates to the center of the source node.

Parameters

edge:Edge — an edge in the graph

Returns
YPoint
getTargetPointAbs()method 
public function getTargetPointAbs(edge:Edge):YPoint

Returns the coordinates of the target end point of an edge in absolute coordinates.

Parameters

edge:Edge — an edge in the graph

Returns
YPoint
getTargetPointRel()method 
public function getTargetPointRel(edge:Edge):YPoint

Returns the coordinates of the target end point of an edge in relative coordinates to the center of the target node.

Parameters

edge:Edge — an edge in the graph

Returns
YPoint
getWidth()method 
public function getWidth(v:Node):Number

Returns the width of the given node.

Parameters

v:Node

Returns
Number
getX()method 
public function getX(v:Node):Number

Returns the upper left x-coordinate of the given node.

Parameters

v:Node

Returns
Number
getY()method 
public function getY(v:Node):Number

Returns the upper left y-coordinate of the given node.

Parameters

v:Node

Returns
Number
initLayoutGraph1()method 
protected final function initLayoutGraph1():void

initLayoutGraph2()method 
protected final function initLayoutGraph2(argGraph:LayoutGraph):void

Parameters

argGraph:LayoutGraph

initLayoutGraph3()method 
protected final function initLayoutGraph3(graph:LayoutGraph, nodeSubset:YCursor):void

Parameters

graph:LayoutGraph
 
nodeSubset:YCursor

moveBy()method 
public function moveBy(node:Node, dx:Number, dy:Number):void

Moves the location of a node by a given vector

Parameters

node:Node — a node in the graph
 
dx:Number — the x-component of the vector
 
dy:Number — the y-component of the vector

setCenter()method 
public function setCenter(v:Node, x:Number, y:Number):void

Sets the center coordinates of the given node.

Parameters

v:Node
 
x:Number
 
y:Number

setCenter2()method 
public function setCenter2(node:Node, position:YPoint):void

Sets the position of a node in a drawing. The position is defined by the center of the node.

Parameters

node:Node — a node in the graph
 
position:YPoint — the center of the node in the drawing of the node

setEndPointsAbs()method 
public function setEndPointsAbs(edge:Edge, source:YPoint, target:YPoint):void

Set the two end points of an edge in absolute coordinates.

Parameters

edge:Edge — an edge in the graph.
 
source:YPoint — the port on the source side of the edge.
 
target:YPoint — the port on the target side of the edge.

setLocation()method 
public function setLocation(v:Node, x:Number, y:Number):void

Sets the upper left coordinates of the given node.

Parameters

v:Node
 
x:Number
 
y:Number

setLocationToPoint()method 
public function setLocationToPoint(node:Node, position:YPoint):void

Set the position of the node in a drawing. The position is defined by the upper left corner of the node.

Parameters

node:Node — a node in the graph
 
position:YPoint — the upper left corner of the drawing of the node

setPath()method 
public function setPath(edge:Edge, path:YList):void

Sets the path of an edge. The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position of the target port. Both source and target port are expected to be given in absolute coordinates.

Precondition The length of the path must be 2 at least.

Parameters

edge:Edge — an edge in the graph
 
path:YList — the path sequence given as a YList

setPath2()method 
public function setPath2(edge:Edge, path:YPointPath):void

Sets the path of an edge. The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position of the target port. Both source and target port are expected to be given in absolute coordinates.

Precondition The length of the path must be 2 at least.

Parameters

edge:Edge — an edge in the graph
 
path:YPointPath — the path sequence.

setPoints()method 
public function setPoints(edge:Edge, points:YPointPath):void

Sets the control points of an edge.

Parameters

edge:Edge — an edge in the graph
 
points:YPointPath — the sequence of control points.

setPointsFromList()method 
public function setPointsFromList(edge:Edge, points:YList):void

Sets the control points of an edge.

Parameters

edge:Edge — an edge in the graph
 
points:YList — the sequence of control points as a YList

setSize()method 
public function setSize(v:Node, w:Number, h:Number):void

Sets the size of the given node.

Parameters

v:Node
 
w:Number
 
h:Number

setSize2()method 
public function setSize2(node:Node, size:YDimension):void

Set the size of the node in a drawing.

Parameters

node:Node — a node in the graph
 
size:YDimension — the size of the node.

setSourcePointAbs()method 
public function setSourcePointAbs(edge:Edge, point:YPoint):void

Sets the coordinates of the source end point of an edge in absolute coordinates.

Parameters

edge:Edge — an edge in the graph
 
point:YPoint

setSourcePointRel()method 
public function setSourcePointRel(edge:Edge, point:YPoint):void

Sets the coordinates of the source end point of an edge in relative coordinates to the center of the source node.

Parameters

edge:Edge — an edge in the graph
 
point:YPoint

setTargetPointAbs()method 
public function setTargetPointAbs(edge:Edge, point:YPoint):void

Sets the coordinates of the target end point of an edge in absolute coordinates.

Parameters

edge:Edge — an edge in the graph
 
point:YPoint

setTargetPointRel()method 
public function setTargetPointRel(edge:Edge, point:YPoint):void

Sets the coordinates of the target end point of an edge in relative coordinates to the center of the target node.

Parameters

edge:Edge — an edge in the graph
 
point:YPoint