|
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.incremental.MultiComponentLayerer
public class MultiComponentLayerer
Wrapper Layerer implementation that delegates the actual layering to a
delegate Layerer. If the graph consists of multiple components, they will
be identified and sorted and each of the components will be layered separately
using the delegate Layerer instance. After that they will all be merged
in order using the specified LayeredComponentsMerger
instance.
Constructor Summary | |
---|---|
MultiComponentLayerer(Layerer singleComponentLayerer)
Creates a new instance of MultiComponentLayerer using the given delegate and a new instance of DefaultLayeredComponentsMerger
as the merger and no component comparator. |
|
MultiComponentLayerer(Layerer singleComponentLayerer,
LayeredComponentsMerger merger,
Comparator componentComparator)
Creates a new instance of MultiComponentLayerer using the given delegates. |
Method Summary | |
---|---|
void |
assignLayers(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
This method assigns all nodes in the graph to layers and registers them in the Layers instance. |
Comparator |
getComponentComparator()
Returns the current component Comparator or null . |
LayeredComponentsMerger |
getMerger()
Returns the merger. |
Layerer |
getSingleComponentLayerer()
Returns the Layerer instance that is used for delegation. |
void |
setComponentComparator(Comparator componentComparator)
Sets the component Comparator instance, may be null |
void |
setMerger(LayeredComponentsMerger merger)
Sets the new merger instance. |
void |
setSingleComponentLayerer(Layerer singleComponentLayerer)
Sets the new delegate Layerer instance. |
protected void |
sort(NodeList[] nodeLists,
DataProvider componentIndexProvider)
Callback method that is called during assignLayers(LayoutGraph, Layers, LayoutDataProvider) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiComponentLayerer(Layerer singleComponentLayerer)
DefaultLayeredComponentsMerger
as the merger and no component comparator.
public MultiComponentLayerer(Layerer singleComponentLayerer, LayeredComponentsMerger merger, Comparator componentComparator)
Method Detail |
---|
public void assignLayers(LayoutGraph graph, Layers layers, LayoutDataProvider ldp)
Layerer
Layers
instance. In order to create new layers, the factory
method Layers.insert(byte, int)
must be used.
assignLayers
in interface Layerer
graph
- the graph that contains the nodes that should be distributed
into the layerslayers
- the object that will be filled with the results of the
calculationldp
- LayoutDataProvider that can be used to query information about
the nodes - note that positional information
(see NodeData.getPosition()
and NodeData.getLayer()
) cannot
be available at any time.Layers.insert(byte, int)
,
Layer.add(y.base.Node)
protected void sort(NodeList[] nodeLists, DataProvider componentIndexProvider)
assignLayers(LayoutGraph, Layers, LayoutDataProvider)
.
It is responsible for sorting an array consisting of NodeList
s, each
containing nodes that belong to a different component. By default this method
uses the ComponentComparator
to sort the list
or does nothing if that instance is null
.
nodeLists
- the array of NodeLists each containing all nodes that belong
to the same componentcomponentIndexProvider
- a DataProvider that can be used to query the
nodes' component indices via DataProvider.getInt(Object)
and/or
DataProvider.get(Object)
.public Layerer getSingleComponentLayerer()
public void setSingleComponentLayerer(Layerer singleComponentLayerer)
NullPointerException
- if the argument is null
singleComponentLayerer
- the new instance.public LayeredComponentsMerger getMerger()
public void setMerger(LayeredComponentsMerger merger)
NullPointerException
- if the argument is null
merger
- the new instance.public Comparator getComponentComparator()
null
.
null
public void setComponentComparator(Comparator componentComparator)
null
componentComparator
- the new instance or null
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |