
Search this API  
PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object y.layout.router.BusRepresentations
public class BusRepresentations
This class provides helper methods 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 (nonhubs) which are connected to hubs of the same component are endnodes 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 endnode 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 to which it is associated. This is
the representation expected by BusRouter
.
Field Summary  

static java.lang.Object 
SOURCE_ID_DPKEY
A DataAcceptor key to transfer a userdefined object from each original edge to the respective
newly created edge
Since there is no onetoone
mapping between original and new edges, the data provider of this key is responsible for the edges whose source endpoint
is a regular node. 
static java.lang.Object 
TARGET_ID_DPKEY
A DataAcceptor key to transfer a userdefined object from each original edge to the respective
newly created edge
Since there is no onetoone
mapping between original and new edges, the data provider of this key is responsible for the edges whose target endpoint
is a regular node. 
Method Summary  

static EdgeList 
replaceHubsBySubgraph(LayoutGraph graph,
DataProvider hubMarker,
DataAcceptor descriptorAcceptor)
Changes the representation of buses from hubs to complete subgraphs. 
static EdgeList 
replaceHubsBySubgraph(LayoutGraph graph,
EdgeList[] hubEdgesLists,
DataProvider hubMarker,
DataProvider fixedMarker,
DataAcceptor descriptorAcceptor)
Changes the representation of buses from hubs to complete subgraphs by creating new edges between regular nodes and removing the hubs. 
static void 
replaceSubgraphByHubs(LayoutGraph graph,
EdgeCursor edgeCursor,
DataProvider descriptorProvider,
DataAcceptor busIDAcceptor)
Changes the representation of buses from complete subgraphs to hubs by replacing intersection points by hubs. 
static EdgeList[] 
toEdgeLists(Graph graph,
DataProvider hubMarker)
Calculates for every bus represented by hubs a list of all of its edges. 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Field Detail 

public static final java.lang.Object SOURCE_ID_DPKEY
DataAcceptor
key to transfer a userdefined object from each original edge to the respective
newly created edge
Since there is no onetoone mapping between original and new edges, the data provider of this key is responsible for the edges whose source endpoint is a regular node.
public static final java.lang.Object TARGET_ID_DPKEY
DataAcceptor
key to transfer a userdefined object from each original edge to the respective
newly created edge
Since there is no onetoone mapping between original and new edges, the data provider of this key is responsible for the edges whose target endpoint is a regular node.
Method Detail 

public static EdgeList[] toEdgeLists(Graph graph, DataProvider hubMarker)
graph
 the graph where buses are represented by means of hubshubMarker
 a DataProvider
which marks hub nodes
EdgeList
s where each list contains all edges of a buspublic static EdgeList replaceHubsBySubgraph(LayoutGraph graph, DataProvider hubMarker, DataAcceptor descriptorAcceptor)
replaceHubsBySubgraph(LayoutGraph, EdgeList[], DataProvider, DataProvider, DataAcceptor)
.
graph
 the graph of the bushubMarker
 a DataProvider
that marks hub nodesdescriptorAcceptor
 a DataAcceptor
for storing the created bus descriptors
replaceHubsBySubgraph(LayoutGraph, EdgeList[], DataProvider, DataProvider, DataAcceptor)
,
toEdgeLists(Graph, DataProvider)
public static EdgeList replaceHubsBySubgraph(LayoutGraph graph, EdgeList[] hubEdgesLists, DataProvider hubMarker, DataProvider fixedMarker, DataAcceptor descriptorAcceptor)
This method respects multiple connections of nodes and creates appropriate BusDescriptor
s consisting of the bus ID as well as 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.
graph
 the graph of the bushubEdgesLists
 an array of EdgeList
s each containing the edges of a bushubMarker
 a DataProvider
that marks hub nodesfixedMarker
 a DataProvider
that marks fixed edgesdescriptorAcceptor
 a DataAcceptor
for storing the created bus descriptors
public static void replaceSubgraphByHubs(LayoutGraph graph, EdgeCursor edgeCursor, DataProvider descriptorProvider, DataAcceptor busIDAcceptor)
The edges of the given graph must form an orthogonal, cyclefree bus, otherwise an IllegalStateException
is thrown.
graph
 the graph where each bus is represented by a complete subgraph of the corresponding nodesedgeCursor
 an EdgeCursor
of the regular edgesdescriptorProvider
 a DataProvider
that provides a BusDescriptor
for each edgebusIDAcceptor
 an optional DataAcceptor
that stores the bus ID for each new edge
java.lang.IllegalStateException
 if the path of an edge is not orthogonal or if some paths form a cycle

© Copyright 20002022, yWorks GmbH. All rights reserved. 

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 