|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.hierarchic.ClassicLayerSequencer
public class ClassicLayerSequencer
This class implements the sequencing phase of the HierarchicLayouter
(i.e.,
the order of the nodes within each layer is determined).
It minimizes the crossings in the diagram by using either the barycentric or median heuristic.
Field Summary | |
---|---|
static byte |
BARYCENTER_HEURISTIC
A weight assignment based on a barycenter heuristic. |
static java.lang.Object |
GROUP_KEY
A DataProvider key for mapping nodes with groups.
|
static byte |
MEDIAN_HEURISTIC
A weight assignment based on a median heuristic. |
Constructor Summary | |
---|---|
ClassicLayerSequencer()
Creates a ClassicLayerSequencer instance with default settings. |
Method Summary | |
---|---|
void |
adoptValues(LayerSequencer otherSequencer)
Tries to adopt/copy the settings of the given LayerSequencer to this sequencer. |
NodeList[] |
getLayers(LayoutGraph graph,
NodeMap layerID,
int maxLayer)
Calculates the sequence of nodes within each layer. |
long |
getMaximalDuration()
Returns the time limit in milliseconds set for this sequencer per execution. |
int |
getRandomizationRounds()
Returns the number of randomized rounds that this algorithm performs, if there was no optimal solution. |
int |
getRecentCrossingNumber()
Returns the number of edge crossings that were produced by this sequencer the last time it was applied to a graph. |
boolean |
getRemoveFalseCrossings()
Returns whether or not to remove so-called false crossings in an additional phase. |
boolean |
getUseTransposition()
Returns whether or not to apply an additional crossing minimization heuristic. |
byte |
getWeightHeuristic()
Returns the weight heuristic that is used. |
boolean |
isUsingGroups()
Returns whether or not this ClassicLayerSequencer will preserve the groupings of
nodes between each layer. |
void |
setMaximalDuration(long maximalDuration)
Specifies the time limit in milliseconds set for this sequencer per execution. |
void |
setRandomizationRounds(int randomizationRounds)
Specifies the number of randomized rounds that this algorithm performs, if there was no optimal solution. |
void |
setRemoveFalseCrossings(boolean b)
Specifies whether or not to remove so-called false crossings in an additional phase. |
void |
setUseTransposition(boolean b)
Specifies whether or not to apply an additional crossing minimization heuristic. |
void |
setUsingGroups(boolean usingGroups)
Specifies whether or not this ClassicLayerSequencer will preserve the groupings of
nodes between each layer. |
void |
setWeightHeuristic(byte h)
Specifying the weight heuristic that should be used. |
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 GROUP_KEY
DataProvider
key for mapping nodes with groups.
public static final byte BARYCENTER_HEURISTIC
The position of a node within a layer will be determined by the barycenter of its successor (downward pass) and predecessor (upward pass) nodes.
setWeightHeuristic(byte)
,
Constant Field Valuespublic static final byte MEDIAN_HEURISTIC
The position of a node within a layer will be determined by the median position of its successor (downward pass) and predecessor (upward pass) nodes.
setWeightHeuristic(byte)
,
Constant Field ValuesConstructor Detail |
---|
public ClassicLayerSequencer()
ClassicLayerSequencer
instance with default settings.
Method Detail |
---|
public void setUseTransposition(boolean b)
Activating this heuristic can reduce the overall number of edge crossings. On the other hand, it may increase the running time.
public boolean getUseTransposition()
Activating this heuristic can reduce the overall number of edge crossings. On the other hand, it may increase the running time.
true
if the crossing minimization heuristic is applied, false
otherwisesetUseTransposition(boolean)
public void setWeightHeuristic(byte h)
BARYCENTER_HEURISTIC
h
- one of the predefined weight heuristics
java.lang.IllegalArgumentException
- if the specified constant is unknownpublic byte getWeightHeuristic()
setWeightHeuristic(byte)
public void setRemoveFalseCrossings(boolean b)
A false crossing is a crossing between two edges that share a common terminal node.
Enabling this option may increase the running time of the algorithm.
public boolean getRemoveFalseCrossings()
A false crossing is a crossing between two edges that share a common terminal node.
Enabling this option may increase the running time of the algorithm.
true
if false crossings should be removed, false
otherwisesetRemoveFalseCrossings(boolean)
public void setMaximalDuration(long maximalDuration)
Values have to be greater than or equal to 0
.
maximalDuration
- a non-negative value that specifies the time limit
java.lang.IllegalArgumentException
- if the maximum duration is negativepublic int getRecentCrossingNumber()
This method can be called after CanonicMultiStageLayouter.doLayout(LayoutGraph)
has finished to
return the current number of edge crossings in the layout.
getLayers(LayoutGraph, NodeMap, int)
must have been called before.public void adoptValues(LayerSequencer otherSequencer)
LayerSequencer
to this sequencer.
LayerSequencer
is an instance of
ClassicLayerSequencer
.otherSequencer
- the given LayerSequencer
instancepublic NodeList[] getLayers(LayoutGraph graph, NodeMap layerID, int maxLayer)
The result is returned as an array of NodeList
s containing nodes that belong to the same layer. The
order of the nodes within such list represents the sequence of the nodes within their layer.
getLayers
in interface LayerSequencer
graph
- the input graphlayerID
- the NodeMap
that returns the zero-based index of the layer to which each node belongsmaxLayer
- the number of layers
NodeList
s containing nodes that belong to the same layer; the order of the nodes
within each such list represents the sequence of the nodes within their layerpublic boolean isUsingGroups()
ClassicLayerSequencer
will preserve the groupings of
nodes between each layer.
Preserving groupings means nodes inside the same group will be placed directly next to each other within each layer.
true
if groupings is preserved, false
otherwisepublic void setUsingGroups(boolean usingGroups)
ClassicLayerSequencer
will preserve the groupings of
nodes between each layer.
Preserving groupings means nodes inside the same group will be placed directly next to each other within each layer.
usingGroups
- true
if groupings should be preserved, false
otherwisefalse - Groups are ignored. Nodes 5 and 7 belong to Group 2 , while nodes 6 and 8 to Group 3 . | true - Groups are considered. Nodes 5 and 7 belong to Group 2 , while nodes 6 and 8 to Group 3 . |
public long getMaximalDuration()
Values have to be greater than or equal to 0
.
public int getRandomizationRounds()
Values have to be greater than or equal to 0
.
setRandomizationRounds(int)
public void setRandomizationRounds(int randomizationRounds)
Values have to be greater than or equal to 0
.
40
, if the maximum duration
hasn't been reduced below its default value.randomizationRounds
- the given number of additional rounds
java.lang.IllegalArgumentException
- if a negative value is given
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |