| Package | org.un.flex.graphLayout.visual |
| Class | public class VisualGraph |
| Inheritance | VisualGraph mx.containers.Canvas |
| Implements | IVisualGraph |
| Property | Defined by | ||
|---|---|---|---|
| addItemEffect : Effect
If set, this effect will be applied if a view
is created (e.g.
| VisualGraph | ||
| center : Point [read-only]
Provide access to the center point of the VGraph's
drawing surface, used by layouters to properly center
their layout.
| VisualGraph | ||
| currentRootSID : String [read-only]
This was added for testing.
| VisualGraph | ||
| currentRootVNode : IVisualNode
Set or get the current root node (or focused node).
| VisualGraph | ||
| displayEdgeLabels : Boolean
Specify whether to display edge labels or not.
| VisualGraph | ||
| dragLockCenter : Boolean = false
This property controls whether the mouse cursor
should be locked in the dragged node's center or not.
| VisualGraph | ||
| edgeLabelRenderer : IFactory
Allow to provide an EdgeLabelRenderer in order to
display edge labels.
| VisualGraph | ||
| edgeRenderer : IEdgeRenderer
Allow the provision of an EdgeRenderer to
allow drawing of edges in a customised way.
| VisualGraph | ||
| graph : IGraph
This property allows access and setting of the underlying
graph object.
| VisualGraph | ||
| itemRenderer : IFactory
Access to a parameter Object to preset various
settings for the drawing of Edges.
| VisualGraph | ||
| layouter : ILayoutAlgorithm
Access to the layouter to be used for the
layout of the graph.
| VisualGraph | ||
| maxVisibleDistance : int
Limit the currently visible nodes to those in a limited
distance (in terms of degrees of separation) from the current
root node.
| VisualGraph | ||
| moveNodeInDrag : Boolean [write-only]
| VisualGraph | ||
| newNodesDefaultVisible : Boolean = false
Default visibility setting for new nodes.
| VisualGraph | ||
| noVisibleVNodes : uint [read-only]
Returns the number of currently visible nodes.
| VisualGraph | ||
| origin : Point [read-only]
Provide access to the current origin of the of the Visual Graph
which is required for proper drawing.
| VisualGraph | ||
| removeItemEffect : Effect
If set, this effect will be applied if a view
is removed (e.g.
| VisualGraph | ||
| scale : Number
The scale property of VGraph will affect
the scaleX and scaleY properties and also
will ensure drag&drop works properly.
| VisualGraph | ||
| scrollBackgroundInDrag : Boolean [write-only]
| VisualGraph | ||
| showHistory : Boolean
This property controls whether to show the history of
root nodes (or focused nodes) or not.
| VisualGraph | ||
| visibilityLimitActive : Boolean
Specifies if any visibility limits should be active
or not.
| VisualGraph | ||
| visibleEdges : Dictionary [read-only]
Provide access to a list of currently visible edges,
i.e.
| VisualGraph | ||
| visibleVNodes : Dictionary [read-only]
Provide access to a list of currently visible VNodes.
| VisualGraph | ||
| Method | Defined by | ||
|---|---|---|---|
|
The constructor just initialises most data structures, but not all
required.
| VisualGraph | ||
|
calcNodesBoundingBox():Rectangle
Calculate and return the current bounding box of all visible nodes.
| VisualGraph | ||
|
clearHistory():void
Clears the current history of root nodes.
| VisualGraph | ||
|
createNode(sid:String = "", o:Object = null):IVisualNode
Create a new Node in this VisualGraph, this automatically
creates an underlying Node in the Graph object.
| VisualGraph | ||
|
draw():void
Calling this forces a full calculation and redraw of the layout
including all edges.
| VisualGraph | ||
|
initFromGraph():void
This initialises a VGraph from a Graph object.
| VisualGraph | ||
|
Links two nodes, thus creating an edge.
| VisualGraph | ||
|
redrawEdges():void
Redraw all edges, this is called from the updateDisplayList()
method.
| VisualGraph | ||
|
refresh():void
| VisualGraph | ||
|
removeNode(vn:IVisualNode):void
Removes a node from this VisualGraph.
| VisualGraph | ||
|
scroll(deltaX:Number, deltaY:Number):void
Scrolls all objects according to the specified coordinates
(used as an offset).
| VisualGraph | ||
|
Unlinks two nodes, thus removing the edge between them, if it
exists.
| VisualGraph | ||
| Method | Defined by | ||
|---|---|---|---|
|
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
This calls the base updateDisplayList() method of the
Canvas and in addition redraws all edges if the layouter
indicates that the layout has changed.
| VisualGraph | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when there is any change to the nodes and/or links of this graph. | VisualGraph | |||
| addItemEffect | property |
public var addItemEffect:EffectIf set, this effect will be applied if a view is created (e.g. while a node becomes visible or if a new node is created).
| center | property |
center:Point [read-only]Provide access to the center point of the VGraph's drawing surface, used by layouters to properly center their layout.
Implementation public function get center():Point
| currentRootSID | property |
currentRootSID:String [read-only]This was added for testing. It may be removed again.
Implementation public function get currentRootSID():String
| currentRootVNode | property |
currentRootVNode:IVisualNode [read-write]Set or get the current root node (or focused node). Setting this property will result in a redraw of the graph to reflect the change (if it was actually a change).
This property can be used as the source for data binding.
Implementation public function get currentRootVNode():IVisualNode
public function set currentRootVNode(value:IVisualNode):void
| displayEdgeLabels | property |
displayEdgeLabels:Boolean [read-write]Specify whether to display edge labels or not. If no edge label renderer is present a default will be used.
Implementation public function get displayEdgeLabels():Boolean
public function set displayEdgeLabels(value:Boolean):void
| dragLockCenter | property |
public var dragLockCenter:Boolean = falseThis property controls whether the mouse cursor should be locked in the dragged node's center or not.
| edgeLabelRenderer | property |
edgeLabelRenderer:IFactory [read-write]Allow to provide an EdgeLabelRenderer in order to display edge labels. The created instances must be UIComponents.
Implementation public function get edgeLabelRenderer():IFactory
public function set edgeLabelRenderer(value:IFactory):void
| edgeRenderer | property |
edgeRenderer:IEdgeRenderer [read-write]Allow the provision of an EdgeRenderer to allow drawing of edges in a customised way. The edgeRenderer has to implement the IEdgeRenderer interface.
Implementation public function get edgeRenderer():IEdgeRenderer
public function set edgeRenderer(value:IEdgeRenderer):void
| graph | property |
graph:IGraph [read-write]This property allows access and setting of the underlying graph object. If set, it will automatically initialise the VGraph from the Graph object, i.e. create VNodes and VEdges for each Graph node and Graph edge. If there was already a Graph present, the VGraph is purged, but no other cleanup is done, which means that there could still be some references floating around thus leaking memory. For now, avoid setting it more than once in the same VGraph.
Implementation public function get graph():IGraph
public function set graph(value:IGraph):void
| itemRenderer | property |
itemRenderer:IFactory [read-write]Access to a parameter Object to preset various settings for the drawing of Edges. The Object is a hash with the following properties: "alpha" "thickness" "color" "distcolor" which are to be used by an Edge Renderer
Implementation public function get itemRenderer():IFactory
public function set itemRenderer(value:IFactory):void
| layouter | property |
layouter:ILayoutAlgorithm [read-write]Access to the layouter to be used for the layout of the graph.
Implementation public function get layouter():ILayoutAlgorithm
public function set layouter(value:ILayoutAlgorithm):void
| maxVisibleDistance | property |
maxVisibleDistance:int [read-write]Limit the currently visible nodes to those in a limited distance (in terms of degrees of separation) from the current root node. If showHistory is enabled, the previous root nodes will be shown regardless of this limit.
This property can be used as the source for data binding.
Implementation public function get maxVisibleDistance():int
public function set maxVisibleDistance(value:int):void
| moveNodeInDrag | property |
moveNodeInDrag:Boolean [write-only]Implementation
public function set moveNodeInDrag(value:Boolean):void
| newNodesDefaultVisible | property |
public var newNodesDefaultVisible:Boolean = falseDefault visibility setting for new nodes. If set all new nodes are created visible and with a view component. Beware of that if you have many nodes.
| noVisibleVNodes | property |
noVisibleVNodes:uint [read-only]Returns the number of currently visible nodes.
Implementation public function get noVisibleVNodes():uint
| origin | property |
origin:Point [read-only]Provide access to the current origin of the of the Visual Graph which is required for proper drawing.
Implementation public function get origin():Point
| removeItemEffect | property |
public var removeItemEffect:EffectIf set, this effect will be applied if a view is removed (e.g. a node becomes invisible or is removed).
| scale | property |
scale:Number [read-write]The scale property of VGraph will affect the scaleX and scaleY properties and also will ensure drag&drop works properly.
Implementation public function get scale():Number
public function set scale(value:Number):void
| scrollBackgroundInDrag | property |
scrollBackgroundInDrag:Boolean [write-only]Implementation
public function set scrollBackgroundInDrag(value:Boolean):void
| showHistory | property |
showHistory:Boolean [read-write]This property controls whether to show the history of root nodes (or focused nodes) or not. If enabled, these previous root nodes will be shown even though they are are now more degrees of separation away from the current root node than the limit allows. Also any intermediate node from a previous root node to the current root node will be shown to have a complete link and not a disconnected graph.
Implementation public function get showHistory():Boolean
public function set showHistory(value:Boolean):void
| visibilityLimitActive | property |
visibilityLimitActive:Boolean [read-write]Specifies if any visibility limits should be active or not. If not active, always all nodes are visible. If you have many nodes, this could have a severe impact on your performance so handle with care.
This property can be used as the source for data binding.
Implementation public function get visibilityLimitActive():Boolean
public function set visibilityLimitActive(value:Boolean):void
| visibleEdges | property |
visibleEdges:Dictionary [read-only]Provide access to a list of currently visible edges, i.e. edges whose both nodes are visible and thus need to be drawn. Likewise this can save a lot of CPU if the layouter only needs to consider the currently visible edges.
Implementation public function get visibleEdges():Dictionary
| visibleVNodes | property |
visibleVNodes:Dictionary [read-only]Provide access to a list of currently visible VNodes. This is very important for layouters, if we have many many nodes, but only a few of them are visible at a time. Layouters typically will only layout the currently visible nodes.
Implementation public function get visibleVNodes():Dictionary
| VisualGraph | () | constructor |
public function VisualGraph()The constructor just initialises most data structures, but not all required. Currently it does neither set a Graph object, nor a Layouter object. Reasonable defaults may be added as an option.
| calcNodesBoundingBox | () | method |
public function calcNodesBoundingBox():RectangleCalculate and return the current bounding box of all visible nodes. This is required by some layouters.
ReturnsRectangle — The bounding box rectangle of all visible nodes.
|
| clearHistory | () | method |
public function clearHistory():voidClears the current history of root nodes.
| createNode | () | method |
public function createNode(sid:String = "", o:Object = null):IVisualNodeCreate a new Node in this VisualGraph, this automatically creates an underlying Node in the Graph object. It does not link the node to any other node, yet and it does not trigger a layout pass. The reason is that currently all layouters require a CONNECTED graph, since the new node would create a disconnected graph (since it is not linked, yet) this would break things.
Parameterssid:String (default = "") — The string id of the new node.
|
|
o:Object (default = null) — The data object of this new node.
|
IVisualNode —
The created VisualNode object.
|
| draw | () | method |
public function draw():voidCalling this forces a full calculation and redraw of the layout including all edges.
| initFromGraph | () | method |
public function initFromGraph():voidThis initialises a VGraph from a Graph object. I.e. it crates a VNode for every Node found in the Graph and a VEdge for every Edge in the Graph. Careful, this currently does not check if the VGraph was already initialised and it does not purge anything. Things could break of used on an already initialized VGraph.
| linkNodes | () | method |
public function linkNodes(v1:IVisualNode, v2:IVisualNode):IVisualEdgeLinks two nodes, thus creating an edge. If the underlying Graph is directional, the order matters, not otherwise. If the nodes are already linked, simply returns the existing edge between them.
Parametersv1:IVisualNode — The first node (from node) to link.
|
|
v2:IVisualNode — The second node (to node) to link.
|
IVisualEdge —
The created VisualEdge.
|
| redrawEdges | () | method |
public function redrawEdges():voidRedraw all edges, this is called from the updateDisplayList() method. This forces a redraw of all edges
| refresh | () | method |
public function refresh():void
| removeNode | () | method |
public function removeNode(vn:IVisualNode):voidRemoves a node from this VisualGraph. This removes any associated VEdges and Edges with the node and of course the underlying Node from the Graph datastructure.
Parametersvn:IVisualNode — The VisualNode to be removed.
|
| scroll | () | method |
public function scroll(deltaX:Number, deltaY:Number):voidScrolls all objects according to the specified coordinates (used as an offset).
ParametersdeltaX:Number |
|
deltaY:Number |
| unlinkNodes | () | method |
public function unlinkNodes(v1:IVisualNode, v2:IVisualNode):voidUnlinks two nodes, thus removing the edge between them, if it exists. Does nothing if the nodes were not linked. Again, order matters of the graph is directional.
Parametersv1:IVisualNode — The first node to unlink.
|
|
v2:IVisualNode — The second node to unlink.
|
| updateDisplayList | () | method |
protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):voidThis calls the base updateDisplayList() method of the Canvas and in addition redraws all edges if the layouter indicates that the layout has changed.
ParametersunscaledWidth:Number |
|
unscaledHeight:Number |
| VGRAPH_CHANGED | event |
org.un.flex.utils.events.VGraphEvent
Dispatched when there is any change to the nodes and/or links of this graph.