Packagecom.yworks.yfiles.layout.router
Classpublic class BusRepresentations
InheritanceBusRepresentations Inheritance YObject Inheritance Object

This class provides helpers to convert between buses given by complete subgraphs and buses represented by specific hub nodes.

In a representation by means of hubs, each connected subgraph induced by hubs establishes a bus. All regular nodes (non-hubs) which are connected to hubs of the same component are end-nodes of the same bus. In other words, nodes which are reachable on paths consisting of only hubs belong to the same bus. Of course, a node can be an end-node of more than one bus.

Since a bus models a group of nodes in which every node is connected to every other node, it can be represented as a complete subgraph of these nodes. To distinguish buses in this representation, each edge must be associated with a unique ID which identifies the bus it is associated to. This is the representation expected by com.yworks.yfiles.layout.router.BusRouter .

See also

com.yworks.yfiles.layout.router.BusRouter


Public Methods
 MethodDefined By
  
BusRepresentations(init:Boolean = true)
BusRepresentations
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
BusRepresentations
 Inherited
hashCode():int
YObject
  
[static] Changes the representation of buses from hubs to complete subgraphs.
BusRepresentations
  
replaceHubsBySubgraph2(graph:LayoutGraph, hubEdgesLists:Vector.<Object>, hubMarker:DataProvider, fixedMarker:DataProvider, descriptorAcceptor:DataAcceptor):EdgeList
[static] Changes the representation of buses from hubs to complete subgraphs by creating new edges between regular nodes and removing the hubs.
BusRepresentations
  
replaceSubgraphByHubs(graph:LayoutGraph, edgeCursor:EdgeCursor, descriptorProvider:DataProvider, busIDAcceptor:DataAcceptor):void
[static] Changes the representation of buses from complete subgraphs to hubs by replacing intersection points by hubs.
BusRepresentations
  
toEdgeLists(graph:Graph, hubMarker:DataProvider):Vector.<Object>
[static] Calculates for every bus represented by hubs a list of all of its edges.
BusRepresentations
Public Constants
 ConstantDefined By
  SOURCE_ID_DPKEY : Object = y.layout.router.BusRepresentations.SOURCE_ID_DPKEY
[static] com.yworks.yfiles.base.DataProvider key used to transfer a user-defined object from each original edge to the respective newly created edge.
BusRepresentations
  TARGET_ID_DPKEY : Object = y.layout.router.BusRepresentations.TARGET_ID_DPKEY
[static] com.yworks.yfiles.base.DataProvider key used to transfer a user-defined object from each original edge to the respective newly created edge.
BusRepresentations
Constructor Detail
BusRepresentations()Constructor
public function BusRepresentations(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
getClass()method
override public function getClass():Class

Returns
Class
replaceHubsBySubgraph()method 
public static function replaceHubsBySubgraph(graph:LayoutGraph, hubMarker:DataProvider, descriptorAcceptor:DataAcceptor):EdgeList

Changes the representation of buses from hubs to complete subgraphs. This method calls replaceHubsBySubgraph(graph, calculateBusEdgeLists(graph, hubMarker), hubMarker, false, busDescriptors).

Parameters

graph:LayoutGraph
 
hubMarker:DataProvider
 
descriptorAcceptor:DataAcceptor

Returns
EdgeList

See also

replaceHubsBySubgraph2()method 
public static function replaceHubsBySubgraph2(graph:LayoutGraph, hubEdgesLists:Vector.<Object>, hubMarker:DataProvider, fixedMarker:DataProvider, descriptorAcceptor:DataAcceptor):EdgeList

Changes the representation of buses from hubs to complete subgraphs by creating new edges between regular nodes and removing the hubs. This method respects multiple connections of nodes and creates appropriate com.yworks.yfiles.layout.router.BusDescriptor s consisting of the bus ID and source and target group IDs.

The path of each new edge follows the route defined by the component of the hubs. If the subgraph of hubs is not a tree, these paths are ambiguous. In this case, an arbitrary tree is computed from the hub's subgraph which defines all the paths.

Parameters

graph:LayoutGraph — the graph of the bus
 
hubEdgesLists:Vector.<Object> — an EdgeList for each bus
 
hubMarker:DataProvider — a DataProvider that returns true if and only if a node is a hub
 
fixedMarker:DataProvider — a DataProvider that returns true if and only if an edge is fixed
 
descriptorAcceptor:DataAcceptor — a DataAcceptor to which the created bus descriptors are set

Returns
EdgeList — a list of the created edges

See also

replaceSubgraphByHubs()method 
public static function replaceSubgraphByHubs(graph:LayoutGraph, edgeCursor:EdgeCursor, descriptorProvider:DataProvider, busIDAcceptor:DataAcceptor):void

Changes the representation of buses from complete subgraphs to hubs by replacing intersection points by hubs. The edges must form an orthogonal, cycle-free bus, otherwise an Error is thrown.

Parameters

graph:LayoutGraph — the graph of the bus
 
edgeCursor:EdgeCursor — an EdgeCursor of the regular edges
 
descriptorProvider:DataProvider — a DataProvider that provides a com.yworks.yfiles.layout.router.BusDescriptor for each edge
 
busIDAcceptor:DataAcceptor — an optional DataAcceptor. If specified, the bus ID for each new edge is set to this data acceptor


Throws
Error — if the path of an edge is not orthogonal or if some paths form a cycle

See also

toEdgeLists()method 
public static function toEdgeLists(graph:Graph, hubMarker:DataProvider):Vector.<Object>

Calculates for every bus represented by hubs a list of all of its edges. Note that this method cannot return isolated hubs and that each edge between two regular nodes establishes a separate bus.

Parameters

graph:Graph — the graph
 
hubMarker:DataProvider — a DataProvider which returns true if and only if a node is a hub

Returns
Vector.<Object> — an array of EdgeLists. Each list contains all edges of a bus.
Constant Detail
SOURCE_ID_DPKEYConstant
public static const SOURCE_ID_DPKEY:Object = y.layout.router.BusRepresentations.SOURCE_ID_DPKEY

com.yworks.yfiles.base.DataProvider key used to transfer a user-defined object from each original edge to the respective newly created edge. Algorithms which respect this key expect the associated data provider to be also an instance of com.yworks.yfiles.base.DataAcceptor to enable the storage of the data object for the new edge. Since there is no one-to-one mapping between original and new edges, the data provider of this key is responsible for the edges whose source end is a regular node.

See also

TARGET_ID_DPKEYConstant 
public static const TARGET_ID_DPKEY:Object = y.layout.router.BusRepresentations.TARGET_ID_DPKEY

com.yworks.yfiles.base.DataProvider key used to transfer a user-defined object from each original edge to the respective newly created edge. Algorithms which respect this key expect the associated data provider to be also an instance of com.yworks.yfiles.base.DataAcceptor to enable the storage of the data object for the new edge. Since there is no one-to-one mapping between original and new edges, the data provider of this key is responsible for the edges whose target end is a regular node.

See also