public class IlvShortLinkLayout extends IlvGraphLayout
This algorithm reshapes the links of a graph without moving the nodes.
By default, the algorithm computes orthogonal links (that is, links
composed of alternating horizontal and vertical segments). Optionally,
direct links can be computed. (See setGlobalLinkStyle(int)
and setLinkStyle(java.lang.Object, int)
.)
The links are placed freely in the plane by choosing the best shape from a fixed number of link shapes. Orthogonal links can a maximum of 4 bends. Direct links have 3 bends.
This layout algorithm is recommended when any of the following apply:
IlvLongLinkLayout
may be more
suitable.
Here are sample drawings produced by the Short Link Layout algorithm:
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:
IlvGraphLayout.setPreserveFixedLinks(boolean)
is enabled or links that have the link style NO_RESHAPE_STYLE
are not reshaped. The incremental mode cannot be used for intergraph
links.Modifier and Type | Field and Description |
---|---|
static int |
AUTOMATIC_PINS
Automatic pin style.
|
static int |
DIRECT_STYLE
Direct link style.
|
static int |
EVENLY_SPACED_PINS
Evenly spaced pin style.
|
static int |
FIRST_LAST_SEGMENT
Simple link bundles.
|
static int |
FIXED_CONNECTION_POINTS_MODE
Fixed connection-points mode.
|
static int |
FIXED_MODE
Fixed mode.
|
static int |
FIXED_NODE_SIDES_MODE
Fixed node-side mode.
|
static int |
FIXED_OFFSET_PINS
Fixed-offset pin style.
|
static int |
FIXED_SHAPE_TYPE_MODE
Fixed shape-type mode.
|
static int |
FREE_MODE
Free mode.
|
static int |
IMPROVED_FIRST_LAST_SEGMENT
Improved link bundles.
|
static int |
MIXED_MODE
Mixed mode.
|
static int |
MIXED_STYLE
Mixed link shape.
|
static int |
NO_BUNDLE
No link bundles.
|
static int |
NO_RESHAPE_STYLE
No reshape link style.
|
static int |
ORTHOGONAL_STYLE
Orthogonal link style.
|
static int |
THREE_BENDS_ORTHOGONAL_STYLE
Three-bends orthogonal self-link.
|
static int |
TWO_BENDS_ORTHOGONAL_STYLE
Two-bends orthogonal self-link.
|
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES
Constructor and Description |
---|
IlvShortLinkLayout()
Creates a new instance of the Short Link Layout algorithm.
|
IlvShortLinkLayout(IlvShortLinkLayout source)
Creates a new layout instance by copying an existing one.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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
IlvShortLinkLayoutGrapherProperty
that stores the parameter settings of this layout class. |
protected IlvGraphLayoutLinkProperty |
createLayoutLinkProperty(String name,
IlvGraphic link,
boolean withDefaults)
Returns a new instance of
IlvShortLinkLayoutLinkProperty 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
IlvShortLinkLayoutNodeProperty that
stores the parameter settings of this layout class for nodes. |
void |
detach()
Detaches the graph model from the layout instance.
|
int |
getAllowedNumberOfIterations()
Returns the maximum number of allowed optimization iterations.
|
IlvLongLinkLayout |
getAuxiliaryLongLinkLayout()
Returns the instance of
IlvLongLinkLayout that is used for
avoiding overlaps between links and nodes when isLinkOverlapNodesForbidden() returns true . |
double |
getBypassDistance()
Returns the minimum distance between the origin and destination node
for which a link shape going directly from one node to another is
allowed.
|
int |
getConnectorStyle(Object node)
Returns the connector style of an individual node.
|
int |
getDestinationPointMode(Object link)
Returns the destination-point mode of an individual link.
|
double |
getEvenlySpacedPinsMarginRatio()
Returns the margin ratio for the evenly spaced pins connector style.
|
int |
getGlobalConnectorStyle()
Returns the global style of the connectors.
|
int |
getGlobalDestinationPointMode()
Returns the global mode for the connection points of the links on the
destination nodes.
|
int |
getGlobalIncrementalModifiedLinkReshapeMode()
Returns the reshape mode used during the incremental layout of
modified links.
|
int |
getGlobalIncrementalUnmodifiedLinkReshapeMode()
Returns the reshape mode used during the incremental layout of
unmodified links.
|
int |
getGlobalLinkStyle()
Returns the current choice for the style of the shape of the links.
|
int |
getGlobalOriginPointMode()
Returns the global mode for the connection points of the links on the
origin nodes.
|
int |
getGlobalSelfLinkStyle()
Returns the current choice for the style of the shape of the
self-links.
|
int |
getIncrementalModifiedLinkReshapeMode(Object link)
Returns the reshape mode of an individual link used during the
incremental layout of modified links.
|
int |
getIncrementalUnmodifiedLinkReshapeMode(Object link)
Returns the reshape mode of an individual link used during the
incremental layout of unmodified links.
|
int |
getLinkBundlesMode()
Returns the current choice for the link bundles mode.
|
double |
getLinkOffset()
Returns the offset between links connected on the same side of the
node.
|
int |
getLinkStyle(Object link)
Returns the style of the shape of an individual link.
|
double |
getLinkToLinkCrossingPenalty()
Returns the link-to-link crossing penalty factor.
|
double |
getLinkToNodeCrossingPenalty()
Returns the link-to-node crossing penalty factor.
|
double |
getMinFinalSegmentLength()
Returns the minimum length of the final segment of the links.
|
IlvNodeBoxInterface |
getNodeBoxInterface()
Returns the node box interface used during the layout.
|
IlvNodeSideFilter |
getNodeSideFilter()
Returns the node-side filter used during layout.
|
int |
getOriginPointMode(Object link)
Returns the origin-point mode of an individual link.
|
protected void |
init()
Initializes instance variables.
|
boolean |
isCombinedInterGraphLinksMode()
Returns
true if the routing of normal links in addition
to intergraph links is enabled; returns false otherwise. |
boolean |
isIncrementalMode()
Returns
true if the incremental mode is enabled. |
boolean |
isInterGraphLinksMode()
Returns
true if the routing of intergraph links is
enabled; returns false otherwise. |
boolean |
isLinkOverlapNodesForbidden()
Returns
true if the overlap of links with nodes is
forbidden; returns false otherwise. |
boolean |
isSameShapeForMultipleLinks()
Returns
true if the algorithm that makes sure that
multiple links are reshaped in the same manner is enabled, and
false otherwise. |
protected void |
layout(boolean redraw)
Computes the layout using the Short Link Layout algorithm.
|
void |
setAllowedNumberOfIterations(int iterations)
Sets the maximum number of iterations of the layout algorithm.
|
void |
setBypassDistance(double dist)
Sets the minimum distance between the origin and destination node for
which a link shape going directly from one node to another is
allowed.
|
void |
setCombinedInterGraphLinksMode(boolean enable)
Sets the routing of normal links in addition to intergraph links.
|
void |
setConnectorStyle(Object node,
int style)
Sets the connector style of an individual node.
|
void |
setDestinationPointMode(Object link,
int mode)
Sets the mode for the connection point of an individual link on the
destination node.
|
void |
setEvenlySpacedPinsMarginRatio(double ratio)
Sets the margin ratio for the evenly spaced pins connector style.
|
void |
setGlobalConnectorStyle(int style)
Sets the global style of connectors.
|
void |
setGlobalDestinationPointMode(int mode)
Sets the global mode for the connection point of the links on the
destination nodes.
|
void |
setGlobalIncrementalModifiedLinkReshapeMode(int mode)
Sets the reshape mode used during the incremental layout of modified
links, that is, links that have already been laid out in the previous
layout execution and for which either the bounding box (see
getNodeBoxInterface() or the "link connection box" (see IlvGraphLayout.getLinkConnectionBoxInterface() ) of their origin and destination
nodes has been modified. |
void |
setGlobalIncrementalUnmodifiedLinkReshapeMode(int mode)
Sets the reshape mode used during the incremental layout of unmodified
links, that is, links that have already been laid out in the previous
layout execution and for which neither the bounding box (see
getNodeBoxInterface() nor the "link connection box" (see IlvGraphLayout.getLinkConnectionBoxInterface() ) of their origin and destination
nodes have been modified. |
void |
setGlobalLinkStyle(int style)
Sets the global style of the shape of the links.
|
void |
setGlobalOriginPointMode(int mode)
Sets the global mode for the connection point of the links on the
origin nodes.
|
void |
setGlobalSelfLinkStyle(int style)
Sets the global style of the shape of the self-links.
|
void |
setIncrementalMode(boolean enable)
Sets the incremental layout mode.
|
void |
setIncrementalModifiedLinkReshapeMode(Object link,
int mode)
Sets the reshape mode of an individual link used during the
incremental layout of modified links, that is, links that have
already been laid out in the previous layout execution and for which
either the bounding box (see
getNodeBoxInterface() or the
"link connection box" (see IlvGraphLayout.getLinkConnectionBoxInterface() )
of their origin and destination nodes has been modified. |
void |
setIncrementalUnmodifiedLinkReshapeMode(Object link,
int mode)
Sets the reshape mode of an individual link used during the
incremental layout of unmodified links, that is, links that have
already been laid out in the previous layout execution and for which
neither the bounding box (see
getNodeBoxInterface() nor the
"link connection box" (see IlvGraphLayout.getLinkConnectionBoxInterface() )
of their origin and destination nodes have been modified. |
void |
setInterGraphLinksMode(boolean enable)
Sets the routing of intergraph links.
|
void |
setLinkBundlesMode(int mode)
Sets the link bundles mode.
|
void |
setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface connectionBoxInterface)
Sets the link connection box interface for the connection points of
links.
|
void |
setLinkOffset(double offset)
Sets the offset between links connected on the same side of the node.
|
void |
setLinkOverlapNodesForbidden(boolean set)
Sets whether it is forbidden for the layout to reshape links such that
they overlap nodes.
|
void |
setLinkStyle(Object link,
int style)
Sets the style of the shape of an individual link.
|
void |
setLinkToLinkCrossingPenalty(double penalty)
Sets the link-to-link crossing penalty factor.
|
void |
setLinkToNodeCrossingPenalty(double penalty)
Sets the link-to-node crossing penalty factor.
|
void |
setMinFinalSegmentLength(double length)
Sets the minimum length of the final (first and last) segment of the
links.
|
void |
setNodeBoxInterface(IlvNodeBoxInterface nodeBoxInterface)
Sets an object that provides the rectangle defining the position and
size of each node.
|
void |
setNodeSideFilter(IlvNodeSideFilter filter)
Sets the node-side filter, that is, an object that allows or prohibits
the connection of the links on a given side of the nodes.
|
void |
setOriginPointMode(Object link,
int mode)
Sets the mode for the connection point on an individual link on the
origin node.
|
void |
setSameShapeForMultipleLinks(boolean option)
Sets whether the layout algorithm must make sure that all multiple
links have the same type of shape, that is, a shape with the same
number of bends and with parallel segments.
|
boolean |
stopImmediately()
Overridden version of the base class method.
|
boolean |
supportsAllowedTime()
Indicates that this layout class can stop the layout computation in
the proper manner when the user-defined allowed time is exceeded.
|
boolean |
supportsAnimation()
Indicates that this layout class supports the animation mechanism;
that is, it performs a redraw of the grapher after each iteration if
the method {#
|
boolean |
supportsLinkConnectionBox()
Indicates that this layout class can use a link connection box
interface to calculate the end points of a link.
|
boolean |
supportsPreserveFixedLinks()
Indicates that this layout class allows the user to specify fixed
links.
|
boolean |
supportsSaveParametersToNamedProperties()
Indicates that this layout class can transfer the layout parameters to
named properties.
|
boolean |
supportsSplineRouting()
Tests if this class supports the generic optimization of spline
control points.
|
boolean |
supportsStopImmediately()
Indicates that this layout class can interrupt the current run of the
layout immediately in a controlled way.
|
addGraphLayoutEventListener, addGraphLayoutParameterEventListener, afterLayoutOfSubgraph, attach, attach, beforeLayout, beforeLayoutOfSubgraph, callLayoutStepPerformedIfNeeded, cleanGraphModel, cleanLink, cleanNode, clipAllLinks, clipLink, connectAllLinksToCenter, connectLinkToCenter, contentsChanged, createLayoutReport, getAllowedTime, getAutoLayoutHandler, getBalanceSplineCurveThreshold, getCalcLayoutRegion, getCoordinatesMode, getGrapher, getGraphModel, getInstanceId, getLayout, getLayoutOfConnectedComponents, getLayoutOfConnectedComponentsReport, getLayoutRegion, getLayoutReport, getLayouts, getLinkClipInterface, getLinkConnectionBoxInterface, getMaxSplineCurveSize, getMinBusyTime, getMinSplineCurveSize, getMovingNodes, getParentLayout, getProperty, getProperty, getRecursiveLayout, getRemainingAllowedTime, getSeedValueForRandomGenerator, getSpecLayoutRegion, getSplineLinkFilter, increasePercentageComplete, isAnimate, isAutoLayout, isFitToView, isFixed, isGeometryUpToDate, isInputCheckEnabled, isLayoutNeeded, isLayoutOfConnectedComponentsEnabled, isLayoutOfConnectedComponentsEnabledByDefault, isLayoutRunning, isLayoutRunning, isLayoutTimeElapsed, isLocalRecursiveLayoutNeeded, isMemorySavings, isParametersUpToDate, isPreserveFixedLinks, isPreserveFixedNodes, isSplineRoutingEnabled, isStoppedImmediately, isStructureUpToDate, isUseDefaultParameters, isUseSeedValueForRandomGenerator, layoutStepPerformed, onParameterChanged, onParameterChanged, performAutoLayout, performLayout, performLayout, performLayout, PerformLayout, performSublayout, removeGraphLayoutEventListener, removeGraphLayoutParameterEventListener, setAllowedTime, setAnimate, setAutoCheckAppropriateLinksEnabled, setAutoLayout, setAutoLayoutHandler, setBalanceSplineCurveThreshold, setCoordinatesMode, setFixed, setGeometryUpToDate, setGrapher, setGraphModel, setInputCheckEnabled, setLayoutOfConnectedComponents, setLayoutOfConnectedComponentsEnabled, setLayoutRegion, setLayoutRegion, setLayoutRegion, setLayoutReport, setLayoutRunning, setLinkClipInterface, setMaxSplineCurveSize, setMemorySavings, setMinBusyTime, setMinSplineCurveSize, setParametersUpToDate, setParentLayout, setPreserveFixedLinks, setPreserveFixedNodes, setProperty, setProperty, setSeedValueForRandomGenerator, setSplineLinkFilter, setSplineRoutingEnabled, setStructureUpToDate, setUseDefaultParameters, setUseSeedValueForRandomGenerator, supportsLayoutOfConnectedComponents, supportsLayoutRegion, supportsLinkClipping, supportsMemorySavings, supportsPercentageComplete, supportsPreserveFixedNodes, supportsRandomGenerator, unfixAllLinks, unfixAllNodes, useAnimateRedraw
public static final int ORTHOGONAL_STYLE
setGlobalLinkStyle(int)
, all links get an orthogonal shape
(alternating horizontal and vertical segments).
To specify the style of an individual link, use this style as the
argument of the method setLinkStyle(Object, int)
.
public static final int DIRECT_STYLE
setGlobalLinkStyle(int)
, all links get a (semi)direct shape.
To specify the style of an individual link, use this style 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 the
method setLinkStyle(java.lang.Object, int)
.setGlobalConnectorStyle(int)
, each node can
have a different connector style. The connector style of an
individual node can be set by the method setConnectorStyle(Object, int)
.public static final int NO_RESHAPE_STYLE
MIXED_STYLE
. To specify the style of an
individual link, use this style as the argument of the method setLinkStyle(Object, int)
.setLinkStyle(Object, int)
,
Constant Field Valuespublic static final int NO_BUNDLE
setLinkBundlesMode(int)
, no link bundles are computed.setLinkBundlesMode(int)
,
Constant Field Valuespublic static final int FIRST_LAST_SEGMENT
setLinkBundlesMode(int)
, only first and last segments of the links
are bundled.setLinkBundlesMode(int)
,
Constant Field Valuespublic static final int IMPROVED_FIRST_LAST_SEGMENT
setLinkBundlesMode(int)
, the first and the last segments of the
links are bundled.setLinkBundlesMode(int)
,
Constant Field Valuespublic static final int TWO_BENDS_ORTHOGONAL_STYLE
setGlobalSelfLinkStyle(int)
, a two-bend shape is
given to the self-links, that is, links with the same origin and
destination node.setGlobalSelfLinkStyle(int)
,
Constant Field Valuespublic static final int THREE_BENDS_ORTHOGONAL_STYLE
setGlobalSelfLinkStyle(int)
, a three-bend shape is
given to the self-links, that is, links with the same origin and
destination node.setGlobalSelfLinkStyle(int)
,
Constant Field Valuespublic static final int FREE_MODE
setGlobalOriginPointMode(int)
or
setGlobalDestinationPointMode(int)
, the layout is free to
choose the appropriate position for 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 free
mode as the argument of the method setOriginPointMode(Object,
int)
or setDestinationPointMode(Object, int)
.setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
or setGlobalIncrementalModifiedLinkReshapeMode(int)
in incremental
mode, the layout is allowed to reshape the links freely. Any settings
done using IlvGraphLayout.isFixed(Object)
, getGlobalOriginPointMode()
and getGlobalDestinationPointMode()
are still obeyed. To specify the
mode for the incremental reshape of an individual link, use free mode
as the argument of the method setIncrementalUnmodifiedLinkReshapeMode(Object, int)
or setIncrementalModifiedLinkReshapeMode(Object, int)
.public static final int FIXED_MODE
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 fixed mode as the
argument of the method setOriginPointMode(Object, int)
or
setDestinationPointMode(Object, int)
. setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
or setIncrementalModifiedLinkReshapeMode(Object, int)
in incremental
mode, the layout is not allowed to reshape the links in any way. To
specify the mode for the incremental reshape of an individual link,
use fixed mode as the argument of the method setIncrementalUnmodifiedLinkReshapeMode(Object, int)
or setIncrementalModifiedLinkReshapeMode(Object, int)
.public static final int FIXED_SHAPE_TYPE_MODE
setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
or the setIncrementalModifiedLinkReshapeMode(Object, int)
in incremental mode, the layout preserves the shape type of the link.
This means that both the number of bends and the node sides to which
the links are connected are preserved. To specify the mode for the
incremental reshape of an individual link, use fixed shape-type mode
as the argument of the method setIncrementalUnmodifiedLinkReshapeMode(Object, int)
or setIncrementalModifiedLinkReshapeMode(Object, int)
.public static final int FIXED_NODE_SIDES_MODE
setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
or the setIncrementalModifiedLinkReshapeMode(Object, int)
in incremental mode, the layout preserves the node sides to which the
links are connected. To specify the mode for the incremental reshape
of an individual link, use fixed node-side mode as the argument of
the method setIncrementalUnmodifiedLinkReshapeMode(Object,
int)
or setIncrementalModifiedLinkReshapeMode(Object, int)
.public static final int FIXED_CONNECTION_POINTS_MODE
setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
or the setIncrementalModifiedLinkReshapeMode(Object, int)
in incremental
mode, the layout preserves the connection points of the links. To
specify the mode for the incremental reshape of an individual link,
use fixed connection-points mode as the argument of the method setIncrementalUnmodifiedLinkReshapeMode(Object, int)
or setIncrementalModifiedLinkReshapeMode(Object, int)
.public static final int MIXED_MODE
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)
.setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
or setIncrementalModifiedLinkReshapeMode(Object, int)
, each link can
have a different incremental reshape mode. The mode for the
incremental reshape of an individual link can be set by the method
setIncrementalUnmodifiedLinkReshapeMode(Object, int)
or
setIncrementalModifiedLinkReshapeMode(Object, int)
.setGlobalOriginPointMode(int)
,
setGlobalDestinationPointMode(int)
,
setOriginPointMode(Object, int)
,
setDestinationPointMode(Object, int)
,
setGlobalIncrementalModifiedLinkReshapeMode(int)
,
setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
,
setIncrementalModifiedLinkReshapeMode(Object, int)
,
setIncrementalUnmodifiedLinkReshapeMode(Object, int)
,
Constant Field Valuespublic static final int AUTOMATIC_PINS
setGlobalConnectorStyle(int)
, the connector style of
all nodes is automatically selected as follows. The connection points
are dispatched using the style FIXED_OFFSET_PINS
if in so
doing no connection point goes outside the border to which the link
is attached. Otherwise, the connection points are dispatched using
the style EVENLY_SPACED_PINS
.
To specify automatic pins for an individual node, use automatic pin
style as the argument of the method setConnectorStyle(Object,
int)
.
setGlobalConnectorStyle(int)
,
setConnectorStyle(Object, int)
,
Constant Field Valuespublic static final int FIXED_OFFSET_PINS
setGlobalConnectorStyle(int)
, the connector pins of
all the links are placed at a fixed distance, given by the method
getLinkOffset()
.
To specify fixed-offset pina for an individual node, use fixed-offset
pin style as the argument of the method setConnectorStyle(Object, int)
.
setGlobalConnectorStyle(int)
,
setConnectorStyle(Object, int)
,
Constant Field Valuespublic static final int EVENLY_SPACED_PINS
setGlobalConnectorStyle(int)
, the connector pins
of all the links are evenly spaced along the node border to which the
link is attached.
To specify evenly spaced pins for an individual node, use evenly
spaced pin style as the argument of the method setConnectorStyle(Object, int)
.
setGlobalConnectorStyle(int)
,
setConnectorStyle(Object, int)
,
Constant Field Valuespublic IlvShortLinkLayout()
IlvGraphLayout.attach(IlvGrapher)
. IlvGraphLayout.attach(IlvGraphModel)
. IlvGraphLayout.performLayout()
. public IlvShortLinkLayout(IlvShortLinkLayout 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 on 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. The other parameters, including the customization interfaces, are also copied.
copy
in class IlvGraphLayout
copyParameters(IlvGraphLayout)
public void copyParameters(IlvGraphLayout source)
Note that the parameters which are specific to a node or a link are not copied. The other parameters, including the customization interfaces, are also copied.
If a method of the type supportsXXX
is associated with a
parameter, the parameter is copied only if the corresponding method
returns true
.
copyParameters
in class IlvGraphLayout
source
- The layout instance from which the parameters are copied.copy()
public void detach()
IlvGraphLayout.attach(IlvGraphModel)
.
The method performs cleaning operations on the graph model. In addition to the cleaning operations in the base class, the Short Link Layout removes the link style specifications of individual links.
Note that you must call this method when you no longer need the layout instance. Otherwise, some objects may not be garbage collected.
detach
in class IlvGraphLayout
IlvGraphLayout.attach(IlvGraphModel)
,
setLinkStyle(Object, int)
protected void layout(boolean redraw) throws IlvGraphLayoutException
IlvGraphLayout.performLayout()
.layout
in class IlvGraphLayout
redraw
- If true
, the attached graph model will be
asked to redraw the graph after layout. When the layout algorithm
moves the nodes and reshapes the links, it is required to pass the
value of the redraw
argument to the methods IlvGraphModel.moveNode(java.lang.Object, double, double, boolean)
and IlvGraphModel.reshapeLink(java.lang.Object, ilog.views.IlvPoint, ilog.views.IlvPoint[], int, int, ilog.views.IlvPoint, boolean)
.IlvInappropriateLinkException
- if the grapher contains links
that cannot be reshaped to a polyline and whose connection points
cannot be moved. (For details, see IlvInappropriateLinkException
.)IlvGraphLayoutException
- If an unusual situation occurs.
WARNING: this method can throw one of the subclasses of IlvGraphLayoutException
. Specifically, it can throw an IlvInappropriateGraphException
. It can also throw an IlvInappropriateLinkException
when inappropriate types of links
and/or link connectors are used in an IlvGrapher
. For
details, refer to the documentation of these exception classes.IlvGraphLayout.performLayout()
public void setLinkOverlapNodesForbidden(boolean set)
The default value of this parameter is false
.
If overlaps are not forbidden, the algorithm tries to avoid overlaps anyway. However, it may create overlaps if, for example, it needs to prevent a link from crossing other links.
If overlaps are forbidden, the algorithm uses the auxiliary long link
layout (see getAuxiliaryLongLinkLayout()
to lay out links
that would otherwise overlap nodes in an orthogonal shape.
The auxiliary long link layout works on a grid and the default grid
size may need to be reduced to allow this algorithm to avoid overlaps
(see IlvLongLinkLayout.setHorizontalGridOffset(double)
and
IlvLongLinkLayout.setVerticalGridOffset(double)
).
Forbidding overlaps can slow down the layout and can produce additional link bends and link crossings.
isLinkOverlapNodesForbidden()
,
getAuxiliaryLongLinkLayout()
public boolean isLinkOverlapNodesForbidden()
true
if the overlap of links with nodes is
forbidden; returns false
otherwise.setLinkOverlapNodesForbidden(boolean)
public final IlvLongLinkLayout getAuxiliaryLongLinkLayout()
IlvLongLinkLayout
that is used for
avoiding overlaps between links and nodes when isLinkOverlapNodesForbidden()
returns true
.
This method allows you to get this auxiliary layout instance and to
customize its parameters if needed. In particular, you can reduce or
increase the grid size (see IlvLongLinkLayout.setHorizontalGridOffset(double)
and IlvLongLinkLayout.setVerticalGridOffset(double)
).
You should not modify the origin and destination point mode, nor
disable the preservation of fixed links. An IlvGraphModel
instance is attached to the IlvLongLinkLayout
instance only
if needed, therefore
getAuxiliaryLongLinkLayout().getGraphModel()may return
null
.IlvLongLinkLayout
that is used for
avoiding overlaps between links and nodes when isLinkOverlapNodesForbidden()
returns true
.setLinkOverlapNodesForbidden(boolean)
public void setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface connectionBoxInterface)
By default, the layout algorithm places the connection points of the
links relative to the bounding box of the nodes (see IlvGraphic.boundingBox()
and IlvGraphModel.boundingBox(Object)
).
By setting a link connection box interface, the links can be
connected relative to a different box (see IlvLinkConnectionBoxInterface.getBox(IlvGraphModel, Object)
).
By default, the links are connected symmetrically to the middle of
the box, and it is possible to "shift" the links tangentially by
using the method IlvLinkConnectionBoxInterface.getTangentialOffset(IlvGraphModel,
Object, int)
from the interface IlvLinkConnectionBoxInterface
:
0
if no offset is necessary on a
certain node and/or side.
If you do not call this method , the layout algorithm places the
connection points on the node box that has been customized using the
method setNodeBoxInterface(IlvNodeBoxInterface)
. If this
method has not been used, the bounding box of the node in the graph
model (see IlvGraphModel.boundingBox(Object)
) is used.
You can call this method with a null
argument to go back
to the default behavior.
setLinkConnectionBoxInterface
in class IlvGraphLayout
setLinkConnectionRectangle
IlvGraphLayout.getLinkConnectionBoxInterface()
,
supportsLinkConnectionBox()
,
IlvGraphLayout.getLinkConnectionBoxInterface()
,
setNodeBoxInterface(IlvNodeBoxInterface)
public void setNodeBoxInterface(IlvNodeBoxInterface nodeBoxInterface)
If you do not call this method , the layout algorithm uses the
bounding box of the node (see IlvGraphModel.boundingBox(Object)
).
You can call this method with a null
argument to go
back to the default behavior.
getNodeBoxInterface()
public IlvNodeBoxInterface getNodeBoxInterface()
null
if none is specified.setNodeBoxInterface(IlvNodeBoxInterface)
public void setNodeSideFilter(IlvNodeSideFilter filter)
If a node-side filter is not installed, and the connection points of
the links are not fixed (see setOriginPointMode(Object,
int)
, setDestinationPointMode(Object, int)
), the layout
algorithm is free to choose any side of the nodes, except for
"pinned" connection points (see IlvGraphModel.hasPinnedConnectionPoint(Object, boolean)
).
When a filter is installed, the layout algorithm asks the filter at which side of its end node each link is allowed to attach to.
Note the following points:
setGlobalOriginPointMode(int)
, setGlobalDestinationPointMode(int)
, setOriginPointMode(java.lang.Object, int)
, setDestinationPointMode(java.lang.Object, int)
), the filter is not used for the origin or
the destination node, respectively.null
argument to return
to the default behavior.filter
- The node-side filter.getNodeSideFilter()
public IlvNodeSideFilter getNodeSideFilter()
null
if none is specified.setNodeSideFilter(IlvNodeSideFilter)
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 final void setGlobalLinkStyle(int style)
DIRECT_STYLE
: the shape of the links is a polyline
composed of a straight-line segment between the end nodes with two
horizontal or vertical segments at its extremities (their length is
controlled by setMinFinalSegmentLength(double)
and may be
0).ORTHOGONAL_STYLE
: the shape of the links is a polyline
composed of alternating horizontal and vertical segments.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 ORTHOGONAL_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 link connectors of type
IlvFreeLinkConnector
. Other link or
connector types may cause an IlvInappropriateLinkException
during layout. You can use the methods IlvGraphLayoutUtil.EnsureAppropriateLinkTypes(IlvGraphLayout,
boolean)
and IlvGraphLayoutUtil.EnsureAppropriateLinkConnectors(IlvGraphLayout,
boolean)
before layout, or the method IlvGraphLayoutUtil.EnsureAppropriateLinks(IlvGraphLayout, boolean)
when the exception is caught, to convert all links and connectors to
an appropriate type.
getGlobalLinkStyle()
public final int getGlobalLinkStyle()
setGlobalLinkStyle(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:
ORTHOGONAL_STYLE
- the link gets an orthogonal shape,
that is, a shape consisting of a sequence of orthogonal line
segments.DIRECT_STYLE
- the link gets a straight-line
shape.NO_RESHAPE_STYLE
- the link is not reshaped.
The default value is ORTHOGONAL_STYLE
.
IlvGrapher
, the effect of link reshaping depends on the
type of link. For the following link types, the reshaping has no
effect:
For all link styles, you are recommended to use links of type IlvPolylineLinkImage
and 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.
link
- The link instance.style
- The style of the shape of an individual link.setGlobalLinkStyle(int)
,
getLinkStyle(java.lang.Object)
public int getLinkStyle(Object link)
link
- The link instance.ORTHOGONAL_STYLE
, DIRECT_STYLE
or NO_RESHAPE_STYLE
.setGlobalLinkStyle(int)
,
setLinkStyle(java.lang.Object, int)
public final void setGlobalSelfLinkStyle(int style)
Valid values are the following:
TWO_BENDS_ORTHOGONAL_STYLE
: the shape of the links is a
polyline composed of three alternating horizontal and vertical
segments, connected to the same side of the node.THREE_BENDS_ORTHOGONAL_STYLE
: the shape of the links is
a polyline composed of four alternating horizontal and vertical
segments, connected to two adjacent sides of the node.
The default value is TWO_BENDS_ORTHOGONAL_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 link connectors of type
IlvFreeLinkConnector
. Other link or
connector types may cause an IlvInappropriateLinkException
during layout. You can use the methods IlvGraphLayoutUtil.EnsureAppropriateLinkTypes(IlvGraphLayout,
boolean)
and IlvGraphLayoutUtil.EnsureAppropriateLinkConnectors(IlvGraphLayout,
boolean)
before layout, or the method IlvGraphLayoutUtil.EnsureAppropriateLinks(IlvGraphLayout, boolean)
when the exception is caught, to convert all links and connectors to
an appropriate type.
getGlobalSelfLinkStyle()
public final int getGlobalSelfLinkStyle()
setGlobalSelfLinkStyle(int)
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)
).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.
Note that, in this mode, the layout algorithm has less freedom for
the choice of a link shape. Hence, this mode usually produces more
crossings and overlaps than the mode FREE_MODE
.
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.
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()
,
setOriginPointMode(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(java.lang.Object, boolean)
).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.
Note that, in this mode, the layout algorithm has less freedom for
the choice of a link shape. Hence, this mode usually produces more
crossings and overlaps than the mode FREE_MODE
.
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.
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()
,
setDestinationPointMode(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)
).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.
Note that, in this mode, the layout algorithm has less freedom for
the choice of a link shape. Hence, this mode usually produces more
crossings and overlaps than the mode FREE_MODE
.
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.
The default value is FREE_MODE
.
link
- The link.mode
- The mode to set.getOriginPointMode(Object)
,
setGlobalOriginPointMode(int)
,
IlvPinLinkConnector
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)
).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.
Note that, in this mode, the layout algorithm has less freedom for
the choice of a link shape. Hence, this mode usually produces more
crossings and overlaps than the mode FREE_MODE
.
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.
The default value is FREE_MODE
.
link
- The link.mode
- The mode to set.getDestinationPointMode(Object)
,
setGlobalDestinationPointMode(int)
,
IlvPinLinkConnector
public int getDestinationPointMode(Object link)
link
- The link.setGlobalDestinationPointMode(int)
,
setDestinationPointMode(Object, int)
public final void setGlobalConnectorStyle(int style)
FIXED_OFFSET_PINS
- The link connector pins are spaced
along the node border at a distance equal to the link offset
(see getLinkOffset()
).EVENLY_SPACED_PINS
- The link connector pins are evenly
spaced along the node border, preserving a margin which is determined
by getEvenlySpacedPinsMarginRatio()
.AUTOMATIC_PINS
- Uses the connector style FIXED_OFFSET_PINS
except if this pushes a connection point outside
the border to which the link is attached, in which case it uses the
connector style EVENLY_SPACED_PINS
.MIXED_STYLE
: each node can have a different connector
style. The style of each individual node can be set by the method
setConnectorStyle(Object, int)
so that different connector
styles can occur in the same graph.
Unless the global connector style is MIXED_STYLE
, all links
have the same connector style.
The default value is AUTOMATIC_PINS
.
The connector style is used to place the connector pins of links that have the free origin-point or destination-point mode and no specified port index. Links with fixed-point mode do not change their connection point at the origin node. The placement of connector pins also depends on the connection box interface in the following way:
IlvGraphLayout.setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface)
,
the bounding box and offsets are delivered by that interface.
Otherwise, the node bounding box delivered by the graph model (see
IlvGraphModel.boundingBox(Object)
) is used.
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-point or destination-point mode, you are
recommended to use 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.getGlobalConnectorStyle()
,
setConnectorStyle(Object, int)
,
setEvenlySpacedPinsMarginRatio(double)
,
setGlobalOriginPointMode(int)
,
setOriginPointMode(Object, int)
,
setGlobalDestinationPointMode(int)
,
setDestinationPointMode(Object, int)
public final int getGlobalConnectorStyle()
setGlobalConnectorStyle(int)
public final void setConnectorStyle(Object node, int style)
MIXED_STYLE
. Otherwise, all nodes have the connector style that is
specified as the global connector style.
Valid values are:
FIXED_OFFSET_PINS
- The link connector pins are spaced
along the node border at a distance equal to the link offset
(see getLinkOffset()
).EVENLY_SPACED_PINS
- The link connector pins are evenly
spaced along the node border, preserving a margin which is determined
by getEvenlySpacedPinsMarginRatio()
.AUTOMATIC_PINS
- Uses the connector style FIXED_OFFSET_PINS
except if this pushes a connection point outside
the border the link is attached to, in which case it uses the
connector style EVENLY_SPACED_PINS
.
The default value is AUTOMATIC_PINS
.
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, you are
recommended to use 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.
node
- The node.style
- The connector style.setGlobalConnectorStyle(int)
,
getConnectorStyle(Object)
public final int getConnectorStyle(Object node)
node
- The node.setGlobalConnectorStyle(int)
,
setConnectorStyle(Object, int)
public final void setEvenlySpacedPinsMarginRatio(double ratio)
FIXED_OFFSET_PINS
is used.
In evenly spaced pins connector style (see setGlobalConnectorStyle(int)
), the connection points of the links
are evenly spaced along the node border, preserving a margin at each
extremity of the node border. The size of this margin is controlled
by the margin ratio, and is computed by multiplying the offset
between the links by the ratio.
The input value must be a positive or zero value. A ratio of
0
means no margin; a ratio of 1
means a
margin equal to the offset between the links; a ratio of
0.5
means a margin equal to half the offset between the
links; a ratio of 2
means a margin equal to twice the
offset between the links and so on. There is no upper bound for the
ratio; however, the margin which is obtained has an upper bound equal
to (node-side-dimension - total-width-of-links) / 2
.
The default value for the ratio is 0.5
.
ratio
- The margin ratio for the evenly spaced pins connector
style.getEvenlySpacedPinsMarginRatio()
,
setGlobalConnectorStyle(int)
public final double getEvenlySpacedPinsMarginRatio()
setEvenlySpacedPinsMarginRatio(double)
,
setGlobalConnectorStyle(int)
public final void setLinkBundlesMode(int mode)
NO_BUNDLE
: Several links connected to the same side of
a node share the same connection point, that is, the middle of the
node side. The final segments of the links overlap. No bundles are
created and the link offset parameter is ignored.FIRST_LAST_SEGMENT
: The connection points of several
links connected to the same side of a node are distributed according
to the link offset value. With the orthogonal link style, the
algorithm additionally ensures that the first and last segments of
the links are always orthogonal to the side of the node to which they
are connected.IMPROVED_FIRST_LAST_SEGMENT
: The algorithm additionally
tries to avoid overlapping the second segment and the segment next to
the last. Note that with the direct link style, this mode is
equivalent to FIRST_LAST_SEGMENT
.
The default value is IMPROVED_FIRST_LAST_SEGMENT
.
getLinkBundlesMode()
public final int getLinkBundlesMode()
setLinkBundlesMode(int)
public final void setIncrementalMode(boolean enable)
true
, the algorithm tries to create a layout with
similar shapes for the links that were already laid out in the last
layout execution, in order to preserve the "mental map" of the user
as much as possible.
The exact incremental behavior is controlled by the
"incremental link reshape" mode. For details, see setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
and setGlobalIncrementalModifiedLinkReshapeMode(int)
.
Incremental layout works only if the intergraph links mode is disabled or if there are no intergraph links. Also, incremental layout has no effect if the layout parameters have been changed since the previous layout.
Incremental layout is disabled by default.
enable
- Set to true
to enable incremental layout, or
false
to disable it.isIncrementalMode()
,
setInterGraphLinksMode(boolean)
,
setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
,
setGlobalIncrementalModifiedLinkReshapeMode(int)
public final boolean isIncrementalMode()
true
if the incremental mode is enabled. It
returns false
otherwise.setIncrementalMode(boolean)
public final void setGlobalIncrementalUnmodifiedLinkReshapeMode(int mode)
getNodeBoxInterface()
nor the "link connection box" (see IlvGraphLayout.getLinkConnectionBoxInterface()
) of their origin and destination
nodes have been modified.
This mode has no effect if the incremental mode is disabled.
Valid values are:
FIXED_SHAPE_TYPE_MODE
- The incremental layout preserves
preserves the shape type of the link. This means that both the number
of bends and the node sides to which the link is connected are
preserved.FIXED_NODE_SIDES_MODE
- The incremental layout preserves
the node sides to which the links are connected.FIXED_CONNECTION_POINTS_MODE
- The incremental layout
preserves the connection points of the links.FIXED_MODE
- The links are not reshaped at all during
incremental layout. Only newly added links are rerouted.FREE_MODE
- The incremental layout is allowed to freely
reshape the links. This is equivalent to a non-incremental behavior
for all the links, hence it is recommended to disable the incremental
mode (setIncrementalMode(boolean)
) instead of setting FREE_MODE
as global incremental reshape mode. (Of course, settings
that may have been done using IlvGraphLayout.isFixed(Object)
, getGlobalOriginPointMode()
and getGlobalDestinationPointMode()
are still obeyed.)MIXED_MODE
- Each link can have a different mode. The
mode of each individual link can be set by the method setIncrementalUnmodifiedLinkReshapeMode(Object, int)
.
Unless the global mode is MIXED_MODE
, all links are reshaped
according to the same mode.
The default mode is FIXED_SHAPE_TYPE_MODE
.
mode
- The link reshape mode to set.getGlobalIncrementalUnmodifiedLinkReshapeMode()
,
setIncrementalUnmodifiedLinkReshapeMode(Object, int)
,
setIncrementalModifiedLinkReshapeMode(Object, int)
,
setIncrementalMode(boolean)
public final int getGlobalIncrementalUnmodifiedLinkReshapeMode()
setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
public final void setIncrementalUnmodifiedLinkReshapeMode(Object link, int mode)
getNodeBoxInterface()
nor the
"link connection box" (see IlvGraphLayout.getLinkConnectionBoxInterface()
)
of their origin and destination nodes have been modified.
This reshape mode is used only if incremental layout is enabled and
the global link-reshape mode is set to MIXED_MODE
. If the
global mode is not MIXED_MODE
, all links have the mode that
is specified as the global link reshape mode.
Valid values are:
FIXED_SHAPE_TYPE_MODE
- Incremental layout preserves
the shape type of the link. This means that both the number of bends
and the node sides to which the link is connected are preserved.FIXED_NODE_SIDES_MODE
- Incremental layout preserves
the node sides to which the links are connected.FIXED_CONNECTION_POINTS_MODE
- Incremental layout
preserves the connection points of the links.FIXED_MODE
- The links are not reshaped at all during
incremental layout. Only newly added links are rerouted.FREE_MODE
- Incremental layout is allowed to reshape
the links freely. This is equivalent to nonincremental behavior for
the link
argument. Any settings done using IlvGraphLayout.isFixed(java.lang.Object)
, getGlobalOriginPointMode()
and getGlobalDestinationPointMode()
are still obeyed.
The default mode is FIXED_SHAPE_TYPE_MODE
.
link
- The link.mode
- The link reshape mode to set.setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
,
getIncrementalUnmodifiedLinkReshapeMode(Object)
,
setIncrementalModifiedLinkReshapeMode(Object, int)
,
setIncrementalMode(boolean)
public final int getIncrementalUnmodifiedLinkReshapeMode(Object link)
link
- The link.getNodeBoxInterface()
nor the "link connection box" (see IlvGraphLayout.getLinkConnectionBoxInterface()
) of their origin and destination
nodes have been modified.setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
,
setIncrementalUnmodifiedLinkReshapeMode(Object, int)
public final void setGlobalIncrementalModifiedLinkReshapeMode(int mode)
getNodeBoxInterface()
or the "link connection box" (see IlvGraphLayout.getLinkConnectionBoxInterface()
) of their origin and destination
nodes has been modified.
This mode has no effect if incremental layout is disabled.
Valid values are:
FIXED_SHAPE_TYPE_MODE
- Incremental layout preserves the
shape type of the link. This means that both the number of bends and
the node sides to which the link is connected are preserved.FIXED_NODE_SIDES_MODE
- Incremental layout preserves the
node sides to which the links are connected.FIXED_CONNECTION_POINTS_MODE
- Incremental layout
preserves the connection points of the links.FIXED_MODE
- The links are not reshaped at all during
incremental layout. Only newly added links are rerouted.FREE_MODE
- Incremental layout is allowed to freely
reshape the links. This is equivalent to nonincremental behavior for
all the links, hence it is recommended to disable incremental layout
({link setIncrementalMode(boolean)
) instead of setting
FREE_MODE
as the global incremental reshape mode. Any
settings done using IlvGraphLayout.isFixed(Object)
, getGlobalOriginPointMode()
, and getGlobalDestinationPointMode()
are still obeyed.MIXED_MODE
- Each link can have a different mode. The
mode of each individual link can be set by the method setIncrementalUnmodifiedLinkReshapeMode(Object, int)
.
Unless the global mode is MIXED_MODE
, all links are reshaped
according to the same mode.
The default mode is FREE_MODE
.
mode
- The link reshape mode to set.getGlobalIncrementalModifiedLinkReshapeMode()
,
setIncrementalModifiedLinkReshapeMode(Object, int)
,
setIncrementalUnmodifiedLinkReshapeMode(Object, int)
,
setIncrementalMode(boolean)
public final int getGlobalIncrementalModifiedLinkReshapeMode()
setGlobalIncrementalModifiedLinkReshapeMode(int)
public final void setIncrementalModifiedLinkReshapeMode(Object link, int mode)
getNodeBoxInterface()
or the
"link connection box" (see IlvGraphLayout.getLinkConnectionBoxInterface()
)
of their origin and destination nodes has been modified.
This link reshape mode is used only if incremental layout is enabled
and the global link reshape mode is set to MIXED_MODE
. If
the global mode is not MIXED_MODE
, all links have the mode
that is specified as the global link-reshape mode.
Valid values are:
FIXED_SHAPE_TYPE_MODE
- Incremental layout preserves
the shape type of the link. This means that both the number of bends
and the node sides to which the link is connected are preserved.FIXED_NODE_SIDES_MODE
- Incremental layout preserves
the node sides to which the links are connected.FIXED_CONNECTION_POINTS_MODE
- Incremental layout
preserves the connection points of the links.FIXED_MODE
- The links are not reshaped at all during
incremental layout. Only newly added links are rerouted.FREE_MODE
- Incremental layout is allowed to freely
reshape the links. This is equivalent to nonincremental behavior for
the link
argument. Any settings done using IlvGraphLayout.isFixed(Object)
, getGlobalOriginPointMode()
, and getGlobalDestinationPointMode()
are still obeyed.
The default mode is FREE_MODE
.
link
- The link.mode
- The link reshape mode to set.setGlobalIncrementalModifiedLinkReshapeMode(int)
,
getIncrementalModifiedLinkReshapeMode(Object)
,
setIncrementalUnmodifiedLinkReshapeMode(Object, int)
,
setIncrementalMode(boolean)
public final int getIncrementalModifiedLinkReshapeMode(Object link)
link
- The link.getNodeBoxInterface()
or the "link connection box" (see IlvGraphLayout.getLinkConnectionBoxInterface()
) of their origin and destination
nodes has been modified.setGlobalIncrementalModifiedLinkReshapeMode(int)
,
setIncrementalModifiedLinkReshapeMode(Object, int)
,
setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
,
setIncrementalUnmodifiedLinkReshapeMode(Object, int)
public final void setInterGraphLinksMode(boolean enable)
true
, the intergraph links are routed; otherwise, only
the normal links are routed. An intergraph link is a link stored in
one graph that has an origin or destination not stored in the same
graph. If the combined intergraph link routing is enabled in
addition, this means that normal links and intergraph links are
routed together; otherwise only the intergraph links are routed.
The default value is true
.
If the intergraph link mode is enabled and the graph does contain some intergraph links, there are some restrictions:
IlvGrapher
(or IlvGrapherAdapter
), the top-level grapher must have a manager view
attached because of the coordinate transformations of the
subgraphers. If you create your own subclass of IlvGraphModel
instead of IlvGrapherAdapter
to route intergraph links, you
must make sure that all graph models of all subgraphers use the same
coordinate system through appropriate coordinate
transformations.public final boolean isInterGraphLinksMode()
true
if the routing of intergraph links is
enabled; returns false
otherwise.setInterGraphLinksMode(boolean)
public final void setCombinedInterGraphLinksMode(boolean enable)
true
, both normal links and intergraph links are routed
in the same pass. Otherwise, only the intergraph links are routed.
The default value is true
.
isCombinedInterGraphLinksMode()
,
setInterGraphLinksMode(boolean)
,
IlvGraphModel.isInterGraphLink(Object)
public final boolean isCombinedInterGraphLinksMode()
true
if the routing of normal links in addition
to intergraph links is enabled; returns false
otherwise.setInterGraphLinksMode(boolean)
,
setCombinedInterGraphLinksMode(boolean)
public final void setSameShapeForMultipleLinks(boolean option)
Multiple links are links that have the same origin and destination nodes.
If the argument is true
, additional work is done to make
sure that multiple links are reshaped in the same manner.
The default value is false
.
For some categories of links, it cannot be guaranteed that they will be given the same type of shape as the other links with the same origin and destination nodes:
setIncrementalMode(boolean)
.IlvGraphLayout.setFixed(Object, boolean)
.setGlobalOriginPointMode(int)
, setGlobalDestinationPointMode(int)
, setOriginPointMode(Object, int)
, setDestinationPointMode(Object, int)
).option
- Set to true
to enable the same shape option,
or false
to disable it.isSameShapeForMultipleLinks()
public final boolean isSameShapeForMultipleLinks()
true
if the algorithm that makes sure that
multiple links are reshaped in the same manner is enabled, and
false
otherwise.setSameShapeForMultipleLinks(boolean)
public final void setLinkToNodeCrossingPenalty(double penalty)
getLinkToNodeCrossingPenalty()
public final double getLinkToNodeCrossingPenalty()
Link_to_Link_Penalty * #Link_to_Link_Crossings +
Link_to_Node_Penalty * #Link_to_Node_Crossings
The default value is 1
.
setLinkToNodeCrossingPenalty(double)
public final void setLinkToLinkCrossingPenalty(double penalty)
getLinkToLinkCrossingPenalty()
public final double getLinkToLinkCrossingPenalty()
Link_to_Link_Penalty * #Link_to_Link_Crossings +
Link_to_Node_Penalty * #Link_to_Node_Crossings
The default value is 1
.
setLinkToLinkCrossingPenalty(double)
public final void setMinFinalSegmentLength(double length)
The default value is 10
.
getMinFinalSegmentLength()
public final double getMinFinalSegmentLength()
setMinFinalSegmentLength(double)
public final void setBypassDistance(double dist)
If the specified value is strictly negative, the value of the
parameter getMinFinalSegmentLength()
is used as the bypass
distance. This allows the automatic adjustment of the bypass distance
according to the current value of getMinFinalSegmentLength()
. This behavior is suitable in most
cases. However, you can specify a non-negative value in order to
override the default behavior.
The default value is a negative value.
dist
- The minimum distance for a direct connection.getBypassDistance()
public final double getBypassDistance()
setBypassDistance(double)
public final void setLinkOffset(double offset)
The default value is 2
.
getLinkOffset()
public final double getLinkOffset()
setLinkOffset(double)
public final int getAllowedNumberOfIterations()
setAllowedNumberOfIterations(int)
public final void setAllowedNumberOfIterations(int iterations)
The default value is 3
.
getAllowedNumberOfIterations()
public boolean stopImmediately()
stopImmediately
in class IlvGraphLayout
true
if it was possible to indicate to this layout
to stop its execution, false
if this layout does not
support this feature or if it cannot be stopped.IlvGraphLayout.isAutoLayout()
,
IlvGraphLayout.performAutoLayout()
public final boolean supportsPreserveFixedLinks()
IlvGraphLayout.setPreserveFixedLinks(boolean)
is called with a
true
argument.supportsPreserveFixedLinks
in class IlvGraphLayout
true
.IlvGraphLayout.setPreserveFixedLinks(boolean)
,
IlvGraphLayout.isPreserveFixedLinks()
public final boolean supportsAllowedTime()
The result code in the layout report is IlvGraphLayoutReport.STOPPED_AND_INVALID
in this case.
supportsAllowedTime
in class IlvGraphLayout
true
.IlvGraphLayout.setAllowedTime(long)
,
IlvGraphLayout.getAllowedTime()
,
IlvGraphLayoutReport.getCode()
public final boolean supportsStopImmediately()
IlvGraphLayoutReport.STOPPED_AND_INVALID
in this
case.supportsStopImmediately
in class IlvGraphLayout
true
.IlvGraphLayout.stopImmediately()
,
IlvGraphLayout.isStoppedImmediately()
,
IlvGraphLayoutReport.getCode()
public final boolean supportsAnimation()
supportsAnimation
in class IlvGraphLayout
true
.IlvGraphLayout.setAnimate(boolean)
,
IlvGraphLayout.isAnimate()
public final boolean supportsLinkConnectionBox()
The link connection box is used instead of the bounding box of each
node (see IlvGraphic.boundingBox(ilog.views.IlvTransformer)
and IlvGraphModel.boundingBox(Object)
) during the routing of
links.
supportsLinkConnectionBox
in class IlvGraphLayout
true
.setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface)
public final boolean supportsSaveParametersToNamedProperties()
.ivl
file.supportsSaveParametersToNamedProperties
in class IlvGraphLayout
true
.IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout,
boolean)
,
IlvGrapherAdapter.loadParametersFromNamedProperties(IlvGraphLayout)
,
IlvGrapherAdapter.removeParametersFromNamedProperties()
public boolean supportsSplineRouting()
IlvSplineLinkImage
and IlvGeneralLink
are used, the bend points
calculated by the layout algorithm are often suboptimal. Call IlvGraphLayout.setSplineRoutingEnabled(boolean)
to enable a generic optimization mechanism.supportsSplineRouting
in class IlvGraphLayout
true
.IlvGraphLayout.setSplineRoutingEnabled(boolean)
,
IlvGraphLayout.setMinSplineCurveSize(double)
,
IlvGraphLayout.setMaxSplineCurveSize(double)
,
IlvGraphLayout.setBalanceSplineCurveThreshold(double)
,
IlvGraphLayout.setSplineLinkFilter(IlvSplineLinkFilter)
protected IlvGraphLayoutGrapherProperty createLayoutGrapherProperty(String name, boolean withDefaults)
IlvShortLinkLayoutGrapherProperty
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)
IlvShortLinkLayoutNodeProperty
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)
IlvShortLinkLayoutLinkProperty
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()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.