|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Layouter
Layouter
describes the general interface for algorithms that perform a layout process on a LayoutGraph
.
The main method for invoking the layout calculation is doLayout(LayoutGraph)
. Implementing classes will
arrange the graph there. To avoid that the layout algorithm crashes if it cannot handle the input graph,
canLayout(LayoutGraph)
can be called to check whether or not a graph is a valid input for the layout
algorithm.
This class also provides keys to register DataProvider
s with the graph that contain information
about the nodes and edges in the graph. DataProvider
s registered with NODE_ID_DPKEY
and
EDGE_ID_DPKEY
contain unique identifiers for both nodes and edges. These identifiers allow for ensuring
consistent results even if the order of nodes and edges was changed between two layout runs.
The selection state of nodes and edges is stored in DataProvider
s registered with the keys
SELECTED_NODES
and SELECTED_EDGES
. Based on this information, the layout algorithm may reduce its
calculations to the selected subset of nodes or edges.
Field Summary | |
---|---|
static java.lang.Object |
EDGE_ID_DPKEY
A DataProvider key for looking up a unique identifier for each edge in a graph
Layout algorithms may use this information to provide consistent layouts for multiple runs. |
static java.lang.Object |
NODE_ID_DPKEY
A DataProvider key for looking up a unique identifier for each node in a graph
Layout algorithms may use this information to provide consistent layouts for multiple runs. |
static java.lang.Object |
SELECTED_EDGES
A DataProvider key for looking up the selected state of the edges in the graph
A layout algorithm can retrieve a DataProvider registered with this key to apply a special
handling to the selected edges. |
static java.lang.Object |
SELECTED_NODES
A DataProvider key for looking up the selected state of the nodes in the graph
A layout algorithm can retrieve a DataProvider registered with this key to apply a special
handling to the selected nodes. |
Method Summary | |
---|---|
boolean |
canLayout(LayoutGraph graph)
Checks whether or not the given graph can be arranged by this layout algorithm. |
void |
doLayout(LayoutGraph graph)
Main layout routine that assigns new layout information to the given graph. |
Field Detail |
---|
static final java.lang.Object NODE_ID_DPKEY
DataProvider
key for looking up a unique identifier for each node in a graph
Layout algorithms may use this information to provide consistent layouts for multiple runs.
static final java.lang.Object EDGE_ID_DPKEY
DataProvider
key for looking up a unique identifier for each edge in a graph
Layout algorithms may use this information to provide consistent layouts for multiple runs.
static final java.lang.Object SELECTED_NODES
DataProvider
key for looking up the selected state of the nodes in the graph
A layout algorithm can retrieve a DataProvider
registered with this key to apply a special
handling to the selected nodes. For example, the layout algorithm may restrict its scope, i.e., it only arranges
the selected nodes.
However, it is often more convenient to use a specific DataProvider
key for this
purpose, e.g., if you want to combine two layout algorithms of the same kind which have to operate on different
subsets of the graph. Thus, these algorithms may provide a method like setSubgraphNodesDpKey(Object)
that customizes the DataProvider
key allowing to specify different sets of selected nodes for
nested layout algorithms.
static final java.lang.Object SELECTED_EDGES
DataProvider
key for looking up the selected state of the edges in the graph
A layout algorithm can retrieve a DataProvider
registered with this key to apply a special
handling to the selected edges. For example, the layout algorithm may restrict its scope, i.e., it only
routes the selected edges.
However, it is often more convenient to use a specific DataProvider
key for this
purpose, e.g., if you want to combine two layout algorithms of the same kind which have to operate on different
subsets of the graph. Thus, these algorithms may provide a method like setSubgraphEdgesDpKey(Object)
that customizes the DataProvider
key allowing to specify different sets of selected edges for
nested layout algorithms.
Method Detail |
---|
boolean canLayout(LayoutGraph graph)
main layout routine
on this graph will only succeed if this method returns
true
.
graph
- the input graph
true
if this layout algorithm can handle the input graph, false
otherwisedoLayout(LayoutGraph)
void doLayout(LayoutGraph graph)
can handle
the input graph.
graph
- the input graphcanLayout(LayoutGraph)
|
© Copyright 2000-2021, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |