|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.AbstractLayoutStage y.layout.PartitionLayouter y.layout.orthogonal.CompactOrthogonalLayouter
public class CompactOrthogonalLayouter
This class is a variant of OrthogonalLayouter
that tries to arrange nodes in a more
compact way, even allowing to specify a desired aspect ratio for the bounds of the
calculated layout. This is especially important if you want to print the layout
on a paper with predefined size. As a disadvantage, this algorithm will usually produce
less elegant edge routes than OrthogonalLayouter
does.
The algorithm is realized as a PartitionLayouter
, that uses PartitionLayouter.EdgeBetweennessPartitionFinder
to partition the graph, OrthogonalLayouter
to layout the graph partitions, PartitionLayouter.ComponentPartitionPlacer
to place the partitions, and finally PartitionLayouter.ChannelInterEdgeRouter
to route the edges between partitions.
Each of these strategies can be individually configured and/or replaced.
Here is a sample output of the layouter with aspect ratio of the resulting layout bounds set to 1
.
Nested Class Summary |
---|
Field Summary |
---|
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
CompactOrthogonalLayouter()
Create a new instance of this class with a default aspect ratio of 1 and a default grid spacing of 20. |
Method Summary | |
---|---|
double |
getAspectRatio()
Returns the desired aspect ratio of the resulting layout bounds. |
int |
getGridSpacing()
Returns the grid spacing used to place the nodes. |
void |
setAspectRatio(double aspectRatio)
Sets the desired aspect ratio (i.e. the quotient width/height) of the resulting layout bounds. |
void |
setGridSpacing(int gridSpacing)
Sets the grid spacing to be used. |
Methods inherited from class y.layout.PartitionLayouter |
---|
canLayout, doLayout, getInterEdgeRouter, getPartitionFinder, getPartitionPlacer, setInterEdgeRouter, setPartitionFinder, setPartitionPlacer |
Methods inherited from class y.layout.AbstractLayoutStage |
---|
canLayoutCore, doLayoutCore, getCoreLayouter, setCoreLayouter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompactOrthogonalLayouter()
Method Detail |
---|
public int getGridSpacing()
public void setGridSpacing(int gridSpacing)
20
is set.
Setting the grid spacing will only have an effect if the configurable stages
have not been replaced by other implementations.
public double getAspectRatio()
public void setAspectRatio(double aspectRatio)
1
is set.
This setting will only have an effect if the set PartitionLayouter.PartitionPlacer
is of the pre-configured type PartitionLayouter.ComponentPartitionPlacer
.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |