|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.layout.CanonicMultiStageLayouter | +--y.layout.tree.BalloonLayouter
A tree layouter that lays out the subtrees of the tree in a balloon-like fashion.
Here is a sample layout output
Nested Class Summary | |
static class |
BalloonLayouter.NodeInfo
Encapsulates information bound to a node during the algorithm calculates a layout |
Field Summary | |
static byte |
CENTER_ROOT
Root node policy specifier constant. |
static byte |
DIRECTED_ROOT
Root node policy specifier constant. |
protected LayoutGraph |
graph
The layout graph being acted upon. |
static byte |
WEIGHTED_CENTER_ROOT
Root node policy specifier constant. |
Fields inherited from interface y.layout.Layouter |
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
BalloonLayouter()
|
Method Summary | |
protected double |
calcAngles(Node root)
Calculates the angle wedge that has to be reserved for the subtree rooted at the given node. |
protected void |
calcChildArrangement(Node root)
Calculates the chld nodes arrangement for a given root node of the tree. |
boolean |
canLayoutCore(LayoutGraph graph)
Returns true iff the core layouter can layout the given graph structure. |
protected Node |
determineRoot()
|
void |
doLayoutCore(LayoutGraph graph)
Core layout routine. |
boolean |
getAllowOverlaps()
Returns whether or not to allow partially overlapping nodes. |
double |
getCompactnessFactor()
Returns the compactness factor for this layouter. |
protected BalloonLayouter.NodeInfo |
getInfo(Node v)
Returns the NodeInfo object that is associated with the given node while the layouter is active. |
int |
getMinimalEdgeLength()
Returns the minimal edge length that this layouter assigns to layed out edges. |
int |
getPreferredChildWedge()
Returns the preferred child wedge angle. |
protected double |
getPreferredChildWedge(Node root)
Returns the preferred child wedge angle in degrees that is used for the children of the given root node. |
int |
getPreferredRootWedge()
Returns the preferrred radial amount in degrees that stay unoccupied around the root node of the graph. |
byte |
getRootNodePolicy()
Returns the root node policy that determines which node is chosen as (virtual) tree root for the layout process. |
void |
setAllowOverlaps(boolean allow)
Whether or not this layouter should allow (partially) overlapping nodes. |
void |
setCompactnessFactor(double factor)
Sets the compactness factor for this layouter. |
void |
setMinimalEdgeLength(int length)
Sets the minimal edge length that this layouter assigns to layed out edges. |
void |
setPreferredChildWedge(int wedgeAngle)
Set the preferred radial amount in degrees that all child nodes may occupy around a parent node. |
void |
setPreferredRootWedge(int wedgeAngle)
Sets the preferred radial amount in degrees that stay unoccupied around the root node of the graph Allowed values lie within 0 and 360
degrees.
|
void |
setRootNodePolicy(byte policy)
Sets the root node policy that determines which node is chosen as (virtual) tree root for the layout process. |
protected void |
sortChildNodes(Node root)
Sort child nodes according to their wedge angle sizes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte DIRECTED_ROOT
public static final byte CENTER_ROOT
Trees.getCenterRoot(Graph)
,
Constant Field Valuespublic static final byte WEIGHTED_CENTER_ROOT
Trees.getCenterRoot(Graph)
,
Constant Field Valuesprotected LayoutGraph graph
Constructor Detail |
public BalloonLayouter()
Method Detail |
public void setRootNodePolicy(byte policy)
By default BalloonLayouter.DIRECTED_ROOT
is set.
policy
- one of BalloonLayouter.DIRECTED_ROOT
, BalloonLayouter.CENTER_ROOT
.public byte getRootNodePolicy()
BalloonLayouter.setRootNodePolicy(byte)
public void setPreferredChildWedge(int wedgeAngle)
340
degrees which means that
the child nodes may radiate in almost any direction from a
parent node.
Allowed values lie within 0
and 360
degrees.
By default a child wedge of 340
degrees is used.
public void setPreferredRootWedge(int wedgeAngle)
Allowed values lie within 0
and 360
degrees.
By default a root wedge of 360
degrees is used.
public int getPreferredRootWedge()
BalloonLayouter.setPreferredRootWedge(int)
public int getPreferredChildWedge()
BalloonLayouter.setPreferredChildWedge(int)
public void setAllowOverlaps(boolean allow)
false
.
public boolean getAllowOverlaps()
BalloonLayouter.setAllowOverlaps(boolean)
public void setCompactnessFactor(double factor)
public double getCompactnessFactor()
BalloonLayouter.setCompactnessFactor(double)
public void setMinimalEdgeLength(int length)
By default a minimal edge length of 40 is set.
public int getMinimalEdgeLength()
BalloonLayouter.setMinimalEdgeLength(int)
public void doLayoutCore(LayoutGraph graph)
doLayoutCore
in class CanonicMultiStageLayouter
public boolean canLayoutCore(LayoutGraph graph)
canLayoutCore
in class CanonicMultiStageLayouter
protected BalloonLayouter.NodeInfo getInfo(Node v)
protected Node determineRoot()
protected void calcChildArrangement(Node root)
protected void sortChildNodes(Node root)
BalloonLayouter.calcChildArrangement(Node)
just after the wedges
sizes for all subgraphs rooted at root were determined.
protected double getPreferredChildWedge(Node root)
Subclasses may overwrite this method to provide a custom child wedge function.
protected double calcAngles(Node root)
Subclasses may overwrite this method to perform a custom angle wedge assignment scheme.
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |