|
Search this API | ||||||||
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.ARTreeLayouter
public class ARTreeLayouter
This tree layouter tries to generate compact tree layouts with a certain aspect ratio. The ratio can be specified for each subtree.
Here is a sample layout output (using an aspect ratio of 1 by 2)
Field Summary | |
---|---|
protected LayoutGraph |
graph
|
static Object |
PLACEMENT_CORNER
A data provider value used to specify the placement of the root. |
static Object |
PLACEMENT_CORNER_SIDE
A data provider value used to specify the placement of the root. |
static Object |
PLACEMENT_CORNER_TOP
A data provider value used to specify the placement of the root. |
static Object |
PLACEMENT_TOP
A data provider value used to specify the placement of the root. |
static Object |
RATIO
The data provider key used to specify target aspect ratio. |
static Object |
ROOT_PLACEMENT
The data provider key used to specify the placement of each subtree root. |
static Object |
ROUTING_HORIZONTAL
A data provider value used to specify the routing policy of each subtree. |
static Object |
ROUTING_POLICY
The data provider key used to specify the routing policy of each subtree root. |
static Object |
ROUTING_VERTICAL
A data provider value used to specify the routing policy of each subtree. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
ARTreeLayouter()
|
Method Summary | |
---|---|
boolean |
canLayoutCore(LayoutGraph graph)
The core layouter can layout trees. |
protected void |
createBends(EdgeLayout el,
Node root,
Node child,
Object rootPlacement,
Object routingPolicy)
|
void |
doLayoutCore(LayoutGraph graph)
Core layout routine. |
double |
getAspectRatio()
Returns the preferred aspect ratio for this ARTreeLayouter . |
protected double |
getAspectRatio(Node v)
Returns the aspectRatio that should be used for the subtree starting at the given node. |
double |
getBendDistance()
Returns the preferred distance between any two bends of an edge. |
Comparator |
getComparator()
Returns the Comparator that will be used
to sort the outgoing edges
of each local root in the tree before they are being arranged. |
double |
getHorizontalSpace()
Returns the horizontal distance between adjacent nodes. |
Object |
getRootPlacement()
Returns the desired placement of the tree's root node. |
protected Object |
getRootPlacement(Object root)
Returns the desired placement for the given subtree root. |
Object |
getRoutingPolicy()
Returns the routing policy used by this ARTreeLayouter . |
protected Object |
getRoutingPolicy(Object root)
Returns the routing policy used by this ARTreeLayouter for
the given subtree root. |
protected NodeCursor |
getSuccessors(Node localRoot)
|
double |
getVerticalSpace()
Returns the vertical distance between adjacent nodes. |
void |
setAspectRatio(double aspectRatio)
Specifies the preferred aspect ratio for this ARTreeLayouter . |
void |
setBendDistance(double bendDistance)
Specifies the preferred distance between any two bends of an edge. |
void |
setComparator(Comparator comparator)
Sets the Comparator that will be used
to sort the outgoing edges
of each local root in the tree before they are being arranged. |
void |
setHorizontalSpace(double hspace)
Sets the horizontal distance between adjacent nodes. |
void |
setRootPlacement(Object rootPlacement)
Specifies the desired placement of the tree's root node. |
void |
setRoutingPolicy(Object routingPolicy)
Specifies the routing policy used by this ARTreeLayouter . |
void |
setVerticalSpace(double vspace)
Sets the vertical distance between adjacent nodes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object RATIO
public static final Object ROOT_PLACEMENT
public static final Object PLACEMENT_TOP
public static final Object PLACEMENT_CORNER
public static final Object PLACEMENT_CORNER_SIDE
public static final Object PLACEMENT_CORNER_TOP
public static final Object ROUTING_POLICY
public static final Object ROUTING_HORIZONTAL
public static final Object ROUTING_VERTICAL
protected LayoutGraph graph
Constructor Detail |
---|
public ARTreeLayouter()
Method Detail |
---|
public void setHorizontalSpace(double hspace)
10
is set.
public double getHorizontalSpace()
setHorizontalSpace(double)
public void setVerticalSpace(double vspace)
10
is set.
public double getVerticalSpace()
setVerticalSpace(double)
public void doLayoutCore(LayoutGraph graph)
doLayoutCore
in class CanonicMultiStageLayouter
public boolean canLayoutCore(LayoutGraph graph)
canLayoutCore
in class CanonicMultiStageLayouter
protected double getAspectRatio(Node v)
protected NodeCursor getSuccessors(Node localRoot)
public Comparator getComparator()
Comparator
that will be used
to sort the outgoing edges
of each local root in the tree before they are being arranged.
Note that the algorithm will only use the order induced by the comparator,
if the nodes (or better their whole subtrees) have equal size.
The default value is null
which indicates that the algorithm should
use its built-in logic, only.
null
if the default
order should be used.setComparator(java.util.Comparator)
public void setComparator(Comparator comparator)
Comparator
that will be used
to sort the outgoing edges
of each local root in the tree before they are being arranged.
Note that the algorithm will only use the order induced by the comparator,
if the nodes (or better their whole subtrees) have equal size.
The default value is null
which indicates that the algorithm should
use its built-in logic, only.
comparator
- the new comparator to use or null
if the default
order should be used.getComparator()
protected void createBends(EdgeLayout el, Node root, Node child, Object rootPlacement, Object routingPolicy)
protected Object getRoutingPolicy(Object root)
ARTreeLayouter
for
the given subtree root.
Should be one of
root
- the subtree root.
protected Object getRootPlacement(Object root)
root
- the subtree root.
public double getAspectRatio()
ARTreeLayouter
.
ARTreeLayouter
.public void setAspectRatio(double aspectRatio)
ARTreeLayouter
.
aspectRatio
- the preferred aspect ratio.public Object getRootPlacement()
public void setRootPlacement(Object rootPlacement)
rootPlacement
- the desired root placement.
Should be one of
public Object getRoutingPolicy()
ARTreeLayouter
.
Should be one of
ARTreeLayouter
.public void setRoutingPolicy(Object routingPolicy)
ARTreeLayouter
.
routingPolicy
- the routing policy. Should be one of
public double getBendDistance()
public void setBendDistance(double bendDistance)
bendDistance
- the preferred bend distance.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |