|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.hierarchic.AsIsLayerer
public class AsIsLayerer
AsIsLayerer assigns nodes to layers by analyzing already existing node coordinates.
Nodes whose bounding boxes overlap in the main layout direction are assigned to the same layer.
To influence to which amount the boxes need to overlap, the nodes can temporarily be
scaled. Alternatively, a minimum and maximum size or a halo can be specified
for the nodes.

Hierarchic layout when the initial drawing is used as sketch

Hierarchic layout when the initial drawing is not used as sketch
IncrementalHierarchicLayouter as well as HierarchicLayouter and
HierarchicGroupLayouter.![]() |
![]() |
| Constructor Summary | |
|---|---|
AsIsLayerer()
Creates an instance of AsIsLayerer with default settings. |
|
| Method Summary | |
|---|---|
void |
assignLayers(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
Assigns all nodes of the graph to layers by analyzing already existing node coordinates and adds them to the Layers instance. |
int |
assignNodeLayer(LayoutGraph graph,
NodeMap layerID,
EdgeList reversedEdges)
Assigns all nodes of the graph to layers. |
double |
getHalo()
Returns the size of the halo around a node, that means the insets that are used for calculating layer overlaps. |
protected double |
getMax(LayoutGraph graph,
Node node)
Callback used for calculating the lower (max) value of a given node. |
double |
getMaximumNodeSize()
Returns the maximum size of a node used for calculating layer overlaps. |
protected double |
getMin(LayoutGraph graph,
Node node)
Callback used for calculating the upper (min) value of a given node. |
double |
getMinimumNodeSize()
Returns the minimum size of a node used for calculating layer overlaps. |
double |
getNodeScalingFactor()
Returns the scaling factor used for scaling the size of the nodes. |
void |
setMaximumNodeSize(double max)
Specifies the maximum size of a node used for calculating layer overlaps. |
void |
setMinimumNodeSize(double min)
Specifies the minimum size of a node used for calculating layer overlaps. |
void |
setNodeHalo(double halo)
Specifies the size of the halo around a node, that means the insets that are used for calculating layer overlaps. |
void |
setNodeScalingFactor(double factor)
Specifies the scaling factor used for scaling the size of the nodes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsIsLayerer()
AsIsLayerer with default settings.
| Method Detail |
|---|
public double getNodeScalingFactor()
Nodes are being scaled from their center. This can be used for more fuzzy layering.
The scaling factor can take positive values. Factors smaller than 1 only consider large overlaps
of the nodes' bounding boxes in the main layout direction. Factors larger than 1 also combine nodes
with some distance between them.
setNodeScalingFactor(double),
getMinimumNodeSize(),
getMaximumNodeSize(),
getHalo()public void setNodeScalingFactor(double factor)
Nodes are being scaled from their center. This can be used for more fuzzy layering.
The scaling factor can take positive values. Factors smaller than 1 only consider large overlaps
of the nodes' bounding boxes in the main layout direction. Factors larger than 1 also combine nodes
with some distance between them.
factor - a positive double value
java.lang.IllegalArgumentException - if the specified value is less than 0getMinimumNodeSize(),
getMaximumNodeSize(),
getHalo()![]() Initial graph | ![]() Node scaling factor 1.0 | ![]() Node scaling factor 3.0 |
public double getMaximumNodeSize()
This can be used for more fuzzy layering.
The maximum size can take positive values.
setMaximumNodeSize(double),
setNodeScalingFactor(double),
setNodeHalo(double)public void setMaximumNodeSize(double max)
This can be used for more fuzzy layering.
The maximum size can take positive values.
Double.MAX_VALUE. max - a positive double value
java.lang.IllegalArgumentException - if the specified value is less than 0setNodeScalingFactor(double),
setNodeHalo(double)![]() Initial graph | ![]() Maximum node size 100 | ![]() Maximum node size 1000 |
public double getMinimumNodeSize()
This can be used for more fuzzy layering.
The minimum size can take positive values.
setMinimumNodeSize(double),
setNodeScalingFactor(double),
setNodeHalo(double)public void setMinimumNodeSize(double min)
This can be used for more fuzzy layering.
The minimum size can take positive values.
public void setNodeHalo(double halo)
If the value of the halo is positive, it specifies a border around a node. In case it is negative, it is considered as an inset that defines a smaller area inside the node.
This can be used for more fuzzy layering.
public double getHalo()
If the value of the halo is positive, it specifies a border around a node. In case it is negative, it is considered as an inset that defines a smaller area inside the node.
This can be used for more fuzzy layering.
setNodeHalo(double),
setNodeScalingFactor(double),
setMinimumNodeSize(double),
setMaximumNodeSize(double)
public int assignNodeLayer(LayoutGraph graph,
NodeMap layerID,
EdgeList reversedEdges)
graph - the given graphlayerID - the NodeMap that will be filled by the layout algorithm and returns the zero-based index
of the layer to which each node belongsreversedEdges - an EdgeList containing the edges which had been reversed
protected double getMin(LayoutGraph graph,
Node node)
It is called by method assignNodeLayer(LayoutGraph, NodeMap, EdgeList).
graph - the graphnode - the node
protected double getMax(LayoutGraph graph,
Node node)
It is called by method assignNodeLayer(LayoutGraph, NodeMap, EdgeList).
graph - the graphnode - the node
public void assignLayers(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
Layers instance.
Nodes whose bounding boxes overlap in the main layout direction are assigned to the same layer.
To influence to which amount the boxes need to overlap, the nodes can temporarily be
scaled.
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)
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||