public enum LayeringStrategy extends Enum<LayeringStrategy>
Enum Constant and Description |
---|
BFS
A layering strategy based on a breadth first search (BFS).
|
FROM_SKETCH
A layering strategy which derives the layers from the initial coordinates of the nodes.
|
HIERARCHICAL_DOWNSHIFT
A layering strategy which applies a fast heuristic that improves the layering done by
HIERARCHICAL_TOPMOST by
shifting some nodes down. |
HIERARCHICAL_OPTIMAL
A layering strategy which places each node in the optimal layer to minimize the layer distances.
|
HIERARCHICAL_TIGHT_TREE
A layering strategy which applies a heuristic to approximate the
optimal layering . |
HIERARCHICAL_TOPMOST
A layering strategy which places each node in the highest possible layer without passing its predecessor in the
topological order of nodes.
|
UNKNOWN
A dummy layering strategy which describes a strategy that is not part of the default strategies.
|
USER_DEFINED
A layering strategy which uses a layer assignment specified by the user.
|
Modifier and Type | Method and Description |
---|---|
static LayeringStrategy |
fromOrdinal(int ordinal) |
int |
value() |
static LayeringStrategy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static LayeringStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LayeringStrategy BFS
All edges will span at most one layer in the resulting drawing. Edges between nodes that belong to the same layer are possible.
The nodes that will be placed in the first layer can be provided by a data provider bound to the input graph using the
key
BFSLayerer.CORE_NODES_DPKEY
. If this data provider is not given, then
nodes that have no incoming edges are placed in the first layer.
public static final LayeringStrategy FROM_SKETCH
It tries to find a layering that is similar to the one in the input graph. The layout algorithm may place nodes in the same layer, even though they are connected by an edge.
In a vertically oriented layout, nodes that overlap vertically are placed in the same layer. The same holds for a horizontally oriented layout in the case where the nodes overlap horizontally.
public static final LayeringStrategy HIERARCHICAL_DOWNSHIFT
HIERARCHICAL_TOPMOST
by
shifting some nodes down.
The quality of the result is usually worse than the one produced by HIERARCHICAL_TIGHT_TREE
.
public static final LayeringStrategy HIERARCHICAL_OPTIMAL
The layer distance of an edge is the absolute difference between the layer numbers of its source and target node. The layer assignment will minimize the overall sum of the layer distances of all edges in the layout.
public static final LayeringStrategy HIERARCHICAL_TIGHT_TREE
optimal layering
.
The quality of the result may not be as good as with optimal layering
but it is usually
achieved faster.
public static final LayeringStrategy HIERARCHICAL_TOPMOST
All nodes with indegree zero will be assigned to the topmost layer of the layout. The number of separate layers will be as small as possible.
public static final LayeringStrategy UNKNOWN
public static final LayeringStrategy USER_DEFINED
The nodes' layer assignment must be provided by a data provider bound to the input graph using the key
GivenLayersLayerer.LAYER_ID_DPKEY
.
This layering strategy allows edges whose source and target share a layer.
public static final LayeringStrategy fromOrdinal(int ordinal)
public int value()
public static LayeringStrategy valueOf(String name)
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullname
- the name of the enum constant to be returned.public static LayeringStrategy[] values()
for (LayeringStrategy c : LayeringStrategy.values()) System.out.println(c);