public class DefaultLayerSequencer extends Object implements ISequencer
ISequencer implementation that performs the second phase of the Sugiyama algorithm.
It minimizes the crossings in the diagram by using either the barycentric or median heuristic.
| Constructor and Description |
|---|
DefaultLayerSequencer()
Creates a new instance of
DefaultLayerSequencer. |
| Modifier and Type | Method and Description |
|---|---|
long |
getMaximumDuration()
Gets the time limit (in milliseconds) set for this sequencer per execution.
|
int |
getRandomizationRounds()
Gets the number of randomized rounds that this algorithm performs, if there was no optimal solution.
|
WeightHeuristic |
getWeightHeuristic()
Gets the weight heuristic that should be used.
|
boolean |
isGroupTransposition()
Gets whether or not an additional crossing minimization heuristic should be used in the presence of grouped graphs.
|
boolean |
isTransposition()
Gets whether or not to apply an additional crossing minimization heuristic.
|
void |
sequenceNodeLayers(LayoutGraph graph,
ILayers glayers,
ILayoutDataProvider ldp,
IItemFactory itemFactory)
Calculates the sequence of the nodes within each
layer. |
void |
setGroupTransposition(boolean value)
Sets whether or not an additional crossing minimization heuristic should be used in the presence of grouped graphs.
|
void |
setMaximumDuration(long value)
Sets the time limit (in milliseconds) set for this sequencer per execution.
|
void |
setRandomizationRounds(int value)
Sets the number of randomized rounds that this algorithm performs, if there was no optimal solution.
|
void |
setTransposition(boolean value)
Sets whether or not to apply an additional crossing minimization heuristic.
|
void |
setWeightHeuristic(WeightHeuristic value)
Sets the weight heuristic that should be used.
|
public DefaultLayerSequencer()
DefaultLayerSequencer.public long getMaximumDuration()
Values have to be greater than or equal to 0.
IllegalArgumentException - if the maximum duration is negative.setMaximumDuration(long)public int getRandomizationRounds()
Values have to be greater than or equal to 0.
IllegalArgumentException - if a negative value is given50, if the maximum duration hasn't been
reduced below its default value. Otherwise, 14 rounds are performed.setRandomizationRounds(int)public WeightHeuristic getWeightHeuristic()
IllegalArgumentException - if the constant is unknownWeightHeuristic.BARYCENTER. A barycenter heuristic is used.setWeightHeuristic(WeightHeuristic)public boolean isGroupTransposition()
Activating this heuristic can reduce the overall number of edge crossings in grouped graphs. On the other hand, it may increase running time.
false. The group transposition rule is disabled.true if the crossing minimization heuristic should be applied, false otherwisesetGroupTransposition(boolean)public boolean isTransposition()
Activating this heuristic can reduce the overall number of edge crossings. On the other hand, it may increase the running time.
true. The transposition rule is active.true if the crossing minimization heuristic is applied, false otherwisesetTransposition(boolean)public void sequenceNodeLayers(LayoutGraph graph, ILayers glayers, ILayoutDataProvider ldp, IItemFactory itemFactory)
ISequencerlayer.
This method is called by HierarchicLayoutCore during the second phase and
finally writes back the calculated sequence using the ILayer.setNodeOrder(com.yworks.yfiles.algorithms.YList)
method.
sequenceNodeLayers in interface ISequencergraph - the input graphglayers - the given ILayers instance containing the elements in the layeringldp - the ILayoutDataProvider implementation which provides access to the INodeData
and IEdgeData instancesitemFactory - the IItemFactory used temporarily for modifying the graph instancepublic void setGroupTransposition(boolean value)
Activating this heuristic can reduce the overall number of edge crossings in grouped graphs. On the other hand, it may increase running time.
false. The group transposition rule is disabled.value - true if the crossing minimization heuristic should be applied, false otherwiseisGroupTransposition()public void setMaximumDuration(long value)
Values have to be greater than or equal to 0.
IllegalArgumentException - if the maximum duration is negative.value - a non-negative value that specifies the time limitgetMaximumDuration()public void setRandomizationRounds(int value)
Values have to be greater than or equal to 0.
IllegalArgumentException - if a negative value is given50, if the maximum duration hasn't been
reduced below its default value. Otherwise, 14 rounds are performed.value - the number of additional roundsgetRandomizationRounds()public void setTransposition(boolean value)
Activating this heuristic can reduce the overall number of edge crossings. On the other hand, it may increase the running time.
true. The transposition rule is active.value - true if the crossing minimization heuristic is applied, false otherwiseisTransposition()public void setWeightHeuristic(WeightHeuristic value)
IllegalArgumentException - if the constant is unknownWeightHeuristic.BARYCENTER. A barycenter heuristic is used.value - one of the predefined weight heuristicsgetWeightHeuristic()