public class IlvTreeLayout extends IlvGraphLayout
The Tree Layout algorithm places the nodes of a tree starting from the root of the tree to the leaves. If the graph has parts that are disconnected, it arranges each connected component as an individual tree. The Tree Layout algorithm is primarily designed for a forest of pure trees. In a tree, each node except the root has a parent node. All the nodes that have the same parent are called children with respect to the parent and siblings with respect to each other. The Tree Layout algorithm can also be used for non-trees (for example, cyclic graphs). In this case, the layout algorithm ignores those links that violate the tree structure and takes only the spanning tree of the graph into account.
The algorithm has several layout modes:
Several alignment options are provided. In particular, the free layout mode allows the tip-over alignment, which means that subtrees are arranged serially rather than in parallel. If the subtrees starting at one node are normally arranged horizontally, the tip-over alignment arranges them vertically. The tree layout provides layout modes that automatically adapt the tip-over alignment to best fit the layout to a given aspect ratio.
The following sample drawings are produced by the Tree Layout algorithm. The left drawing uses the level layout mode. The flow direction of the links is towards the bottom, and the nodes are south-justified (that is, they are aligned to the bottom) within each level. The right drawing is the same tree in free layout mode (which always uses north level alignment):
Here is another sample drawing in free layout mode with the tip-over alignment at some leaf nodes:
The following are two sample drawings in the two radial layout modes. The normal radial mode in the left drawing places the nodes of the same level on a circle around the root node. The alternating radial mode in the right drawing places the nodes of the same level alternating on two circles around the root node. This results in better usage of the space.
In nonradial layout modes, the Tree Layout algorithm supports different styles of links in the same drawing. The following sample drawing shows orthogonal and straight-line links. It also shows nodes that are aligned to the center (see the red nodes), to the east (green), and to the west (blue) of their children. The drawing was created by the free layout mode with the link flow direction to the right, and so north is to the left.
The Tree Layout algorithm supports node neighboring in all modes. The following sample drawing shows a tree layout with the flow direction towards the top. Some nodes are not placed as children but rather as neighbors at the same level as the corresponding parent node. The red links, which are perpendicular to the flow direction, are between nodes that were specified as neighbored.
See the corresponding chapter of the User's Manual for details on the algorithm, the types of graphs for which this algorithm can be used, the features and limitations, code samples, and so on.
Note the following points:
Modifier and Type | Field and Description |
---|---|
static int |
ALTERNATING_RADIAL
Alternating radial layout mode.
|
static int |
AUTOMATIC_PINS
Automatic connector pin option.
|
static int |
BALLOON
Balloon layout mode.
|
static int |
BORDER_CENTER
Border center alignment option.
|
static int |
CENTER
Center alignment option.
|
static int |
CENTERED_PINS
Centered connector pin option.
|
static int |
CLIPPED_PINS
Clipped connector pin option.
|
static int |
EAST
East alignment option.
|
static int |
EAST_NEIGHBOR
East neighbor child alignment option.
|
static int |
EVENLY_SPACED_PINS
Evenly spaced connector pin option.
|
static int |
FAST_PROPORTIONAL
Fast proportional angle spacing.
|
static int |
FREE
Free layout mode.
|
static int |
LEVEL
Level layout mode.
|
static int |
MIXED
Mixed alignment option.
|
static int |
MIXED_STYLE
Mixed link shape option.
|
static int |
NO_RESHAPE_STYLE
No reshape option.
|
static int |
NORTH
North alignment option.
|
static int |
OPTIMIZED_UNIFORM_LEAVES_RADIUS
Optimized uniform balloon radius mode.
|
static int |
OPTIMIZED_VARIABLE_RADIUS
Optimized variable balloon radius mode.
|
static int |
ORTHOGONAL_STYLE
Orthogonal link shape option.
|
static int |
PROPORTIONAL
Slow proportional angle spacing.
|
static int |
RADIAL
Radial layout mode.
|
static int |
REGULAR
Regular angle spacing.
|
static int |
SOUTH
South alignment option.
|
static int |
STRAIGHT_LINE_STYLE
Straight-line link shape option.
|
static int |
TIP_LEAVES_OVER
Tip-over layout mode.
|
static int |
TIP_OVER
Tip-over alignment option.
|
static int |
TIP_OVER_ASSOCIATE_BOTH_SIDES
Associate child alignment option.
|
static int |
TIP_OVER_ASSOCIATE_EAST
Associate east child alignment option.
|
static int |
TIP_OVER_ASSOCIATE_WEST
Associate west child alignment option.
|
static int |
TIP_OVER_BOTH_SIDES
Tip-over to both sides alignment option.
|
static int |
TIP_OVER_EAST
Tip-over east alignment option.
|
static int |
TIP_OVER_EAST_WEST
Tip-over east and west alignment option.
|
static int |
TIP_OVER_WEST
Tip-over west alignment option.
|
static int |
TIP_ROOTS_AND_LEAVES_OVER
Tip-over layout mode.
|
static int |
TIP_ROOTS_OVER
Tip-over layout mode.
|
static int |
UNIFORM_LEAVES_RADIUS
Uniform balloon radius mode.
|
static int |
UNIFORM_RADIUS
Uniform radius mode.
|
static int |
UNSPECIFIED
Unspecified child alignment option.
|
static int |
VARIABLE_RADIUS
Variable balloon radius mode.
|
static int |
WEST
West alignment option.
|
static int |
WEST_NEIGHBOR
West neighbor child alignment option.
|
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES
Constructor and Description |
---|
IlvTreeLayout()
Creates a new instance of the Tree Layout algorithm.
|
IlvTreeLayout(IlvTreeLayout source)
Creates a new layout instance by copying an existing one.
|
Modifier and Type | Method and Description |
---|---|
void |
addAssociate(Object parentNode,
Object associateNode)
Sets one node as associate of another node.
|
int |
checkAppropriateLink(Object link)
Checks whether the input link is appropriate for this layout.
|
void |
checkAppropriateLinks()
Throws an exception if the links are not appropriate for the layout.
|
void |
cleanLink(IlvGraphModel graphModel,
Object link)
Cleans a link.
|
void |
cleanNode(IlvGraphModel graphModel,
Object node)
Cleans a node.
|
IlvGraphLayout |
copy()
Copies the layout instance.
|
void |
copyParameters(IlvGraphLayout source)
Copies the parameters from a given layout instance.
|
protected IlvGraphLayoutGrapherProperty |
createLayoutGrapherProperty(String name,
boolean withDefaults)
Returns a new instance of
IlvTreeLayoutGrapherProperty that
stores the parameter settings of this layout class. |
protected IlvGraphLayoutLinkProperty |
createLayoutLinkProperty(String name,
IlvGraphic link,
boolean withDefaults)
Returns a new instance of
IlvTreeLayoutLinkProperty that
stores the parameter settings of this layout class for links. |
protected IlvGraphLayoutNodeProperty |
createLayoutNodeProperty(String name,
IlvGraphic node,
boolean withDefaults)
Returns a new instance of
IlvTreeLayoutNodeProperty that
stores the parameter settings of this layout class for nodes. |
void |
detach()
Detaches the graph model from the layout instance.
|
int |
getAlignment(Object node)
Returns the local alignment option of the node.
|
double |
getAspectRatio()
Returns the aspect ratio specified for the layout.
|
double |
getAssociateOffset()
Returns the minimum offset between associates and the orthogonal link
segment starting at the parent.
|
Object |
getAssociateParent(Object node)
Returns the parent node for which the input node is an associate.
|
Enumeration |
getAssociates(Object parentNode)
Returns all associate nodes of the input parent node.
|
int |
getBalloonAngleSpacing()
Returns the current angle spacing for balloon layout mode.
|
int |
getBalloonInnerChildrenAngle()
Returns the maximum angle for children of inner nodes in balloon mode.
|
int |
getBalloonLeafChildrenAngle()
Returns the maximum angle for children of nodes that have only leaves
as children in balloon mode.
|
int |
getBalloonRadiusMode()
Returns the radius mode for balloon layout mode.
|
int |
getBalloonRootChildrenAngle()
Returns the maximum angle for children of the root node in balloon
mode.
|
int |
getBalloonStartAngle()
Returns the start angle of the layout in balloon mode.
|
double |
getBranchOffset()
Returns the minimum offset between neighbor nodes that belong to
different branches in the tree.
|
Enumeration |
getCalcBackwardTreeLinks()
Returns the backward links that were used in the reverse direction as
part of the spanning tree during layout.
|
Enumeration |
getCalcForwardTreeLinks()
Returns the forward links that were used as part of the spanning tree
during layout.
|
Enumeration |
getCalcNonTreeLinks()
Returns the links that were neither forward nor backward links in the
spanning tree during layout.
|
Enumeration |
getCalcRoots()
Returns the nodes that were used as roots during layout.
|
int |
getChildAlignment(Object node)
Returns the child alignment option of the node.
|
int |
getConnectorStyle()
Returns the style of the connectors.
|
Object |
getEastNeighbor(Object node)
Returns the specified east neighbor node of the input node, or
null if none was specified. |
double |
getEastSubtreeBlockMargin(Object node)
Returns the margin on the east side of the subtree starting at the
input node.
|
int |
getFlowDirection()
Returns the current direction of the flow.
|
int |
getGlobalAlignment()
Returns the global alignment option.
|
int |
getGlobalLinkStyle()
Returns the global style of the shapes of links.
|
int |
getLayoutMode()
Returns the current layout mode.
|
int |
getLevelAlignment()
Returns the current alignment within the levels.
|
int |
getLinkStyle(Object link)
Returns the style of the shape of an individual link.
|
int |
getMaxChildrenAngle()
Returns the maximum angle for children that are placed in radial mode.
|
IlvGraphicVector |
getMovingNodes()
Returns the vector of nodes being moved by the graph layout algorithm.
|
Comparator |
getNodeComparator()
Returns the comparator used for sorting the nodes.
|
double |
getNorthSubtreeBlockMargin(Object node)
Returns the margin on the north side of the subtree starting at the
input node.
|
int |
getNumberOfAlternatingCircles()
Returns the number of alternating circles.
|
double |
getOrthForkPercentage()
Returns the percentage of the parent-child offset that determines the
location where the orthogonal link routing places the bends in order
to fork the routing towards the children.
|
double |
getOverlapPercentage()
Returns the percentage for which a node is considered smaller in the
flow direction.
|
double |
getParentChildAssociateOffset()
Returns the minimum offset between the parent and the first associate.
|
double |
getParentChildOffset()
Returns the minimum offset between a parent and its children.
|
IlvPoint |
getPosition()
Returns the specified position of the layout.
|
int |
getRootPreference(Object node)
Returns the specified preference of the node to become root node.
|
double |
getSiblingOffset()
Returns the minimum offset between siblings.
|
double |
getSouthSubtreeBlockMargin(Object node)
Returns the margin on the south side of the subtree starting at the
input node.
|
Enumeration |
getSpecRoots()
Returns the nodes that were specified as root.
|
double |
getSubtreeBlockMargin(Object node,
int side)
Returns the margin on the specified side of the subtree starting at
the input node.
|
double |
getTipOverBranchOffset()
Returns the minimum offset in the flow direction between neighbor
nodes that belong to different branches in the tree.
|
Object |
getWestNeighbor(Object node)
Returns the specified west neighbor node of the input node, or
null if none was specified. |
double |
getWestSubtreeBlockMargin(Object node)
Returns the margin on the west side of the subtree starting at the
input node.
|
protected void |
init()
Initializes instance variables.
|
boolean |
isAllLevelsAlternating()
Returns
true if at all levels, nodes are forced into
alternating circular layers. |
boolean |
isCalcRoot(Object node)
Returns
true if the input node was used as root during
layout. |
boolean |
isCategorizingLinks()
Returns
true if the layout algorithm stores the
categorization of links into forward, backward, and non-tree links. |
boolean |
isCategorizingLinksWithoutLayout()
Returns
true if the layout algorithm does not really
perform a full layout. |
boolean |
isFirstCircleEvenlySpacing()
Returns
true if the nodes on the first circle must be
evenly spaced in radial mode. |
boolean |
isIncrementalMode()
Returns
true if the incremental mode is enabled. |
boolean |
isIntergraphConnectivityMode()
Returns
true if the intergraph link connectivity is
considered for the partitioning of the layout into subtrees. |
boolean |
isInvisibleRootUsed()
Returns
true if an invisible root is used to combine
components that are disconnected from each other. |
boolean |
isLocalRecursiveLayoutNeeded(IlvLayoutProvider layoutProvider,
IlvGraphLayout recLayout,
IlvGraphModel rootModel,
boolean traverse)
Checks whether layout is needed when layout is performed recursively
on a hierarchy of nested subgraphs.
|
boolean |
isNonTreeLinksStraight()
Returns
true if all non-tree links that
don't have the no-reshape link style and that are not fixed and are not incident to fixed nodes are reshaped to be straight. |
boolean |
isRecursiveLayoutFromAncestorAllowed()
Returns
true if the layout instance of an ancestor graph
is in principle allowed to treat this subgraph in a recursive layout. |
boolean |
isRecursiveLeafLayoutMode()
Returns
true if the recursive layout of nested subgraphs
in leaves of the tree is enabled. |
boolean |
isRespectNodeSizes()
Returns
true if the algorithm tries to respect the size
of the nodes, and false otherwise. |
boolean |
isRootPosition()
Returns
true if the specified position means the position
of the root node. |
boolean |
isSpecRoot(Object node)
Returns
true if the input node was specified as root. |
protected void |
layout(boolean redraw)
Computes the layout using the Tree Layout algorithm.
|
void |
layoutStepPerformed()
This method can be called by the layout classes when a step of the
layout algorithm has been performed.
|
void |
removeAllAssociates(Object parentNode)
Removes all the associate nodes from the input parent node.
|
void |
removeAssociate(Object parentNode,
Object associateNode)
Removes the associate node from its parent node.
|
void |
setAlignment(Object node,
int alignment)
Sets the alignment option of an individual node.
|
void |
setAllLevelsAlternating(boolean enable)
Sets whether at all levels, nodes are forced into alternating circular
layers.
|
void |
setAspectRatio(double aspectRatio)
Sets the aspect ratio for the layout.
|
void |
setAspectRatio(IlvManagerView view)
Sets the aspect ratio for the layout from a given view.
|
void |
setAspectRatio(IlvRect rect)
Sets the aspect ratio for the layout from a given rectangle.
|
void |
setAssociateOffset(double offset)
Sets the minimum offset between associates and the orthogonal link
segment starting at the parent.
|
void |
setBalloonAngleSpacing(int angleSpacing)
Sets the current angle spacing for balloon layout mode.
|
void |
setBalloonInnerChildrenAngle(int angle)
Sets the maximum angle for children of inner nodes in balloon mode.
|
void |
setBalloonLeafChildrenAngle(int angle)
Sets the maximum angle for children of nodes that have only leaves as
children in balloon mode.
|
void |
setBalloonRadiusMode(int radiusMode)
Sets the current radius mode for balloon layout mode.
|
void |
setBalloonRootChildrenAngle(int angle)
Sets the maximum angle for children of the root node in balloon mode.
|
void |
setBalloonStartAngle(int angle)
Sets the start angle of the layout in balloon mode.
|
void |
setBranchOffset(double offset)
Sets the minimum offset between neighbor nodes that belong to
different branches in the tree.
|
void |
setCategorizingLinks(boolean flag)
Sets whether the layout algorithm stores the categorization of links
into forward, backward, and non-tree links.
|
void |
setCategorizingLinksWithoutLayout(boolean flag)
Sets whether the layout algorithm does not really perform a full
layout.
|
void |
setChildAlignment(Object node,
int alignment)
Sets the child alignment option of the node.
|
void |
setConnectorStyle(int style)
Sets the style of the connectors.
|
void |
setEastSubtreeBlockMargin(Object node,
double margin)
Sets the margin on the east side of the subtree starting at the input
node.
|
void |
setEastWestNeighboring(Object eastNode,
Object westNode)
Creates an east-west neighboring of two nodes.
|
void |
setFirstCircleEvenlySpacing(boolean enable)
Sets whether the nodes on the first circle must be evenly spaced in
radial mode.
|
void |
setFlowDirection(int direction)
Sets the direction of the flow.
|
void |
setGlobalAlignment(int alignment)
Sets the global alignment option.
|
void |
setGlobalLinkStyle(int style)
Sets the global style of the shapes of links.
|
void |
setIncrementalMode(boolean enable)
Sets the incremental mode.
|
void |
setIntergraphConnectivityMode(boolean flag)
Sets whether the intergraph link connectivity is considered for the
partitioning of the layout into subtrees.
|
void |
setInvisibleRootUsed(boolean flag)
Sets whether an invisible root is used to combine components that are
disconnected from each other.
|
void |
setLayoutMode(int mode)
Sets the layout mode.
|
void |
setLevelAlignment(int alignment)
Sets the alignment within the levels.
|
void |
setLinkStyle(Object link,
int style)
Sets the style of the shape of an individual link.
|
void |
setMaxChildrenAngle(int angle)
Sets the maximum angle for children that are placed in radial mode.
|
void |
setNodeComparator(Comparator comparator)
Sets the comparator used for sorting the nodes.
|
void |
setNonTreeLinksStraight(boolean enable)
Sets whether all non-tree links that
don't have the no-reshape link style and that are not fixed and are not incident to fixed nodes are reshaped to be straight.
|
void |
setNorthSubtreeBlockMargin(Object node,
double margin)
Sets the margin on the north side of the subtree starting at the input
node.
|
void |
setNumberOfAlternatingCircles(int numCircles)
Sets the number of alternating circles.
|
void |
setOrthForkPercentage(double percentage)
Sets the percentage of the parent-child offset that determines the
location where the orthogonal link routing places the bends in order
to fork the routing towards the children.
|
void |
setOverlapPercentage(double percentage)
Sets the percentage for which a node is considered smaller in the flow
direction.
|
void |
setParentChildAssociateOffset(double offset)
Sets the minimum offset between the parent and the first associate.
|
void |
setParentChildOffset(double offset)
Sets the minimum offset between a parent and its children.
|
void |
setPosition(IlvPoint point)
Sets the position of the layout.
|
void |
setPosition(IlvPoint point,
boolean isRootPosition)
Sets the position of the layout.
|
void |
setRecursiveLayoutFromAncestorAllowed(boolean flag)
Sets whether the layout instance of the ancestor graph is in principle
allowed to treat this subgraph in a recursive layout.
|
void |
setRecursiveLeafLayoutMode(boolean flag)
Sets whether the recursive layout of nested subgraphs in leaves of the
tree is enabled.
|
void |
setRespectNodeSizes(boolean respect)
Sets whether the algorithm must try to respect the size of the nodes.
|
void |
setRoot(Object node)
Allows you to specify the root(s) of the tree.
|
void |
setRootPosition(boolean isRootPosition)
Sets the meaning of the specified position.
|
void |
setRootPreference(Object node,
int preference)
Specifies the preference of the node to become root node.
|
void |
setSiblingOffset(double offset)
Sets the minimum offset between siblings, that is, between nodes that
have the same parent in the tree structure.
|
void |
setSouthSubtreeBlockMargin(Object node,
double margin)
Sets the margin on the south side of the subtree starting at the input
node.
|
void |
setSubtreeBlockMargin(Object node,
int side,
double margin)
Sets the margin on the specified side of the subtree starting at the
input node.
|
void |
setTipOverBranchOffset(double offset)
Sets the minimum offset in the flow direction between neighbor nodes
that belong to different branches in the tree.
|
void |
setWestEastNeighboring(Object westNode,
Object eastNode)
Creates an east-west neighboring of two nodes.
|
void |
setWestSubtreeBlockMargin(Object node,
double margin)
Sets the margin on the west side of the subtree starting at the input
node.
|
boolean |
stopImmediately()
Stops the running layout algorithm as soon as possible.
|
boolean |
supportsAllowedTime()
Indicates that this layout class can stop the layout computation in a
proper manner when the user-defined allowed time is exceeded.
|
boolean |
supportsLayoutOfConnectedComponents()
Indicates that this layout class can use the generic connected
component layout mechanism of the
IlvGraphLayout base
class. |
boolean |
supportsLinkClipping()
Indicates that this layout class can use a link clip interface to clip
the end points of a link.
|
boolean |
supportsLinkConnectionBox()
Indicates that this layout class can use a link connection box
interface to calculate the end points of links.
|
boolean |
supportsPercentageComplete()
Indicates that this layout class can estimate the percentage of
completion during the run of the layout.
|
boolean |
supportsPreserveFixedLinks()
Indicates that this layout class allows the user to specify fixed
links.
|
boolean |
supportsPreserveFixedNodes()
Indicates that this layout class allows the user to specify fixed
nodes.
|
boolean |
supportsSaveParametersToNamedProperties()
Indicates that this layout class can transfer the layout parameters to
named properties.
|
boolean |
supportsSplineRouting()
Tests if this class supports the generic optimization of spline
control points.
|
boolean |
supportsStopImmediately()
Indicates that this layout class can interrupt the current run of the
layout immediately in a controlled way.
|
addGraphLayoutEventListener, addGraphLayoutParameterEventListener, afterLayoutOfSubgraph, attach, attach, beforeLayout, beforeLayoutOfSubgraph, callLayoutStepPerformedIfNeeded, cleanGraphModel, clipAllLinks, clipLink, connectAllLinksToCenter, connectLinkToCenter, contentsChanged, createLayoutReport, getAllowedTime, getAutoLayoutHandler, getBalanceSplineCurveThreshold, getCalcLayoutRegion, getCoordinatesMode, getGrapher, getGraphModel, getInstanceId, getLayout, getLayoutOfConnectedComponents, getLayoutOfConnectedComponentsReport, getLayoutRegion, getLayoutReport, getLayouts, getLinkClipInterface, getLinkConnectionBoxInterface, getMaxSplineCurveSize, getMinBusyTime, getMinSplineCurveSize, getParentLayout, getProperty, getProperty, getRecursiveLayout, getRemainingAllowedTime, getSeedValueForRandomGenerator, getSpecLayoutRegion, getSplineLinkFilter, increasePercentageComplete, isAnimate, isAutoLayout, isFitToView, isFixed, isGeometryUpToDate, isInputCheckEnabled, isLayoutNeeded, isLayoutOfConnectedComponentsEnabled, isLayoutOfConnectedComponentsEnabledByDefault, isLayoutRunning, isLayoutRunning, isLayoutTimeElapsed, isMemorySavings, isParametersUpToDate, isPreserveFixedLinks, isPreserveFixedNodes, isSplineRoutingEnabled, isStoppedImmediately, isStructureUpToDate, isUseDefaultParameters, isUseSeedValueForRandomGenerator, onParameterChanged, onParameterChanged, performAutoLayout, performLayout, performLayout, performLayout, PerformLayout, performSublayout, removeGraphLayoutEventListener, removeGraphLayoutParameterEventListener, setAllowedTime, setAnimate, setAutoCheckAppropriateLinksEnabled, setAutoLayout, setAutoLayoutHandler, setBalanceSplineCurveThreshold, setCoordinatesMode, setFixed, setGeometryUpToDate, setGrapher, setGraphModel, setInputCheckEnabled, setLayoutOfConnectedComponents, setLayoutOfConnectedComponentsEnabled, setLayoutRegion, setLayoutRegion, setLayoutRegion, setLayoutReport, setLayoutRunning, setLinkClipInterface, setLinkConnectionBoxInterface, setMaxSplineCurveSize, setMemorySavings, setMinBusyTime, setMinSplineCurveSize, setParametersUpToDate, setParentLayout, setPreserveFixedLinks, setPreserveFixedNodes, setProperty, setProperty, setSeedValueForRandomGenerator, setSplineLinkFilter, setSplineRoutingEnabled, setStructureUpToDate, setUseDefaultParameters, setUseSeedValueForRandomGenerator, supportsAnimation, supportsLayoutRegion, supportsMemorySavings, supportsRandomGenerator, unfixAllLinks, unfixAllNodes, useAnimateRedraw
public static final int NO_RESHAPE_STYLE
setGlobalLinkStyle(int)
, none of the links are reshaped. To specify
the shape of an individual link, use this option as the argument of
the method setLinkStyle(Object, int)
.public static final int STRAIGHT_LINE_STYLE
setGlobalLinkStyle(int)
, all links that are part of
the spanning tree get a straight-line shape. To specify the shape of
an individual link, use this option as the argument of the method
setLinkStyle(Object, int)
.public static final int ORTHOGONAL_STYLE
setGlobalLinkStyle(int)
, all links that are part of the
spanning tree get a shape consisting of a sequence of orthogonal line
segments. To specify the shape of an individual link, use this option
as the argument of the method setLinkStyle(Object, int)
.public static final int MIXED_STYLE
setGlobalLinkStyle(int)
, each link can have a different
shape. The shape of an individual link can be set by setLinkStyle(Object, int)
.setGlobalLinkStyle(int)
,
setLinkStyle(Object, int)
,
Constant Field Valuespublic static final int AUTOMATIC_PINS
setConnectorStyle(int)
, the connector style is
automatically selected depending on the global link style.setConnectorStyle(int)
,
setGlobalLinkStyle(int)
,
Constant Field Valuespublic static final int CENTERED_PINS
setConnectorStyle(int)
, the connector pins of links are
placed at the center of the border to which the link is attached.setConnectorStyle(int)
,
Constant Field Valuespublic static final int CLIPPED_PINS
setConnectorStyle(int)
, the connector pins of links are
placed such that the link pointing toward the node center is clipped
at the node border.setConnectorStyle(int)
,
Constant Field Valuespublic static final int EVENLY_SPACED_PINS
setConnectorStyle(int)
, the connector pins of
links are evenly spaced along the border to which the link is
attached.setConnectorStyle(int)
,
Constant Field Valuespublic static final int EAST
setGlobalAlignment(int)
, all parent nodes are aligned to the east
border of their children. The alignment of an individual node can be
set by setAlignment(Object, int)
.setGlobalAlignment(int)
,
setAlignment(Object, int)
,
Constant Field Valuespublic static final int WEST
setGlobalAlignment(int)
, all parent nodes are aligned to the west
border of their children. The alignment of an individual node can be
set by setAlignment(Object, int)
.setGlobalAlignment(int)
,
setAlignment(Object, int)
,
Constant Field Valuespublic static final int NORTH
setLevelAlignment(int)
, the nodes of the same
level are justified to the north side (towards the root).setLevelAlignment(int)
,
Constant Field Valuespublic static final int SOUTH
setLevelAlignment(int)
, the nodes of the same
level are justified to the south side (away from the root).setLevelAlignment(int)
,
Constant Field Valuespublic static final int CENTER
setGlobalAlignment(int)
, all parent nodes are centered with
respect to their children. The alignment of an individual node can be
set by setAlignment(Object, int)
.
When used in level layout mode as the argument of the method setLevelAlignment(int)
, the nodes of the same level are justified
to their centers.
public static final int BORDER_CENTER
setGlobalAlignment(int)
, all parent nodes are
centered with respect to the border of their children. The alignment
of an individual node can be set by setAlignment(Object,
int)
.setGlobalAlignment(int)
,
setAlignment(Object, int)
,
Constant Field Valuespublic static final int TIP_OVER
When used as the argument of the method setGlobalAlignment(int)
, it behaves like TIP_OVER_EAST
.
The alignment of an individual parent node can be set by setAlignment(Object, int)
.
When used as the argument of the method setLayoutMode(int)
,
all links flow roughly in the flow direction. In this layout mode,
the algorithm tries to optimize the layout to automatically fit best
to the specified aspect ratio by calculating which individual nodes
need tip-over alignment and which nodes can use the specified
alignment. The layout algorithm uses a fast heuristic.
setGlobalAlignment(int)
,
setAlignment(Object, int)
,
setLayoutMode(int)
,
Constant Field Valuespublic static final int TIP_OVER_EAST
When used as the argument of the method setGlobalAlignment(int)
, the children are arranged serially rather
than in parallel, on the east side of the parent node.. For instance,
if the children are normally arranged horizontally below each parent
node, the tip-over alignment arranges them vertically on the east
side below the parent node. The alignment of an individual parent
node can be set by setAlignment(Object, int)
.
setGlobalAlignment(int)
,
setAlignment(Object, int)
,
Constant Field Valuespublic static final int TIP_OVER_WEST
When used as the argument of the method setGlobalAlignment(int)
, the children are arranged serially rather
than in parallel, on the west side of the parent node.. For instance,
if the children are normally arranged horizontally below each parent
node, the tip-over alignment arranges them vertically on the west
side below the parent node. The alignment of an individual parent
node can be set by setAlignment(Object, int)
.
setGlobalAlignment(int)
,
setAlignment(Object, int)
,
Constant Field Valuespublic static final int TIP_OVER_EAST_WEST
When used as the argument of the method setGlobalAlignment(int)
, the children are arranged serially rather
than in parallel, alternating on the east and on the west side of the
parent node. This is basically a combination of TIP_OVER_EAST
and TIP_OVER_WEST
. The first child is placed
on the east side. Further children are placed on the east or west
side, so that the space usage on both sides is roughly the same,
i.e., the subtrees on the east side have roughly the same sum of
height than the subtrees on the west side. The alignment of an
individual parent node can be set by setAlignment(Object,
int)
.
Since this alignment option decides between east and west side
depending on subtree sizes, it is not well suited in incremental mode
(see setIncrementalMode(boolean)
), since little changes in
the graph can cause big changes in the layout even if the incremental
mode is switched on.
setGlobalAlignment(int)
,
setAlignment(Object, int)
,
setIncrementalMode(boolean)
,
Constant Field Valuespublic static final int TIP_OVER_BOTH_SIDES
When used as the argument of the method setGlobalAlignment(int)
, the child nodes are arranged in pairs
serially rather than in parallel. This style is very similar to the
style TIP_OVER_EAST_WEST
, because both the east and west
sides are used. However, the algorithm does not try to optimize the
space used on both sides; instead it always puts the odd-numbered
child nodes to the west and the even-numbered child nodes to the
east. The pairs of child nodes, one on the east side and one on the
west side, are aligned with one another. The alignment of an
individual parent node can be set by setAlignment(Object,
int)
.
setGlobalAlignment(int)
,
setAlignment(Object, int)
,
Constant Field Valuespublic static final int MIXED
setGlobalAlignment(int)
, each node can have a different
alignment. The alignment of an individual node can be set by setAlignment(Object, int)
.setGlobalAlignment(int)
,
setAlignment(Object, int)
,
Constant Field Valuespublic static final int UNSPECIFIED
setChildAlignment(Object, int)
, the child passed as
argument uses the alignment of the parent node.setChildAlignment(Object, int)
,
Constant Field Valuespublic static final int EAST_NEIGHBOR
setChildAlignment(Object, int)
, the child passed as
argument is made a neighbor at the east side of its parent node.setEastWestNeighboring(Object, Object)
,
setChildAlignment(Object, int)
,
Constant Field Valuespublic static final int WEST_NEIGHBOR
setChildAlignment(Object, int)
, the child passed as
argument is made a neighbor at the west side of its parent node.setEastWestNeighboring(Object, Object)
,
setChildAlignment(Object, int)
,
Constant Field Valuespublic static final int TIP_OVER_ASSOCIATE_BOTH_SIDES
setChildAlignment(Object, int)
, the child is laid out
like an associate node of its parent node. Associate nodes occur
alternating on the east or west side of its parent node.addAssociate(Object, Object)
,
setChildAlignment(Object, int)
,
Constant Field Valuespublic static final int TIP_OVER_ASSOCIATE_EAST
setChildAlignment(Object, int)
, the child is laid
out like an associate node of its parent node. This associate nodes
occurs on the east side of its parent node.addAssociate(Object, Object)
,
setChildAlignment(Object, int)
,
Constant Field Valuespublic static final int TIP_OVER_ASSOCIATE_WEST
setChildAlignment(Object, int)
, the child is laid
out like an associate node of its parent node. This associate nodes
occurs on the west side of its parent node.addAssociate(Object, Object)
,
setChildAlignment(Object, int)
,
Constant Field Valuespublic static final int FREE
setLayoutMode(int)
, all links flow roughly in the flow direction.
Parents and sibling nodes are aligned according to the specified
alignment option, but nodes of different tree branches are not
justified with each other,setLayoutMode(int)
,
Constant Field Valuespublic static final int LEVEL
setLayoutMode(int)
, all links flow roughly in the flow direction.
All nodes are organized in levels and are justified to their borders
or centered according to the level alignment option. Tip-over node
alignment is not possible; all other alignment options are possible.setLayoutMode(int)
,
Constant Field Valuespublic static final int RADIAL
setLayoutMode(int)
, the root node is in the center and the links
flow radially away from the center. The nodes are placed in circular
layers around the root node.setLayoutMode(int)
,
Constant Field Valuespublic static final int ALTERNATING_RADIAL
setLayoutMode(int)
, the root node is in the center
and the links flow radially away from the center. The nodes are
placed in circular layers around the root node. To optimize space,
siblings may be placed alternating in several different circular
layers. The alternating radial mode differs only from the radial mode
if the alternating placement produces smaller circles.setLayoutMode(int)
,
Constant Field Valuespublic static final int BALLOON
setLayoutMode(int)
, the root node is in the center and the subtrees
are arranged as balloon circles around the root. Each subtree froms
its own balloon recursively.setLayoutMode(int)
,
Constant Field Valuespublic static final int TIP_LEAVES_OVER
setLayoutMode(int)
, all links flow roughly in the flow direction.
The algorithm tries to optimize the layout to automatically fit best
to the specified aspect ratio by calculating which individual nodes
need tip-over alignment and which nodes can use the specified
alignment. The layout algorithm uses a heuristic that checks whether
leaf nodes (and their immediate parent nodes) should be tipped over.
It checks only the alignment mode TIP_OVER_EAST
, but not
TIP_OVER_BOTH_SIDES
or other variants.setLayoutMode(int)
,
Constant Field Valuespublic static final int TIP_ROOTS_OVER
setLayoutMode(int)
, all links flow roughly in the flow direction.
The algorithm tries to optimize the layout to automatically fit best
to the specified aspect ratio by calculating which individual nodes
need tip-over alignment and which nodes can use the specified
alignment. The layout algorithm uses a heuristic that checks whether
root nodes (and their immediate children nodes) should be tipped
over. It checks only the alignment mode TIP_OVER_EAST
, but
not TIP_OVER_BOTH_SIDES
or other variants.setLayoutMode(int)
,
Constant Field Valuespublic static final int TIP_ROOTS_AND_LEAVES_OVER
setLayoutMode(int)
, all links flow roughly in the flow direction.
The algorithm tries to optimize the layout to automatically fit best
to the specified aspect ratio by calculating which individual nodes
need tip-over alignment and which nodes can use the specified
alignment. The layout algorithm uses a heuristic that checks whether
root nodes and leaf nodes should be tipped over. It checks only the
alignment mode TIP_OVER_EAST
, but not TIP_OVER_BOTH_SIDES
or other variants.setLayoutMode(int)
,
Constant Field Valuespublic static final int REGULAR
setBalloonAngleSpacing(int)
in balloon layout mode, the available
angle range at a node is evenly split so that each subtrees at the
node can occupy the same angle.setBalloonAngleSpacing(int)
,
Constant Field Valuespublic static final int FAST_PROPORTIONAL
setBalloonAngleSpacing(int)
in balloon layout mode,
the available angle range at a node is proprionally split so that
larger subtrees at the node can occupy larger angles. The algorithm
uses a fast heuristic to calculate the angle ranges.setBalloonAngleSpacing(int)
,
Constant Field Valuespublic static final int PROPORTIONAL
setBalloonAngleSpacing(int)
in balloon layout mode,
the available angle range at a node is proprionally split so that
larger subtrees at the node can occupy larger angles. The algorithm
uses a slow heuristic to calculate the angle ranges, which is often
more precise than the fast heuristic.setBalloonAngleSpacing(int)
,
Constant Field Valuespublic static final int VARIABLE_RADIUS
setBalloonRadiusMode(int)
in balloon layout mode, the radius
of different child balloons at the same parent node can vary.setBalloonRadiusMode(int)
,
Constant Field Valuespublic static final int OPTIMIZED_VARIABLE_RADIUS
setBalloonRadiusMode(int)
in balloon layout
mode, the radius of different child balloons at the same parent node
can vary. An additional optimization heuristic reduces the radius.
This has the advantage of smaller space requirements but looses
symmetries in the diagram.setBalloonRadiusMode(int)
,
Constant Field Valuespublic static final int UNIFORM_LEAVES_RADIUS
setBalloonRadiusMode(int)
in balloon layout mode, the
radiuses of all leaves that are children of the same node are
uniform. The radius of balloons that contain more than one node can
still vary.setBalloonRadiusMode(int)
,
Constant Field Valuespublic static final int OPTIMIZED_UNIFORM_LEAVES_RADIUS
setBalloonRadiusMode(int)
in balloon layout
mode, the radiuses of all leaves that are children of the same node
are uniform. The radius of balloons that contain more than one node
can still vary. An additional optimization heuristic reduces the
radius. This has the advantage of smaller space requirements but
looses symmetries in the diagram.setBalloonRadiusMode(int)
,
Constant Field Valuespublic static final int UNIFORM_RADIUS
setBalloonRadiusMode(int)
in balloon layout mode, the radiuses of
all subtree balloons that are children of the same node are uniform.setBalloonRadiusMode(int)
,
Constant Field Valuespublic IlvTreeLayout()
IlvGraphLayout.attach(IlvGrapher)
. IlvGraphLayout.attach(IlvGraphModel)
. IlvGraphLayout.performLayout()
. public IlvTreeLayout(IlvTreeLayout source)
copy()
method. Any subclass
should provide a copy constructor.
The parameters of the source
layout are copied using the
method copyParameters(IlvGraphLayout)
.
source
- The layout instance that is copied.copy()
,
copyParameters(IlvGraphLayout)
protected void init()
You should not call this method directly. The method is called internally by the constructor without arguments and by the copy constructor. The method must be overridden by subclasses that need to initialize additional instance variables.
init
in class IlvGraphLayout
public IlvGraphLayout copy()
This method copies the layout instance by calling the copy constructor.
When performing a recursive layout of a nested graph, this method is
used by IlvLayoutProvider
to "clone" the layout instance of a
parent graph. Note that the parameters which are specific to a node
or a link are not copied. Only the global parameters are copied. The
layout position is not copied.
copy
in class IlvGraphLayout
copyParameters(IlvGraphLayout)
,
setPosition(IlvPoint)
,
setPosition(IlvPoint, boolean)
public void copyParameters(IlvGraphLayout source)
Note that the parameters which are specific to a node or a link are not copied. Only the global parameters are copied. The layout position is not copied.
copyParameters
in class IlvGraphLayout
source
- The layout instance from which the parameters are copied.copy()
,
setPosition(IlvPoint)
,
setPosition(IlvPoint, boolean)
protected void layout(boolean redraw) throws IlvGraphLayoutException
IlvGraphLayout.performLayout()
.layout
in class IlvGraphLayout
redraw
- If true
, the attached graph model will be
asked to redraw the graph after layout. When the layout algorithm
moves the nodes and reshapes the links, it is required to pass the
value of the redraw
argument to the methods IlvGraphModel.moveNode(java.lang.Object, double, double, boolean)
and IlvGraphModel.reshapeLink(java.lang.Object, ilog.views.IlvPoint, ilog.views.IlvPoint[], int, int, ilog.views.IlvPoint, boolean)
.IlvGraphLayoutException
- If an unusual situation occurs.
WARNING: this method can throw one of the subclasses of IlvGraphLayoutException
. Specifically, it can throw an IlvInappropriateGraphException
. It can also throw an IlvInappropriateLinkException
when inappropriate types of links
and/or link connectors are used in an IlvGrapher
. For
details, refer to the documentation of these exception classes.IlvGraphLayout.performLayout()
public void detach()
IlvGraphLayout.attach(IlvGraphModel)
. The detach method performs cleaning
operations on the graph model. In addition to the cleaning operations
in the base class, the Tree Layout removes the alignment, root
preference, and node neighboring specifications of individual nodes,
and the link style specifications of individual links.
Note that you must call this method when you no longer need the layout instance. Otherwise, some objects may not be garbage collected.
public void cleanNode(IlvGraphModel graphModel, Object node)
Subclasses can override this method to remove additional information stored in the nodes.
cleanNode
in class IlvGraphLayout
graphModel
- The graph model to which node
belongs.node
- The node to be cleaned.detach()
public void cleanLink(IlvGraphModel graphModel, Object link)
Subclasses can override this method to remove additional information stored in the links.
cleanLink
in class IlvGraphLayout
graphModel
- The graph model to which link
belongs.link
- The link to be cleaned.detach()
public final boolean supportsPreserveFixedNodes()
Fixed nodes are not moved during the layout if the method IlvGraphLayout.setPreserveFixedNodes(boolean)
is called with a true
argument. Links that are incident to fixed nodes are not reshaped
during the layout. Fixed nodes are ignored by the Tree Layout
algorithm, which may lead to node overlaps. The effect is very
similar to the effect when the node is filtered during layout.
supportsPreserveFixedNodes
in class IlvGraphLayout
true
.IlvGrapherAdapter.setFilter(IlvLayoutGraphicFilter)
,
IlvGraphLayout.setPreserveFixedNodes(boolean)
,
IlvGraphLayout.isPreserveFixedNodes()
public final boolean supportsPreserveFixedLinks()
IlvGraphLayout.setPreserveFixedLinks(boolean)
is called with a
true
argument. Fixed links are ignored by the Tree
Layout algorithm, which may lead to overlaps. The effect is very
similar to the effect when the link is filtered during layout.supportsPreserveFixedLinks
in class IlvGraphLayout
true
.IlvGrapherAdapter.setFilter(IlvLayoutGraphicFilter)
,
IlvGraphLayout.setPreserveFixedLinks(boolean)
,
IlvGraphLayout.isPreserveFixedLinks()
,
setGlobalLinkStyle(int)
,
setLinkStyle(Object, int)
public final boolean supportsAllowedTime()
IlvGraphLayoutReport.STOPPED_AND_INVALID
in this
case.supportsAllowedTime
in class IlvGraphLayout
true
.IlvGraphLayout.setAllowedTime(long)
,
IlvGraphLayout.getAllowedTime()
,
IlvGraphLayoutReport.getCode()
public final boolean supportsStopImmediately()
IlvGraphLayoutReport.STOPPED_AND_INVALID
in this case.supportsStopImmediately
in class IlvGraphLayout
true
.IlvGraphLayout.stopImmediately()
,
IlvGraphLayout.isStoppedImmediately()
,
IlvGraphLayoutReport.getCode()
public boolean stopImmediately()
true
. In the last step, the layout algorithm cannot be
stopped and the method returns false
.stopImmediately
in class IlvGraphLayout
true
during the early steps of the layout algorithm
and false
in the last step when the layout algorithm
cannot be stopped.IlvGraphLayoutReport.getCode()
,
IlvGraphLayout.supportsStopImmediately()
,
IlvGraphLayout.isStoppedImmediately()
public final boolean supportsPercentageComplete()
supportsPercentageComplete
in class IlvGraphLayout
true
.IlvGraphLayout.increasePercentageComplete(int)
,
IlvGraphLayoutReport.getPercentageComplete()
,
IlvJGraphLayoutProgressBar
public final boolean supportsLayoutOfConnectedComponents()
IlvGraphLayout
base
class. This mechanism cuts the attached graph into connected
components, applies itself to each connected component separately,
and then uses the layout instance returned by the method IlvGraphLayout.getLayoutOfConnectedComponents()
to position the connected
components. By default, this layout is an instance of IlvGridLayout
which can be customized as
needed.
The generic connected component layout mechanism has the disadvantage that it moves connected components completely. Fixed nodes within a component do not preserve their old positions, and the resulting layout may be unstable on incremental changes in incremental mode, depending on which layout instance is used for the component layout.
If the generic connected component layout mechanism is disabled, the algorithm uses its own specialized internal mechanism instead of the generic mechanism to lay out each component as a separate tree. This is usually faster and more stable on incremental changes than the generic mechanism. In addition, it enables the user to set the position of the layout.
supportsLayoutOfConnectedComponents
in class IlvGraphLayout
true
.IlvGraphLayout.getLayoutOfConnectedComponents()
,
IlvGraphLayout.setLayoutOfConnectedComponentsEnabled(boolean)
,
IlvGraphLayout.performLayout(boolean, boolean)
,
setIncrementalMode(boolean)
public boolean supportsLinkConnectionBox()
Link connection points are not calculated for links that have the no-reshape link style, that are fixed, or that are not tree links. Only the connection points of reshapeable tree links are calculated.
If a connection box interface object is set using the method IlvGraphLayout.setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface)
,
the layout algorithm uses this object together with the connector
style to calculate the connection points for links.
supportsLinkConnectionBox
in class IlvGraphLayout
true
.IlvGraphLayout.setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface)
,
IlvGraphLayout.setLinkClipInterface(IlvLinkClipInterface)
,
setLinkStyle(Object, int)
,
setConnectorStyle(int)
,
getCalcNonTreeLinks()
,
supportsLinkClipping()
public boolean supportsLinkClipping()
Links are not clipped if they have the no-reshape link style, if they are fixed, or if they are not tree links. Only reshapeable tree links are clipped.
If a clip interface object is set using the method
, the layout algorithm uses this
object to calculate final clipped connection points for links at the
border of the node shapes, after some initial connection points at
the bounding box of the nodes were preliminarily obtained from the
connector style (see setLinkClipInterface
setConnectorStyle(int)
). The mechanism works
best for straight links if the connector style
CLIPPED_PINS
is used in addition to the link clip
interface. For orthogonal links, the connector style
EVENLY_SPACED_PINS
can be used.
If a link connection box interface is set additionally, the layout algorithm calculates the initial connection points by respecting node boxes obtained by the link connection box interface (instead of the bounding box) and obtains the final connection points at the border of the node shaped by clipping with the link clip interface. This works well particularly if the node box obtained by the the link connection box interface is smaller than the real bounding box of the node.
supportsLinkClipping
in class IlvGraphLayout
true
.IlvGraphLayout.setLinkClipInterface(IlvLinkClipInterface)
,
IlvGraphLayout.setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface)
,
setLinkStyle(Object, int)
,
setConnectorStyle(int)
,
getCalcNonTreeLinks()
,
supportsLinkConnectionBox()
public final boolean supportsSaveParametersToNamedProperties()
.ivl
file.supportsSaveParametersToNamedProperties
in class IlvGraphLayout
true
.IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout,
boolean)
,
IlvGrapherAdapter.loadParametersFromNamedProperties(IlvGraphLayout)
,
IlvGrapherAdapter.removeParametersFromNamedProperties()
public boolean supportsSplineRouting()
IlvSplineLinkImage
and IlvGeneralLink
are used, the bend points
calculated by the layout algorithm are often suboptimal. A generic
optimization mechanism is available that can be enabled by calling
IlvGraphLayout.setSplineRoutingEnabled(boolean)
.
Due to the nature of a tree, the optimized spline routing is less seldom needed for tree layout, while it is highly useful for other layout styles such as hierarchical layout. Optimized spline routing is offered for tree layout for consistency reasons.
supportsSplineRouting
in class IlvGraphLayout
true
.IlvGraphLayout.setSplineRoutingEnabled(boolean)
,
IlvGraphLayout.setMinSplineCurveSize(double)
,
IlvGraphLayout.setMaxSplineCurveSize(double)
,
IlvGraphLayout.setBalanceSplineCurveThreshold(double)
,
IlvGraphLayout.setSplineLinkFilter(IlvSplineLinkFilter)
public final void setGlobalLinkStyle(int style)
ORTHOGONAL_STYLE
- all links have an orthogonal shape,
that is, a shape consisting of a sequence of orthogonal line
segments. This option is not available for the radial layout
modes.STRAIGHT_LINE_STYLE
- all links have a straight-line
shape.NO_RESHAPE_STYLE
- no reshape is performed on any
link.MIXED_STYLE
- each link can have a different link
style. The style of each individual link can be set by the method
setLinkStyle(Object, int)
so that different link shapes can
occur in the same graph.
Unless the global link style is MIXED_STYLE
, all links have
the same shape style.
The default value is STRAIGHT_LINE_STYLE
.
Note that when the graph attached to the layout is of type IlvGrapher
, the effect of the link reshaping depends on the type of
the links and the connectors installed at the node. For all link
styles, we recommend using links of type IlvPolylineLinkImage
. For the orthogonal link
style, we additionally recommend using link connectors of type IlvFreeLinkConnector
. Other link or
connector types may cause an IlvInappropriateLinkException
during layout. You can use the method
and
method IlvGraphLayoutUtil.EnsureAppropriateLinkTypes
before layout, or the method IlvGraphLayoutUtil.EnsureAppropriateLinkConnectors
when the
exception is caught, to convert all links to an appropriate type.
IlvGraphLayoutUtil.EnsureAppropriateLinks
getGlobalLinkStyle()
,
setLinkStyle(Object, int)
,
setLayoutMode(int)
public final int getGlobalLinkStyle()
setGlobalLinkStyle(int)
public final void setConnectorStyle(int style)
Valid values are:
CENTERED_PINS
- the link connector pins are placed in
the center of the border of the node bounding box to which the link
is attached.CLIPPED_PINS
- each link pointing to the center of the
node is clipped at the bounding box of the node. This style affects
straight links; it behaves like centered connector pins for
orthogonal links.EVENLY_SPACED_PINS
- the link connector pins are evenly
spaced along the border of the node bounding box.AUTOMATIC_PINS
- the connector style is selected
depending on the link style.
The default value is AUTOMATIC_PINS
.
The connector style is ignored in the radial layout modes because clipped pins are always used in this case . The placement of connector pins also depends on the link clip interface and the connection box interface, in the following way:
IlvGraphLayout.setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface)
,
the bounding box and offsets are delivered by that interface.
Otherwise, the node bounding box delivered by the graph model (see
IlvGraphModel.boundingBox(Object)
) is used. setLinkClipInterface
, the connector pins are corrected
by clipping with that interface.
Note that when the graph attached to the layout is of type IlvGrapher
, the effect of the connector style depends on the type of
the connectors installed at the node. We recommend using link
connectors of type IlvFreeLinkConnector
. Other connector types
may cause an IlvInappropriateLinkException
during layout. You
can use the method
before layout, or the method IlvGraphLayoutUtil.EnsureAppropriateLinkConnectors
when the
exception is caught, to install the appropriate connectors.
IlvGraphLayoutUtil.EnsureAppropriateLinks
setLayoutMode(int)
,
getConnectorStyle()
,
supportsLinkClipping()
,
supportsLinkConnectionBox()
public final int getConnectorStyle()
setConnectorStyle(int)
public final void setFlowDirection(int direction)
IlvDirection.Right
- the root is on the left and the
links flow to the right.IlvDirection.Left
- the root is on the right and the
links flow to the left.IlvDirection.Bottom
- the root is at the top and the
links flow to the bottom.IlvDirection.Top
- the root is at the bottom and the
links flow to the top.
Note that except for the radial layout modes, the compass direction
SOUTH
is identical to the flow direction.
In the radial layout modes, all links flow radially from the center of the root outward. If connected component processing is disabled, the flow direction affects only the arrangement of disconnected trees in the radial modes.
The default value is IlvDirection.Right
.
getFlowDirection()
,
setLayoutMode(int)
,
IlvGraphLayout.setLayoutOfConnectedComponentsEnabled(boolean)
public final int getFlowDirection()
setFlowDirection(int)
public final void setLayoutMode(int mode)
FREE
- all links flow roughly in the flow direction.
Nodes of different tree branches (that is, nodes with a different
parent node) are not justified to each other; therefore, the level
alignment parameter is ignored. Tip-over alignment is possible if
specified as alignment. All link styles are possible. The aspect
ratio is ignored.LEVEL
- all links flow roughly in the flow direction.
Nodes are organized in levels and are justified to their borders or
centered according to the level alignment parameter. Tip-over
alignment is not possible, but all link styles are possible. The
aspect ratio is ignored.TIP_OVER
- similar to the mode FREE
. However,
in mode TIP_OVER
, the algorithm tries to optimize the layout
to automatically fit best to the specified aspect ratio. Using a fast
heuristic, it chooses the local alignment TIP_OVER_EAST
for
some nodes but keeps the alignment of all other nodes as specified.
This heuristic is a fast compromise between the modes TIP_LEAVES_OVER
, TIP_ROOTS_OVER
, and TIP_ROOTS_AND_LEAVES_OVER
.TIP_LEAVES_OVER
- similar to the mode TIP_OVER
. The algorithm tries to optimize the layout to
automatically fit best to the specified aspect ratio. This slow
heuristic tries to tip over beginning with the leaves and then
chooses the best layout. It checks the alignment mode TIP_OVER_EAST
, but not TIP_OVER_BOTH_SIDES
or other
variants. It keeps the alignment of all nodes close to the root as
specified.TIP_ROOTS_OVER
- similar to the mode TIP_OVER
.
The algorithm tries to optimize the layout to automatically fit best
to the specified aspect ratio. This slow heuristic tries to tip over
beginning with the roots and then chooses the best layout. It checks
the alignment mode TIP_OVER_EAST
, but not TIP_OVER_BOTH_SIDES
or other variants. It keeps the alignment of
all nodes close to the leaves as specified.TIP_ROOTS_AND_LEAVES_OVER
- similar to the mode TIP_OVER
. The algorithm tries to optimize the layout to
automatically fit best to the specified aspect ratio. This slow
heuristic tries to tip over beginning with the roots and with the
leaves, and then chooses the best layout. It checks the alignment
mode TIP_OVER_EAST
, but not TIP_OVER_BOTH_SIDES
or
other variants. It keeps the alignment of all nodes in the middle
between roots and leaves as specified.RADIAL
- the root node is in the center, the links flow
radially away from the center, and the nodes are placed in circular
layers around the root node according to the level alignment.
Tip-over alignment and orthogonal link styles are not possible.
Clipped connector pins are used as the connector style. If an aspect
ratio is specified, the layers are ellipses around the center.ALTERNATING_RADIAL
- this is the same as mode RADIAL
, with the exception that children of the same node are
placed alternating in different circular layers when this results in
a smaller radius and better usage of the space. Tip-over alignment
and orthogonal link styles are not possible. Clipped connector pins
are used as the connector style. If an aspect ratio is specified, the
layers are ellipses around the center.BALLOON
- the root node is in the center and the
subtrees are arranged as balloon circles around the root. It is very
similar to the mode RADIAL
, however each subtree froms its
own balloon recursively. If an aspect ratio is specified, the
balloons are ellipses instead of circles. Tip-over alignment and
orthogonal link styles are not possible. Clipped connector pins are
used as the connector style. The recursive leaf layout mode is not
supported in combination with the balloon mode.
The default value is FREE
.
Note that the tip-over layout modes work best if the node sizes are respected during layout.
getLayoutMode()
,
setFlowDirection(int)
,
setLevelAlignment(int)
,
setConnectorStyle(int)
,
setGlobalLinkStyle(int)
,
setLinkStyle(Object, int)
,
setGlobalAlignment(int)
,
setAlignment(Object, int)
,
setAspectRatio(double)
,
setAspectRatio(IlvManagerView)
,
setAspectRatio(IlvRect)
,
setRespectNodeSizes(boolean)
,
setRecursiveLeafLayoutMode(boolean)
public final int getLayoutMode()
setLayoutMode(int)
public final void setBalloonAngleSpacing(int angleSpacing)
BALLOON
. Valid
values are:
REGULAR
- the available angle range at a node is evenly
split so that each subtrees balloon at the node can occupy the same
angle. FAST_PROPORTIONAL
- the available angle range at a node
is proportonally split so that larger subtrees balloons at the node
can occupy larger angles. The algorithm uses a fast heuristic to
calculate the angle ranges. This heuristic is not very precise. PROPORTIONAL
- the available angle range at a node is
proportonally split so that larger subtrees balloons at the node can
occupy larger angles. The algorithm uses a slower heuristic to
calculate the angle ranges. This heuristic is more precise than the
fast heuristic.
The default value is PROPORTIONAL
.
getBalloonAngleSpacing()
,
setLayoutMode(int)
public final int getBalloonAngleSpacing()
setBalloonAngleSpacing(int)
,
setLayoutMode(int)
public final void setBalloonRadiusMode(int radiusMode)
BALLOON
. Valid values
are:
VARIABLE_RADIUS
- the radius of different child
balloons at the same parent node can vary. OPTIMIZED_VARIABLE_RADIUS
- the radius of different
child balloons at the same parent node can vary. An additional
optimization heuristic reduces the radius. This has the advantage of
smaller space requirements but looses symmetries in the diagram.
UNIFORM_LEAVES_RADIUS
- the radiuses of all leaves that
are children of the same node are uniform. The radius of balloons
that contain more than one node can still vary. Use this mode if
symmetries of the layout are important. OPTIMIZED_UNIFORM_LEAVES_RADIUS
- the radiuses of all
leaves that are children of the same node are uniform. The radius of
balloons that contain more than one node can still vary. An
additional optimization heuristic reduces the radius. This has the
advantage of smaller space requirements but looses symmetries in the
diagram. UNIFORM_RADIUS
- the radiuses of all subtree balloons
that are children of the same node are uniform. This mode requires
the most area but also shows the most symmetries in the layout.
The default value is OPTIMIZED_UNIFORM_LEAVES_RADIUS
.
getBalloonRadiusMode()
,
setLayoutMode(int)
public final int getBalloonRadiusMode()
setBalloonRadiusMode(int)
,
setLayoutMode(int)
public final void setBalloonStartAngle(int angle)
The default value is 0.
The angle orientation is clockwise for flow direction left and top and counter clockwise for flow direction right and bottom. The start angle 0 is always towards the right.
This is an expert option. It has no effect in layout modes other than balloon.
getBalloonStartAngle()
,
setLayoutMode(int)
public final int getBalloonStartAngle()
setBalloonStartAngle(int)
public final void setBalloonRootChildrenAngle(int angle)
The default value is 360.
This is an expert option. It has no effect in layout modes other than balloon.
getBalloonRootChildrenAngle()
,
setLayoutMode(int)
public final int getBalloonRootChildrenAngle()
setBalloonRootChildrenAngle(int)
public final void setBalloonInnerChildrenAngle(int angle)
The default value is 360.
This is an expert option. It has no effect in layout modes other than balloon.
getBalloonInnerChildrenAngle()
,
setLayoutMode(int)
public final int getBalloonInnerChildrenAngle()
setBalloonInnerChildrenAngle(int)
public final void setBalloonLeafChildrenAngle(int angle)
The default value is 360.
This is an expert option. It has no effect in layout modes other than balloon.
getBalloonLeafChildrenAngle()
,
setLayoutMode(int)
public final int getBalloonLeafChildrenAngle()
setBalloonLeafChildrenAngle(int)
public final void setIncrementalMode(boolean enable)
If the incremental mode is enabled, the algorithm tries to preserve the relative order of the children on incremental changes, unless a node comparator is specified. The logical order of children of nodes in the tree is calculated from their coordinates. In this case, the layout is stable when incremental changes are made. If nodes are added or removed after a layout, the next layout uses a heuristic to try to adjust the layout only minimally and to avoid major structural reorganization.
If the incremental mode is disabled, the algorithm calculates the
logical order of children of nodes in the tree by using the order in
which nodes are returned by IlvGraphModel.getNodes()
.
If a node comparator is specified, the algorithm calculate the logical order of children of nodes in the tree from the node comparator, independent from whether the incremental mode is enabled or disabled.
The incremental mode is enabled by default.
isIncrementalMode()
,
setNodeComparator(Comparator)
public final boolean isIncrementalMode()
true
if the incremental mode is enabled.setIncrementalMode(boolean)
public final void setNodeComparator(Comparator comparator)
null
is passed, no comparator is used. If a node
comparator is specified, the algorithm calculates the logical order
of children of nodes in the tree by using this comparator.
The default value is null
(no comparator).
getNodeComparator()
public Comparator getNodeComparator()
setNodeComparator(java.util.Comparator)
public final void setAllLevelsAlternating(boolean enable)
This option has only an effect in layout mode ALTERNATING_RADIAL
. Alternating placement means that the nodes of
one level are placed alternating in several (normally 2) circular
layers. Nonalternating placement means that the nodes of one level
are placed in one circular layer. Normally, the layout analyses which
levels must use the alternating placement in order to optimize space.
If the alternating placement of a level does not improve the space
usage, the nonalternating placement is used for the level even in
alternating radial layout mode.
This option allows to change this behavior: if the option is enabled, all levels use the alternating placement even if the alternating placement uses more space than the nonalternating placement. The option is ignored if the number of alternating circles is set to 0, because in that more, the number of alternating circles is automatically determined from the space usage.
The option is disabled by default.
isAllLevelsAlternating()
,
setNumberOfAlternatingCircles(int)
,
setLayoutMode(int)
public final boolean isAllLevelsAlternating()
true
if at all levels, nodes are forced into
alternating circular layers.setAllLevelsAlternating(boolean)
public final void setNumberOfAlternatingCircles(int numCircles)
This option has only an effect in layout mode ALTERNATING_RADIAL
. Alternating placement means that the nodes of
one level are placed alternating in several circular layers. By
default, it uses 2 circular layers for the alternating placement.
Nonalternating placement means that the nodes of one level are
placed in one circular layer.
This option allows to define how many alternating layers are
maximally used. You cannot have more layers than nodes in the level,
hence it is only the maximum number of layers. Furthermore, the
layout analyses which levels must use the alternating placement in
order to optimize space, unless the option isAllLevelsAlternating()
returns true.
If you set the number to a positive value and isAllLevelsAlternating()
returns true, each level has exactly that
many circular layers, unless the level has not sufficient nodes. If
you set the number to a positive value and isAllLevelsAlternating()
returns false, each level has either exactly
that many circular layers or one circular layer, depending on which
version uses the space better. If you set the number to 0, a
heuristic tries to determine for each level how many circular layers
are needed in order to optimize the space. In this case, different
levels can have different number of circular layers, and the value of
isAllLevelsAlternating()
is ignored.
Note that the layout may have link crossings if a huge number of alternating circles per level is used.
The default value is 2.
getNumberOfAlternatingCircles()
,
setLayoutMode(int)
public final int getNumberOfAlternatingCircles()
ALTERNATING_RADIAL
.setNumberOfAlternatingCircles(int)
public void setRespectNodeSizes(boolean respect)
true
, the spacing parameters are
interpreted as the minimum distance between the node borders. If the
argument is false
, the spacing parameters are
interpreted as the minimum distance between the node centers.
If respecting node sizes is disabled, the level alignment option has no effect.
This is an expert option. The default is true
. It makes
sense to switch this option off only if all nodes already have
approximately the same size and the spacing parameters are larger
than the largest node. If the option is switched off, large nodes may
otherwise overlap. In particular, it is recommended keeping the
option enabled if orthogonal links are used.
setLevelAlignment(int)
,
isRespectNodeSizes()
public boolean isRespectNodeSizes()
true
if the algorithm tries to respect the size
of the nodes, and false
otherwise.setRespectNodeSizes(boolean)
public final void setLevelAlignment(int alignment)
This feature sets the alignment of the nodes within each level. It
can be used in layout modes LEVEL
, RADIAL
, and
ALTERNATING_RADIAL
. It has an effect only if the respect
node sizes option is enabled.
If the nodes are center-justified, all nodes of the same level are
placed with their centers along a line. Otherwise, all nodes of the
same level are placed with the specified border justified to a line.
For instance, if the link flow direction is to the right, the
alignment NORTH
means that the nodes are justified to the
left and the alignment SOUTH
means that the nodes are
justified to the right.
In the radial layout modes, the alignment NORTH
means that
the nodes are aligned along a circle with the border that is closer
to the root, and the alignment SOUTH
means that the nodes
are aligned along a circle with the border that is farther away from
the root.
The default value is CENTER
.
getLevelAlignment()
,
setLayoutMode(int)
,
setFlowDirection(int)
,
setRespectNodeSizes(boolean)
public final int getLevelAlignment()
setLevelAlignment(int)
public final void setGlobalAlignment(int alignment)
CENTER
- a parent is centered above its child nodes,
taking the center of the child nodes into account.BORDER_CENTER
- a parent is centered above its child
nodes, taking the border of the child nodes into account. This
differs from the alignment CENTER
if the Respect node sizes
option is enabled.EAST
- a parent is aligned to the border of its
easternmost child node.WEST
- a parent is aligned to the border of its
westernmost child node.TIP_OVER_EAST
- a parent is outside the border of the
child nodes, and the child nodes are placed sequentially instead of
in parallel. The child nodes are on the east side of the parent. This
alignment option is not possible in the radial or level layout
modes.TIP_OVER_WEST
- a parent is outside the border of the
child nodes, and the child nodes are placed sequentially instead of
in parallel. The child nodes are on the west side of the parent. This
alignment option is not possible in the radial or level layout
modes.TIP_OVER_EAST_WEST
- similar to TIP_OVER_EAST
or TIP_OVER_WEST
, but the child nodes are arranged on both
sides of the link segment that starts at the parent node. The first
child node is placed on the east side. Further child nodes are placed
on the east or west side, so that the space used on both sides is
roughly the same, that is, the subtrees on the east side have roughly
the same sum of heights as the subtrees on the west side. This
alignment option is not possible in the radial or level layout
modes.TIP_OVER_BOTH_SIDES
- similar to TIP_OVER_EAST
or TIP_OVER_WEST
, but the child nodes are arranged in pairs
on both sides of the link segment that starts at the parent node.
Unlike TIP_OVER_EAST_WEST
, this style does not try to
optimize the space used on both sides but always puts the
odd-numbered child nodes to the west and the even-numbered child
nodes to the east. The pairs of child nodes, one on the east side and
one on the west side, are aligned with one another. This alignment
option is not possible in the radial or level layout modes.MIXED
- each node can have a different alignment
option. The alignment of each individual node can be set by the
method setAlignment(Object, int)
so that different
alignments can occur in the same graph.
The default value is CENTER
.
getGlobalAlignment()
,
setLayoutMode(int)
,
setAlignment(Object, int)
,
setRespectNodeSizes(boolean)
public final int getGlobalAlignment()
setGlobalAlignment(int)
public final void setSiblingOffset(double offset)
If the flow direction is towards the top or bottom and the layout mode is not radial, this is a horizontal offset. If the flow direction is towards the left or right and the layout mode is not radial, this is a vertical offset. If the layout mode is radial, this is an offset tangential to the circles or ellipses.
This offset has no effect in balloon layout mode. Use the branch offset to control the spacing between all nodes in balloon layout mode.
If the respect node sizes option is enabled, this is the minimum offset between node borders; otherwise, it is the minimum offset between node centers.
The default value is 40
.
getSiblingOffset()
,
setFlowDirection(int)
,
setLayoutMode(int)
,
setRespectNodeSizes(boolean)
,
setBranchOffset(double)
public final double getSiblingOffset()
setSiblingOffset(double)
public final void setParentChildOffset(double offset)
If the flow direction is towards the top or bottom and the layout mode is not radial or balloon, this is a vertical offset. If the flow direction is towards the left or right and the layout mode is not radial or balloon, this is a horizontal offset. If the layout mode is radial or balloon, this is an offset radial to the circle or ellipses. In balloon mode, it corresponds to the minimal radius of the balloon.
If the respect node sizes option is enabled, this is the minimum offset between node borders; otherwise, it is the minimum offset between node centers.
The default value is 40
.
getParentChildOffset()
,
setFlowDirection(int)
,
setLayoutMode(int)
,
setRespectNodeSizes(boolean)
public final double getParentChildOffset()
setParentChildOffset(double)
public final void setBranchOffset(double offset)
If the flow direction is towards the top or bottom and the layout mode is not radial or balloon, this is a horizontal offset. If the flow direction is towards the left or right and the layout mode is not radial or balloon, this is a vertical offset. If the layout mode is radial, this is an offset tangential to the circles or ellipses.
If the layout mode is balloon, this is the minimal offset between nodes in all directions. The balloon mode does not distinguish between siblings and branches, hence the branch offset is used for all nodes.
If the respect node sizes option is enabled, this is the minimum offset between node borders; otherwise, it is the minimum offset between node centers.
The default value is 40
.
getBranchOffset()
,
setFlowDirection(int)
,
setLayoutMode(int)
,
setRespectNodeSizes(boolean)
public final double getBranchOffset()
setFlowDirection(int)
,
setBranchOffset(double)
public final void setTipOverBranchOffset(double offset)
If the flow direction is towards the top or bottom, this is a vertical offset. If the flow direction is towards the left or right, this is a horizontal offset.
If the respect node sizes option is enabled, this is the minimum offset between node borders; otherwise, it is the minimum offset between node centers.
The default value is 40
.
getTipOverBranchOffset()
,
setFlowDirection(int)
,
setLayoutMode(int)
,
setRespectNodeSizes(boolean)
public final double getTipOverBranchOffset()
setFlowDirection(int)
,
setTipOverBranchOffset(double)
public final void setAssociateOffset(double offset)
If the flow direction is toward the top or bottom, the orthogonal link segment starting at the parent is vertical, and the associates are placed left or right of this link segment. Hence it is a horizontal offset. If the flow direction is toward the left or right, the orthogonal link segment starting at the parent is horizontal, and the associates are placed above or below this link segment. Hence it is a vertical offset.
If the Respect node sizes option is enabled, this is the minimum offset between node borders; otherwise, it is the minimum offset between node centers.
The default value is 30
.
getAssociateOffset()
,
addAssociate(Object, Object)
,
setFlowDirection(int)
,
setLayoutMode(int)
,
setRespectNodeSizes(boolean)
public final double getAssociateOffset()
setAssociateOffset(double)
,
addAssociate(Object, Object)
public final void setParentChildAssociateOffset(double offset)
If the flow direction is toward the top or bottom, the orthogonal link segment starting at the parent is vertical, and the associates are placed left or right of this link segment. In this case, it is a vertical offset between parent and child. If the flow direction is toward the left or right, the orthogonal link segment starting at the parent is horizontal, and the associates are placed above or below this link segment. In this case, it is a horizontal offset between parent and child.
If the Respect node sizes option is enabled, this is the minimum offset between node borders; otherwise, it is the minimum offset between node centers.
The default value is 30
.
getParentChildAssociateOffset()
,
addAssociate(Object, Object)
,
setFlowDirection(int)
,
setLayoutMode(int)
,
setRespectNodeSizes(boolean)
public final double getParentChildAssociateOffset()
setParentChildAssociateOffset(double)
,
addAssociate(Object, Object)
public final void setAspectRatio(double aspectRatio)
width /
height
of the desired layout region.
The effect of the aspect ratio depends on the layout mode:
RADIAL
and ALTERNATING_RADIAL
,
the nodes are placed in circular layers if the aspect ratio is
1
. Otherwise, they are placed in elliptical layers.BALLOON
, the nodes are placed in
circular balloons if the aspect ratio is 1
. Otherwise,
they are placed in elliptical ballons.TIP_OVER
, TIP_ROOTS_OVER
,
TIP_LEAVES_OVER
, and TIP_ROOTS_AND_LEAVES_OVER
, the
nodes are placed as in in free mode, but local tip-over alignments
are automatically added to better fit the layout to the aspect
ratio.getAspectRatio()
,
setLayoutMode(int)
,
setAlignment(Object, int)
public final void setAspectRatio(IlvRect rect)
setAspectRatio(double aspectRatio)
public final void setAspectRatio(IlvManagerView view)
setAspectRatio(double aspectRatio)
public final double getAspectRatio()
width / height
of the desired layout region.setAspectRatio(double aspectRatio)
public final void setOverlapPercentage(double percentage)
FREE
, TIP_OVER
, TIP_ROOTS_OVER
, TIP_LEAVES_OVER
, and TIP_ROOTS_AND_LEAVES_OVER
, outgoing links of a node may, in rare
cases, cross the neighbor leaf nodes if the overlap percentage is
high. To avoid this, set the parameter to 0
%.
The default value is 30
%, which is a good compromise for
many graphs between wasting space and the risk of having links cross
nodes.
This is an expert option. In all normal cases, it is not necessary to change the option. It is recommended choosing an orthogonal fork percentage that is always larger than the overlap percentage to obtain a good layout.
This option has no effect if the respect node sizes option is disabled.
setLayoutMode(int)
,
setOrthForkPercentage(double)
,
setRespectNodeSizes(boolean)
public final double getOverlapPercentage()
setOverlapPercentage(double)
public final void setMaxChildrenAngle(int angle)
The default value is 0.
In radial mode, children of a single node may cover nearly completely one circular layer. This sometime appears to be unbalanced, in particular because the links from the node to its outermost children are likely to cross other nodes. To avoid this effect, a maximum angle can be specified so that the children are placed more in the same direction and are not spread too widely around the parent. This angular restriction is applied to all children except the children of the root node. As a side effect, specifying a small maximum children angle enlarges the radius of the circles.
It is recommended choosing a value between 30
and
180
degrees for good results. The algorithm uses a
heuristic that has precision deviations below 30
degrees
and above 180
degrees. If an aspect ratio is specified,
the layout algorithm uses ellipses instead of circles. In this case,
precision deviations may occur as well.
This is an expert option. It has no effect in layout modes other than radial.
getMaxChildrenAngle()
,
setLayoutMode(int)
,
setAspectRatio(double)
,
setAspectRatio(IlvManagerView)
,
setAspectRatio(IlvRect)
public final int getMaxChildrenAngle()
setMaxChildrenAngle(int)
public final void setFirstCircleEvenlySpacing(boolean enable)
By default, all nodes are placed as close as possible according to the offset parameters. In radial mode, this may cause the first circle to be only partially filled (that is, all nodes are placed close together at one part of the circle and there is a larger gap in another part of the circle).
To avoid this effect, you can enable the evenly spacing of the first circle. In this case, the children of the root node are placed such that their centers are approximately evenly spaced on the first circle, filling the entire circle. This may, however, cause the final result to waste much more space on the other circles.
It is disabled by default.
This is an expert option. It has no effect in layout modes other than radial. If there is east-west neighboring of the nodes in the first circle, these neighbors will not be equally spaced.
public final boolean isFirstCircleEvenlySpacing()
true
if the nodes on the first circle must be
evenly spaced in radial mode.setFirstCircleEvenlySpacing(boolean)
public final void setOrthForkPercentage(double percentage)
The default value is 45
%.
This is an expert option. In all normal cases, it is not necessary to change the option. It is recommended choosing an orthogonal fork percentage that is always larger than the overlap percentage to obtain a good layout.
setGlobalLinkStyle(int)
,
setLinkStyle(Object, int)
,
setParentChildOffset(double)
,
setOverlapPercentage(double)
public final double getOrthForkPercentage()
setOrthForkPercentage(double)
public final void setLinkStyle(Object link, int style)
MIXED_STYLE
and
the link is part of the spanning tree. If the global link style is
not MIXED_STYLE
, all links of the spanning tree have the
style that is specified as the global link style. Links that are not
part of the spanning tree have the link style NO_RESHAPE_STYLE
.
Valid values are:
ORTHOGONAL_STYLE
- the link has an orthogonal shape,
that is, a shape consisting of a sequence of orthogonal line
segments. This option is not available for the radial layout
modes.STRAIGHT_LINE_STYLE
- the link has a straight-line
shape.NO_RESHAPE_STYLE
- no reshape is performed on the
link.
The default value is STRAIGHT_LINE_STYLE
.
When the graph attached to the layout is of type IlvGrapher
,
the effect of the link reshaping depends on the type of the links and
the connectors installed at the node. For all link styles, you are
recommended to use links of type IlvPolylineLinkImage
. For the orthogonal link
style, you are additionally recommended to use link connectors of
type IlvFreeLinkConnector
. Other
link or connector types may cause an IlvInappropriateLinkException
during layout. You can use the method
and
method IlvGraphLayoutUtil.EnsureAppropriateLinkTypes
before layout, or the method IlvGraphLayoutUtil.EnsureAppropriateLinkConnectors
when the
exception is caught, to convert all links to an appropriate type.
IlvGraphLayoutUtil.EnsureAppropriateLinks
link
- The link object.style
- The style of the link shape.getLinkStyle(Object)
,
setLayoutMode(int)
,
setGlobalLinkStyle(int)
public final int getLinkStyle(Object link)
link
- The individual link.setGlobalLinkStyle(int)
,
setLinkStyle(Object, int)
public final void setEastWestNeighboring(Object eastNode, Object westNode)
westNode
is placed as the first neighbor on the same
level to the west of the eastNode
. This implies,
conversely, that the eastNode
is the first neighbor on
the same level to the east of the westNode
.
For instance, in free layout mode and with the flow direction towards
the bottom, the east node is placed as the immediate neighbor to the
right of the west node at approximately the same y
coordinate. A link between both nodes is routed as a straight
horizontal line between both nodes. In radial layout mode, the east
node is placed as the immediate neighbor in the same circle as the
west node. A link between both nodes is routed tangentially to the
node circle as a straight line.
Note that each node can have at most one east neighbor and one west neighbor.
East-west neighboring is possible even though there is no link between both nodes. The layout algorithm considers both nodes as if they were conceptually connected by a link.
eastNode
- The east neighbor of the westNode
.westNode
- The west neighbor of the eastNode
.getEastNeighbor(Object)
,
getWestNeighbor(Object)
public final void setWestEastNeighboring(Object westNode, Object eastNode)
westNode
is placed as the first neighbor on the same
level to the west of the eastNode
. This implies,
conversely, that the eastNode
is the first neighbor on
the same level to the east of the westNode
.
This method is identical to setEastWestNeighboring(Object
eastNode, Object westNode)
with a reversed argument order, and is
provided for convenience. Note that, for instance, when the flow
direction is towards the bottom, east is to the right of west, and
therefore resembles more the argument order of
setWestEastNeighboring
. When the flow direction is
towards the top, east is to the left of west, and therefore resembles
more the argument order of setEastWestNeighboring
.
westNode
- The west neighbor of the eastNode
.eastNode
- The east neighbor of the westNode
.getEastNeighbor(Object)
,
getWestNeighbor(Object)
public final Object getEastNeighbor(Object node)
null
if none was specified. It returns only the neighbor
node if it was specified by setEastWestNeighboring(java.lang.Object, java.lang.Object)
or setWestEastNeighboring(java.lang.Object, java.lang.Object)
, but not if the neighbor node was only
specified by setChildAlignment(java.lang.Object, int)
.node
- The node object.getWestNeighbor(Object)
,
setEastWestNeighboring(Object, Object)
,
setWestEastNeighboring(Object, Object)
,
setChildAlignment(Object, int)
public final Object getWestNeighbor(Object node)
null
if none was specified. It returns only the neighbor
node if it was specified by setEastWestNeighboring(java.lang.Object, java.lang.Object)
or setWestEastNeighboring(java.lang.Object, java.lang.Object)
, but not if the neighbor node was only
specified by setChildAlignment(java.lang.Object, int)
.node
- The node instance.getEastNeighbor(Object)
,
setEastWestNeighboring(Object, Object)
,
setWestEastNeighboring(Object, Object)
,
setChildAlignment(Object, int)
public final void addAssociate(Object parentNode, Object associateNode)
TIP_OVER_ASSOCIATE_BOTH_SIDES
. It is further possible to specify
the child alignment TIP_OVER_ASSOCIATE_EAST
and TIP_OVER_ASSOCIATE_WEST
for associate nodes.
Associates can be laid out in free and level mode, but not in radial mode.
Associate nodes are possible even though there is no link between the associate node and its parent node. The layout algorithm considers both nodes as if they were conceptually connected by a link.
For instance, in free layout mode and with the flow direction towards
the bottom, the first associate is placed to the left below the
parent, the second associate at approximately the same y
coordinate to the right below the parent, the third associate to the
left below the first one, the forth to the right below the second one
and so on. A link between parent and its associate node is always
routed orthogonally.
A parent can have many associate nodes, but each associate node can only have one parent.
parentNode
- The parent node of the associateNode
.associateNode
- The associate node of the parentNode
.setChildAlignment(Object, int)
,
getAssociates(Object)
,
removeAssociate(Object, Object)
public final void removeAssociate(Object parentNode, Object associateNode)
parentNode
- The parent node of the associateNode
.associateNode
- The associate node of the parentNode
.getAssociates(Object)
,
addAssociate(Object, Object)
public final void removeAllAssociates(Object parentNode)
parentNode
- The parent node of the associateNode
.getAssociates(Object)
,
addAssociate(Object, Object)
public final Object getAssociateParent(Object node)
null
if the node was never added as an associate
of a parent.node
- The node instance.null
if the node was never added as an associate of a
parent.getAssociates(Object)
,
addAssociate(Object, Object)
,
removeAssociate(Object, Object)
public final Enumeration getAssociates(Object parentNode)
addAssociate(java.lang.Object, java.lang.Object)
, but not the
associate nodes that were only specified by setChildAlignment(java.lang.Object, int)
.parentNode
- The node instance.getAssociateParent(Object)
,
addAssociate(Object, Object)
,
removeAssociate(Object, Object)
,
setChildAlignment(Object, int)
public final void setRoot(Object node)
Setting the root node by this method is identical to setting the root preference of this node to 10000.
node
- The root of the tree.getCalcRoots()
,
getSpecRoots()
,
setRootPreference(Object, int)
public final Enumeration getSpecRoots()
getCalcRoots()
.getCalcRoots()
,
isSpecRoot(Object)
,
setRoot(Object)
,
setRootPreference(Object, int)
public final boolean isSpecRoot(Object node)
true
if the input node was specified as root.
This does not necessarily mean that this node is selected as real
root, because the specification may have conflicts (for example, each
connected component can only have one root, so specifying two roots
for the same connected component causes a conflict). To check whether
the node was really used as root during the layout, call the method
isCalcRoot(Object)
.node
- The node instance.true
if the input node was specified as root.getSpecRoots()
,
isCalcRoot(Object)
,
setRoot(Object)
,
setRootPreference(Object, int)
public final Enumeration getCalcRoots()
This method can be called after layout. If more than one connected component exists, each component has a root. If no root was specified, the layout algorithm automatically selects an appropriate node. If too many roots were specified, some specified roots will not become calculated roots during layout.
getSpecRoots()
,
setRoot(Object)
,
setRootPreference(Object, int)
public final boolean isCalcRoot(Object node)
true
if the input node was used as root during
layout. This method can be called after the layout. If more than one
connected component exists, each component has a root. If no root was
specified, the layout algorithm automatically selects an appropriate
node. If too many roots were specified, some specified roots will not
become calculated roots during layout.node
- The node instance.true
if the input node was used as root during
layout.getCalcRoots()
,
setRoot(Object)
,
setRootPreference(Object, int)
public final void setRootPreference(Object node, int preference)
If a negative value is passed as input, the preference of the node is unspecified. In this case, the algorithm calculates a preference so that for directed trees the canonical root nodes with degree 0 have the highest preference.
node
- The node instance.preference
- The preference of the node to become a root node.getCalcRoots()
,
getSpecRoots()
,
getRootPreference(Object)
,
setRoot(Object)
public final int getRootPreference(Object node)
-1
.node
- The node instance.setRoot(Object)
,
setRootPreference(Object, int)
public final void setPosition(IlvPoint point, boolean isRootPosition)
If no position is specified, the layout algorithm keeps the position of the first root node unchanged.
point
- The position.isRootPosition
- If true
, it specifies the position of
the first root node. This is useful in incremental mode. If
false
, it specifies the position of the top-left
border of the layout.getPosition()
,
setRoot(Object)
,
IlvGraphLayout.setLayoutOfConnectedComponentsEnabled(boolean)
,
setIncrementalMode(boolean)
public final void setPosition(IlvPoint point)
The meaning of the position depends on the flag isRootPosition()
. If the flag is true
, it specifies
the position of the first root node. This is useful in incremental
mode. If the flag is false
, it specifies the position of
the top-left border of the layout.
If no position is specified, the layout algorithm keeps the position of the first root node unchanged.
public final IlvPoint getPosition()
setPosition(IlvPoint)
,
setPosition(IlvPoint, boolean)
,
isRootPosition()
,
setRoot(Object)
,
IlvGraphLayout.setLayoutOfConnectedComponentsEnabled(boolean)
public final void setRootPosition(boolean isRootPosition)
getPosition()
. If passed
true
the specified position means the position of the
root node. Otherwise, it means the position of the top-left border of
the layout. This can be used if connected component processing is
disabled, or if the graph is fully connected. It has no effect
otherwise.setPosition(IlvPoint, boolean)
,
setPosition(IlvPoint)
,
isRootPosition()
,
setRoot(Object)
public final boolean isRootPosition()
true
if the specified position means the position
of the root node. Otherwise, it means the position of the top-left
border of the layout. This can be used if connected component
processing is disabled, or if the graph is fully connected. It has no
effect otherwise.setPosition(IlvPoint)
,
setPosition(IlvPoint, boolean)
,
getPosition()
,
setRoot(Object)
public final void setInvisibleRootUsed(boolean flag)
setRoot(Object)
or setRootPreference(Object, int)
are the
roots of each individual component. If an invisible root is used, all
roots of each individual component are added as children to an
invisible dummy node and the layout is performed on the resulting
connected graph. By doing this, the components are arranged in the
same global structure. In particular, this is useful for the radial
layout modes to fit all components into the same global circular
layer structure instead of generating an individual circular layer
structure for each component.
Note that the layout is no longer stable on incremental changes if an invisible root is used. The layout heuristic cannot preserve the relative order of the components in this case. This means that the order of the components may change in subsequent layouts, and hence the next layout may look very different from the previous layout.
The default value is false
.
isInvisibleRootUsed()
,
setRoot(Object)
,
setRootPreference(Object, int)
,
setLayoutMode(int)
,
setIncrementalMode(boolean)
public final boolean isInvisibleRootUsed()
true
if an invisible root is used to combine
components that are disconnected from each other.setInvisibleRootUsed(boolean)
public final void setIntergraphConnectivityMode(boolean flag)
Note that this option has no effect if the generic disconnected node
placement is enabled (see IlvGraphLayout.setLayoutOfConnectedComponentsEnabled(boolean)
).
Even if this option is enabled, the Tree Layout algorithm does not route intergraph links. They should be routed by applying a Link Layout after the Tree Layout.
flag
- true
to set intergraph connectivity mode, or
false
to disable the mode.public final boolean isIntergraphConnectivityMode()
true
if the intergraph link connectivity is
considered for the partitioning of the layout into subtrees.public final void setRecursiveLeafLayoutMode(boolean flag)
The layout is suited if the nodes and links have no labels that need to be placed around the nodes and links. (Labels in the center of nodes don't cause a problem). The layout may produce suboptimal results if the nodes or links of subgraphs have very long labels that must be placed by a label layout. Since the label layout can only run after the tree layout, it will influence the bounding boxes of the subgraphs after they are already placed, which is the cause for the suboptimal result.
flag
- true
to enable the recursive leaf layout mode,
or false
to disable the mode.public final boolean isRecursiveLeafLayoutMode()
true
if the recursive layout of nested subgraphs
in leaves of the tree is enabled.public final void setRecursiveLayoutFromAncestorAllowed(boolean flag)
This option is enabled by default.
flag
- true
to allow the ancestor layout to treat the
subgraph attached to this layout, or false
otherwise.public final boolean isRecursiveLayoutFromAncestorAllowed()
true
if the layout instance of an ancestor graph
is in principle allowed to treat this subgraph in a recursive layout.
Whether the layout of the ancestor graph can handle the subgraph
attached to this layout instance depends on the parameter settings of
the ancestor layout.public final void setCategorizingLinks(boolean flag)
true
, the
next run of the layout algorithm makes the link categorization
available through the methods getCalcForwardTreeLinks()
,
getCalcBackwardTreeLinks()
, and getCalcNonTreeLinks()
. If false
, the link
categorization is not made available. This saves memory and is
faster. In this case, the methods getCalcForwardTreeLinks()
,
getCalcBackwardTreeLinks()
, and getCalcNonTreeLinks()
will return empty enumerations.
Note that only normal links can be categorized. Intergraph links are
never categorized, even if setIntergraphConnectivityMode(boolean)
is set to true
.
The default value is false
.
isCategorizingLinks()
public final boolean isCategorizingLinks()
true
if the layout algorithm stores the
categorization of links into forward, backward, and non-tree links.
Note that a run of the layout is necessary to make the categorization
available. Even if this method returns true
, the methods
getCalcForwardTreeLinks()
, getCalcBackwardTreeLinks()
, and getCalcNonTreeLinks()
return empty enumerations if there was no run of the layout.
setCategorizingLinks(boolean)
public final void setCategorizingLinksWithoutLayout(boolean flag)
Note that a run of the layout is necessary to make the categorization
available. Otherwise, the methods getCalcForwardTreeLinks()
,
getCalcBackwardTreeLinks()
, and getCalcNonTreeLinks()
return empty enumerations if there was no run
of the layout.
The default value is false
.
isCategorizingLinksWithoutLayout()
,
setCategorizingLinks(boolean)
,
setRecursiveLeafLayoutMode(boolean)
public final boolean isCategorizingLinksWithoutLayout()
true
if the layout algorithm does not really
perform a full layout. It only calculates a spanning tree but does
not move nodes or links. If categorizing links is additionally
enabled, it stores the calculated root nodes and the categorization
of links into forward, backward, and non-tree links. Since
intergraph links are never categorized, this works only in
nonrecursive mode.
Note that a run of the layout is necessary to make the categorization
available. Otherwise, the methods getCalcForwardTreeLinks()
,
getCalcBackwardTreeLinks()
, and getCalcNonTreeLinks()
return empty enumerations if there was no run
of the layout.
setCategorizingLinksWithoutLayout(boolean)
,
setCategorizingLinks(boolean)
,
setRecursiveLeafLayoutMode(boolean)
public final Enumeration getCalcForwardTreeLinks()
true
before
layout by using the method setCategorizingLinks(boolean)
.
The forward tree links have the property that the "from" node is the parent of the "to" node in the tree layout. These links are reshaped by the layout algorithm.
If the graph was not a tree, some links will not be part of the spanning tree that forms the base structure for the layout. If the graph was not a directed tree, some links need to be reversed to form the spanning tree. These links are not part of this enumeration.
Depending on whether recursive leaf mode is set, the enumeration may or may not contain intergraph links:
setIntergraphConnectivityMode(boolean)
is set
to true
.getCalcBackwardTreeLinks()
,
getCalcNonTreeLinks()
,
setRoot(Object)
,
setRecursiveLeafLayoutMode(boolean)
public final Enumeration getCalcBackwardTreeLinks()
true
before the layout by using the method setCategorizingLinks(boolean)
.
The backward tree links have the property that the "to" node is the parent of the "from" node in the tree layout. These links are reshaped by the layout algorithm.
If the graph was not a tree, some links will not be part of the spanning tree that forms the base structure for the layout. These links are not part of this enumeration. Also, links that do not need to be reversed but form the spanning tree are not part of this enumeration.
Depending on whether recursive leaf mode is set, the enumeration may contain intergraph links:
setIntergraphConnectivityMode(boolean)
is set
to true
.getCalcForwardTreeLinks()
,
getCalcNonTreeLinks()
,
setRoot(Object)
public final Enumeration getCalcNonTreeLinks()
true
before the layout by using the method setCategorizingLinks(boolean)
.
The non-tree links have the property that neither the "from" node is the parent of the "to" node nor the "to" node is the parent of the "from" node in the tree layout. These links are not reshaped by the layout algorithm.
If the graph was not a tree, some links will not be part of the
spanning tree that forms the base structure for the layout. Only
these links are part of this enumeration. If necessary, they can be
treated by a link routing layout algorithm after the tree layout (for
example, by IlvLinkLayout
).
Note that links that are removed by a layout filter, and links that are specified as fixed links or that are adjacent to fixed nodes, are not part of this enumeration even though they are also not part of the spanning tree.
Depending on the recursive leaf mode, it may contain intergraph
links. If the recursive leaf mode is switched off, only only normal
links are categorized. Intergraph links are not categorized as
non-tree links, even if setIntergraphConnectivityMode(boolean)
is set to true
.
However if the recursive leaf mode is switched on, intergraph links
that could not get reshaped by the tree layout are categorized as
non-tree links.
getCalcForwardTreeLinks()
,
getCalcBackwardTreeLinks()
,
setRoot(Object)
,
IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter)
,
IlvGraphLayout.setPreserveFixedLinks(boolean)
,
IlvGraphLayout.isPreserveFixedLinks()
public final void setNonTreeLinksStraight(boolean enable)
This option is disabled by default. When disabled, the tree layout only routes the links of the spanning tree, but no other link. When enabled, the tree layout iterates over the links obtained by getCalcNonTreeLinks()
and makes them straight.
It obeys the link clip interface and the link connection box interface when making the non-tree links straight. The tree layout can only obey the link style and the connector style of the tree links but not of the non-tree links. In particular, it is not able to route non-tree links orthogonally. Only tree-links can be routed orthogonally. Usually it is recommended to apply an additional link layout to the non-tree links if there are any. However, if the non-tree links should just be straight, this option comes in handy since an additional link layout can be omitted in this case.
isNonTreeLinksStraight()
,
getCalcNonTreeLinks()
,
setGlobalLinkStyle(int)
,
getConnectorStyle()
,
setLinkStyle(Object, int)
,
IlvGraphLayout.setPreserveFixedLinks(boolean)
,
IlvGraphLayout.isPreserveFixedLinks()
,
IlvGraphLayout.setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface)
,
IlvGraphLayout.setLinkClipInterface(IlvLinkClipInterface)
public final boolean isNonTreeLinksStraight()
true
if all non-tree links that
don't have the no-reshape link style and that are not fixed and are not incident to fixed nodes are reshaped to be straight. Otherwise, the non-tree links are not changed at all.setNonTreeLinksStraight(boolean)
public final void setAlignment(Object node, int alignment)
MIXED
.
Otherwise, all nodes have the alignment that is specified as the
global alignment. This option has no effect in balloon layout mode.
Valid values are:
CENTER
- the node is centered with respect to the
centers of its child nodes.BORDER_CENTER
- the node is centered with respect to
the border of its child nodes.EAST
- the node is aligned to the border of its
easternmost child node.WEST
- the node is aligned to the border of its
westernmost child node.TIP_OVER_EAST
- a parent is outside the border of the
child nodes, and the child nodes are placed sequentially instead of
in parallel on the east side of the parent. This alignment option is
not possible in the radial or level layout modes. TIP_OVER_WEST
- a parent is outside the border of the
child nodes, and the child nodes are placed sequentially instead of
in parallel on the west side of the parent. This alignment option is
not possible in the radial or level layout modes. TIP_OVER_EAST_WEST
- similar to TIP_OVER_EAST
or TIP_OVER_WEST
, but the child nodes are arranged on both
sides of the link segment that starts at the parent node. The first
child is placed on the east side. Further child nodes are placed on
the east or west side, so that the space used on both sides is
roughly the same, that is, the subtrees on the east side have roughly
the same sum of heights as the subtrees on the west side. This
alignment option is not possible in the radial or level layout modes.
TIP_OVER_BOTH_SIDES
- similar to TIP_OVER_EAST
or TIP_OVER_WEST
, but the child nodes are arranged in pairs
on both sides of the link segment that starts at the parent node.
Unlike the behavior with TIP_OVER_EAST_WEST
, the algorithm
does not try to optimize the space used on both sides but always puts
the odd-numbered child nodes to the west and the even-numbered child
nodes to the east, and the pairs of child nodes, one on the east side
and one on the west side, are aligned with one another. This
alignment option is not possible in the radial or level layout modes.
The default value is CENTER
.
node
- The node instance.alignment
- The alignment option of the individual node.getAlignment(Object)
,
setGlobalAlignment(int)
public final int getAlignment(Object node)
node
- The node instance.setAlignment(Object, int)
,
setGlobalAlignment(int)
public final void setChildAlignment(Object node, int alignment)
setAlignment(Object, int)
and setGlobalAlignment(int)
at the parent. Child alignments only take
effect in free and level mode but not in radial or balloon mode, and
only if the child node is not a root node of a tree.
Valid values are:
UNSPECIFIED
- no exceptional alignment is specified for
this child node.EAST_NEIGHBOR
- the child node is made a neighbor on
the east side of its parent node.WEST_NEIGHBOR
- the child node is made a neighbor on
the west side of its parent node.TIP_OVER_ASSOCIATE_BOTH_SIDES
- the child is laid out
like an associate node of its parent node. Associate nodes occur
alternating on the east and west sides of their parent node.TIP_OVER_ASSOCIATE_EAST
- the child is laid out like an
associate node of its parent node. This associate nodes occurs on the
east side of its parent node.TIP_OVER_ASSOCIATE_WEST
- the child is laid out like an
associate node of its parent node. This associate nodes occurs on the
west side of its parent node.
The default value is UNSPECIFIED
.
node
- The node instance.alignment
- The child alignment option of the input node. This
child alignment option is used to specify exceptional alignments
for the child node that differ from the alignment specified at the
parent for all child nodes.getChildAlignment(Object)
,
setAlignment(Object, int)
,
setGlobalAlignment(int)
,
setEastWestNeighboring(Object, Object)
,
addAssociate(Object, Object)
public final int getChildAlignment(Object node)
node
- The node instance.setChildAlignment(Object, int)
,
setAlignment(Object, int)
,
setGlobalAlignment(int)
public final void setEastSubtreeBlockMargin(Object node, double margin)
The default value is -1, which means no margin.
node
- The node instance.margin
- The margin on the east side of the subtree starting at the
input node.getEastSubtreeBlockMargin(Object)
public final double getEastSubtreeBlockMargin(Object node)
node
- The node instance.setEastSubtreeBlockMargin(Object, double)
public final void setWestSubtreeBlockMargin(Object node, double margin)
The default value is -1, means no margin.
node
- The node instance.margin
- The margin on the west side of the subtree starting at the
input node.getWestSubtreeBlockMargin(Object)
public final double getWestSubtreeBlockMargin(Object node)
node
- The node instance.setWestSubtreeBlockMargin(Object, double)
public final void setNorthSubtreeBlockMargin(Object node, double margin)
The default value is -1, means no margin.
node
- The node instance.margin
- The margin on the north side of the subtree starting at
the input node.getNorthSubtreeBlockMargin(Object)
public final double getNorthSubtreeBlockMargin(Object node)
node
- The node instance.setNorthSubtreeBlockMargin(Object, double)
public final void setSouthSubtreeBlockMargin(Object node, double margin)
The default value is -1, which means no margin.
node
- The node instance.margin
- The margin on the south side of the subtree starting at
the input node.getSouthSubtreeBlockMargin(Object)
public final double getSouthSubtreeBlockMargin(Object node)
node
- The node instance.setSouthSubtreeBlockMargin(Object, double)
public final void setSubtreeBlockMargin(Object node, int side, double margin)
side
parameter are
EAST
, WEST
, NORTH
, and SOUTH
. If
the value is set to a positive number, the subtree starting at this
node is considered a rectangular block, and other nodes not belonging
to this subtree are moved at least the specified margin away from
this block. Specifying subtree block margins is useful if you plan to
draw a rectangle around this subtree, since it ensures that unrelated
nodes do not extend into the rectangle.
The default value is -1, which means no margin on the specified side.
node
- The node instance.side
- The subtree side.margin
- The margin on the specified side of the subtree starting
at the input node.getSubtreeBlockMargin(Object, int)
public final double getSubtreeBlockMargin(Object node, int side)
side
parameter
are EAST
, WEST
, NORTH
, and SOUTH
.node
- The node instance.side
- The subtree side.setSubtreeBlockMargin(Object, int, double)
public boolean isLocalRecursiveLayoutNeeded(IlvLayoutProvider layoutProvider, IlvGraphLayout recLayout, IlvGraphModel rootModel, boolean traverse)
isLocalRecursiveLayoutNeeded
in class IlvGraphLayout
layoutProvider
- The object that provides a layout instance to be
used for laying out each subgraph.recLayout
- The recursive layout that started the recursive
application of layouts. This can be null
.rootModel
- The graph model that is the root of the nesting
hierarchy of graph models.traverse
- If false
, this layout is intended to be
only applied to its own graph model. If true
, this
layout is intended to be applied to its graph model and the layout
instances provided by the layoutProvider
are intended
to be applied recursively to all nested subgraph models. The
traverse flag is basically passed through from the call of IlvGraphLayout.performLayout(boolean, boolean, boolean)
.true
if it is necessary to perform the layout,
false
otherwise.IlvGraphLayout.isLayoutNeeded()
,
IlvGraphLayout.performLayout(boolean, boolean, boolean)
,
IlvGraphLayout.PerformLayout(IlvGraphModel, IlvLayoutProvider, boolean, boolean, boolean)
,
IlvRecursiveLayout
protected IlvGraphLayoutGrapherProperty createLayoutGrapherProperty(String name, boolean withDefaults)
IlvTreeLayoutGrapherProperty
that
stores the parameter settings of this layout class. The method is
used by IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout,
boolean)
to create a named property that contains parameter settings
of this layout instance.createLayoutGrapherProperty
in class IlvGraphLayout
IlvGraphLayoutGrapherProperty
,
IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout,
boolean)
,
IlvGrapherAdapter.loadParametersFromNamedProperties(IlvGraphLayout)
,
IlvGrapherAdapter.removeParametersFromNamedProperties()
protected IlvGraphLayoutNodeProperty createLayoutNodeProperty(String name, IlvGraphic node, boolean withDefaults)
IlvTreeLayoutNodeProperty
that
stores the parameter settings of this layout class for nodes. The
method is used by IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout,
boolean)
to create a named property for a node that contains
parameter settings of this layout instance for the input node.createLayoutNodeProperty
in class IlvGraphLayout
IlvGraphLayoutNodeProperty
,
IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout,
boolean)
,
IlvGrapherAdapter.loadParametersFromNamedProperties(IlvGraphLayout)
,
IlvGrapherAdapter.removeParametersFromNamedProperties()
protected IlvGraphLayoutLinkProperty createLayoutLinkProperty(String name, IlvGraphic link, boolean withDefaults)
IlvTreeLayoutLinkProperty
that
stores the parameter settings of this layout class for links. The
method is used by IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout,
boolean)
to create a named property for a link that contains
parameter settings of this layout instance for the input link.createLayoutLinkProperty
in class IlvGraphLayout
IlvGraphLayoutLinkProperty
,
IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout,
boolean)
,
IlvGrapherAdapter.loadParametersFromNamedProperties(IlvGraphLayout)
,
IlvGrapherAdapter.removeParametersFromNamedProperties()
public void layoutStepPerformed()
layoutStepPerformed
in class IlvGraphLayout
IlvGraphLayout.increasePercentageComplete(int)
public void checkAppropriateLinks() throws IlvInappropriateLinkException
checkAppropriateLinks
in class IlvGraphLayout
IlvInappropriateLinkException
IlvGraphLayout.performLayout(boolean, boolean, boolean)
,
IlvGraphLayout.performLayout(boolean, boolean)
,
IlvGraphLayout.checkAppropriateLink(java.lang.Object)
,
IlvGraphModel.setLinkCheckEnabled(boolean)
,
IlvGraphModel.setConnectionPointCheckEnabled(boolean)
,
IlvGraphLayoutUtil.EnsureAppropriateLinks(ilog.views.graphlayout.IlvGraphModel, ilog.views.graphlayout.IlvLayoutProvider)
,
IlvInappropriateLinkException
public int checkAppropriateLink(Object link)
checkAppropriateLinks()
.checkAppropriateLink
in class IlvGraphLayout
link
- The link to be checked.checkAppropriateLinks()
public IlvGraphicVector getMovingNodes()
IlvGrapherAdaper
in order to optimize for speed.getMovingNodes
in class IlvGraphLayout
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.