|
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.AspectRatioComponentLayerer
public class AspectRatioComponentLayerer
This class is a wrapper Layerer implementation that delegates the actual layering to a
delegate Layerer object.
If the graph consists of multiple components, they will be identified and each of the components will be layered
separately using the delegate Layerer instance. After that they will all be merged such that the desired aspect
ratio is fulfilled best.

AspectRatioComponentLayerer with default settings on a graph with two connected components.
setDesiredAspectRatio(double),
MultiComponentLayerer![]() |
![]() |
| Constructor Summary | |
|---|---|
AspectRatioComponentLayerer(Layerer singleComponentLayerer)
Creates a new instance of AspectRatioComponentLayerer using the given delegate Layerer instance. |
|
| Method Summary | |
|---|---|
void |
assignLayers(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
Assigns all nodes of the graph to layers and registers them to the Layers instance based on the given
aspect ratio. |
double |
getDesiredAspectRatio()
Returns the desired aspect ratio. |
Layerer |
getSingleComponentLayerer()
Returns the delegate Layerer instance. |
boolean |
isConsiderNodeSize()
Returns whether or not the size of the nodes should be considered. |
void |
setConsiderNodeSize(boolean considerNodeSize)
Specifies whether or not the size of the nodes should be considered. |
void |
setDesiredAspectRatio(double desiredAspectRatio)
Specifies the desired aspect ratio. |
void |
setSingleComponentLayerer(Layerer singleComponentLayerer)
Specifies the delegate Layerer instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AspectRatioComponentLayerer(Layerer singleComponentLayerer)
AspectRatioComponentLayerer using the given delegate Layerer instance.
java.lang.IllegalArgumentException - if the specified Layerer is null| Method Detail |
|---|
public Layerer getSingleComponentLayerer()
Layerer instance.
Layerer instancepublic void setSingleComponentLayerer(Layerer singleComponentLayerer)
Layerer instance.
singleComponentLayerer - the given Layerer instance
java.lang.IllegalArgumentException - if the specified Layerer is nullpublic boolean isConsiderNodeSize()
If this option is disabled, all nodes are considered to be of equal size. Hence, the given aspect ratio specifies the ratio between the number of nodes within a layer and the overall number of layers.
true if the size of the node is considered, false otherwisesetConsiderNodeSize(boolean)public void setConsiderNodeSize(boolean considerNodeSize)
If this option is disabled, all nodes are considered to be of equal size. Hence, the given aspect ratio specifies the ratio between the number of nodes within a layer and the overall number of layers.
public double getDesiredAspectRatio()
If the graph consists of multiple components, they will be identified and each of the components will be layered
separately using the delegate Layerer instance. After that, they will all be merged such that the desired
aspect ratio is best fulfilled.
The given aspect ratio should be greater or equal to 0.
setDesiredAspectRatio(double)public void setDesiredAspectRatio(double desiredAspectRatio)
If the graph consists of multiple components, they will be identified and each of the components will be layered
separately using the delegate Layerer instance. After that, they will all be merged such that the desired
aspect ratio is best fulfilled.
The given aspect ratio should be greater or equal to 0.
desiredAspectRatio - the desired aspect ratio
java.lang.IllegalArgumentException - if the aspect ratio is negative![]() Aspect ratio 0.1 | ![]() Aspect ratio 1.0 | ![]() Aspect ratio 2.0 |
public void assignLayers(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
Layers instance based on the given
aspect ratio.
If the graph consists of multiple components, they will be identified and each of the components will be layered
separately using the delegate Layerer instance. After that, they will all be merged such that the desired
aspect ratio is best fulfilled.
assignLayers in interface Layerergraph - the input graphlayers - the Layers instance that will be filled with the results of the calculationldp - the LayoutDataProvider used for query information about the nodes and edgesLayers.insert(byte, int),
Layer.add(y.base.Node)
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||