public class IlvBasicLinkStyleLayout extends IlvGraphLayout
While the main purpose of IlvBasicLinkStyleLayout
is to
serve as a base class for some other layout algorithms, the Basic Link
Style Layout can also be used by itself. In this case, it does not
place any nodes, but it can route certain links. Links between
different node pairs can be routed as straight lines. Multiple links
between different node pairs can be routed as shifted bundle of
straight links, or as bundle with one bend point. Self-links that
start and end at the same node can be routed in a rectangular or
square style (or, if spline links are used, as approximation of a
circle).
Here are sample drawings produced with the Basic Link Style Layout algorithm:
See the corresponding chapter of the JViews Graph Layout 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, parameters, and so on.
Modifier and Type | Field and Description |
---|---|
static int |
ALL_CORNERS
Defines that all the corners are allowed for placing self-links (that
is, links that start and end at the same node).
|
static int |
BOTTOM_LEFT
Defines the bottom left corner as allowed corner to place
self-links (that is, links that start and end at the same node).
|
static int |
BOTTOM_RIGHT
Defines the bottom right corner as allowed corner to place
self-links (that is, links that start and end at the same node).
|
static int |
CENTERED
Multiple self-link distribution: centered.
|
static int |
CLOCK_WISE
Self-link orientation: clockwise.
|
static int |
CONNECTED_ONE_BEND_BUNDLE
Multilink mode: one bend polyline bundling with connection.
|
static int |
CONNECTED_RECTANGULAR
Self-link mode: rectangular self-links with 3 bends and connection.
|
static int |
CONNECTED_SQUARE
Self-link mode: square self-links with 3 bends and connection.
|
static int |
COUNTER_CLOCK_WISE
Self-link orientation: counterclockwise.
|
static int |
FREE_ONE_BEND_BUNDLE
Multilink mode: one bend polyline bundling without enforced
connection.
|
static int |
FREE_RECTANGULAR
Self-link mode: rectangular self-links with 3 bends without enforced
connection.
|
static int |
FREE_SQUARE
Self-link mode: square self-links with 3 bends without enforced
connection.
|
static int |
HORIZONTAL_TO_VERTICAL
Self-link orientation: horizontal to vertical.
|
static int |
INNER
Multiple self-link distribution: towards inner nestings.
|
static int |
NARROW_CONNECTED_RECTANGULAR
Self-link mode: narrow rectangular self-links with 3 bends and
connection.
|
static int |
NARROW_CONNECTED_SQUARE
Self-link mode: narrow square self-links with 3 bends and connection.
|
static int |
NARROW_FREE_RECTANGULAR
Self-link mode: narrow rectangular self-links with 3 bends without
enforced connection.
|
static int |
NARROW_FREE_SQUARE
Self-link mode: narrow square self-links with 3 bends without enforced
connection.
|
static int |
NARROW_STRAIGHT_LINE_BUNDLE
Multilink mode: narrow straight bundling.
|
static int |
NO_BENDS
Self-link mode: no reshape.
|
static int |
NO_BUNDLE
Multilink mode: no bundling.
|
static int |
NO_RESHAPE_STYLE
No links reshape option.
|
static int |
OUTER
Multiple self-link distribution: towards outer nestings.
|
static int |
STRAIGHT_LINE_BUNDLE
Multilink mode: straight bundling.
|
static int |
STRAIGHT_LINE_STYLE
Straight-line links shape option.
|
static int |
TOP_LEFT
Defines the top left corner as allowed corner to place
self-links (that is, links that start and end at the same node).
|
static int |
TOP_RIGHT
Defines the top right corner as allowed corner to place
self-links (that is, links that start and end at the same node).
|
static int |
VERTICAL_TO_HORIZONTAL
Self-link orientation: vertical to horizontal.
|
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES
Constructor and Description |
---|
IlvBasicLinkStyleLayout()
Creates a new instance of the Basic Link Style Layout algorithm.
|
IlvBasicLinkStyleLayout(IlvBasicLinkStyleLayout 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
IlvBasicLinkStyleLayoutGrapherProperty that stores the parameter
settings of this layout class. |
protected int |
getLayoutCodeOnInterrupt()
Returns the layout code when the allowed time elapsed before
completion of the layout.
|
int |
getLinkStyle()
Returns the current option for the style of the shape of the links.
|
IlvGraphicVector |
getMovingNodes()
Returns the vector of nodes being moved by the graph layout algorithm.
|
double |
getMultiLinkMaxSpread()
Returns the maximum spread width between multiple links between the
same pair of nodes.
|
int |
getMultiLinkMode()
Returns the current option for the mode how multiple links between the
same pair of nodes are laid out.
|
double |
getMultiLinkOffset()
Returns the offset between multiple links between the same pair of
nodes.
|
protected int |
getMultiLinksCount()
Returns the number of multilinks.
|
int |
getMultiSelfLinkDistribution()
Returns the current option for the distribution of bundles of multiple
self-links (that is, multiple links that start and end at the same
node).
|
double |
getMultiSelfLinkMaxSpread()
Returns the maximum spread width between multiple self-links (that is,
multiple links that start and end at the same node).
|
double |
getMultiSelfLinkOffset()
Returns the offset between multiple self-links (that is, multiple
links that start and end at the same node).
|
protected int[] |
getPercentagesOfCompletion()
Returns an array of 4 integer numbers, denoting the percentage of
completion for each of the 4 steps.
|
IlvPoint |
getSelfLinkAbsoluteAttachPosition()
Returns the absolute attach position at the node border for self-links
(that is, links that start and end at the same node).
|
int |
getSelfLinkAllowedCorners()
Returns which corners are allowed to have self-links (that is, links
that start and end at the same node).
|
int |
getSelfLinkMode()
Returns the current option for the mode how self-links (that is, links
that start and end at the same node) are laid out.
|
int |
getSelfLinkOrientation()
Returns the current option for the orientation of self-links (that is,
links that start and end at the same node).
|
IlvPoint |
getSelfLinkRelativeAttachPosition()
Returns the relative attach position at the node border for self-links
(that is, links that start and end at the same node).
|
protected int |
getSelfLinksCount()
Returns the number of self-links.
|
double |
getSelfLinkSpacing()
Returns the minimal spacing between node border and the self-links
(that is, links that start and end at the same node).
|
void |
increasePercentageComplete(int newPercentage)
Increases the percentage of completion that is stored in the layout
report to the input value.
|
protected void |
init()
Initializes instance variables.
|
protected void |
internalLayout(boolean redraw)
Called from
layout(boolean) to place the nodes. |
boolean |
isConnectLinksToNodeCenters()
Returns
true if the algorithm connects the links to the
centers of the nodes. |
protected boolean |
isInterrupted()
Returns
true if the layout is interrupted. |
boolean |
isSelfLinkConnectToNodeCenter()
Returns whether self-links (that is, links that start and end at the
same node) connect towards the node center.
|
protected void |
layout(boolean redraw)
Computes the layout using the Basic Link Style Layout algorithm.
|
void |
setConnectLinksToNodeCenters(boolean enable)
Sets whether the algorithm connects the links to the centers of the
nodes.
|
void |
setLinkStyle(int style)
Sets the style of the shape of the links.
|
void |
setMultiLinkMaxSpread(double maxSpread)
Sets the maximum spread width between multiple links between the same
pair of nodes.
|
void |
setMultiLinkMode(int mode)
Sets the mode how multiple links between the same pair of nodes are
laid out.
|
void |
setMultiLinkOffset(double offset)
Sets the offset between multiple links between the same pair of nodes.
|
void |
setMultiSelfLinkDistribution(int distribution)
Sets the distribution of bundles of multiple self-links (that is,
multiple links that start and end at the same node).
|
void |
setMultiSelfLinkMaxSpread(double maxSpread)
Sets the maximum spread width between multiple self-links (that is,
multiple links that start and end at the same node).
|
void |
setMultiSelfLinkOffset(double offset)
Sets the offset between multiple self-links (that is, multiple links
that start and end at the same node).
|
void |
setSelfLinkAbsoluteAttachPosition(IlvPoint position)
Sets the absolute attach position at the node border for self-links
(that is, links that start and end at the same node).
|
void |
setSelfLinkAllowedCorners(int corners)
Sets which corners are allowed to have self-links (that is, links that
start and end at the same node).
|
void |
setSelfLinkConnectToNodeCenter(boolean enable)
Sets whether self-links (that is, links that start and end at the same
node) connect towards the node center.
|
void |
setSelfLinkMode(int mode)
Sets the mode how self-links (that is, links that start and end at the
same node) are laid out.
|
void |
setSelfLinkOrientation(int orientation)
Sets the orientation of self-links (that is, links that start and end
at the same node).
|
void |
setSelfLinkRelativeAttachPosition(IlvPoint position)
Sets the relative attach position at the node border for self-links
(that is, links that start and end at the same node).
|
void |
setSelfLinkSpacing(double spacing)
Sets the minimal spacing between node border and self-links (that is,
links that start and end at the same node).
|
boolean |
supportsAllowedTime()
Indicates that this layout class can stop the layout computation when
the user-defined allowed time is exceeded.
|
boolean |
supportsLayoutOfConnectedComponents()
Indicates that this layout class can cut the attached graph into
connected components, apply itself to each connected component
separately, and then use the layout instance returned by the method
IlvGraphLayout.getLayoutOfConnectedComponents() to position the connected
components. |
boolean |
supportsLinkClipping()
Indicates that this layout class can use a link clip interface to clip
the end points of a link.
|
boolean |
supportsLinkConnectionBox()
Indicates that this layout class can use a link connection box
interface to calculate the end points of a link.
|
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 |
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, createLayoutLinkProperty, createLayoutNodeProperty, createLayoutReport, detach, getAllowedTime, getAutoLayoutHandler, getBalanceSplineCurveThreshold, getCalcLayoutRegion, getCoordinatesMode, getGrapher, getGraphModel, getInstanceId, getLayout, getLayoutOfConnectedComponents, getLayoutOfConnectedComponentsReport, getLayoutRegion, getLayoutReport, getLayouts, getLinkClipInterface, getLinkConnectionBoxInterface, getMaxSplineCurveSize, getMinBusyTime, getMinSplineCurveSize, getParentLayout, getProperty, getProperty, getRecursiveLayout, getRemainingAllowedTime, getSeedValueForRandomGenerator, getSpecLayoutRegion, getSplineLinkFilter, 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, setLinkConnectionBoxInterface, setMaxSplineCurveSize, setMemorySavings, setMinBusyTime, setMinSplineCurveSize, setParametersUpToDate, setParentLayout, setPreserveFixedLinks, setPreserveFixedNodes, setProperty, setProperty, setSeedValueForRandomGenerator, setSplineLinkFilter, setSplineRoutingEnabled, setStructureUpToDate, setUseDefaultParameters, setUseSeedValueForRandomGenerator, stopImmediately, supportsAnimation, supportsLayoutRegion, supportsMemorySavings, supportsRandomGenerator, supportsSplineRouting, unfixAllLinks, unfixAllNodes, useAnimateRedraw
public static final int STRAIGHT_LINE_STYLE
setLinkStyle(int)
, the links are given a straight-line shape.setLinkStyle(int)
,
Constant Field Valuespublic static final int NO_RESHAPE_STYLE
setLinkStyle(int)
, the links are not reshaped.setLinkStyle(int)
,
Constant Field Valuespublic static final int NO_BUNDLE
setMultiLinkMode(int)
, multiple links between the same pair of
nodes are not spread out and will overlap.setMultiLinkMode(int)
,
Constant Field Valuespublic static final int STRAIGHT_LINE_BUNDLE
setMultiLinkMode(int)
, multiple links between the same pair of
nodes are routed straight but shifted to avoid overlaps.setMultiLinkMode(int)
,
Constant Field Valuespublic static final int NARROW_STRAIGHT_LINE_BUNDLE
setMultiLinkMode(int)
, multiple links between the same pair
of nodes are routed straight but shifted to avoid overlaps. The
bundle may appear more narrow since the shift offset is limited by
the size of the end nodes.setMultiLinkMode(int)
,
Constant Field Valuespublic static final int CONNECTED_ONE_BEND_BUNDLE
setMultiLinkMode(int)
, multiple links
between the same pair of nodes are routed with one bend to avoid
overlaps. All links of the bundle are connected to the node and start
at the same point and end at the same point.setMultiLinkMode(int)
,
Constant Field Valuespublic static final int FREE_ONE_BEND_BUNDLE
setMultiLinkMode(int)
, multiple links between the same pair of
nodes are routed with one bend to avoid overlaps. The link connection
points are not enforced, that is, the nodes and links are free to
decide themselves where to place the connection points. There is no
guarantee that all links of the bundle start or end at a common
point. This mode is in particular useful if an IlvCenterLinkConnector
or IlvPinLinkConnector
is used that cannot
change the connection point, or when an IlvClippingLinkConnector
is used while the
attachment point should not change.setMultiLinkMode(int)
,
Constant Field Valuespublic static final int NO_BENDS
setSelfLinkMode(int)
, self-links (that is, links that start and end
at the same node) are not reshaped with bends and may not be visible
after layout.setSelfLinkMode(int)
,
Constant Field Valuespublic static final int CONNECTED_RECTANGULAR
setSelfLinkMode(int)
, 3 bends
are added to self-links (that is, links that start and end at the
same node). The bends are placed in orthogonal style so that the link
segments approximately resemble three quarters of a rectangle (the
fourth quarter being the node where the self-link is attached). The
connection points are placed on the border of the node.setSelfLinkMode(int)
,
Constant Field Valuespublic static final int FREE_RECTANGULAR
setSelfLinkMode(int)
, 3 bends are added to self-links (that is,
links that start and end at the same node). The bends are placed at
the same position like CONNECTED_RECTANGULAR
. The link
connection points are not enforced, that is, the nodes and links are
free to decide themselves where to place the connection point. This
mode is in particular useful if an IlvCenterLinkConnector
or IlvPinLinkConnector
is used that cannot
change the connection point.setSelfLinkMode(int)
,
Constant Field Valuespublic static final int CONNECTED_SQUARE
setSelfLinkMode(int)
, 3 bends are
added to self-links (that is, links that start and end at the same
node). The bends are placed in orthogonal style so that the link
segments approximately resemble three quarters of a square (the
fourth quarter being the node where the self-link is attached). If
the self-link is a spline link, the square shape might be more
appropriate than a rectangular shape since the spline then may
approximately resemble three quarters of a circle. The connection
points are placed on the border of the node.setSelfLinkMode(int)
,
Constant Field Valuespublic static final int FREE_SQUARE
setSelfLinkMode(int)
, 3 bends are added to self-links (that is,
links that start and end at the same node). The bends are placed at
the same position like CONNECTED_SQUARE
. If the self-link is
a spline link, the square shape might be more appropriate than a
rectangular shape since the spline then may approximately resemble
three quarters of a circle. The link connection points are not
enforced, that is, the nodes and links are free to decide themselves
where to place the connection point. This mode is in particular
useful if an IlvCenterLinkConnector
or IlvPinLinkConnector
is used that
cannot change the connection point.setSelfLinkMode(int)
,
Constant Field Valuespublic static final int NARROW_CONNECTED_RECTANGULAR
setSelfLinkMode(int)
, 3 bends are added to self-links (that is,
links that start and end at the same node). The bends are placed in
orthogonal style so that the link segments approximately resemble
three quarters of a rectangle (the fourth quarter being the node
where the self-link is attached). The connection points are placed
on the border of the node. For single self-links, this mode has the
same effect like CONNECTED_RECTANGULAR
. If you have multiple
self-links at the same node, the self-links are shifted by an offset
to avoid overlaps. In this case, this mode differs from CONNECTED_RECTANGULAR
, as the self-link bundle may appear more
narrow since the shift offset of the multiple self-links is limited
by the size of the end node.setSelfLinkMode(int)
,
Constant Field Valuespublic static final int NARROW_FREE_RECTANGULAR
setSelfLinkMode(int)
, 3 bends are added to self-links (that is,
links that start and end at the same node). The bends are placed at
the same position like NARROW_CONNECTED_RECTANGULAR
. For
single self-links, this mode has the same effect like FREE_RECTANGULAR
. If you have multiple self-links at the same node,
the self-links are shifted by an offset to avoid overlaps. In this
case, this mode differs from FREE_RECTANGULAR
, as the
self-link bundle may appear more narrow since the shift offset of the
multiple self-links * is limited by the size of the end node.
The link connection points are not enforced, that is, the nodes and
links are free to decide themselves where to place the connection
point. This mode is in particular useful if an IlvCenterLinkConnector
or IlvPinLinkConnector
is used that cannot
change the connection point.setSelfLinkMode(int)
,
Constant Field Valuespublic static final int NARROW_CONNECTED_SQUARE
setSelfLinkMode(int)
, 3 bends
are added to self-links (that is, links that start and end at the
same node). The bends are placed in orthogonal style so that the link
segments approximately resemble three quarters of a square (the
fourth quarter being the node where the self-link is attached). If
the self-link is a spline link, the square shape might be more
appropriate than a rectangular shape since the spline then may
approximately resemble three quarters of a circle. The connection
points are placed on the border of the node. For single self-links,
this mode has the same effect like CONNECTED_SQUARE
. If you
have multiple self-links at the same node, the self-links are shifted
by an offset to avoid overlaps. In this case, this mode differs from
CONNECTED_SQUARE
, as the self-link bundle may appear more
narrow since the shift offset of the multiple self-links is limited
by the size of the end node.setSelfLinkMode(int)
,
Constant Field Valuespublic static final int NARROW_FREE_SQUARE
setSelfLinkMode(int)
, 3 bends are added to self-links (that is,
links that start and end at the same node). The bends are placed at
the same position like NARROW_CONNECTED_SQUARE
. If the
self-link is a spline link, the square shape might be more
appropriate than a rectangular shape since the spline then may
approximately resemble three quarters of a circle. For single
self-links, this mode has the same effect like FREE_SQUARE
.
If you have multiple self-links at the same node, the self-links are
shifted by an offset to avoid overlaps. In this case, this mode
differs from FREE_SQUARE
, as the self-link bundle may appear
more narrow since the shift offset of the multiple self-links is
limited by the size of the end node. The link connection points are
not enforced, that is, the nodes and links are free to decide
themselves where to place the connection point. This mode is in
particular useful if an IlvCenterLinkConnector
or IlvPinLinkConnector
is used that cannot
change the connection point.setSelfLinkMode(int)
,
Constant Field Valuespublic static final int TOP_LEFT
public static final int BOTTOM_LEFT
public static final int TOP_RIGHT
public static final int BOTTOM_RIGHT
public static final int ALL_CORNERS
TOP_LEFT
: top left corner.TOP_RIGHT
: top right corner.BOTTOM_RIGHT
: bottom right corner.BOTTOM_LEFT
: bottom left corner.public static final int CLOCK_WISE
setSelfLinkOrientation(int)
, self-links (that is, links that start
and end at the same node) are routed in clockwise orientation.setSelfLinkOrientation(int)
,
Constant Field Valuespublic static final int COUNTER_CLOCK_WISE
setSelfLinkOrientation(int)
, self-links (that is, links
that start and end at the same node) are routed in counterclockwise
orientation.setSelfLinkOrientation(int)
,
Constant Field Valuespublic static final int HORIZONTAL_TO_VERTICAL
setSelfLinkOrientation(int)
, self-links (that
is, links that start and end at the same node) start at the left or
right side of the node with a horizontal segment and end at the top
or bottom side of the node with a vertical segment.setSelfLinkOrientation(int)
,
Constant Field Valuespublic static final int VERTICAL_TO_HORIZONTAL
setSelfLinkOrientation(int)
, self-links (that
is, links that start and end at the same node) start at the top or
bottom side of the node with a vertical segment and end at the left
or right side of the node with a horizontal segment.setSelfLinkOrientation(int)
,
Constant Field Valuespublic static final int CENTERED
setMultiSelfLinkDistribution(int)
, the middle of the
bundles of multiple self-links (that is, multiple links that start
and end at the same node) is attached at the reference points for
self-links.public static final int OUTER
setMultiSelfLinkDistribution(int)
, the
innermost self-link loop of a bundle of multiple self-links (that is,
multiple links that start and end at the same node) is attached at
the reference points for self-links, and the remaining self-link
loops are distributed towards the outer of the nestings.public static final int INNER
setMultiSelfLinkDistribution(int)
, the
outermost self-link loop of a bundle of multiple self-links (that is,
multiple links that start and end at the same node) is attached at
the reference points for self-links, and the remaining self-links
loops are distributed towards the inner of the nestings.public IlvBasicLinkStyleLayout()
IlvGraphLayout.attach(ilog.views.IlvGrapher)
. IlvGraphLayout.attach(IlvGraphModel)
. IlvGraphLayout.performLayout()
. public IlvBasicLinkStyleLayout(IlvBasicLinkStyleLayout 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. The other parameters, including the customization interfaces, are also copied. A copy of the layout instance used for laying out the connected components is set on the new instance.
If a method of the type supportsXXX
is associated with a
parameter, the parameter is copied only if the corresponding method
returns true
.
copy
in class 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. A copy of the layout instance used for laying out the connected components is set on this layout instance.
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 final boolean supportsPreserveFixedNodes()
IlvGraphLayout.setPreserveFixedLinks(boolean)
is called with a
true
argument. The base class IlvBasicLinkStyleLayout
does not move any nodes anyway, hence
specifying nodes as fixed is not necessary. All subclasses of this
class however move nodes, and specifying nodes as fixed for a
subclass can be useful.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()
,
setLinkStyle(int)
public boolean supportsAllowedTime()
IlvGraphLayoutReport.STOPPED_AND_INVALID
in
this case. Subclasses may return a different result code if the
method getLayoutCodeOnInterrupt()
is overridden.supportsAllowedTime
in class IlvGraphLayout
true
.IlvGraphLayout.setAllowedTime(long)
,
IlvGraphLayout.getAllowedTime()
,
IlvGraphLayoutReport.getCode()
public boolean supportsStopImmediately()
IlvGraphLayoutReport.STOPPED_AND_INVALID
in this
case. Subclasses may return a different result code if the method
getLayoutCodeOnInterrupt()
is overridden.supportsStopImmediately
in class IlvGraphLayout
true
.IlvGraphLayout.stopImmediately()
,
IlvGraphLayout.isStoppedImmediately()
,
IlvGraphLayoutReport.getCode()
public final boolean supportsLayoutOfConnectedComponents()
IlvGraphLayout.getLayoutOfConnectedComponents()
to position the connected
components. By default, this layout is an instance of IlvGridLayout
which can be customized as
needed.supportsLayoutOfConnectedComponents
in class IlvGraphLayout
true
.IlvGraphLayout.getLayoutOfConnectedComponents()
,
IlvGraphLayout.isLayoutOfConnectedComponentsEnabled()
,
IlvGraphLayout.performLayout(boolean, boolean)
public final boolean supportsLinkConnectionBox()
The connection box interface is only used if the link style is
straight line. It is used when the option
"connect links to node centers" (see isConnectLinksToNodeCenters()
) or the link clipping (see IlvGraphLayout.setLinkClipInterface(ilog.views.graphlayout.IlvLinkClipInterface)
) is enabled. It is used for multilink bundles
unless the multilink mode is NO_BUNDLE
or FREE_ONE_BEND_BUNDLE
. It is used for self-links if the self-link
mode is CONNECTED_RECTANGULAR
, NARROW_CONNECTED_RECTANGULAR
, CONNECTED_SQUARE
, or NARROW_CONNECTED_SQUARE
. In all other cases, the layout algorithms
does not actively place the end points of links, hence it is not
used. In that cases, it relies on the link connectors that are
attached to the nodes to find appropriate connection points for the
links.
When the connection box interface is used, the layout algorithm
calculates the virtual center of the end nodes of each link by the
link connection box interface and routes the links relative to those
centers. It then obtains the final connection points by clipping
with the link clip interface. The virtual center is defined as the
center of the connection box shifted by the average of the tangential
"top" and "bottom" offsets in the horizontal direction, and by the
average of the tangential "left" and "right" offsets in the vertical
direction. For instance, if the tangential offset is 20 at the top
side and 10 at all other sides, the average shift offset is (20
+ 10)/2 = 15
in the horizontal direction and (10 + 10)/2
= 10
in the vertical direction; hence, the virtual center is
at connectionBox.center() + (15, 10)
.
supportsLinkConnectionBox
in class IlvGraphLayout
true
.IlvGraphLayout.setLinkConnectionBoxInterface(ilog.views.graphlayout.IlvLinkConnectionBoxInterface)
,
IlvGraphLayout.setLinkClipInterface(ilog.views.graphlayout.IlvLinkClipInterface)
,
IlvLinkConnector
,
setLinkStyle(int)
,
supportsLinkClipping()
,
setConnectLinksToNodeCenters(boolean)
,
setMultiLinkMode(int)
,
setSelfLinkMode(int)
public final boolean supportsLinkClipping()
Link clipping is performed only if the link style is straight line.
supportsLinkClipping
in class IlvGraphLayout
true
.IlvGraphLayout.setLinkClipInterface(ilog.views.graphlayout.IlvLinkClipInterface)
,
IlvLinkConnector
,
setLinkStyle(int)
,
supportsLinkConnectionBox()
public boolean supportsPercentageComplete()
supportsPercentageComplete
in class IlvGraphLayout
true
.increasePercentageComplete(int)
,
IlvGraphLayoutReport.getPercentageComplete()
,
IlvJGraphLayoutProgressBar
public final boolean supportsSaveParametersToNamedProperties()
.ivl
file.
supportsSaveParametersToNamedProperties
in class IlvGraphLayout
true
.IlvGrapherAdapter.saveParametersToNamedProperties(IlvGraphLayout, boolean)
,
IlvGrapherAdapter.loadParametersFromNamedProperties(IlvGraphLayout)
,
IlvGrapherAdapter.removeParametersFromNamedProperties()
protected void layout(boolean redraw) throws IlvGraphLayoutException
IlvGraphLayout.performLayout()
.
Subclasses should not override this method but should override internalLayout(boolean)
instead.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 straight line
and the link style is STRAIGHT_LINE_STYLE
. (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()
,
IlvGraphLayout.createLayoutReport()
,
IlvGraphLayout.getCalcLayoutRegion()
protected void internalLayout(boolean redraw) throws IlvGraphLayoutException
layout(boolean)
to place the nodes. This layout does not
place any nodes, but subclasses of this layout may place nodes in
this method.IlvGraphLayoutException
protected final int getSelfLinksCount()
internalLayout(boolean)
to test how many self-links have to be
treated.protected final int getMultiLinksCount()
internalLayout(boolean)
to test how many multilinks have to be
treated.protected boolean isInterrupted()
true
if the layout is interrupted.true
if the layout is interrupted.protected int getLayoutCodeOnInterrupt()
supportsAllowedTime()
,
supportsStopImmediately()
protected int[] getPercentagesOfCompletion()
internalLayout(boolean)
. supportsPercentageComplete()
,
IlvGraphLayoutReport.getPercentageComplete()
public void increasePercentageComplete(int newPercentage)
increasePercentageComplete
in class IlvGraphLayout
newPercentage
- New percentage of completionsupportsPercentageComplete()
,
IlvGraphLayoutReport.getPercentageComplete()
public void setLinkStyle(int style)
STRAIGHT_LINE_STYLE
(the links are given a straight-line shape) and
NO_RESHAPE_STYLE
(no reshape is performed on the links).
This feature can be useful if the graph contains links that have
intermediate points and are not straight-line links, for instance,
IlvPolylineLinkImage
links with
intermediate points.
The default value is STRAIGHT_LINE_STYLE
.
Note that when the graph attached to the layout is of type IlvGrapher
, the effect of the link reshaping depends on
the type of the links and the connectors installed at the node. For
link style NO_RESHAPE_STYLE
, the link type and connector
type does not really matter, since the link shape is not changed in
any way. For STRAIGHT_LINE_STYLE
, we recommend using links
of type IlvPolylineLinkImage
and as link
connector IlvClippingLinkConnector
.
This link type and this connector works in all cases. In combination
with the IlvClippingLinkConnector
,
enabling the option setConnectLinksToNodeCenters(boolean)
is useful.
If link clipping (see IlvGraphLayout.setLinkClipInterface(ilog.views.graphlayout.IlvLinkClipInterface)
) is
enabled, then IlvFreeLinkConnector
might be appropriate as well. In that case, 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. However, if link clipping
is disabled, then IlvFreeLinkConnector
or IlvPinLinkConnector
do usually not produce
aesthetic results, while in that case IlvCenterLinkConnector
or no link connector
might be appropriate. Which link connector is appropriate depends
also on the multilink mode (see setMultiLinkMode(int)
).
style
- The link style value.getLinkStyle()
public int getLinkStyle()
setLinkStyle(int)
public void setConnectLinksToNodeCenters(boolean enable)
NO_RESHAPE_STYLE
and link clipping is not enabled, that is,
if IlvGraphLayout.getLinkClipInterface()
returns null
. If the
argument is true
, the links are connected to the center
of the nodes. If a link connection box is set, it uses the virtual
center of the connection box instead of the center of the bounding
boxes of the end nodes. The virtual center is defined as the center
of the connection box shifted by the average of the tangential "top"
and "bottom" offset in the horizontal direction and by the average of
the tangential "left" and "right" offset in the vertical direction.
For instance, if the tangential offset is 20 at the top side and 10
at all other sides, the average shift offset is (20 + 10)/2 =
15
in the horizontal direction and (10 + 10)/2 =
10
in the vertical direction; hence the virtual center is at
connectionBox.center() + (15, 10)
.
Note that when the graph attached to the layout is of type IlvGrapher
, the effect depends on the type of the link
connectors installed at the node. This option is mainly useful for
the IlvClippingLinkConnector
. It
can also be enabled with the IlvFreeLinkConnector
. Other link connector
types may cause an IlvInappropriateLinkException
during layout
if this option is enabled. 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.
The default value is false
.
isConnectLinksToNodeCenters()
public boolean isConnectLinksToNodeCenters()
true
if the algorithm connects the links to the
centers of the nodes.setConnectLinksToNodeCenters(boolean)
public void setMultiLinkMode(int mode)
NO_BUNDLE
- no bundling. Multiple links between the
same pair of nodes are not spread out and will overlap. STRAIGHT_LINE_BUNDLE
- straight line bundling. Multiple
links between the same pair of nodes are routed as straight lines but
shifted relative to each other to avoid overlaps. Different to the
narrow mode, the shift offset is not limited by the node size. NARROW_STRAIGHT_LINE_BUNDLE
- narrow straight line
bundling (the default). Multiple links between the same pair of nodes
are routed as straight lines but shifted relative to each other to
avoid overlaps. The bundle may appear more narrow since the shift
offset is limited by the size of the end nodes. CONNECTED_ONE_BEND_BUNDLE
- one bend polyline bundling
with connection. Multiple links between the same pair of nodes are
routed with one bend to avoid overlaps. All links of the bundle are
connected to the node and start at the same point and end at the same
point. FREE_ONE_BEND_BUNDLE
- one bend polyline bundling
without enforced connection. Multiple links between the same pair of
nodes are routed with one bend to avoid overlaps. The link
connection point is not enforced, that is, the node and link are free
to decide themselves where to place the connection point. There is no
guarantee that all links of the bundle start or end at a common
point. This mode is in particular useful if an IlvCenterLinkConnector
or IlvPinLinkConnector
is used that cannot
change the connection point, or when an IlvClippingLinkConnector
is used while the
attachment point should not change. NO_RESHAPE_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. We
recommend using links of type IlvPolylineLinkImage
and as link connector IlvClippingLinkConnector
. This link type
and this connector works in all cases. In combination with the
IlvClippingLinkConnector
, enabling
the option setConnectLinksToNodeCenters(boolean)
is useful.
If the link bundle mode is STRAIGHT_LINE_BUNDLE
, NARROW_STRAIGHT_LINE_BUNDLE
or CONNECTED_ONE_BEND_BUNDLE
,
then IlvFreeLinkConnector
might be
appropriate as well. In that case, 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. However, if the link
bundle mode is FREE_ONE_BEND_BUNDLE
, then the IlvCenterLinkConnector
or no link connector
might be appropriate.
mode
- The multilink mode value.getMultiLinkMode()
,
setLinkStyle(int)
public int getMultiLinkMode()
setMultiLinkMode(int)
public final void setMultiLinkOffset(double offset)
STRAIGHT_LINE_BUNDLE
or NARROW_STRAIGHT_LINE_BUNDLE
, it is the offset between the the
multiple straight line links. If the multilink mode is CONNECTED_ONE_BEND_BUNDLE
or FREE_ONE_BEND_BUNDLE
, it is
the offset between the bends that are added to the multiple links to
avoid that those links overlap. If the multilink mode is NO_BUNDLE
, the offset has no effect.
The straight links, or the multilink bends, respectively, are shifted
relative to each other by the multilink offset unless the number of
links times the offset exceeds the max spread value. In that case,
the offset is limited by the max spread value. If the multilink mode
is NARROW_STRAIGHT_LINE_BUNDLE
, the offset is further
limited by the node size.
This offset affects only links that are no self-links. See setMultiSelfLinkOffset(double)
for the same parameter at
self-links.
The default value is 10
.
offset
- The offset value.getMultiLinkOffset()
,
setMultiLinkMode(int)
,
setMultiLinkMaxSpread(double)
,
setMultiSelfLinkOffset(double)
public final double getMultiLinkOffset()
setMultiLinkOffset(double)
,
setMultiLinkMode(int)
public final void setMultiLinkMaxSpread(double maxSpread)
If the multilink mode is STRAIGHT_LINE_BUNDLE
or NARROW_STRAIGHT_LINE_BUNDLE
, the multiple straight line links are
shifted relative to each other to avoid overlaps. If the multilink
mode is CONNECTED_ONE_BEND_BUNDLE
or FREE_ONE_BEND_BUNDLE
, bends are added to the multiple links to
avoid that those links overlap. The straight links, or the multilink
bends, respectively, are shifted relative to each other by the
multilink offset unless the number of links times the offset exceeds
the max spread value. In that case, the offset is limited by the max
spread value. If the multilink mode is NARROW_STRAIGHT_LINE_BUNDLE
, the offset is further limited by the
node size. If the multilink mode is NO_BUNDLE
, the maximum
spread width has no effect.
This maximum spread width affects only links that are no self-links.
See setMultiSelfLinkMaxSpread(double)
for the same parameter
at self-links.
The default maximum spread value is 50
.
maxSpread
- The maximum spread value.getMultiLinkMaxSpread()
,
setMultiLinkOffset(double)
,
setMultiLinkMode(int)
,
setMultiSelfLinkMaxSpread(double)
public final double getMultiLinkMaxSpread()
public void setSelfLinkMode(int mode)
NO_BENDS
- no reshape. Self-links are not reshaped with
bends and may not be visible after layout. CONNECTED_RECTANGULAR
- rectangular self-links with 3
bends and connection. Self-links are reshaped with 3 bends placed in
orthogonal style so that the link segments approximately resemble
three quarters of a rectangle (the fourth quarter being the node
where the self-link is attached). The connection points are placed
on the border of the node. FREE_RECTANGULAR
- rectangular self-links with 3 bends
without enforced connection. Self-links are reshaped with 3 bends
placed at the same position like CONNECTED_RECTANGULAR
.
However, the link connection points are not enforced, that is, the
nodes and links are free to decide themselves where to place the
connection point. Since the connection point is not enforced, the
link segments in free rectangular mode may not be orthogonal. This
mode is in particular useful if an IlvCenterLinkConnector
or IlvPinLinkConnector
is used that cannot
change the connection point. CONNECTED_SQUARE
- square self-links with 3 bends and
connection. Self-links are reshaped with 3 bends placed in orthogonal
style so that the link segments approximately resemble three quarters
of a square (the fourth quarter being the node where the self-link is
attached). If the self-link is a spline link, the square shape might
be more appropriate than a rectangular shape since the spline then
may approximately resemble three quarters of a circle. The
connection points are placed on the border of the node. FREE_SQUARE
- square self-links with 3 bends without
enforced connection. Self-links are reshaped with 3 bends placed at
the same position like CONNECTED_SQUARE
. If the self-link
is a spline link, the square shape might be more appropriate than a
rectangular shape since the spline then may approximately resemble
three quarters of a circle. However, the link connection points are
not enforced, that is, the nodes and links are free to decide
themselves where to place the connection point. Since the connection
point is not enforced, the link segments in free rectangular mode may
not be orthogonal. This mode is in particular useful if an IlvCenterLinkConnector
or IlvPinLinkConnector
is used that cannot
change the connection point. NARROW_CONNECTED_RECTANGULAR
- narrow rectangular
self-links with 3 bends and connection (default). Self-links are
reshaped with 3 bends placed in orthogonal style so that the link
segments approximately resemble three quarters of a rectangle (the
fourth quarter being the node where the self-link is attached). The
connection points are placed on the border of the node. For single
self-links, this mode has the same effect like CONNECTED_RECTANGULAR
. If you have multiple self-links at the same
node, the self-links are shifted by an offset to avoid overlaps. In
this case, this mode differs from CONNECTED_RECTANGULAR
, as
the self-link bundle may appear more narrow since the shift offset of
the multiple self-links is limited by the size of the end node. NARROW_FREE_RECTANGULAR
- narrow rectangular self-links
with 3 bends without enforced connection. Self-links are reshaped
with 3 bends placed at the same position like NARROW_CONNECTED_RECTANGULAR
. For single self-links, this mode has
the same effect like FREE_RECTANGULAR
. If you have multiple
self-links at the same node, the self-links are shifted by an offset
to avoid overlaps. In this case, this mode differs from FREE_RECTANGULAR
, as the self-link bundle may appear more narrow
since the shift offset of the multiple self-links is limited by the
size of the end node. The link connection points are not enforced,
that is, the nodes and links are free to decide themselves where to
place the connection point. Since the connection point is not
enforced, the link segments in free rectangular mode may not be
orthogonal. This mode is in particular useful if an IlvCenterLinkConnector
or IlvPinLinkConnector
is used that cannot
change the connection point. NARROW_CONNECTED_SQUARE
- narrow square self-links with
3 bends and connection. Self-links are reshaped with 3 bends placed
in orthogonal style so that the link segments approximately resemble
three quarters of a square (the fourth quarter being the node where
the self-link is attached). If the self-link is a spline link, the
square shape might be more appropriate than a rectangular shape since
the spline then may approximately resemble three quarters of a
circle. The connection points are placed on the border of the node.
For single self-links, this mode has the same effect like CONNECTED_SQUARE
. If you have multiple self-links at the same node,
the self-links are shifted by an offset to avoid overlaps. In this
case, this mode differs from CONNECTED_SQUARE
, as the
self-link bundle may appear more narrow since the shift offset of the
multiple self-links is limited by the size of the end node. NARROW_FREE_SQUARE
- narrow square self-links with 3
bends without enforced connection. Self-links are reshaped with 3
bends placed at the same position like NARROW_CONNECTED_SQUARE
. If the self-link is a spline link, the
square shape might be more appropriate than a rectangular shape since
the spline then may approximately resemble three quarters of a
circle. For single self-links, this mode has the same effect like
FREE_SQUARE
. If you have multiple self-links at the same
node, the self-links are shifted by an offset to avoid overlaps. In
this case, this mode differs from FREE_SQUARE
, as the
self-link bundle may appear more narrow since the shift offset of the
multiple self-links is limited by the size of the end node. The link
connection points are not enforced, that is, the nodes and links are
free to decide themselves where to place the connection point. Since
the connection point is not enforced, the link segments in free
square mode may not be orthogonal. This mode is in particular useful
if an IlvCenterLinkConnector
or
IlvPinLinkConnector
is used that
cannot change the connection point. NO_RESHAPE_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. We
recommend using links of type IlvPolylineLinkImage
and as link connector IlvClippingLinkConnector
. This link type
and this connector works in all cases. In combination with the
IlvClippingLinkConnector
, enabling
the option setConnectLinksToNodeCenters(boolean)
is useful.
If the self-link mode is CONNECTED_RECTANGULAR
, CONNECTED_SQUARE
, NARROW_CONNECTED_RECTANGULAR
, or NARROW_CONNECTED_SQUARE
, then IlvFreeLinkConnector
might be appropriate
as well. In that case, 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. However, if the link
bundle mode is FREE_RECTANGULAR
, FREE_SQUARE
,
NARROW_FREE_RECTANGULAR
, or NARROW_FREE_SQUARE
,
then the IlvCenterLinkConnector
or
no link connector might be appropriate.
mode
- The mode for self-links.getSelfLinkMode()
,
setLinkStyle(int)
public int getSelfLinkMode()
setSelfLinkMode(int)
public void setSelfLinkOrientation(int orientation)
CLOCK_WISE
- clockwise (default). COUNTER_CLOCK_WISE
- counterclockwise. HORIZONTAL_TO_VERTICAL
- horizontal to vertical.
Self-links start at the left or right side of the node with a
horizontal segment and end at the top or bottom side of the node with
a vertical segment. VERTICAL_TO_HORIZONTAL
- vertical to horizontal.
Self-links start at the top or bottom side of the node with a
vertical segment and end at the left or right side of the node with a
horizontal segment. NO_RESHAPE_STYLE
and the self-link mode is not NO_BENDS
.orientation
- The orientation mode for self-links.getSelfLinkOrientation()
,
setLinkStyle(int)
,
setSelfLinkMode(int)
public int getSelfLinkOrientation()
setSelfLinkOrientation(int)
public void setSelfLinkAllowedCorners(int corners)
ALL_CORNERS
, that is, a combination of all the possible values:
TOP_LEFT
: top left corner.TOP_RIGHT
: top right corner.BOTTOM_RIGHT
: bottom right corner.BOTTOM_LEFT
: bottom left corner.corners
- A bitwise-Or combination of the following values:
TOP_LEFT
: top left corner.TOP_RIGHT
: top right corner.BOTTOM_RIGHT
: bottom right corner.BOTTOM_LEFT
: bottom left corner.ALL_CORNERS
.getSelfLinkAllowedCorners()
public final int getSelfLinkAllowedCorners()
TOP_LEFT
: top left corner.
TOP_RIGHT
: top right corner.
BOTTOM_RIGHT
: bottom right corner.
BOTTOM_LEFT
: bottom left corner.
ALL_CORNERS
.setSelfLinkAllowedCorners(int)
public final void setSelfLinkSpacing(double spacing)
NO_BENDS
, the offset has no effect.
If the spacing is negative, the spacing is calculated automatically.
This is in particular useful for the self-link modes CONNECTED_SQUARE
and NARROW_CONNECTED_SQUARE
in
combination with spline links, to form approximate circle shapes for
the self-links.
The default value is 5
.
spacing
- The spacing value.getSelfLinkSpacing()
,
setSelfLinkMode(int)
public final double getSelfLinkSpacing()
setSelfLinkSpacing(double)
,
setSelfLinkMode(int)
public final void setSelfLinkRelativeAttachPosition(IlvPoint position)
(0.5, 0.1)
specifies the middle of the
top or bottom side and a point that is one tenth of the node height
away from the corner of the self-link at the left or right side. If
the self-link occurs at the bottom right corner, it goes from the
middle of the bottom side, to a point at the right side that is 10%
away from that corner. The attach position (0.0, 0.0)
specifies exactly the corresponding corner. The attach position
(1.0, 1.0)
specified the, in each direction, opposite
corners, that is, if the self-link occurs at the bottom right corner,
it goes from the bottom left corner to the top right corner. Such
extreme values are perhaps not useful; they are mentioned only to
illustrate the meaning of the relative position. The coordinate range
for useful values is approximately between 0.1 and 0.5 for the
relative position.
If the self-link mode is CONNECTED_SQUARE
, NARROW_CONNECTED_SQUARE
, FREE_SQUARE
, or NARROW_FREE_SQUARE
, then the attach position is only respected at
one side and calculate on the other side to form a square.
The real attach position is the sum of the relative attach position and the absolute attach position.
The default value of the relative attach position is (0.5,
0.5)
.
position
- The relative attach position for self-links.setSelfLinkRelativeAttachPosition(IlvPoint)
,
setSelfLinkAbsoluteAttachPosition(IlvPoint)
,
setSelfLinkMode(int)
,
setSelfLinkAllowedCorners(int)
public final IlvPoint getSelfLinkRelativeAttachPosition()
public final void setSelfLinkAbsoluteAttachPosition(IlvPoint position)
(10, 20)
specifies
that the self-link goes from 10 units away from the corner at the
bottom side (that is, x = node.x + node.width - 10
) to
20 units away from the corner at the right side (that is, y =
node.y + node.height - 20
).
If the self-link mode is CONNECTED_SQUARE
, NARROW_CONNECTED_SQUARE
, FREE_SQUARE
, or NARROW_FREE_SQUARE
, then the attach position is only respected at
one side and calculate on the other side to form a square.
The real attach position is the sum of the relative attach position
The real attach position is the sum of the relative attach position and the absolute attach position.
The default value of the absolute attach position is (0,
0)
.
position
- The absolute attach position for self-links.setSelfLinkAbsoluteAttachPosition(IlvPoint)
,
setSelfLinkRelativeAttachPosition(IlvPoint)
,
setSelfLinkMode(int)
,
setSelfLinkAllowedCorners(int)
public final IlvPoint getSelfLinkAbsoluteAttachPosition()
public final void setSelfLinkConnectToNodeCenter(boolean enable)
CONNECTED_RECTANGULAR
, NARROW_CONNECTED_RECTANGULAR
,
CONNECTED_SQUARE
, or NARROW_CONNECTED_SQUARE
. If
disabled, the self-link segments incident to the node border are
orthogonal to the node border. If enabled, the self-link segments are
rotated to point towards the node center.enable
- Whether the option is enabled.isSelfLinkConnectToNodeCenter()
,
setSelfLinkMode(int)
public final boolean isSelfLinkConnectToNodeCenter()
public void setMultiSelfLinkDistribution(int distribution)
CENTERED
- centered (default). The middle of a bundle
of multiple self-links is attached at the reference points for
self-links. The nested circles are equally spread out towards the
inner nesting and towards the outer nesting. OUTER
- towards outer nestings. The innermost self-link
of a bundle of multiple self-links is attached at the reference
points for self-links and the remaining self-links are distributed
towards the outer of the nestings. INNER
- towards inner nestings. The outermost self-link
of a bundle of multiple self-links is attached at the reference
points for self-links and the remaining self-links are distributed
towards the inner of the nestings. NO_RESHAPE_STYLE
and the self-link mode is not NO_BENDS
.distribution
- The distribution mode for multiple self-links.getMultiSelfLinkDistribution()
,
setLinkStyle(int)
,
setSelfLinkMode(int)
public int getMultiSelfLinkDistribution()
setMultiSelfLinkDistribution(int)
public final void setMultiSelfLinkOffset(double offset)
If the self-link mode is not NO_BENDS
, bends are added to
self-links. If there are multiple self-links at the same node, the
bends are shifted relative to each other by the multiple self-link
offset unless the number of self-links times the offset exceeds the
multiple self-link max spread value. In that case, the offset is
limited by the max spread value. If the self-link mode is NARROW_CONNECTED_RECTANGULAR
, NARROW_CONNECTED_SQUARE
,
NARROW_FREE_RECTANGULAR
, or NARROW_FREE_SQUARE
, the
offset is further limited by the node size. If the self-link mode is
NO_BENDS
, the offset has no effect.
This offset affects only self-links, no other multilinks. See setMultiLinkOffset(double)
for the same parameter at other
multilinks.
The default value is 10
.
offset
- The offset value.getMultiSelfLinkOffset()
,
setMultiLinkMode(int)
,
setMultiSelfLinkMaxSpread(double)
,
setMultiLinkOffset(double)
public final double getMultiSelfLinkOffset()
public final void setMultiSelfLinkMaxSpread(double maxSpread)
If the self-link mode is not NO_BENDS
, bends are added to
self-links. If there are multiple self-links at the same node, the
bends are shifted relative to each other by the multiple self-link
offset unless the number of self-links times the offset exceeds the
max spread value. In that case, the offset is limited by the max
spread value. If the self-link mode is NARROW_CONNECTED_RECTANGULAR
, NARROW_CONNECTED_SQUARE
,
NARROW_FREE_RECTANGULAR
, or NARROW_FREE_SQUARE
, the
offset is further limited by the node size. If the self-link mode is
NO_BENDS
, the maximum spread width has no effect.
This maximum spread width affects only self-links, no other
multilinks. See setMultiLinkMaxSpread(double)
for the same
parameter at other multilinks.
The default maximum spread value is 50
.
maxSpread
- The maximum spread value.getMultiSelfLinkMaxSpread()
,
setMultiSelfLinkOffset(double)
,
setSelfLinkMode(int)
,
setMultiLinkMaxSpread(double)
public final double getMultiSelfLinkMaxSpread()
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()
IlvGrapherAdapter
in order to optimize for speed.getMovingNodes
in class IlvGraphLayout
protected IlvGraphLayoutGrapherProperty createLayoutGrapherProperty(String name, boolean withDefaults)
IlvBasicLinkStyleLayoutGrapherProperty
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()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.