|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mindfusion.diagramming.TreeLayout
public class TreeLayout
This class can be used to arrange tree-like graphs automatically. It support
three layout modes - cascading, centered and radial - which can be enabled
via the setType(int)
method.
Constructor Summary | |
---|---|
TreeLayout()
Initializes a new instance of the TreeLayout class. |
|
TreeLayout(DiagramNode root)
Initializes a new instance of the TreeLayout class, specifying which node to use as a tree root. |
|
TreeLayout(DiagramNode root,
int type)
Initializes a new instance of the TreeLayout class, specifying the root node and layout mode. |
|
TreeLayout(DiagramNode root,
int type,
boolean reversedArrows,
int arrowStyle,
int direction,
float levelDistance,
float nodeDistance,
boolean keepRootPosition,
float xGap,
float yGap)
Initializes a new instance of the TreeLayout class. |
|
TreeLayout(DiagramNode root,
int type,
boolean reversedArrows,
int arrowStyle,
int direction,
float levelDistance,
float nodeDistance,
boolean keepRootPosition,
float xGap,
float yGap,
boolean keepGroupLayout)
Initializes a new instance of the TreeLayout class. |
|
TreeLayout(int type)
Initializes a new instance of the TreeLayout class, specifying the layout mode. |
Method Summary | |
---|---|
boolean |
arrange(Diagram chart)
Arranges the specified flowchart. |
int |
getAnchoring()
Gets a value indicating how arrows will be aligned to the anchor points of tree nodes. |
boolean |
getCompactAssistants()
Gets a value indicating whether the "assistant" nodes on the same side of a single parent are arranged as close enough to each other as possible. |
int |
getDirection()
Gets a value indicating in what direction child nodes should be placed relatively to their parent nodes. |
boolean |
getEnableAssistants()
Gets a value indicating whether the "assistant" trait is regarded when performing the layout. |
boolean |
getIgnoreLinkDirection()
Gets a value indicating whether the direction of arrows should be ignored. |
boolean |
getKeepGroupLayout()
Gets a value indicating whether groups of diagram nodes should be treated as integral nodes in the tree that will be laid out. |
boolean |
getKeepRootPosition()
Gets a value indicating whether the root node should be kept at its original position. |
float |
getLevelDistance()
Gets the desired distance between tree levels. |
int |
getLinkStyle()
Gets what style is assigned to the arrows processed by the TreeLayout. |
float |
getNodeDistance()
Gets the desired distance between nodes on the same level. |
boolean |
getReversedLinks()
Gets a value indicating which direction of arrows should be considered the parent-to-child one. |
DiagramNode |
getRoot()
Gets the node which will be used as root of the tree. |
float |
getStretchFactor()
Gets a value defining the elliptic factor used with radial layouts. |
int |
getType()
Gets the layout mode. |
float |
getXGap()
Gets a value indicating how much horizontal space to leave between the document boundaries and the tree. |
float |
getYGap()
Gets a value indicating how much vertical space to leave between the document boundaries and the tree. |
void |
setAnchoring(int value)
Sets a value indicating how arrows should be aligned to the anchor points of tree nodes. |
void |
setCompactAssistants(boolean value)
Sets a value indicating whether the "assistant" nodes on the same side of a single parent are arranged as close enough to each other as possible. |
void |
setDirection(int value)
Sets a value indicating in what direction child nodes should be placed relatively to their parent nodes. |
void |
setEnableAssistants(boolean value)
Sets a value indicating whether the "assistant" trait is regarded when performing the layout. |
void |
setIgnoreLinkDirection(boolean value)
Sets a value indicating whether the direction of arrows should be ignored. |
void |
setKeepGroupLayout(boolean value)
Sets a value indicating whether groups of diagram nodes should be treated as integral nodes in the tree that will be laid out. |
void |
setKeepRootPosition(boolean value)
Sets a value indicating whether the root node should be kept at its original position. |
void |
setLevelDistance(float value)
Sets the desired distance between tree levels. |
void |
setLinkStyle(int value)
Sets what style should be assigned to the arrows processed by the layout algorithm. |
void |
setNodeDistance(float value)
Sets the desired distance between nodes on the same level. |
void |
setReversedLinks(boolean value)
Sets a value indicating which direction of arrows should be considered the parent-to-child one. |
void |
setRoot(DiagramNode value)
Sets the object which will be used as root of the tree. |
void |
setStretchFactor(float value)
Sets a value defining the elliptic factor used with radial layouts. |
void |
setType(int value)
Sets the layout mode. |
void |
setXGap(float value)
Sets a value indicating how much horizontal space to leave between the document boundaries and the tree. |
void |
setYGap(float value)
Sets a value indicating how much vertical space to leave between the document boundaries and the tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeLayout()
public TreeLayout(DiagramNode root)
root
- A DiagramNode
-derived object representing the tree root node.public TreeLayout(int type)
type
- One of the TreeLayoutType
constants.public TreeLayout(DiagramNode root, int type)
root
- A DiagramNode
-derived object representing the tree root node.type
- One of the TreeLayoutType
constants.public TreeLayout(DiagramNode root, int type, boolean reversedArrows, int arrowStyle, int direction, float levelDistance, float nodeDistance, boolean keepRootPosition, float xGap, float yGap)
root
- A DiagramNode
-derived object representing the tree root node.type
- One of the TreeLayoutType
constants.reversedArrows
- true
if the parent-to-child direction
in the tree is considered to be the one from arrows destination
nodes to arrows origin nodes, otherwise false
.arrowStyle
- One of the TreeLayoutLinkType
constants.direction
- One of the TreeLayoutDirection
constants.levelDistance
- A float value specifying the distance between tree levels.nodeDistance
- A float value specifying the distance between sibling nodes.keepRootPosition
- true
if the root position
should be preserved, otherwise false
.xGap
- A float value specifying the horizontal offset
from the left document bound.yGap
- A float value specifying the vertical offset
from the top document bound.public TreeLayout(DiagramNode root, int type, boolean reversedArrows, int arrowStyle, int direction, float levelDistance, float nodeDistance, boolean keepRootPosition, float xGap, float yGap, boolean keepGroupLayout)
root
- A DiagramNode
-derived object representing the tree root node.type
- One of the TreeLayoutType
constants.reversedArrows
- true
if the parent-to-child direction
in the tree is considered to be the one from arrows destination
nodes to arrows origin nodes, otherwise false
.arrowStyle
- One of the TreeLayoutLinkType
constants.direction
- One of the TreeLayoutDirection
constants.levelDistance
- A float value specifying the distance between tree levels.nodeDistance
- A float value specifying the distance between sibling nodes.keepRootPosition
- true
if the root position
should be preserved, otherwise false
.xGap
- A float value specifying the horizontal offset
from the left document bound.yGap
- A float value specifying the vertical offset
from the top document bound.keepGroupLayout
- true
if the relative position of
nodes within groups should be preserved, otherwise false
.Method Detail |
---|
public boolean arrange(Diagram chart)
arrange
in interface Layout
chart
- The Diagram
to arrange.
true
if the tree is arranged successfully, or
false
if JDiagram cannot find the tree root, e.g.
when the IgnoreArrowDirection attribute is enabled and the tree
root is not specified by the application.public DiagramNode getRoot()
DiagramNode
-derived object representing the tree root node.public void setRoot(DiagramNode value)
value
- A DiagramNode
-derived object representing the tree root node.public int getType()
TreeLayoutType
constants.public void setType(int value)
value
- One of the TreeLayoutType
constants.public int getLinkStyle()
TreeLayoutLinkType
constants.public void setLinkStyle(int value)
value
- One of the TreeLayoutLinkType
constants.public float getLevelDistance()
public void setLevelDistance(float value)
value
- A float value specifying the distance between tree levels.public float getNodeDistance()
public void setNodeDistance(float value)
value
- A float value specifying the distance between sibling nodes.public boolean getKeepRootPosition()
true
if the root position will be preserved,
otherwise false
.public void setKeepRootPosition(boolean value)
value
- true
if the root position should be
preserved, otherwise false
.public float getXGap()
public void setXGap(float value)
value
- A float value specifying the horizontal offset from the
left document bound.public float getYGap()
public void setYGap(float value)
value
- A float value specifying the vertical offset from the
top document bound.public float getStretchFactor()
public void setStretchFactor(float value)
value
- A float multiplier that is applied to the horizontal distance
between nodes in a radial layout.public int getDirection()
TreeLayoutDirection
constants.public void setDirection(int value)
value
- One of the TreeLayoutDirection
constants.public boolean getReversedLinks()
true
if the parent-to-child direction in the tree
is considered to be the one from arrows destination nodes to
arrows origin nodes, otherwise false
.public void setReversedLinks(boolean value)
value
- true
if the parent-to-child direction in the tree
is considered to be the one from arrows destination nodes to
arrows origin nodes, otherwise false
.public boolean getKeepGroupLayout()
true
if the relative position of nodes within
groups should be preserved, otherwise false
.public void setKeepGroupLayout(boolean value)
value
- true
if the relative position of nodes within
groups should be preserved, otherwise false
.public boolean getIgnoreLinkDirection()
true
if the direction of arrows will be ignored
when arranging a tree, otherwise false
.public void setIgnoreLinkDirection(boolean value)
value
- true
if the direction of arrows should be
ignored when arranging a tree, otherwise false
.public int getAnchoring()
Anchoring
constants.public void setAnchoring(int value)
value
- One of the Anchoring
constants.public boolean getEnableAssistants()
public void setEnableAssistants(boolean value)
public boolean getCompactAssistants()
public void setCompactAssistants(boolean value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |