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 Object
implements Sequencer

This LayerSequencer implementation returns a sequencing that satisfies a comparator constraint.


Constructor Summary
GivenSequenceSequencer()
          Creates a new instance of GivenSequenceSequencer
GivenSequenceSequencer(Comparator c)
          Creates a new instance of GivenSequenceSequencer using the specified comparator for the sequencing.
 
Method Summary
 Comparator getSequenceComparator()
          Returns the comparator used by this GivenSequenceSequencer.
 void sequenceNodeLayers(LayoutGraph graph, Layers layers, LayoutDataProvider ldp, ItemFactory itemFactory)
          Called by HierarchicLayouter during the second phase.
 void setSequenceComparator(Comparator sequenceComparator)
          Sets the comparator used by this GivenSequenceSequencer.
 
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(Comparator c)
Creates a new instance of GivenSequenceSequencer using the specified comparator for the sequencing.

Method Detail

getSequenceComparator

public Comparator getSequenceComparator()
Returns the comparator used by this GivenSequenceSequencer.

Returns:
the comparator used by this GivenSequenceSequencer.

setSequenceComparator

public void setSequenceComparator(Comparator sequenceComparator)
Sets the comparator used by this GivenSequenceSequencer.

Parameters:
sequenceComparator - the comparator used by this GivenSequenceSequencer.

sequenceNodeLayers

public void sequenceNodeLayers(LayoutGraph graph,
                               Layers layers,
                               LayoutDataProvider ldp,
                               ItemFactory itemFactory)
Description copied from interface: Sequencer
Called by HierarchicLayouter during the second phase. Calculates a sequence of the nodes in layers and finally writes back the calculated sequence using the Layer.setNodeOrder(y.base.YList) method.

Specified by:
sequenceNodeLayers in interface Sequencer
Parameters:
graph - the graph that contains the elements from layers
layers - the Layer implementation that holds the Layers for sequencing
ldp - the LayoutDataProvider that provides the necessary NodeData and EdgeData
itemFactory - an ItemFactory implementation that can be used to modify the graph consistently

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