| 
 | Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.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 MultiComponentLayererusing the given delegateLayerer. | |
| MultiComponentLayerer(Layerer singleComponentLayerer,
                      LayeredComponentsMerger merger,
                      java.util.Comparator componentComparator)Creates a new instance of MultiComponentLayererusing the givenLayeredComponentsMergerandComparatorinstances. | |
| Method Summary | |
|---|---|
|  void | assignLayers(LayoutGraph graph,
             Layers layers,
             LayoutDataProvider ldp)Assigns all nodes of the graph to layers and adds them to the Layersinstance. | 
|  java.util.Comparator | getComponentComparator()Returns the component Comparatorinstance. | 
|  LayeredComponentsMerger | getMerger()Returns the mergerinstance. | 
|  Layerer | getSingleComponentLayerer()Returns the delegate Layererinstance. | 
|  void | setComponentComparator(java.util.Comparator componentComparator)Specifies the component Comparatorinstance. | 
|  void | setMerger(LayeredComponentsMerger merger)Specifies the mergerinstance. | 
|  void | setSingleComponentLayerer(Layerer singleComponentLayerer)Specifies the delegate Layererinstance. | 
| protected  void | sort(NodeList[] nodeLists,
     DataProvider componentIndexProvider)Sorts an array which consists of NodeLists 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)
LayererLayers 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 Layerergraph - 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)
NodeLists 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 NodeLists 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 nullpublic 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 nullpublic 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-2025, yWorks GmbH. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||