public class IlvHierarchicalLayout extends IlvGraphLayout
The Hierarchical Layout arranges the nodes in horizontal or vertical levels such that the majority of the links point in the same direction and the number of link crossings is small.
Here is a sample drawing produced by the Hierarchical Layout algorithm with two levels of nodes that are top-justified within each level:
Another sample drawing with eight levels follows. This graph contains a cycle and a self-loop. The direction of the flow is from top to bottom. The nodes are organized in horizontal levels.
The Hierarchical Layout algorithm supports different styles of links in the same drawing. The following sample drawing shows orthogonal, straight, and polyline links. The direction of the flow is to the right and the node levels are vertical.
The Hierarchical Layout algorithm supports port specifications. The side and index of the port where a link connects to a node can be specified. The following sample drawing shows a drawing with port specifications and orthogonal link style. The direction of the flow is from top to bottom.
To simplify the explanations of the layout parameters, we use the compass directions north, south, east, and west. The first level of the layout is the north pole. If the flow direction is top to bottom, north is always upwards, south towards the bottom, west towards the left, and east towards the right side of the layout. If the flow direction is left to right, north is left and south is right.
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 |
AUTOMATIC_PINS
Automatic connector pin option.
|
static int |
CENTERED_PINS
Centered connector pin option.
|
static int |
CLIPPED_PINS
Clipped connector pin option.
|
static int |
EAST
East port side.
|
static int |
EVENLY_SPACED_PINS
Evenly spaced connector pin option.
|
static int |
FIXED_IN_X_MODE
Fixed movement mode for the x direction.
|
static int |
FIXED_IN_Y_MODE
Fixed movement mode for the y direction.
|
static int |
FIXED_MODE
Fixed movement mode.
|
static int |
FREE_MODE
Free movement mode.
|
static int |
HIGHER_LEVELS
The leveling strategy that utilizes higher-numbered levels.
|
static int |
LOWER_LEVELS
The leveling strategy to utilize lower numbered levels.
|
static int |
MIXED_MODE
Mixed movement mode.
|
static int |
MIXED_STYLE
Mixed link shape option.
|
static int |
NO_RESHAPE_STYLE
No reshape option.
|
static int |
NORTH
North port side.
|
static int |
OPTIMAL
The optimal leveling strategy.
|
static int |
ORTHOGONAL_STYLE
Orthogonal link shape option.
|
static int |
POLYLINE_STYLE
Polyline link shape option.
|
static int |
SEMI_OPTIMAL
The semioptimal leveling strategy.
|
static int |
SOUTH
South port side.
|
static int |
SPREAD_OUT
The leveling strategy to spread the nodes over all levels.
|
static int |
STRAIGHT_LINE_STYLE
Straight-line link shape option.
|
static int |
UNSPECIFIED
Unspecified port side.
|
static int |
WEST
West port side.
|
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES
Constructor and Description |
---|
IlvHierarchicalLayout()
Creates a new instance of the Hierarchical Layout algorithm.
|
IlvHierarchicalLayout(IlvHierarchicalLayout source)
Creates a new layout instance by copying an existing one.
|
Modifier and Type | Method and Description |
---|---|
void |
addConstraint(IlvHierarchicalConstraint constraint)
Adds a constraint for the hierarchical layout.
|
protected void |
beforeLayout(boolean redraw)
Performs preprocessing operations before the layout of the entire
graph.
|
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
IlvHierarchicalLayoutGrapherProperty
that stores the parameter settings of this layout class. |
protected IlvGraphLayoutLinkProperty |
createLayoutLinkProperty(String name,
IlvGraphic link,
boolean withDefaults)
Returns a new instance of
IlvHierarchicalLayoutLinkProperty
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
IlvHierarchicalLayoutNodeProperty
that stores the parameter settings of this layout class for nodes. |
void |
detach()
Detaches the graph model from the layout instance.
|
long |
getAllowedTime()
Returns the currently allowed time for the layout algorithm in
milliseconds.
|
int |
getCalcNodeLevelIndex(Object node)
Returns the calculated level index of a node after performing a
layout.
|
int |
getCalcNodePositionIndex(Object node)
Returns the calculated index of the node position within a level after
performing a layout.
|
int |
getConnectorStyle()
Returns the style of the connectors.
|
Enumeration |
getConstraints()
Returns the constraints that have been added to the hierarchical
layout.
|
int |
getDestinationPointMode(Object link)
Returns the destination point mode of an individual link.
|
int |
getEastNumberOfPorts(Object node)
Returns the number of relative ports on the east side of a node.
|
int |
getFlowDirection()
Returns the current direction of the link flow.
|
int |
getFromPortIndex(Object link)
Returns the port index of a link at the "from" side.
|
int |
getFromPortSide(Object link)
Returns the port side of a link at the "from" side.
|
int |
getGlobalDestinationPointMode()
Returns the global mode for the connection points of the links on the
destination nodes.
|
int |
getGlobalIncrementalNodeMovementMode()
Returns the node movement mode used during incremental layout.
|
int |
getGlobalLinkStyle()
Returns the global style of the shapes of links.
|
int |
getGlobalOriginPointMode()
Returns the global mode for the connection points of the links on the
origin nodes.
|
double |
getHorizontalLinkOffset()
Returns the horizontal offset between parallel segments of links.
|
double |
getHorizontalNodeLinkOffset()
Returns the horizontal offset between a node and a link segment that
is parallel to the node border.
|
double |
getHorizontalNodeOffset()
Returns the horizontal offset between nodes.
|
double |
getIncrementalAbsoluteLevelPositionRange()
Returns the range that is considered very close to the previous node
position.
|
double |
getIncrementalAbsoluteLevelPositionTendency()
Returns the percentage of how much the layout algorithm tries to place
nodes to absolute positions within the level that are close to the
previous positions during incremental layout.
|
IlvRect |
getIncrementalNodeBoxForExpand(Object expandedNode)
Returns the effective bounding rectangle of an expanded node during
incremental layout.
|
int |
getIncrementalNodeMovementMode(Object node)
Returns the movement mode of an individual node used during
incremental layout.
|
IlvAnnealingLabelLayout |
getLabelLayout()
Returns the label layout that handles the label in recursive mode.
|
int |
getLevelingStrategy()
Returns the current hierarchical layout leveling strategy.
|
int |
getLevelJustification()
Returns the current justification within the levels.
|
float |
getLinkPriority(Object link)
Returns the priority of a link.
|
int |
getLinkStyle(Object link)
Returns the style for the shape of an individual link.
|
double |
getMaxInterLevelApertureAngle()
Returns the maximum aperture angle of the links incident to a node.
|
double |
getMinEndSegmentLength()
Returns the minimum length of the last segment of each link, that is,
the segment that is incident to the "to" node.
|
double |
getMinForkSegmentLength()
Returns the minimum length of the start or end segment of links if a
fork shape is used for these links.
|
double |
getMinStartSegmentLength()
Returns the minimum length of the first segment of each link, that is,
the segment that is incident to the "from" node.
|
IlvGraphicVector |
getMovingNodes()
Returns the vector of nodes being moved by the graph layout algorithm.
|
double |
getMultiLinkOptimizationMaxSpread()
Returns the maximum spread width for the bends introduced by the
optimization of overlapping multiple links.
|
double |
getMultiLinkOptimizationOffset()
Returns the minimum distance between bends introduced by the
optimization of overlapping multiple links.
|
Enumeration |
getNodeGroups()
Returns the node groups that occur in constraints that were added to
the hierarchical layout.
|
int |
getNorthNumberOfPorts(Object node)
Returns the number of relative ports on the north side of a node.
|
int |
getNumberOfConstraints()
Returns the number of constraints that have been added to the
hierarchical layout.
|
int |
getNumberOfLinkCrossingSweeps()
Returns the number of layer sweeps to remove link crossings.
|
int |
getNumberOfNodeGroups()
Returns the number of node groups that occur in constraints that were
added to the hierarchical layout.
|
int |
getNumberOfPorts(Object node,
int side)
Returns the specified number of relative ports of a node on the
specified side.
|
int |
getOriginPointMode(Object link)
Returns the origin point mode of an individual link.
|
IlvPoint |
getPosition()
Returns the specified position of the layout.
|
double |
getPreferredForkAxisLength()
Returns the preferred length of the axis of a fork shape.
|
int |
getSelfLinkFromPortSide()
Returns the default port side of a self-link at the "from" side.
|
int |
getSelfLinkToPortSide()
Returns the default port side of a self-link at the "to" side.
|
int |
getSouthNumberOfPorts(Object node)
Returns the number of relative ports on the south side of a node.
|
int |
getSpecNodeLevelIndex(Object node)
Returns the index of the specified level for a node.
|
int |
getSpecNodePositionIndex(Object node)
Returns the index of the specified position of a node within a level.
|
int |
getToPortIndex(Object link)
Returns the port index of a link at the "to" side.
|
int |
getToPortSide(Object link)
Returns the port side of a link at the "to" side.
|
double |
getVerticalLinkOffset()
Returns the vertical offset between parallel segments of links.
|
double |
getVerticalNodeLinkOffset()
Returns the vertical offset between a node and a link segment that is
parallel to the node border.
|
double |
getVerticalNodeOffset()
Returns the vertical offset between nodes.
|
int |
getWestNumberOfPorts(Object node)
Returns the number of relative ports on the west side of a node.
|
protected void |
init()
Initializes instance variables.
|
boolean |
isBacktrackCrossingReductionEnabled()
Returns
true if the backtrack mechanism of the link
crossing reduction phase is enabled. |
boolean |
isCrossingReductionDuringIncremental()
Returns
true if crossing reduction during incremental
layout is enabled. |
boolean |
isFromFork()
Returns
true if the fork shape is enabled for links that
start at the same source point. |
boolean |
isIncrementalAbsoluteLevelPositioning()
Returns
true if the algorithm tries to place the nodes
within the level to absolute positions that are close to the previous
positions during incremental layout. |
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 levels. |
boolean |
isLabelLayoutEnabledDuringRecLayoutMode()
Returns
true if the recursive layout mode places also the
labels of the graph. |
boolean |
isLinkCrossingFineTuningEnabled()
Returns
true if the link crossing fine tuning phase is
enabled. |
boolean |
isLinkStraighteningEnabled()
Returns
true if the link straightening phase is enabled. |
boolean |
isLinkWidthUsed()
Returns
true if the layout respects the width of links. |
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 |
isLongLinkCrossingReductionDuringIncremental()
Returns
true if the handling of long links by the
crossing reduction during incremental layout is enabled. |
boolean |
isMedianCrossingValueEnabled()
Returns
true if the median crossing value is used during
crossing reduction. |
boolean |
isMultiLinkOptimizationEnabled()
Returns
true if the optimization of overlapping multiple
links is enabled. |
boolean |
isNeighborLinksAligned()
Returns
true if links between neighbor nodes of the same
level are aligned so that they are parallel. |
boolean |
isNonorthogonalBendEliminationEnabled()
Returns
true if the bend elimination phase for
nonorthogonal links is enabled. |
boolean |
isOrthogonalStairCaseEliminationEnabled()
Returns
true if the stair case elimination phase for
orthogonal links is enabled. |
boolean |
isPolylineLinkOverlapReductionEnabled()
Returns
true if the optimization of polyline links is
enabled to avoid links overlapping large neighbor nodes. |
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 |
isRecursiveLayoutMode()
Returns
true if this layout instance handles all
subgraphs recursively that are nested into this graph. |
boolean |
isSelfLinksSameSideNested()
Returns
true if self-links that attach the same side of a
node are nested. |
boolean |
isToFork()
Returns
true if the fork shape is enabled for links that
end at the same target point. |
protected void |
layout(boolean redraw)
Computes the layout using the Hierarchical Layout algorithm.
|
void |
layoutStepPerformed()
Can be called by the layout classes when a step of the layout
algorithm has been performed.
|
void |
markForIncremental(Object nodeOrLink)
Marks the input node or link to be repositioned with the next call of
IlvGraphLayout.performLayout() if incremental mode is enabled. |
void |
removeAllConstraints()
Removes all the constraints from the hierarchical layout.
|
void |
removeConstraint()
Removes the constraint that was most recently added from the
hierarchical layout.
|
void |
removeConstraint(IlvHierarchicalConstraint constraint)
Removes the specified constraint from the hierarchical layout.
|
void |
setAllowedTime(long time)
Sets the upper limit for the duration of the layout algorithm.
|
void |
setBacktrackCrossingReductionEnabled(boolean flag)
Sets whether the backtrack mechanism of the link crossing reduction
phase is enabled.
|
void |
setConnectorStyle(int style)
Sets the style of connectors.
|
void |
setCrossingReductionDuringIncremental(boolean enable)
Sets whether crossing reduction during incremental layout is enabled.
|
void |
setDestinationPointMode(Object link,
int mode)
Sets the mode for the connection point of an individual link on the
destination node.
|
void |
setEastNumberOfPorts(Object node,
int numberOfPorts)
Sets the number of relative ports on the east side of a node.
|
void |
setFlowDirection(int direction)
Sets the direction of the link flow.
|
void |
setFromFork(boolean enable)
Sets whether a fork shape is created for links that start at the same
source point.
|
void |
setFromPortIndex(Object link,
int portIndex)
Sets the port index of a link at the "from" side.
|
void |
setFromPortSide(Object link,
int side)
Sets the port side of a link at the "from" side.
|
void |
setGlobalDestinationPointMode(int mode)
Sets the global mode for the connection point of the links on the
destination nodes.
|
void |
setGlobalIncrementalNodeMovementMode(int mode)
Sets the node movement mode used during incremental layout.
|
void |
setGlobalLinkStyle(int style)
Sets the global style of the shapes of links.
|
void |
setGlobalOriginPointMode(int mode)
Sets the global mode for the connection point of the links on the
origin nodes.
|
void |
setHorizontalLinkOffset(double offset)
Sets the horizontal offset between parallel segments of links.
|
void |
setHorizontalNodeLinkOffset(double offset)
Sets the horizontal offset between a node and a link segment that is
parallel to the node border.
|
void |
setHorizontalNodeOffset(double offset)
Sets the horizontal offset between nodes.
|
void |
setIncrementalAbsoluteLevelPositioning(boolean enable)
Sets whether it is enabled to place nodes within the level to absolute
positions that are close to the previous positions during incremental
layout.
|
void |
setIncrementalAbsoluteLevelPositionRange(double range)
Sets the range that is considered very close to the previous node
position.
|
void |
setIncrementalAbsoluteLevelPositionTendency(double percentage)
Sets the percentage how much the layout algorithm tries to place nodes
to absolute positions within the level that are close to the previous
positions during incremental layout.
|
void |
setIncrementalMode(boolean enable)
Sets whether the incremental layout mode is enabled.
|
void |
setIncrementalNodeBoxForExpand(Object expandedNode,
IlvRect rect)
Sets the effective bounding rectangle of an expanded node during
incremental layout.
|
void |
setIncrementalNodeMovementMode(Object node,
int mode)
Sets the movement mode of an individual node used during incremental
layout.
|
void |
setIntergraphConnectivityMode(boolean flag)
Sets whether the intergraph link connectivity is considered for the
partitioning of the layout into levels.
|
void |
setLabelLayoutEnabledDuringRecLayoutMode(boolean flag)
Sets whether the recursive layout mode places also the labels of the
graph.
|
void |
setLevelingStrategy(int strategy)
Sets the hierarchical layout leveling strategy.
|
void |
setLevelJustification(int justification)
Sets the justification within the levels.
|
void |
setLinkCrossingFineTuningEnabled(boolean flag)
Sets whether the link crossing fine tuning phase is enabled.
|
void |
setLinkPriority(Object link,
float priority)
Sets the priority of a link.
|
void |
setLinkStraighteningEnabled(boolean flag)
Sets whether the link straightening phase is enabled.
|
void |
setLinkStyle(Object link,
int style)
Sets the style of the shape of an individual link.
|
void |
setLinkWidthUsed(boolean used)
Sets whether the layout respects the width of links.
|
void |
setLongLinkCrossingReductionDuringIncremental(boolean enable)
Sets whether the handling of long links for crossing reduction during
incremental layout is enabled.
|
void |
setMaxInterLevelApertureAngle(double angle)
Sets the maximum aperture angle of the links incident to a node.
|
void |
setMedianCrossingValueEnabled(boolean flag)
Sets whether the median crossing value is used during crossing
reduction.
|
void |
setMinEndSegmentLength(double length)
Sets the minimum length of the last segment of each link, that is, the
segment that is incident to the "to" node.
|
void |
setMinForkSegmentLength(double length)
Sets the minimum length of the start or end segment of links if a fork
shape is used for these links.
|
void |
setMinStartSegmentLength(double length)
Sets the minimum length of the first segment of each link, that is,
the segment that is incident to the "from" node.
|
void |
setMultiLinkOptimizationEnabled(boolean flag)
Sets whether the optimization of overlapping multiple links is
enabled.
|
void |
setMultiLinkOptimizationMaxSpread(double maxSpread)
Sets the maximum spread width for the bends introduced by the
optimization of overlapping multiple links.
|
void |
setMultiLinkOptimizationOffset(double offset)
Sets the minimum distance between bends introduced by the optimization
of overlapping multiple links.
|
void |
setNeighborLinksAligned(boolean enable)
Sets whether links between neighbor nodes of the same level are
aligned so that they are strictly horizontal or vertical.
|
void |
setNonorthogonalBendEliminationEnabled(boolean flag)
Sets whether the bend elimination phase for nonorthogonal links is
enabled.
|
void |
setNorthNumberOfPorts(Object node,
int numberOfPorts)
Sets the number of relative ports on the north side of a node.
|
void |
setNumberOfLinkCrossingSweeps(int numberOfSweeps)
Sets the number of layer sweeps to remove link crossings.
|
void |
setNumberOfPorts(Object node,
int side,
int numberOfPorts)
Sets the number of relative ports of a node on a given side.
|
void |
setOriginPointMode(Object link,
int mode)
Sets the mode for the connection point on an individual link on the
origin node.
|
void |
setOrthogonalStairCaseEliminationEnabled(boolean flag)
Sets whether the stair case elimination phase for orthogonal links is
enabled.
|
void |
setPolylineLinkOverlapReductionEnabled(boolean flag)
Sets whether optimization of polyline links to avoid links overlapping
large neighbor nodes is enabled.
|
void |
setPosition(IlvPoint point)
Sets the position of the layout.
|
void |
setPreferredForkAxisLength(double length)
Sets the preferred length of the axis of a fork shape.
|
void |
setQuickAndUgly(boolean flag)
This is a convenience method to set up for a "quick and ugly" 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 |
setRecursiveLayoutMode(boolean flag)
Sets whether this layout instance handles all subgraphs recursively
that are nested into this graph.
|
void |
setSelfLinkFromPortSide(int side)
Sets the default port side of a self-link at the "from" side.
|
void |
setSelfLinksSameSideNested(boolean flag)
Sets whether self-links that attach the same side of a node are
nested.
|
void |
setSelfLinkToPortSide(int side)
Sets the default port side of a self-link at the "to" side.
|
void |
setSouthNumberOfPorts(Object node,
int numberOfPorts)
Sets the number of relative ports on the south side of a node.
|
void |
setSpecNodeLevelIndex(Object node,
int index)
Sets the index of the specified level for a node.
|
void |
setSpecNodePositionIndex(Object node,
int index)
Sets the index of the specified position of a node within a level.
|
void |
setToFork(boolean enable)
Sets whether a fork shape is created for links that end at the same
target point.
|
void |
setToPortIndex(Object link,
int portIndex)
Sets the port index of a link at the "to" side.
|
void |
setToPortSide(Object link,
int side)
Sets the port side of a link at the "to" side.
|
void |
setVerticalLinkOffset(double offset)
Sets the vertical offset between parallel segments of links.
|
void |
setVerticalNodeLinkOffset(double offset)
Sets the vertical offset between a node and a link segment that is
parallel to the node border.
|
void |
setVerticalNodeOffset(double offset)
Sets the vertical offset between nodes.
|
void |
setWestNumberOfPorts(Object node,
int numberOfPorts)
Sets the number of relative ports on the west side of a 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 links.
|
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 layout run.
|
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()
Indicates if this class supports the generic optimization of spline
control points.
|
boolean |
supportsStopImmediately()
Indicates that this layout class can interrupt the current run of
layout immediately in a controlled way.
|
void |
validateConstraints()
Performs a validation check for the constraints.
|
addGraphLayoutEventListener, addGraphLayoutParameterEventListener, afterLayoutOfSubgraph, attach, attach, beforeLayoutOfSubgraph, callLayoutStepPerformedIfNeeded, cleanGraphModel, clipAllLinks, clipLink, connectAllLinksToCenter, connectLinkToCenter, contentsChanged, createLayoutReport, 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, 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 it as the argument of the method
setLinkStyle(Object, int)
.public static final int STRAIGHT_LINE_STYLE
setGlobalLinkStyle(int)
, all links get a straight-line
shape. To specify the shape of an individual link, use it as the
argument of the method setLinkStyle(Object, int)
.public static final int ORTHOGONAL_STYLE
setGlobalLinkStyle(int)
, all links get a shape consisting of a
sequence of orthogonal line segments. To specify the shape of an
individual link, use it as the argument of the method setLinkStyle(Object, int)
.public static final int POLYLINE_STYLE
setGlobalLinkStyle(int)
, all links get a shape consisting of a
sequence of line segments (not necessarily orthogonal). To specify
the shape of an individual link, use it 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)
.public static final int AUTOMATIC_PINS
setConnectorStyle(int)
, the connector style is automatically
selected depending on the global link style.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 the link is attached to.public 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 the link is attached to.public static final int EAST
setFromPortSide(Object, int)
or setToPortSide(Object,
int)
, the link is connected to the east border of its end node at
the "from" or "to" side.setFromPortSide(Object, int)
,
setToPortSide(Object, int)
,
Constant Field Valuespublic static final int WEST
setFromPortSide(Object, int)
or setToPortSide(Object,
int)
, the link is connected to the west border of its end node at
the "from" or "to" side.setFromPortSide(Object, int)
,
setToPortSide(Object, int)
,
Constant Field Valuespublic static final int NORTH
setFromPortSide(Object, int)
or setToPortSide(Object,
int)
, the link is connected to the north border of its end node at
the "from" or "to" side.setFromPortSide(Object, int)
,
setToPortSide(Object, int)
,
Constant Field Valuespublic static final int SOUTH
setFromPortSide(Object, int)
or setToPortSide(Object,
int)
, the link is connected to the south border of its end node at
the "from" or "to" side.setFromPortSide(Object, int)
,
setToPortSide(Object, int)
,
Constant Field Valuespublic static final int UNSPECIFIED
setFromPortSide(Object, int)
or setToPortSide(Object,
int)
, the link can be connected to any border of its end node at the
"from" or "to" side.setFromPortSide(Object, int)
,
setToPortSide(Object, int)
,
Constant Field Valuespublic static final int FREE_MODE
setGlobalIncrementalNodeMovementMode(int)
, the
incremental layout is free to move the nodes. Depending on the
various parameters of the incremental mode, the layout shifts the
nodes to optimize the space usage, but the shifting does not change
the relative order of the nodes and links, so that the diagram after
an incremental layout looks very similar to the previous diagram.
To specify the mode of an individual node, use this mode as the
argument of the method setIncrementalNodeMovementMode(Object,
int)
.
When this mode is used as the argument of the method setGlobalOriginPointMode(int)
or setGlobalDestinationPointMode(int)
, the layout is free to choose
the appropriate position of the connection points, except for
"pinned" connection points (see IlvGraphModel.hasPinnedConnectionPoint(Object, boolean)
). To specify
the mode for the connection points of an individual link, use this
mode as the argument of the method setOriginPointMode(Object,
int)
or setDestinationPointMode(Object, int)
.
public static final int FIXED_MODE
setGlobalIncrementalNodeMovementMode(int)
, the
incremental layout keeps all nodes fixed. Only nodes that are marked
for incremental repositioning will be moved, and links are rerouted.
To specify the mode of an individual node, use this mode as the
argument of the method setIncrementalNodeMovementMode(Object,
int)
.
When this mode is used as the argument of the method setGlobalOriginPointMode(int)
or setGlobalDestinationPointMode(int)
, the layout must keep the
current position of the connection point. To specify the mode for the
connection points of an individual link, use this mode as the
argument of the method setOriginPointMode(Object, int)
or
setDestinationPointMode(Object, int)
.
public static final int FIXED_IN_X_MODE
setGlobalIncrementalNodeMovementMode(int)
, the incremental layout
is free to move the nodes in the y direction but keeps the nodes
fixed in the x direction.
To specify the mode of an individual node, use this mode as the
argument of the method setIncrementalNodeMovementMode(Object,
int)
.
setGlobalIncrementalNodeMovementMode(int)
,
setIncrementalNodeMovementMode(Object, int)
,
Constant Field Valuespublic static final int FIXED_IN_Y_MODE
setGlobalIncrementalNodeMovementMode(int)
, the incremental layout
is free to move the nodes in the x direction but keeps the nodes
fixed in the y direction.
To specify the mode of an individual node, use this mode as the
argument of the method setIncrementalNodeMovementMode(Object,
int)
.
setGlobalIncrementalNodeMovementMode(int)
,
setIncrementalNodeMovementMode(Object, int)
,
Constant Field Valuespublic static final int MIXED_MODE
setGlobalIncrementalNodeMovementMode(int)
, each node
can have a different movement mode during incremental layout. The
mode for an individual node can be set by the method setIncrementalNodeMovementMode(Object, int)
.
When used as the argument of the method setGlobalOriginPointMode(int)
or setGlobalDestinationPointMode(int)
, the connection point of each
link can have a different mode. The mode for the connection points of
an individual link can be set by the method setOriginPointMode(Object, int)
or setDestinationPointMode(Object, int)
.
public static final int OPTIMAL
When the layout parameter of setLevelingStrategy(int)
is set
to OPTIMAL
, the layout algorithm tries to minimize the
sum of level distances for all edges.
setLevelingStrategy(int)
,
Constant Field Valuespublic static final int SEMI_OPTIMAL
When the layout parameter of setLevelingStrategy(int)
is set
to SEMI_OPTIMAL
, the layout algorithm tries a quick
heuristic to minimize the sum of level distances for all edges. The
algorithm pulls root nodes to the highest-numbered level possible and
leaf nodes to the lowest-numbered level possible.
setLevelingStrategy(int)
,
Constant Field Valuespublic static final int HIGHER_LEVELS
When the layout parameter of setLevelingStrategy(int)
is set
to HIGHER_LEVELS
, the layout algorithm pulls nodes to
the highest-numbered level possible. Root nodes in particular are
affected.
setLevelingStrategy(int)
,
Constant Field Valuespublic static final int LOWER_LEVELS
When the layout parameter of setLevelingStrategy(int)
is set
to LOWER_LEVELS
, the layout algorithm pulls nodes to the
lowest-numbered level possible. This particularly effects leaf nodes.
setLevelingStrategy(int)
,
Constant Field Valuespublic static final int SPREAD_OUT
This can be considered as the inverse of the semioptimal leveling strategy. It pulls root nodes to the lowest-numbered level possible and leaf nodes to the highest-numbered level possible.
setLevelingStrategy(int)
,
Constant Field Valuespublic IlvHierarchicalLayout()
To indicate the grapher you want to lay out, use the method IlvGraphLayout.attach(IlvGrapher)
.
To indicate the graph model you want to lay out, use the method
IlvGraphLayout.attach(IlvGraphModel)
.
To perform the layout, use the method IlvGraphLayout.performLayout()
.
To modify the layout parameters, use the different methods provided in this class and its superclass.
public IlvHierarchicalLayout(IlvHierarchicalLayout 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. Hierarchical constraints are not copied.
The layout position is not copied. Only the global parameters are
copied.
copy
in class IlvGraphLayout
copyParameters(IlvGraphLayout)
,
setPosition(IlvPoint)
,
addConstraint(IlvHierarchicalConstraint)
public void copyParameters(IlvGraphLayout source)
Note that the parameters which are specific to a node or a link are not copied. Hierarchical constraints are not copied. The layout position is not copied. Only the global parameters are copied.
copyParameters
in class IlvGraphLayout
source
- The layout instance from which the parameters are copied.copy()
,
setPosition(IlvPoint)
,
addConstraint(IlvHierarchicalConstraint)
protected void beforeLayout(boolean redraw)
The default implementation calls IlvGraphModel.beforeLayout(IlvGraphLayout, boolean)
. Subclasses can
override this method to perform some initialization operations when
appropriate.
beforeLayout
in class IlvGraphLayout
IlvGraphLayout.beforeLayoutOfSubgraph(IlvGraphModel)
protected void layout(boolean redraw) throws IlvGraphLayoutException, IlvInappropriateLinkException
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.IlvInappropriateLinkException
IlvGraphLayout.performLayout()
public void setAllowedTime(long time)
The default value for Hierarchical layout is 100000000
(100000 seconds).
setAllowedTime
in class IlvGraphLayout
time
- The allowed time in milliseconds.supportsAllowedTime()
,
getAllowedTime()
,
IlvGraphLayout.isLayoutTimeElapsed()
,
IlvGraphLayoutReport.getCode()
public long getAllowedTime()
Note that the method performLayout
does NOT
automatically stop the layout when the allowed time is exceeded. It
is entirely the responsibility of the implementation of the method
layout(boolean)
to do this.
getAllowedTime
in class IlvGraphLayout
supportsAllowedTime()
,
setAllowedTime(long)
,
IlvGraphLayout.isLayoutTimeElapsed()
public final boolean supportsPreserveFixedNodes()
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
Hierarchical Layout algorithm, which may lead to node overlaps.supportsPreserveFixedNodes
in class IlvGraphLayout
true
.IlvGraphLayout.setPreserveFixedNodes(boolean)
,
IlvGraphLayout.isPreserveFixedNodes()
public final boolean supportsPreserveFixedLinks()
IlvGraphLayout.setPreserveFixedLinks(boolean)
is called with a
true
argument.supportsPreserveFixedLinks
in class IlvGraphLayout
true
.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 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, stopping the algorithm is no
longer possible and the method returns false
.stopImmediately
in class IlvGraphLayout
true
if stopping the algorithm is possible.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 on each connected component separately,
and uses the layout instance returned by the method IlvGraphLayout.getLayoutOfConnectedComponents()
to place 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 previous positions. Nodes of different components with the same specified level index are no longer aligned in levels because each component has an individual level structure.
If the generic connected component layout mechanism is disabled, the algorithm uses its own specialized internal mechanism instead of the generic mechanism. All components are merged into the same global level structure.
supportsLayoutOfConnectedComponents
in class IlvGraphLayout
true
.IlvGraphLayout.setLayoutOfConnectedComponents(IlvGraphLayout)
,
IlvGraphLayout.setLayoutOfConnectedComponentsEnabled(boolean)
,
IlvGraphLayout.performLayout(boolean, boolean)
public boolean supportsLinkConnectionBox()
Link connection points are calculated for all links except those with the no-reshape link style and fixed links. The tangential offsets provided by the link connection box interface are currently ignored.
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.
If a link clip interface is set additionally, the layout algorithm calculates the initial connection points at the node boxes with the link connection box interface and the connector style and obtains the final connection points at the border of the node shapes by clipping with the link clip interface. This works well in particular if the node box obtained by the link connection box interface is smaller than the real bounding box of the node.
supportsLinkConnectionBox
in class IlvGraphLayout
true
.IlvGraphLayout.setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface)
,
IlvGraphLayout.setLinkClipInterface(IlvLinkClipInterface)
,
setLinkStyle(Object, int)
,
setConnectorStyle(int)
,
supportsLinkClipping()
public boolean supportsLinkClipping()
Links are not clipped if they have the no-reshape link style or if
they are fixed. If a clip interface object is set using the method
, the layout algorithm uses this
object to calculate final clipped connection points for links after
some initial connection points were preliminarily obtained from the
connector style (see setLinkClipInterface
setConnectorStyle(int)
). The mechanism
works best for polyline 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, 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 in particular 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)
,
supportsLinkConnectionBox()
public boolean supportsSaveParametersToNamedProperties()
.ivl
file.supportsSaveParametersToNamedProperties
in class IlvGraphLayout
true
.IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout, boolean)
,
IlvGrapherAdapter.loadParametersFromNamedProperties(IlvGraphLayout)
,
IlvGrapherAdapter.removeParametersFromNamedProperties()
public final void setFlowDirection(int direction)
IlvDirection.Right
- the majority of the links flow to
the right. IlvDirection.Left
- the majority of the links flow to
the left. IlvDirection.Bottom
- the majority of the links flow to
the bottom. IlvDirection.Top
- the majority of the links flow to the
top. This feature sets the direction of the flow for the majority of the links in a directed graph. The layout algorithm may need to direct some links in the opposite direction of the general link flow. If the links flow to the left or right, the nodes are placed in vertical levels. If the links flow to the top or bottom, the nodes are placed in horizontal levels.
The default value is IlvDirection.Right
.
direction
- The direction of the link flow.getFlowDirection()
public final int getFlowDirection()
setFlowDirection(int)
public final void setLevelingStrategy(int strategy)
This strategy determines how nodes are distributed in the hierarchical levels. Valid values are:
OPTIMAL
: the optimal leveling strategy. The layout
algorithm tries to minimize the sum of level distances for all edges.
SEMI_OPTIMAL
: the semioptimal leveling strategy. This
strategy often gives the same result as the optimal strategy. The
layout algorithm tries a quick heuristic to minimize the sum of level
distances for all edges. It pulls root nodes to the highest-numbered
level possible and leaf nodes to the lowest-numbered level possible.
HIGHER_LEVELS
: the leveling strategy to utilize higher
numbered levels. This layout algorithm pulls nodes to the
highest-numbered level possible. Root nodes in particular are
effected. LOWER_LEVELS
: the leveling strategy to utilize lower
numbered levels. the layout algorithm pulls nodes to the
lowest-numbered level possible. Leaf nodes in particular are
effected. SPREAD_OUT
: the leveling strategy to spread the nodes
out over all levels. This can be considered as the inverse of the
semioptimal leveling strategy. It pulls root nodes to the
lowest-numbered level possible and leaf nodes to the highest-numbered
level possible. SEMI_OPTIMAL
.
The calculation of node levels can also be influenced by the following node constraints:
If the incremental mode is switched on, the leveling strategy has no
effect. The levels are calculated from the node positions, except for
those nodes that are marked for incremental recalculation. See markForIncremental(Object)
for more information.
strategy
- The leveling strategy.getLevelingStrategy()
,
markForIncremental(Object)
public final int getLevelingStrategy()
setLevelingStrategy(int)
,
markForIncremental(Object)
public final void setLevelJustification(int justification)
This feature sets the justification of the nodes within each level. 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. If the link flow direction is to the left or right, the nodes can be justified to the left, center, or right. If the link flow direction is to the top or bottom, the nodes can be justified to the top, center, or bottom.
The default value is IlvDirection.Center
.
justification
- The justification value.getLevelJustification()
,
getFlowDirection()
public final int getLevelJustification()
setLevelJustification(int)
public final void setConnectorStyle(int style)
CENTERED_PINS
- The link connector pins are placed in
the center of the border the link is attached to. CLIPPED_PINS
- Each link pointing to the center of the
node is clipped at the node border. EVENLY_SPACED_PINS
- The link connector pins are evenly
spaced along the node border. AUTOMATIC_PINS
- The connector style is selected
depending on the link style.
The default value is AUTOMATIC_PINS
.
The connector style is used to place the connector pins of links that have the free origin or destination point mode and no specified port index. Links with fixed point mode do not change their connection point at the origin node. Links with specified port indexes are connected to the corresponding connector pin of the port instead. The placement of connector pins also depends on the link clip interface and the connection box interface, in the following way:
IlvGraphLayout.setLinkConnectionBoxInterface(ilog.views.graphlayout.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. IlvGraphLayout.setLinkClipInterface(IlvLinkClipInterface)
, the
connector pins are corrected by clipping with that interface.
If you specify port sides but no port numbers for links (see
setFromPortSide(Object, int)
and setToPortSide(Object, int)
), then it is recommended to avoid CLIPPED_PINS
, since they do not reflect the port side precisely
enough. Only centered or evenly spaced link connector pins display
the port side precisely.
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. For links that have free origin
or destination point mode, we recommend using link connectors of type
IlvFreeLinkConnector
. Other
connector types may cause an IlvInappropriateLinkException
during layout. You can use the method IlvGraphLayoutUtil.EnsureAppropriateLinks(ilog.views.graphlayout.IlvGraphModel, ilog.views.graphlayout.IlvLayoutProvider)
when the exception is
caught to install the appropriate connectors.
style
- The connector style.getConnectorStyle()
,
setFromPortIndex(Object, int)
,
setToPortIndex(Object, int)
,
supportsLinkClipping()
,
supportsLinkConnectionBox()
,
setGlobalOriginPointMode(int)
,
setOriginPointMode(Object, int)
,
setGlobalDestinationPointMode(int)
,
setDestinationPointMode(Object, int)
public final int getConnectorStyle()
setConnectorStyle(int)
public final void setFromFork(boolean enable)
CENTERED_PINS
, or if the links start at the same
specified port index at the north or south side of a node, or if the
links have the fixed origin point mode and are placed at exactly the
same coordinate.
The default value is false
.
enable
- true
to enable fork shape creation, or
false
to disable it.setConnectorStyle(int)
,
setFromPortIndex(Object, int)
,
setGlobalOriginPointMode(int)
,
setOriginPointMode(Object, int)
,
isFromFork()
public final boolean isFromFork()
true
if the fork shape is enabled for links that
start at the same source point.setFromFork(boolean)
public final void setToFork(boolean enable)
CENTERED_PINS
, or if the links start at the same specified port
index at the north or south side of a node, or if the links have the
fixed origin point mode and are placed at exactly the same
coordinate.
The default value is false
.
enable
- true
to enable fork shape creation, or
false
to disable it.setToPortIndex(Object, int)
,
setGlobalDestinationPointMode(int)
,
setDestinationPointMode(Object, int)
,
isToFork()
public final boolean isToFork()
true
if the fork shape is enabled for links that
end at the same target point.setToFork(boolean)
public void setMinForkSegmentLength(double length)
The default value is 10
.
length
- The minimum length of forking segments.setFromFork(boolean)
,
getMinForkSegmentLength()
public final double getMinForkSegmentLength()
setMinForkSegmentLength(double)
public void setPreferredForkAxisLength(double length)
Note this length is only a hint for the layout algorithm. If there is not enough free space, the layout algorithm decreases the length of the axis below the preferred length. If there is enough free space, it may also increase the length of the axis in order to reduce unnecessary link bends.
The default value is 10
.
length
- The preferred length of the axis of a fork shape.setFromFork(boolean)
,
setToFork(boolean)
,
getPreferredForkAxisLength()
public final double getPreferredForkAxisLength()
setPreferredForkAxisLength(double)
public final void setGlobalLinkStyle(int style)
POLYLINE_STYLE
- All links get a polyline shape, that
is, a shape consisting of a sequence of line segments. ORTHOGONAL_STYLE
- All links get an orthogonal shape,
that is, a shape consisting of a sequence of orthogonal line
segments. STRAIGHT_LINE_STYLE
- All links get 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 style of shape.
The default value is POLYLINE_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
and, for links that have
free origin or destination point mode, link connectors of type IlvFreeLinkConnector
. Other link or
connector types may cause an IlvInappropriateLinkException
during layout. You can use the method IlvGraphLayoutUtil.EnsureAppropriateLinks(ilog.views.graphlayout.IlvGraphModel, ilog.views.graphlayout.IlvLayoutProvider)
before layout or when the
exception is caught to convert all links and link connectors to an
appropriate type.
style
- The global style value.getGlobalLinkStyle()
,
setLinkStyle(Object, int)
public final int getGlobalLinkStyle()
setGlobalLinkStyle(int)
,
setLinkStyle(Object, int)
public final void setLinkStyle(Object link, int style)
MIXED_STYLE
.
Otherwise, all links have the style that is specified as the global
link style.
Valid values are:
POLYLINE_STYLE
- The link gets a polyline shape, that
is, a shape consisting of a sequence of line segments. ORTHOGONAL_STYLE
- The link gets an orthogonal shape,
that is, a shape consisting of a sequence of orthogonal line
segments. STRAIGHT_LINE_STYLE
- The link gets a straight-line
shape. NO_RESHAPE_STYLE
- No reshape is performed on the link.
The default value is POLYLINE_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
and, for links that have
free origin or destination point mode, link connectors of type IlvFreeLinkConnector
. Other link or
connector types may cause an IlvInappropriateLinkException
during layout. You can use the method IlvGraphLayoutUtil.EnsureAppropriateLinks(ilog.views.graphlayout.IlvGraphModel, ilog.views.graphlayout.IlvLayoutProvider)
before layout or when the
exception is caught to convert all links to an appropriate type.
link
- The link.style
- The shape style.setGlobalLinkStyle(int)
,
getLinkStyle(Object)
public final int getLinkStyle(Object link)
link
- The link.setGlobalLinkStyle(int)
,
setLinkStyle(Object, int)
public final void setHorizontalNodeOffset(double offset)
The default value is 40
.
offset
- The horizontal offset value.getHorizontalNodeOffset()
public final double getHorizontalNodeOffset()
setHorizontalNodeOffset(double)
public final void setVerticalNodeOffset(double offset)
The default value is 40
.
offset
- The vertical offset value.getVerticalNodeOffset()
public final double getVerticalNodeOffset()
setVerticalNodeOffset(double)
public final void setHorizontalLinkOffset(double offset)
The default value is 15
.
offset
- The horizontal offset value.getHorizontalLinkOffset()
public final double getHorizontalLinkOffset()
setHorizontalLinkOffset(double)
public final void setVerticalLinkOffset(double offset)
The default value is 15
.
offset
- The vertical offset value.getVerticalLinkOffset()
public final double getVerticalLinkOffset()
setVerticalLinkOffset(double)
public final void setHorizontalNodeLinkOffset(double offset)
The default value is 20
.
offset
- The horizontal offset value.getHorizontalNodeLinkOffset()
public final double getHorizontalNodeLinkOffset()
setHorizontalNodeLinkOffset(double)
public final void setVerticalNodeLinkOffset(double offset)
The default value is 20
.
offset
- The vertical offset value.getVerticalNodeLinkOffset()
public final double getVerticalNodeLinkOffset()
setVerticalNodeLinkOffset(double)
public final void setMaxInterLevelApertureAngle(double angle)
This parameter only has an effect if none of the links has the orthogonal link style. It is best suited if the link style is for polyline links. It defines the maximum angle of the link segments that run between the levels of the hierarchical layout.
The maximum angle is given in degrees, it must be between 10 and 90 degrees.
If the flow direction of the layout is vertical, that is, to the bottom or to the top, a strictly vertical link segment has an aperture of 0, and a strictly horizontal link segment has aperture of 90. By limiting the maximum aperture angle, you ensure that the slope of segments between levels is more vertical than horizontal. That is to say, the slope of the link is in the flow direction of the layout. To ensure the slope of the segments, the vertical space between the levels is enlarged.
If the flow direction of the layout is horizontal, that is, to the left or to the right, a strictly vertical link segment has an aperture of 90, and a strictly horizontal link segment has an aperture of 0. By limiting the maximum aperture angle, you ensure that the slope of segments between levels is more horizontal than vertical. To ensure the slope of the segments, the horizontal space between the levels is enlarged.
If the maximum aperture is set to 90, the aperture angle has no influence on the space between levels. This is the default.
Very small maximum aperture angles are not recommended. The resulting layout may waste too much space between the node levels.
angle
- The maximum aperture angle of the links incident to a node.getMaxInterLevelApertureAngle()
,
setFlowDirection(int)
,
setGlobalLinkStyle(int)
public final double getMaxInterLevelApertureAngle()
setMaxInterLevelApertureAngle(double)
public final void setLinkWidthUsed(boolean used)
CLIPPED_PINS
or CENTERED_PINS
.
If true
is passed as the argument, the distribution of
the connector pins varies depending on the link width. The horizontal
or vertical offset between pairs of links or links and nodes is with
respect to the link border. If false
is passed as the
argument, the distribution of connector pins is independent of the
link width. The horizontal or vertical offset between pairs of links
or links and nodes is with respect to the link center.
The default is false
.
used
- true
to take link width into account when
spacing connector pins, or false
to ignore link width
(the default).isLinkWidthUsed()
,
setHorizontalNodeLinkOffset(double)
,
setVerticalNodeLinkOffset(double)
,
setHorizontalLinkOffset(double)
,
setVerticalLinkOffset(double)
,
getConnectorStyle()
public final boolean isLinkWidthUsed()
true
if the layout respects the width of links.setLinkWidthUsed(boolean)
public final void setMinStartSegmentLength(double length)
The default value is 0
.
length
- The minimum starting link segment.getMinStartSegmentLength()
,
setMinEndSegmentLength(double)
public final double getMinStartSegmentLength()
setMinStartSegmentLength(double)
public final void setMinEndSegmentLength(double length)
The default value is 0
.
length
- The minimum ending link segment.getMinEndSegmentLength()
,
setMinStartSegmentLength(double)
public final double getMinEndSegmentLength()
setMinEndSegmentLength(double)
public final void setPosition(IlvPoint point)
If a position is specified, the layout algorithm places the graph
such that the specified point is the upper-left corner. If no
position is specified, in incremental mode the layout algorithm
places the graph close to its previous position before layout
started, and in nonincremental mode it places the graph so that
(0, 0)
is the upper-left corner.
The default value is null
.
point
- The position.getPosition()
,
IlvGraphLayout.setLayoutOfConnectedComponentsEnabled(boolean)
,
setIncrementalMode(boolean)
public final IlvPoint getPosition()
Returns null
if no position was specified. This can be
used if connected component processing is disabled or if the graph is
fully connected. It has no effect otherwise.
setPosition(IlvPoint)
,
IlvGraphLayout.setLayoutOfConnectedComponentsEnabled(boolean)
public final void setLinkPriority(Object link, float priority)
link
- The link.priority
- The link priority value, a number up to 10000.getLinkPriority(Object)
public final float getLinkPriority(Object link)
link
- The link instance.setLinkPriority(Object, float)
public final void setFromPortIndex(Object link, int portIndex)
Port numbers are between 0
and n - 1
, where
n
is the number of ports at the node side where the link
is connected. Links with an unspecified or negative port index are
connected on the node border according to the global connector style.
A link with a specified port index i
is connected at the
ith relative port, and the connector pins of ports are evenly
spaced on the corresponding node border.
link
- The link.portIndex
- The relative port index starting from 0
.getFromPortIndex(Object)
,
setToPortIndex(Object, int)
,
setFromPortSide(Object, int)
,
setNumberOfPorts(Object, int, int)
,
setConnectorStyle(int)
,
setGlobalOriginPointMode(int)
,
setOriginPointMode(Object, int)
public int getFromPortIndex(Object link)
-1
if the port index is unspecified.link
- The link instance.-1
if the port index is unspecified.setFromPortIndex(Object, int)
public final void setToPortIndex(Object link, int portIndex)
Port numbers are between 0
and n - 1
, where
n
is the number of ports at the node side where the link
is connected. Links with an unspecified or negative port index are
connected on the node border according to the global connector style.
A link with specified port index i
is connected at the
ith relative port, and the connector pins of ports are evenly
spaced on the corresponding node border.
link
- The link.portIndex
- The relative port index starting from 0
.getToPortIndex(Object)
,
setFromPortIndex(Object, int)
,
setToPortSide(Object, int)
,
setNumberOfPorts(Object, int, int)
,
setConnectorStyle(int)
,
setGlobalDestinationPointMode(int)
,
setDestinationPointMode(Object, int)
public int getToPortIndex(Object link)
-1
if the port index is unspecified.link
- The link instance.-1
if the port index is unspecified.setToPortIndex(Object, int)
public final void setFromPortSide(Object link, int side)
Possible values for the side
parameter are EAST
, WEST
, NORTH
, SOUTH
, and the
default UNSPECIFIED
.
If a port side is unspecified, the link can connect to any border side of the node. Otherwise, the link connects only to the specified node border.
link
- The link.side
- The side of the node from which the link is connected.getFromPortSide(Object)
,
setToPortSide(Object, int)
,
setSelfLinkFromPortSide(int)
,
setFromPortIndex(Object, int)
,
setConnectorStyle(int)
public int getFromPortSide(Object link)
link
- The link instance.setFromPortSide(Object, int)
public final void setToPortSide(Object link, int side)
Possible values for the side
parameter are EAST
, WEST
, NORTH
, SOUTH
, and the
default UNSPECIFIED
.
If a port side is unspecified, the link can connect to any border side of the node. Otherwise, the link connects only to the specified node border.
link
- The link.side
- The side of the node to which the link is connected.getToPortSide(Object)
,
setFromPortSide(Object, int)
,
setSelfLinkToPortSide(int)
,
setToPortIndex(Object, int)
,
setConnectorStyle(int)
public int getToPortSide(Object link)
link
- The link instance.setToPortSide(Object, int)
public final void setSelfLinkFromPortSide(int side)
Possible values for the side
parameter are EAST
, WEST
, NORTH
, SOUTH
. The default
value is SOUTH
.
side
- The side of the node to which the self-link is connected.getSelfLinkFromPortSide()
,
setSelfLinkToPortSide(int)
,
setFromPortSide(Object, int)
public final int getSelfLinkFromPortSide()
setSelfLinkFromPortSide(int)
,
setFromPortSide(Object, int)
public final void setSelfLinkToPortSide(int side)
Possible values for the side
parameter are EAST
, WEST
, NORTH
, SOUTH
. The default
value is WEST
.
side
- The side of the node to which the self-link is connected.getSelfLinkToPortSide()
,
setSelfLinkFromPortSide(int)
,
setToPortSide(Object, int)
public final int getSelfLinkToPortSide()
setSelfLinkToPortSide(int)
,
setToPortSide(Object, int)
public final void setSelfLinksSameSideNested(boolean flag)
This is an expert option. It is enabled by default.
flag
- true
to enable the nesting of self-links or
false
to disable it.isSelfLinksSameSideNested()
public final boolean isSelfLinksSameSideNested()
true
if self-links that attach the same side of a
node are nested.setSelfLinksSameSideNested(boolean)
public final void setNumberOfPorts(Object node, int side, int numberOfPorts)
side
parameter are EAST
, WEST
, NORTH
, and SOUTH
.
Using the relative ports is a way to specify the relative order of how the links connect to the node. The ports of a node side can be considered as connector pins that are evenly spaced on the node border. Links can connect to specific pins by setting the "from" port index or the "to" port index of the link.
If the "from" port index or the "to" port index of any link connecting to the node is greater than the specified number of ports of this node, the number of ports is automatically adjusted.
node
- The node.side
- The side of the node for the ports.numberOfPorts
- The number of relative ports.getNumberOfPorts(Object, int)
,
setFromPortIndex(Object, int)
,
setToPortIndex(Object, int)
public int getNumberOfPorts(Object node, int side)
side
parameter
are EAST
, WEST
, NORTH
, SOUTH
.
Returns -1
if the number of ports is unspecified.node
- The node.side
- The side of the node.setNumberOfPorts(Object, int, int)
,
setFromPortIndex(Object, int)
,
setToPortIndex(Object, int)
public final void setEastNumberOfPorts(Object node, int numberOfPorts)
node
- The node.numberOfPorts
- The number of relative ports.setNumberOfPorts(Object, int, int)
,
getEastNumberOfPorts(Object)
public final int getEastNumberOfPorts(Object node)
-1
if the number of ports is unspecified.node
- The node.-1
if the number is unspecified.setNumberOfPorts(Object, int, int)
,
setEastNumberOfPorts(Object, int)
public final void setWestNumberOfPorts(Object node, int numberOfPorts)
node
- The node.numberOfPorts
- The number of relative ports.setNumberOfPorts(Object, int, int)
,
getWestNumberOfPorts(Object)
public final int getWestNumberOfPorts(Object node)
-1
if the number of ports is unspecified.node
- The node.-1
if the number is unspecified.setNumberOfPorts(Object, int, int)
,
setWestNumberOfPorts(Object, int)
public final void setNorthNumberOfPorts(Object node, int numberOfPorts)
node
- The node.numberOfPorts
- The number of relative ports.setNumberOfPorts(Object, int, int)
,
getNorthNumberOfPorts(Object)
public final int getNorthNumberOfPorts(Object node)
-1
if the number of ports is unspecified.node
- The node.-1
if the number is unspecified.setNumberOfPorts(Object, int, int)
,
setNorthNumberOfPorts(Object, int)
public final void setSouthNumberOfPorts(Object node, int numberOfPorts)
node
- The node.numberOfPorts
- The number of relative ports.setNumberOfPorts(Object, int, int)
,
getSouthNumberOfPorts(Object)
public final int getSouthNumberOfPorts(Object node)
-1
if the number of ports is unspecified.node
- The node.-1
if the number is unspecified.setNumberOfPorts(Object, int, int)
,
setSouthNumberOfPorts(Object, int)
public final void setSpecNodeLevelIndex(Object node, int index)
0
to
n
. If the link flow direction is from top to bottom, the
nodes with level index 0
are placed in the topmost
level, and the nodes with higher level indexes are placed in the
levels below. If the link flow direction is from left to right, the
nodes with level index 0
are placed in the leftmost
level, and the nodes with higher level indexes are placed in the
levels farther to the right.
This method allows you to specify the level where a node should be placed. If the level index of a node is set to a negative value, it means that there is no preference for the level of the node. In this case, the layout algorithm calculates an appropriate level index.
The default level index of a node is -1
; that is, the
layout algorithm determines the appropriate level automatically.
Note that specified level indexes can cause conflicts to constraints
that are solved depending on the constraint priorities. The index
specification or some of the constraints may be ignored in this case.
Furthermore, note that if the generic connected component layout
mechanism of the IlvGraphLayout
base class is enabled,
each connected component uses its own level structure. If it is
disabled, there is only one global level structure.
node
- The node.index
- The level index.getFlowDirection()
,
getSpecNodeLevelIndex(Object)
,
addConstraint(IlvHierarchicalConstraint)
,
supportsLayoutOfConnectedComponents()
public final int getSpecNodeLevelIndex(Object node)
node
- The node instance.setSpecNodeLevelIndex(Object, int)
,
getCalcNodeLevelIndex(Object)
public final int getCalcNodeLevelIndex(Object node)
performLayout
,
it returns -1
. Nodes are organized in horizontal or
vertical levels numbered from 0
to n
. If
the link flow direction is from top to bottom, the nodes with level
index 0
are placed in the topmost level, and the nodes
with higher level indexes are placed in the levels below. If the link
flow direction is from left to right, the nodes with level index
0
are placed in the leftmost level, and the nodes with
higher level indexes are placed in the levels more to the right.
Note the difference between calculated and specified level index: The
layout algorithm assigns level indexes to all nodes even if no level
index is specified. Therefore, the method getSpecNodeLevelIndex(Object)
returns -1
for nodes
that have no level index specified, but the method getCalcNodeLevelIndex(Object)
returns a nonnegative number, that
is, the real index of the level after layout.
Note that if the generic connected component layout mechanism of the
IlvGraphLayout
base class is enabled, each connected
component uses its own level structure. If it is disabled, there is
only one global level structure.
node
- The node.-1
if no
layout has been performed.getFlowDirection()
,
getSpecNodeLevelIndex(Object)
,
detach()
,
IlvGraphLayout.performLayout()
,
supportsLayoutOfConnectedComponents()
public final void setSpecNodePositionIndex(Object node, int index)
0
to n
. If the link flow
direction is from top to bottom, the node with position index
0
is placed leftmost within its level, and the nodes
with higher position indexes are placed farther to the right. If the
link flow direction is from right to left, the node with position
index 0
is placed topmost within its level, and the
nodes with higher position indexes are placed below.
This method allows you to specify the relative position where a node should be placed within its level. If the position index of a node is set to a negative value, it means that there is no preference for the position of the node. In this case, the layout algorithm calculates an appropriate position index. If the position index is higher than the number of nodes in the level, the position index is ignored. If two nodes of the same level have the same position index, one of the indexes is ignored. The layout algorithm calculates an appropriate position index for the nodes that have inappropriate or conflicting position indexes.
The default position index of a node is -1
; that is, the
layout algorithm determines the appropriate position automatically.
Note that specified position indexes can cause conflicts to
constraints that are solved depending on the constraint priorities.
The index specification or some of the constraints may be ignored in
this case. Furthermore, note that if the generic connected component
layout mechanism of the IlvGraphLayout
base class is
enabled, each connected component uses its own level structure. If it
is disabled, there is only one global level structure.
node
- The node.index
- The position index within a level, starting from
0
.getFlowDirection()
,
getSpecNodePositionIndex(Object)
,
addConstraint(IlvHierarchicalConstraint)
,
supportsLayoutOfConnectedComponents()
public final int getSpecNodePositionIndex(Object node)
node
- The node instance.setSpecNodePositionIndex(Object, int)
,
getCalcNodePositionIndex(Object)
public final int getCalcNodePositionIndex(Object node)
performLayout
, it returns -1
. Nodes are
organized in horizontal or vertical levels. Within each level, the
nodes are placed sequentially at relative positions numbered from
0
to n
. If the link flow direction is from
top to bottom, the node with position index 0
is placed
leftmost within its level, and the nodes with higher position indexes
are placed farther to the right. If the link flow direction is from
right to left, the node with position index 0
is placed
topmost within its level, and the nodes with higher position indexes
are placed below.
Note the difference between calculated and specified position index:
The layout algorithm assigns position indexes to all nodes, even if
no position index is specified. Therefore, the method getSpecNodePositionIndex(Object)
returns -1
for nodes
that have no position index specified, but the method getCalcNodePositionIndex(Object)
returns a nonnegative number, that
is, the real index of the position within its level after layout.
Note, if the generic connected component layout mechanism of the
IlvGraphLayout
base class is enabled, each connected
component uses its own level structure. If it is disabled, there is
only one global level structure.
node
- The node.-1
if
no layout has been performed.getFlowDirection()
,
getSpecNodePositionIndex(Object)
,
detach()
,
IlvGraphLayout.performLayout()
,
supportsLayoutOfConnectedComponents()
public final void setGlobalOriginPointMode(int mode)
FREE_MODE
- For all links, the layout is free to choose
the appropriate position of the connection point on the origin node,
except for "pinned" connection points (see IlvGraphModel.hasPinnedConnectionPoint(Object, boolean)
). The choice
can further be influenced by specifying the side and the port index
of the links. FIXED_MODE
- For all links, the layout must keep the
current position of the connection point on the origin node. This can
be useful, in particular, if the node has fixed pins where the link
is attached (as, for instance, with IlvPinLinkConnector
) and
the pins should not be moved by the layout algorithm.
The fixed mode works only if the link connector delivers
consistently the same connection point when called multiple times. If
a link is not connected to a link connector, or if the IlvClippingLinkConnector
is used, the real connection point is
calculated on the fly and may change when called multiple times with
changing link bends. In this case, the fixed mode cannot ensure a
correct routing of the links.
Note that if the mode is fixed, specifications of the port index of links at the "from" side are ignored.
MIXED_MODE
- Each link can have a different mode for
the connection point on the origin node. The mode of each individual
link can be set by the method setOriginPointMode(Object,
int)
.
Unless the global mode is MIXED_MODE
, the connection points
on the origin node have the same mode for all the links.
The default value is FREE_MODE
.
mode
- The global mode to set.getGlobalOriginPointMode()
,
setFromPortIndex(Object, int)
,
IlvPinLinkConnector
public final int getGlobalOriginPointMode()
setGlobalOriginPointMode(int)
public final void setGlobalDestinationPointMode(int mode)
FREE_MODE
- For all links, the layout is free to choose
the appropriate position of the connection point on the destination
node, except for "pinned" connection points (see IlvGraphModel.hasPinnedConnectionPoint(Object, boolean)
). The choice
can further be influenced by specifying the side and the port index
of the links. FIXED_MODE
- For all links, the layout must keep the
current position of the connection point on the destination node.
This can be useful, in particular, if the node has fixed pins where
the link is attached (as, for instance, with IlvPinLinkConnector
) and the pins should not be moved by the layout
algorithm.
The fixed mode works only if the link connector delivers
consistently the same connection point when called multiple times. If
a link is not connected to a link connector, or if the IlvClippingLinkConnector
is used, the real connection point is
calculated on the fly and may change when called multiple times with
changing link bends. In this case, the fixed mode cannot ensure a
correct routing of the links.
Note that if the mode is fixed, specifications of the port index of links at the "to" side are ignored.
MIXED_MODE
- Each link can have a different mode for
the connection point on the destination node. The mode of each
individual link can be set by the method setDestinationPointMode(Object, int)
.
Unless the global mode is MIXED_MODE
, the connection points
on the destination node have the same mode for all the links.
The default value is FREE_MODE
.
mode
- The global mode to set.getGlobalDestinationPointMode()
,
setToPortIndex(Object, int)
,
IlvPinLinkConnector
public final int getGlobalDestinationPointMode()
setGlobalDestinationPointMode(int)
public final void setOriginPointMode(Object link, int mode)
MIXED_MODE
. Otherwise, the connection points on
the origin nodes have, for all the links, the mode that is specified
as the global origin point mode.
Valid values are:
FREE_MODE
- The layout is free to choose, for this
link, the appropriate position of the connection point on the origin
node, except for "pinned" connection points (see IlvGraphModel.hasPinnedConnectionPoint(Object, boolean)
). The choice
can further be influenced by specifying the side and the port index
of the links. FIXED_MODE
- The layout must keep, for this link, the
current position of the connection point on the origin node. This can
be useful, in particular, if the node has fixed pins where the link
is attached (as, for instance, with IlvPinLinkConnector
) and
the pins should not be moved by the layout algorithm.
The fixed mode works only if the link connector delivers
consistently the same connection point when called multiple times. If
a link is not connected to a link connector, or if the IlvClippingLinkConnector
is used, the real connection point is
calculated on the fly and may change when called multiple times with
changing link bends. In this case, the fixed mode cannot ensure a
correct routing of the links.
Note that if the mode is fixed, specifications of the port index of links at the "from" side are ignored.
The default value is FREE_MODE
.
link
- The link.mode
- The mode to set.getOriginPointMode(Object)
,
setGlobalOriginPointMode(int)
,
setFromPortIndex(Object, int)
public int getOriginPointMode(Object link)
link
- The link.setGlobalOriginPointMode(int)
,
setOriginPointMode(Object, int)
public final void setDestinationPointMode(Object link, int mode)
MIXED_MODE
. Otherwise, the connection points
on the destination nodes have, for all the links, the mode that is
specified as the global destination point mode.
Valid values are:
FREE_MODE
- The layout is free to choose, for this
link, the appropriate position of the connection point on the
destination node, except for "pinned" connection points (see IlvGraphModel.hasPinnedConnectionPoint(Object, boolean)
). The choice
can further be influenced by specifying the side and the port index
of the links. FIXED_MODE
- The layout must keep, for this link, the
current position of the connection point on the destination node.
This can be useful, in particular, if the node has fixed pins where
the link is attached (as, for instance, with IlvPinLinkConnector
) and the pins should not be moved by the layout
algorithm.
The fixed mode works only if the link connector delivers
consistently the same connection point when called multiple times. If
a link is not connected to a link connector, or if the IlvClippingLinkConnector
is used, the real connection point is
calculated on the fly and may change when called multiple times with
changing link bends. In this case, the fixed mode cannot ensure a
correct routing of the links.
Note that if the mode is fixed, specifications of the port index of links at the "to" side are ignored.
The default value is FREE_MODE
.
link
- The link.mode
- The mode to set.getDestinationPointMode(Object)
,
setGlobalDestinationPointMode(int)
,
setToPortIndex(Object, int)
public int getDestinationPointMode(Object link)
link
- The link.setGlobalDestinationPointMode(int)
,
setDestinationPointMode(Object, int)
public final void setIncrementalMode(boolean enable)
true
, the layout respects the current coordinates of
nodes and links, and it tries to create a layout with similar
positions. Depending on the incremental node movement mode, the
layout may need to shift all nodes to optimize the space usage, but
the shifting does not change the relative order of the nodes and
links, so that the diagram after an incremental layout looks very
similar to the previous diagram.
The levels are arranged based on the current coordinates of the nodes. Thus, the specified node level and position indexes are ignored during incremental layout.
The incremental mode is disabled by default.
enable
- true
to enable the incremental layout mode,
or false
to disable it.isIncrementalMode()
,
setGlobalIncrementalNodeMovementMode(int)
,
setIncrementalNodeMovementMode(Object, int)
,
markForIncremental(Object)
,
setSpecNodeLevelIndex(Object, int)
,
setSpecNodePositionIndex(Object, int)
public final boolean isIncrementalMode()
true
if the incremental mode is enabled.setIncrementalMode(boolean)
public final void markForIncremental(Object nodeOrLink)
IlvGraphLayout.performLayout()
if incremental mode is enabled. Normally,
the incremental layout tries to preserve the relative order of nodes
and links. By setting a mark on a node, the level assignment and
relative position of this node will be calculated from scratch. By
setting a mark on a link, this link will be rerouted completely by
the next layout. The mark is transient, that is, it is automatically
cleared after an incremental layout is done.nodeOrLink
- The input node or link to mark.setIncrementalMode(boolean)
,
IlvGraphLayout.performLayout()
public final void setCrossingReductionDuringIncremental(boolean enable)
false
,
the layout preserves the relative order of the nodes and the links
within the levels. If the argument is true
, the layout
preserves the level structure but reorders the nodes within the
levels to avoid link crossings.
It is disabled by default.
enable
- true
to enable crossing reduction during
incremental layout, or false
to disable it.isCrossingReductionDuringIncremental()
,
setIncrementalMode(boolean)
,
IlvGraphLayout.performLayout()
public final boolean isCrossingReductionDuringIncremental()
true
if crossing reduction during incremental
layout is enabled.setCrossingReductionDuringIncremental(boolean)
public final void setLongLinkCrossingReductionDuringIncremental(boolean enable)
false
, the layout preserves the relative
order of the nodes and the links within the levels. If the argument
is true
, the layout preserves the level structure and
the relative order of the nodes, but reroutes the links in order to
avoid link crossings. This means a long link may cross a level
between a different pair of nodes than before layout.
It is disabled by default.
enable
- true
to enable long link crossing reduction
during incremental layout, or false
to disable it.isLongLinkCrossingReductionDuringIncremental()
,
setIncrementalMode(boolean)
,
IlvGraphLayout.performLayout()
public final boolean isLongLinkCrossingReductionDuringIncremental()
true
if the handling of long links by the
crossing reduction during incremental layout is enabled.setLongLinkCrossingReductionDuringIncremental(boolean)
public final void setIncrementalAbsoluteLevelPositioning(boolean enable)
If the incremental mode is enabled and crossing reduction during
incremental layout is disabled, the layout arranges the nodes such
that the relative order of the nodes within each level is preserved.
If this parameter is set to false
, nodes may be placed
at absolute positions far from the previous positions, even though
their relative order does not change, because the main objective of
the algorithm is to produce a balanced layout.
To help the user preserve a mental map of the graph, this parameter
should be set to true
. In this case, the nodes are
placed closer to their previous positions, even though this may
result in a less balanced layout.
The freedom of incremental level positioning can be controlled by the
tendency to preserve the previous node position (see setIncrementalAbsoluteLevelPositionTendency(double)
) and the range
that is considered to be close enough to the previous node position
setIncrementalAbsoluteLevelPositionRange(double)
).
It is enabled by default.
enable
- true
to enable close repositioning of nodes
during incremental layout, at the expense of completely balancing
the layout. A value of false
will give priority to
balancing the layout regardless of node displacements.isIncrementalAbsoluteLevelPositioning()
,
setIncrementalMode(boolean)
,
setCrossingReductionDuringIncremental(boolean)
,
IlvGraphLayout.performLayout()
public final boolean isIncrementalAbsoluteLevelPositioning()
true
if the algorithm tries to place the nodes
within the level to absolute positions that are close to the previous
positions during incremental layout.setIncrementalAbsoluteLevelPositioning(boolean)
public final void setIncrementalAbsoluteLevelPositionTendency(double percentage)
In nonincremental mode, nodes are placed within the level in order to balance the layout. If the incremental absolute level positioning is used, nodes should be placed close to their previous positions, but the layout should also be balanced. Both criteria compete with each other. The position tendency influences how the competing criteria are resolved. A high position tendency has the effect that the nodes stay closer to their previous positions, and a low position tendency has the effect that the nodes stay closer to the balanced position. Passing the position tendency 0 has basically the same effect as disabling the incremental absolute level positioning.
The input value is a percentage between 0
and
100
. The default value is 70
percent.
percentage
- The percentage value for the absolute level position
tendency, a number between 0
and 100
.getIncrementalAbsoluteLevelPositionTendency()
,
setIncrementalAbsoluteLevelPositioning(boolean)
,
setIncrementalMode(boolean)
,
setCrossingReductionDuringIncremental(boolean)
,
IlvGraphLayout.performLayout()
public final double getIncrementalAbsoluteLevelPositionTendency()
setIncrementalAbsoluteLevelPositionTendency(double)
public final void setIncrementalAbsoluteLevelPositionRange(double range)
In nonincremental mode, nodes are placed within the level in order to balance the layout. If the incremental absolute level positioning is used, nodes should be placed close to their previous positions, but the layout should also be balanced. Both criteria compete with each other. The position range influences how the competing criteria are resolved. If a node is placed within this range to its previous position, the balance criteria is used to determine its position. If the node is placed farther away from its previous position, the position tendency is used to determine its position.
A node that is placed within the incremental position range to its previous position is placed at the best balanced position. This avoids having the balance of nodes that are already close to the previous position being disturbed by an additional tendency towards the previous position.
The default value is 20
.
range
- The value of the absolute level position range.getIncrementalAbsoluteLevelPositionRange()
,
setIncrementalAbsoluteLevelPositioning(boolean)
,
setIncrementalMode(boolean)
,
setCrossingReductionDuringIncremental(boolean)
,
IlvGraphLayout.performLayout()
public final double getIncrementalAbsoluteLevelPositionRange()
setIncrementalAbsoluteLevelPositionRange(double)
public final void setIncrementalNodeBoxForExpand(Object expandedNode, IlvRect rect)
In this context, we call expand any interactive operation that changes the size of the node to make it very large while preserving the center position of the node. The typical purpose of an expand operation is to change the graphical representation of the node to show more details in the inner of the node. For instance, an expand operation may show a subgraph in the inner of the node. Often, an incremental re-layout is desired after an expand operation.
The challenge of the re-layout after an expand operation consists of the fact that the node may become so large that it overlaps many nodes. This may yield undesired effects during incremental layout, because incremental layout is unable to determine the level structure from the coordinates of the nodes if some node overlaps many other nodes completely.
To facilitate the incremental layout, the old bounding box of the expanded node, as it was before the expand operation, must be specified as the effective bounding box. This helps the incremental layout determine the proper level structure.
The effective bounding box has no effect if incremental layout is
disabled, or if the node is marked for incremental recalculation. The
effective bounding box is transient, that is, it is automatically
removed after each successful layout and not stored into
.ivl
files.
expandedNode
- The expanded node.rect
- The effective bounding rectangle.getIncrementalNodeBoxForExpand(Object)
,
setIncrementalMode(boolean)
,
markForIncremental(Object)
,
IlvGraphLayout.performLayout()
public final IlvRect getIncrementalNodeBoxForExpand(Object expandedNode)
null
in this case. It returns a meaningful value only
when the effective bounding box was set but layout was not yet
performed.expandedNode
- The expanded node.setIncrementalNodeBoxForExpand(Object, IlvRect)
public final void setGlobalIncrementalNodeMovementMode(int mode)
FREE_MODE
- The incremental layout preserves the
relative order of nodes but does not preserve the exact position of
nodes. It may move the nodes a little bit to optimize the space
usage. The shifting does not change the level structure of the graph.
If crossing reduction is disabled during incremental layout (see
setCrossingReductionDuringIncremental(boolean)
), the
shifting also does not change the order of the nodes within the
levels. FIXED_IN_X_MODE
- The incremental layout preserves the
relative order of nodes and keeps the nodes fixed in the x direction.
The nodes may shift in the y direction. FIXED_IN_Y_MODE
- The incremental layout preserves the
relative order of nodes and keeps the nodes fixed in the y direction.
The nodes may shift in the x direction. FIXED_MODE
- The nodes do not move at all during
incremental layout. Only nodes that are marked for incremental
repositioning will be moved, and links are rerouted. MIXED_MODE
- Each node that is not marked for
incremental can have a different mode. The mode of each individual
node can be set by the method setIncrementalNodeMovementMode(Object, int)
. Mixing fixed and free
nodes should only be done in exceptional cases, because it may create
overlaps or a messy arrangement.
Nodes that are marked for incremental are placed in a nonincremental
way without respecting the previous position. The incremental
movement mode has no effect for these nodes. Unless the global mode
is MIXED_MODE
, all nodes that are not marked for incremental
are placed according to the same mode.
The default mode is FREE_MODE
.
If the incremental mode is enabled and nodes are fixed in the x or y
direction, it works well if the graph has a coarsely level structure
(for example, if it was created by a previous layout in free mode or
in nonincremental mode) but it may create overlaps or a messy
arrangement otherwise. Fixing nodes has several consequences: The
spacing options are obeyed only if there is enough space between the
fixed nodes. The specified position of the layout is not obeyed,
because it would require shifting the fixed nodes. The crossing
reduction during incremental layout has no effect (see isCrossingReductionDuringIncremental()
). However, you can decide
whether to enable the crossing reduction of long links (see isLongLinkCrossingReductionDuringIncremental()
). If the long link
crossing reduction is enabled, it will rearrange the long links that
span several levels to avoid crossings.
Furthermore, note that if the generic connected component layout
mechanism of the IlvGraphLayout
base class is enabled,
it will move nodes even if they are specified as fixed. Therefore, it
is recommended disabling the generic connected component layout
mechanism.
mode
- The node movement mode to set.getGlobalIncrementalNodeMovementMode()
,
setIncrementalNodeMovementMode(Object, int)
,
setIncrementalMode(boolean)
,
markForIncremental(Object)
,
setHorizontalNodeOffset(double)
,
setHorizontalLinkOffset(double)
,
setHorizontalNodeLinkOffset(double)
,
setVerticalNodeOffset(double)
,
setVerticalLinkOffset(double)
,
setVerticalNodeLinkOffset(double)
,
setPosition(IlvPoint)
public final int getGlobalIncrementalNodeMovementMode()
setGlobalIncrementalNodeMovementMode(int)
public final void setIncrementalNodeMovementMode(Object node, int mode)
MIXED_MODE
, and
the node is not marked for incremental recalculation. If the global
movement mode is not MIXED_MODE
, all nodes have the mode
that is specified as the global movement mode.
Valid values are:
FREE_MODE
- The incremental layout preserves the
relative order of the node with respect to all other nodes (except
those that are marked for incremental recalculation). It does not
preserve the exact position. It may move the node a little bit to
optimize the space usage. The shifting does not change the level
structure of the graph. If the crossing reduction is disabled during
incremental layout (see setCrossingReductionDuringIncremental(boolean)
), the shifting also
does not change the order of the node within the levels with respect
to the other nodes. FIXED_IN_X_MODE
- The incremental layout preserves the
relative order of the node with respect to all other nodes (except
those that are marked for incremental recalculation), and it keeps
the node fixed in the x direction. The node may shift in the y
direction. FIXED_IN_Y_MODE
- The incremental layout preserves the
relative order of the node with respect to all other nodes (except
those that are marked for incremental recalculation), and it keeps
the node fixed in the y direction. The nodes may shift in the x
direction. FIXED_MODE
- The node does not move at all during
incremental layout.
The default mode is FREE_MODE
.
If the incremental mode is enabled and some nodes are fixed in the x
or y direction, it often works well if the graph has a coarsely level
structure (for example, if it was created by a previous layout in
free mode or in nonincremental mode) but it may create overlaps or a
messy arrangement otherwise, in particular if only few nodes are
fixed and many nodes are free to move. Fixing nodes has several
consequences: The spacing options are obeyed only if there is enough
space between the fixed nodes. The specified position of the layout
is not obeyed, because it would require shifting the fixed nodes. The
crossing reduction during incremental layout has no effect (see
isCrossingReductionDuringIncremental()
). However, you can
decide whether to enable the crossing reduction of long links (see
isLongLinkCrossingReductionDuringIncremental()
). If the long
link crossing reduction is enabled, it will rearrange the long links
that span several levels to avoid crossings.
Furthermore, note that if the generic connected component layout
mechanism of the IlvGraphLayout
base class is enabled,
it will move nodes even if they are specified as fixed. Therefore it
is recommended disabling the generic connected component layout
mechanism.
node
- The node.mode
- The movement mode to set.setGlobalIncrementalNodeMovementMode(int)
,
getIncrementalNodeMovementMode(Object)
,
setIncrementalMode(boolean)
,
markForIncremental(Object)
,
setHorizontalNodeOffset(double)
,
setHorizontalLinkOffset(double)
,
setHorizontalNodeLinkOffset(double)
,
setVerticalNodeOffset(double)
,
setVerticalLinkOffset(double)
,
setVerticalNodeLinkOffset(double)
,
setPosition(IlvPoint)
public final int getIncrementalNodeMovementMode(Object node)
node
- The node.setGlobalIncrementalNodeMovementMode(int)
,
setIncrementalNodeMovementMode(Object, int)
public final void addConstraint(IlvHierarchicalConstraint constraint)
If many constraints are specified, it may happen that the constraints are contradicting (for instance, node A cannot be below node B and above node B at the same time). In this case, a constraint conflict resolution is automatically started. It takes the constraint priorities into account when deciding which constraints cannot be satisfied. The more conflicts, the more layout time is necessary. Therefore, it is recommended specifying constraints without obvious conflicts when possible.
When the graph model gets detached, all constraints are removed.
constraint
- The constraint to add.IlvSameLevelConstraint
,
IlvLevelRangeConstraint
,
IlvRelativeLevelConstraint
,
IlvGroupSpreadConstraint
,
removeConstraint(IlvHierarchicalConstraint)
,
getConstraints()
,
getNumberOfConstraints()
,
detach()
public final void removeAllConstraints()
addConstraint(IlvHierarchicalConstraint)
public final void removeConstraint(IlvHierarchicalConstraint constraint)
constraint
- The constraint to be removed.addConstraint(IlvHierarchicalConstraint)
public final void removeConstraint()
addConstraint(IlvHierarchicalConstraint)
public final int getNumberOfConstraints()
addConstraint(IlvHierarchicalConstraint)
public final Enumeration getConstraints()
enumeration.nextElement()
). However, it is unsafe to
remove any other constraint from the layout during the iteration.addConstraint(IlvHierarchicalConstraint)
,
removeConstraint(IlvHierarchicalConstraint)
public final void validateConstraints()
The validation check is automatically performed during layout. In the most cases, it is not necessary to call this method directly. Only in a memory-critical application may you want to perform the validation check explicitly, if you added many constraints and removed many constrained nodes from the graph without performing any layout.
Do not confuse the validation check with the automatic constraint conflict resolution. The validation check removes constraints that no longer make sense in the current graph. After the validation check, there may still be conflicting constraints in the hierarchical layout. The constraint conflict resolution also happens automatically during layout. However, the resolution does not remove conflicting constraints from the layout. It only decides not to satisfy them.
addConstraint(IlvHierarchicalConstraint)
,
removeConstraint(IlvHierarchicalConstraint)
,
IlvGraphLayout.performLayout()
public int getNumberOfNodeGroups()
IlvNodeGroup
,
addConstraint(IlvHierarchicalConstraint)
,
getNodeGroups()
public Enumeration getNodeGroups()
IlvNodeGroup
,
IlvLevelRangeConstraint
,
IlvRelativeLevelConstraint
,
IlvGroupSpreadConstraint
,
addConstraint(IlvHierarchicalConstraint)
,
getNumberOfNodeGroups()
public final void setPolylineLinkOverlapReductionEnabled(boolean flag)
If the graph has a huge number of links, it is recommended switching this optimization off, because it is very time-consuming.
The optimization is enabled by default.
isPolylineLinkOverlapReductionEnabled()
public final boolean isPolylineLinkOverlapReductionEnabled()
true
if the optimization of polyline links is
enabled to avoid links overlapping large neighbor nodes.setPolylineLinkOverlapReductionEnabled(boolean)
public final void setMultiLinkOptimizationEnabled(boolean flag)
setMultiLinkOptimizationOffset(double)
.
The optimization is enabled by default.
isMultiLinkOptimizationEnabled()
public final boolean isMultiLinkOptimizationEnabled()
true
if the optimization of overlapping multiple
links is enabled.setMultiLinkOptimizationEnabled(boolean)
public final void setMultiLinkOptimizationOffset(double offset)
The default value is 10
.
offset
- The offset value.getMultiLinkOptimizationOffset()
,
setMultiLinkOptimizationEnabled(boolean)
,
setMultiLinkOptimizationMaxSpread(double)
public final double getMultiLinkOptimizationOffset()
setMultiLinkOptimizationOffset(double)
,
setMultiLinkOptimizationEnabled(boolean)
public final void setMultiLinkOptimizationMaxSpread(double maxSpread)
The default value is 50
.
maxSpread
- The maximum spread value.getMultiLinkOptimizationMaxSpread()
,
setMultiLinkOptimizationOffset(double)
,
setMultiLinkOptimizationEnabled(boolean)
public final double getMultiLinkOptimizationMaxSpread()
setMultiLinkOptimizationMaxSpread(double)
,
setMultiLinkOptimizationEnabled(boolean)
public final void setNeighborLinksAligned(boolean enable)
It is enabled by default.
If neighbor links are not aligned and have the orthogonal style, the spacing between the link segments may be slightly smaller than the specified offset between links. If the incremental node movement mode is fixed, it is not always possible to create aligned links between neighbor nodes, due to the fixed positions of the nodes.
enable
- true
to enable alignment of neighbor nodes
regardless of link style, or false
to disable the
strict alignment option.isNeighborLinksAligned()
,
setConnectorStyle(int)
,
setGlobalLinkStyle(int)
,
setHorizontalLinkOffset(double)
,
setVerticalLinkOffset(double)
public final boolean isNeighborLinksAligned()
true
if links between neighbor nodes of the same
level are aligned so that they are parallel.setNeighborLinksAligned(boolean)
public final void setIntergraphConnectivityMode(boolean flag)
This is an expert option. It is disabled by default.
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 Hierarchical Layout algorithm does not route intergraph links. They should be routed by applying a Link Layout after the Hierarchical 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 levels.public final void setRecursiveLayoutMode(boolean flag)
In detail: the recursive mode causes the hierarchical layout
instances of the subgraphs to delegate the work to this layout. If
the layout instance of a subgraph is no
IlvHierarchicalLayout
, the subgraph is not handled by
this layout. Layout parameters per node and link must be set on the
layout instance of the subgraph the node or link belongs to.
flag
- true
to enable the recursive layout mode, or
false
to disable the mode.public final boolean isRecursiveLayoutMode()
true
if this layout instance handles all
subgraphs recursively that are nested into this graph.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 IlvAnnealingLabelLayout getLabelLayout()
public final void setLabelLayoutEnabledDuringRecLayoutMode(boolean flag)
getLabelLayout()
, which is attached at the same grapher as this
layout instance. The placement of labels is enabled by default.flag
- true
to enable the placement of labels. or
false
to disable it.public final boolean isLabelLayoutEnabledDuringRecLayoutMode()
true
if the recursive layout mode places also the
labels of the graph.public final void setLinkStraighteningEnabled(boolean flag)
This is an expert option. It is enabled by default. It is normally not necessary to disable link straightening, except if you need to speed up the layout.
flag
- true
to enable the link straightening phase, or
false
to disable it.isLinkStraighteningEnabled()
public final boolean isLinkStraighteningEnabled()
true
if the link straightening phase is enabled.setLinkStraighteningEnabled(boolean)
public final void setOrthogonalStairCaseEliminationEnabled(boolean flag)
This is an expert option. It is enabled by default. It is normally not necessary to disable stair case elimination, except if you need to speed up the layout.
flag
- true
to enable the stair case elimination
phase, or false
to disable it.isOrthogonalStairCaseEliminationEnabled()
public final boolean isOrthogonalStairCaseEliminationEnabled()
true
if the stair case elimination phase for
orthogonal links is enabled.setOrthogonalStairCaseEliminationEnabled(boolean)
public final void setNonorthogonalBendEliminationEnabled(boolean flag)
This is an expert option. It is disabled by default. Enabling the bend elimination produces more straight links but also slows down the algorithm. In recursive mode, it might be useful to enable this option since the recursive mode produces many small link segments between bends.
flag
- true
to enable the bend elimination phase, or
false
to disable it.isNonorthogonalBendEliminationEnabled()
,
setRecursiveLayoutMode(boolean)
public final boolean isNonorthogonalBendEliminationEnabled()
true
if the bend elimination phase for
nonorthogonal links is enabled.setNonorthogonalBendEliminationEnabled(boolean)
public final void setBacktrackCrossingReductionEnabled(boolean flag)
This is an expert option. It is enabled by default. It is normally not necessary to disable the backtrack mechanism, except if you need to speed up the layout.
flag
- true
to enable backtracking during link
crossing reduction (the default), or false
to disable
it.isBacktrackCrossingReductionEnabled()
public final boolean isBacktrackCrossingReductionEnabled()
true
if the backtrack mechanism of the link
crossing reduction phase is enabled.setBacktrackCrossingReductionEnabled(boolean)
public final void setMedianCrossingValueEnabled(boolean flag)
This is an expert option. It is enabled by default. It is normally not necessary to change this value. However, if many nodes have very high numbers of incoming or outgoing links, the calculation of the "median" weight may slow down the layout. In this case, you can switch this option off.
flag
- true
to enable use of the median crossing
value, or false
to disable it.isMedianCrossingValueEnabled()
public final boolean isMedianCrossingValueEnabled()
true
if the median crossing value is used during
crossing reduction.setMedianCrossingValueEnabled(boolean)
public final void setNumberOfLinkCrossingSweeps(int numberOfSweeps)
This is an expert option. The default value is 5. It is normally not necessary to change this value.
numberOfSweeps
- The number of sweeps to remove link crossings.getNumberOfLinkCrossingSweeps()
public final int getNumberOfLinkCrossingSweeps()
setNumberOfLinkCrossingSweeps(int)
public final void setLinkCrossingFineTuningEnabled(boolean flag)
This is an expert option. It is enabled by default. It is normally not necessary to disable fine tuning, except if you need to speed up the layout.
flag
- true
to enable the link crossing fine tuning
phase, or false
to disable it.isLinkCrossingFineTuningEnabled()
public final boolean isLinkCrossingFineTuningEnabled()
true
if the link crossing fine tuning phase is
enabled.setLinkCrossingFineTuningEnabled(boolean)
public boolean supportsSplineRouting()
If spline links such as IlvSplineLinkImage
and IlvGeneralLink
are used, the bend
points calculated by the layout algorithm are often suboptimal. A
generic optimization mechanism is available, it is enabled by calling
IlvGraphLayout.setSplineRoutingEnabled(boolean)
.
supportsSplineRouting
in class IlvGraphLayout
true
.IlvGraphLayout.setSplineRoutingEnabled(boolean)
,
IlvGraphLayout.setMinSplineCurveSize(double)
,
IlvGraphLayout.setMaxSplineCurveSize(double)
,
IlvGraphLayout.setBalanceSplineCurveThreshold(double)
,
IlvGraphLayout.setSplineLinkFilter(IlvSplineLinkFilter)
public final void setQuickAndUgly(boolean flag)
true
, it changes various layout parameters
so that the algorithm runs maximally fast. However, the quality of
the result may decrease. If you pass false
, it sets the
parameters back to the original values.
It is normally not necessary to use a quick and ugly layout, because the default layout parameters are chosen carefully so that the speed difference should be very small. However, if you lay out a huge graph and the performance is too slow, you can easily test with the quick and ugly layout whether changing parameters would improve the performance noticeably.
flag
- true
to enable "QuickAndUgly" flag, or
false
to disable it.setLinkStraighteningEnabled(boolean)
,
setBacktrackCrossingReductionEnabled(boolean)
,
setMedianCrossingValueEnabled(boolean)
,
setNumberOfLinkCrossingSweeps(int)
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)
IlvHierarchicalLayoutGrapherProperty
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)
IlvHierarchicalLayoutNodeProperty
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)
IlvHierarchicalLayoutLinkProperty
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 detach()
attach
. The detach
method performs cleaning
operations on the graph model. In addition to the cleaning operations
in the base class, Hierarchical Layout removes all local
specifications per node or link. It also removes the calculated level
index and calculated position index from the nodes.
Note that you must call this method when you no longer need the layout instance. Otherwise, some objects may not be garbage collected.
detach
in class IlvGraphLayout
IlvGraphLayout.attach(IlvGraphModel)
,
setSpecNodeLevelIndex(Object, int)
,
setSpecNodePositionIndex(Object, int)
,
getCalcNodeLevelIndex(Object)
,
getCalcNodePositionIndex(Object)
,
setNumberOfPorts(Object, int, int)
,
setLinkPriority(Object, float)
,
setLinkStyle(Object, int)
,
setFromPortIndex(Object, int)
,
setFromPortSide(Object, int)
,
setToPortIndex(Object, int)
,
setToPortSide(Object, int)
public void cleanNode(IlvGraphModel graphModel, Object node)
cleanNode
in class IlvGraphLayout
graphModel
- The graph model to which the node
belongs.node
- The node to be cleaned.detach()
public void cleanLink(IlvGraphModel graphModel, Object link)
cleanLink
in class IlvGraphLayout
graphModel
- The graph model to which the link
belongs.link
- The link to be cleaned.detach()
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
public void layoutStepPerformed()
layoutStepPerformed
in class IlvGraphLayout
IlvGraphLayout.increasePercentageComplete(int)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.