|
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
This class is a 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 using the
specified LayeredComponentsMerger
instance.
Constructor Summary | |
---|---|
MultiComponentLayerer(Layerer singleComponentLayerer)
Creates a new instance of MultiComponentLayerer using the given delegate Layerer . |
|
MultiComponentLayerer(Layerer singleComponentLayerer,
LayeredComponentsMerger merger,
java.util.Comparator componentComparator)
Creates a new instance of MultiComponentLayerer using the given LayeredComponentsMerger and
Comparator instances. |
Method Summary | |
---|---|
void |
assignLayers(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
Assigns all nodes of the graph to layers and adds them to the Layers instance. |
java.util.Comparator |
getComponentComparator()
Returns the component Comparator instance. |
LayeredComponentsMerger |
getMerger()
Returns the merger instance. |
Layerer |
getSingleComponentLayerer()
Returns the delegate Layerer instance. |
void |
setComponentComparator(java.util.Comparator componentComparator)
Specifies the component Comparator instance. |
void |
setMerger(LayeredComponentsMerger merger)
Specifies the merger instance. |
void |
setSingleComponentLayerer(Layerer singleComponentLayerer)
Specifies the delegate Layerer instance. |
protected void |
sort(NodeList[] nodeLists,
DataProvider componentIndexProvider)
Sorts an array which consists of NodeList s each of which contains nodes that belong to the same component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiComponentLayerer(Layerer singleComponentLayerer)
MultiComponentLayerer
using the given delegate Layerer
.
A new instance of DefaultLayeredComponentsMerger
will be used as merger while no component
Comparator
will be used.
java.lang.IllegalArgumentException
- if the given layerer is null
public MultiComponentLayerer(Layerer singleComponentLayerer, LayeredComponentsMerger merger, java.util.Comparator componentComparator)
MultiComponentLayerer
using the given LayeredComponentsMerger
and
Comparator
instances.
java.lang.IllegalArgumentException
- if the given layerer or merger is null
Method Detail |
---|
public void assignLayers(LayoutGraph graph, Layers layers, LayoutDataProvider ldp)
Layerer
Layers
instance.
In order to create new layers, factory method Layers.insert(byte, int)
has to be used.
Information about the nodes is provided by a LayoutDataProvider
. However, positional information
(see NodeData.getPosition()
and NodeData.getLayer()
) is not available during this phase.
assignLayers
in interface Layerer
graph
- the input graphlayers
- the Layers
instance that will be filled with the results of the calculationldp
- the LayoutDataProvider
used for querying information about the nodes and edgesLayers.insert(byte, int)
,
Layer.add(y.base.Node)
protected void sort(NodeList[] nodeLists, DataProvider componentIndexProvider)
NodeList
s each of which contains nodes that belong to the same component.
It is called during assignLayers(LayoutGraph, Layers, LayoutDataProvider)
.
By default this method uses the ComponentComparator
to sort the list
and has no effect if the instance is null
.
nodeLists
- the array of NodeList
s each of which containing nodes that belong to the same componentcomponentIndexProvider
- the DataProvider
that returns an object (the component index) for
each node (this value can be either integer or object)public Layerer getSingleComponentLayerer()
Layerer
instance.
Layerer
instancesetSingleComponentLayerer(Layerer)
public void setSingleComponentLayerer(Layerer singleComponentLayerer)
Layerer
instance.
singleComponentLayerer
- the given Layerer
instance
java.lang.IllegalArgumentException
- if the specified Layerer
is null
public LayeredComponentsMerger getMerger()
merger
instance.
merger
instancesetMerger(LayeredComponentsMerger)
public void setMerger(LayeredComponentsMerger merger)
merger
instance.
merger
- the merger
instance
java.lang.IllegalArgumentException
- if the specified LayeredComponentsMerger
is null
public java.util.Comparator getComponentComparator()
Comparator
instance.
Comparator
or null
if no specific Comparator
existspublic void setComponentComparator(java.util.Comparator componentComparator)
Comparator
instance.
componentComparator
- the component Comparator
or null
if no specific Comparator
is desired
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |