Search this API

y.layout.hierarchic.incremental
Class GivenSequenceSequencer

java.lang.Object
  extended by y.layout.hierarchic.incremental.GivenSequenceSequencer
All Implemented Interfaces:
Sequencer

public class GivenSequenceSequencer
extends java.lang.Object
implements Sequencer

This class is a Sequencer implementation that determines the sequence of nodes of the same layer based on a given comparator constraint.

 

Constructor Summary
GivenSequenceSequencer()
          Creates a new instance of GivenSequenceSequencer.
GivenSequenceSequencer(java.util.Comparator c)
          Creates a new instance of GivenSequenceSequencer using a given Comparator for the sequencing.
 
Method Summary
 java.util.Comparator getSequenceComparator()
          Returns the Comparator used by this GivenSequenceSequencer to determine the sequence of the nodes.
 void sequenceNodeLayers(LayoutGraph graph, Layers layers, LayoutDataProvider ldp, ItemFactory itemFactory)
          Calculates the sequence of the nodes within a Layers instance based on the given Comparator instance.
 void setSequenceComparator(java.util.Comparator sequenceComparator)
          Specifies the Comparator used by this GivenSequenceSequencer to determine the sequence of the nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GivenSequenceSequencer

public GivenSequenceSequencer()
Creates a new instance of GivenSequenceSequencer.


GivenSequenceSequencer

public GivenSequenceSequencer(java.util.Comparator c)
Creates a new instance of GivenSequenceSequencer using a given Comparator for the sequencing.

Method Detail

getSequenceComparator

public java.util.Comparator getSequenceComparator()
Returns the Comparator used by this GivenSequenceSequencer to determine the sequence of the nodes.

Returns:
a Comparator instance
See Also:
setSequenceComparator(Comparator)

setSequenceComparator

public void setSequenceComparator(java.util.Comparator sequenceComparator)
Specifies the Comparator used by this GivenSequenceSequencer to determine the sequence of the nodes.

Default Value:
The default value is null. No Comparator is specified.
Parameters:
sequenceComparator - the given Comparator instance

sequenceNodeLayers

public void sequenceNodeLayers(LayoutGraph graph,
                               Layers layers,
                               LayoutDataProvider ldp,
                               ItemFactory itemFactory)
Calculates the sequence of the nodes within a Layers instance based on the given Comparator instance.

This method is called by HierarchicLayouter during the sequencing phase and finally writes back the calculated sequence using the Layer.setNodeOrder(y.base.YList) method.

Specified by:
sequenceNodeLayers in interface Sequencer
Parameters:
graph - the input graph
layers - the given Layers instance containing the elements of the layers
ldp - the LayoutDataProvider containing information about the nodes and edges of the graph
itemFactory - the ItemFactory used for creating and destroying helper structures

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.