|
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 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 BusRouter
.
Field Summary | |
---|---|
static Object |
SOURCE_ID_DPKEY
DataProvider key used to transfer a user-defined object from each original edge to the respective
newly created edge. |
static Object |
TARGET_ID_DPKEY
DataProvider key used to transfer a user-defined object from each original edge to the respective
newly created edge. |
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 Object SOURCE_ID_DPKEY
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
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.
public static final Object TARGET_ID_DPKEY
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
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.
Method Detail |
---|
public static EdgeList[] toEdgeLists(Graph graph, DataProvider hubMarker)
graph
- the graphhubMarker
- a DataProvider
which returns true
if and only if a node is a hub
EdgeList
s. Each list contains all edges of a bus.public static EdgeList replaceHubsBySubgraph(LayoutGraph graph, DataProvider hubMarker, DataAcceptor descriptorAcceptor)
replaceHubsBySubgraph(graph, calculateBusEdgeLists(graph, hubMarker), hubMarker, false,
busDescriptors)
.
replaceHubsBySubgraph(LayoutGraph, EdgeList[], DataProvider, DataProvider, DataAcceptor)
,
toEdgeLists(Graph, DataProvider)
public static EdgeList replaceHubsBySubgraph(LayoutGraph graph, EdgeList[] hubEdgesLists, DataProvider hubMarker, DataProvider fixedMarker, DataAcceptor descriptorAcceptor)
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.
graph
- the graph of the bushubEdgesLists
- an EdgeList
for each bushubMarker
- a DataProvider
that returns true
if and only if a node is a
hubfixedMarker
- a DataProvider
that returns true
if and only if an edge is
fixeddescriptorAcceptor
- a DataAcceptor
to which the created bus descriptors are set
public static void replaceSubgraphByHubs(LayoutGraph graph, EdgeCursor edgeCursor, DataProvider descriptorProvider, DataAcceptor busIDAcceptor)
IllegalStateException
is thrown.
IllegalStateException
- if the path of an edge is not orthogonal or if some paths form a cyclegraph
- the graph of the busedgeCursor
- an EdgeCursor
of the regular edgesdescriptorProvider
- a DataProvider
that provides a BusDescriptor
for each edgebusIDAcceptor
- an optional DataAcceptor
. If specified, the bus ID for each new edge is set
to this data acceptor
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |