|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.graphlayout.IlvGraphLayout
ilog.tgo.graphic.graphlayout.IltLinkLayout
public class IltLinkLayout
This is an extended version of the ILOG JViews IlvLinkLayout class. When in short link layout mode, it allows the specification of link connection ports on on every node, and of a set of allowed link connection ports for every link end. It uses an IltShortLinkLayout instance as short link layout.
The Link Layout 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 the method
setGlobalLinkStyle(int).
The layout algorithm has two modes: short link mode and long link mode. The short link mode places the links freely in the plane by choosing the best shape from a fixed number of link shapes. A link has a maximum of 3 bends. The long link mode searches for routes on a grid by avoiding obstacles. By doing this, any link shape can occur (that is, the number of link shapes is unlimited) but a long link route can have many bends.
The long link mode is slower and uses more memory on very large graphs than the short link mode. The short link mode should be used if any of the following conditions apply:

The short link mode works very well with thick links produced by Java 2D:

Here are sample drawings produced by the Link Layout algorithm in long link mode:
The long link mode can be used to find a route through a labyrinth:
The Link Layout algorithm is a wrapper that allows simplified
access to two sublayouts: the Short Link Layout algorithm and the
Long Link Layout algorithm. It calls these sublayouts internally
to perform the layout. This is useful for applications that need to use
both layout modes at the same time.
Applications that use the short link mode exclusively can use the
Short Link Layout algorithm (IltShortLinkLayout) directly.
Applications that use the long link mode exclusively can use the
Long Link Layout algorithm (IlvLongLinkLayout) directly.
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:
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.
| Field Summary | |
|---|---|
static int |
DIRECT_STYLE
Direct link style option. |
static int |
LONG_LINKS
Long links layout mode. |
static int |
MIXED_STYLE
Mixed link style option. |
static int |
NO_RESHAPE_STYLE
No reshape link style option. |
static int |
ORTHOGONAL_STYLE
Orthogonal link style option. |
static int |
SHORT_LINKS
Short links layout mode. |
| Fields inherited from class ilog.views.graphlayout.IlvGraphLayout |
|---|
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES |
| Constructor Summary | |
|---|---|
IltLinkLayout()
Creates a new instance of the Link Layout algorithm. |
|
IltLinkLayout(IltLinkLayout source)
Creates a new layout instance by copying an existing one. |
|
| Method Summary | |
|---|---|
void |
attach(IlvGraphModel graphModel)
Allows you to specify the graph model you want to lay out. |
int |
checkAppropriateLink(Object link)
Checks whether the input link is appropriate for this layout. |
void |
checkAppropriateLinks()
Throws an exception if the links are not appropriate for the layout. |
void |
contentsChanged(GraphModelEvent event)
Overridden version of the base class method to allow the layout to be automatically restarted each time the layout instance is notified that the structure or the geometry of the graph has changed. |
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 IltLinkLayoutGrapherProperty
that stores the parameter settings of this layout class. |
protected IlvGraphLayoutLinkProperty |
createLayoutLinkProperty(String name,
IlvGraphic link,
boolean withDefaults)
Returns a new instance of IltLinkLayoutLinkProperty
that stores the parameter settings of this layout class for links. |
void |
detach()
Detaches the graph model from the layout instance. |
int |
getGlobalLinkStyle()
Returns the global style of the shapes of links. |
float |
getHorizontalGridBase()
Returns the horizontal base coordinate of the grid. |
float |
getHorizontalGridOffset()
Returns the horizontal offset between the grid lines. |
float |
getHorizontalMinOffset()
Returns the minimal horizontal offset between the node border and a link segment that is (vertically) parallel to the node border. |
int |
getLayoutMode()
Returns the current layout mode. |
float |
getLinkOffset()
Returns the offset between links connected on the same side of the node. |
int |
getLinkStyle(Object link)
Returns the shape style of an individual link. |
IlvLongLinkLayout |
getLongLinkLayout()
Returns the Long Link Layout instance that is used internally by this Link Layout instance in layout mode LONG_LINKS. |
float |
getMinFinalSegmentLength()
Returns the minimum length of the first and last segments of each link. |
float |
getMinNodeCornerOffset()
Returns the minimum offset between a node corner and a link starting at this node. |
IlvNodeBoxInterface |
getNodeBoxInterface()
Returns the node box interface used during the layout, or null if none is specified. |
IltNodeSideFilter |
getNodeSideFilter()
Returns the node-side filter used during layout, or null if none is specified. |
IltShortLinkLayout |
getShortLinkLayout()
Returns the Short Link Layout instance that is used internally by this Link Layout instance in layout mode SHORT_LINKS. |
float |
getVerticalGridBase()
Returns the vertical base coordinate of the grid. |
float |
getVerticalGridOffset()
Returns the vertical offset between the grid lines. |
float |
getVerticalMinOffset()
Returns the minimal vertical offset between the node border and a link segment that is (horizontally) parallel to the node border. |
protected void |
init()
Initializes instance variables. |
boolean |
isCombinedInterGraphLinksMode()
Returns true if the routing of normal links in addition to
intergraph links is enabled. |
boolean |
isGeometryUpToDate()
Returns false if at least one node, link, label or obstacle
was moved or reshaped since the last time the layout was successfully
performed on the same graph or if the layout has never been performed
successfully on the same graph. |
boolean |
isIncrementalMode()
Returns true if the incremental mode is enabled. |
boolean |
isInterGraphLinksMode()
Returns true if the routing of intergraph links is enabled. |
boolean |
isParametersUpToDate()
Returns false if at least one parameter was modified since
the last time the layout was successfully performed on the same graph
or if the layout has never been performed successfully on the same graph. |
boolean |
isStructureUpToDate()
Returns false if at least one modification occurred in the
structure of the graph since the last time the layout was successfully
performed on the same graph or if the layout has never been performed
successfully on the same graph. |
protected void |
layout(boolean redraw)
Computes the layout using the Link Layout algorithm. |
void |
markForIncremental(Object link)
Marks the input link to be rerouted with the next call of performLayout if incremental mode is enabled. |
protected void |
performAutoLayout()
Performs the layout again following a structural or a geometric change of the graph. |
void |
setAllowedTime(long time)
Sets an upper limit for the duration of the layout algorithm. |
void |
setAnimate(boolean option)
Enables the animation mechanism. |
void |
setAutoLayout(boolean enable)
Enables the auto layout mode. |
void |
setCombinedInterGraphLinksMode(boolean enable)
Enables the routing of normal links in addition to intergraph links. |
void |
setCoordinatesMode(int mode)
Sets the coordinates mode. |
void |
setGeometryUpToDate(boolean uptodate)
This method is normally called with a false argument
if the geometry of the graph changed. |
void |
setGlobalLinkStyle(int style)
Sets the global style of the shapes of links. |
void |
setGraphModel(IlvGraphModel graphModel)
Sets the graph model to be laid out. |
void |
setHorizontalGridBase(float coordinate)
Sets the horizontal base coordinate of the grid. |
void |
setHorizontalGridOffset(float offset)
Sets the horizontal offset between the grid lines. |
void |
setHorizontalMinOffset(float offset)
Sets the minimal horizontal offset between the node border and a link segment that is (vertically) parallel to the node border. |
void |
setIncrementalMode(boolean enable)
Enables the incremental layout mode. |
void |
setInputCheckEnabled(boolean enable)
Enables the checks for the nodes and/or links provided as arguments for the different methods of this layout algorithm. |
void |
setInterGraphLinksMode(boolean enable)
Enables the routing of intergraph links. |
void |
setLayoutMode(int mode)
Sets the layout mode. |
void |
setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface connectionBoxInterface)
Allows you to specify a link connection box interface for the connection points of links. |
void |
setLinkOffset(float offset)
Sets the offset between links connected on the same side of the node. |
void |
setLinkStyle(Object link,
int style)
Sets the shape style of an individual link. |
void |
setMinBusyTime(long time)
Sets the minimal time that the layout algorithm can be busy between two calls of layoutStepPerformed when the method
callLayoutStepPerformedIfNeeded is used. |
void |
setMinFinalSegmentLength(float length)
Sets the minimum length of the first and last segments of each link. |
void |
setMinNodeCornerOffset(float offset)
Sets the minimum offset between a node corner and a link starting at this node. |
void |
setNodeBoxInterface(IlvNodeBoxInterface nodeBoxInterface)
Allows you to specify a node box interface for the obstacle area. |
void |
setNodeSideFilter(IltNodeSideFilter filter)
Allows you to install a node-side filter, that is, an object that allows or prohibits the connection of the links on a given side of the nodes. |
void |
setParametersUpToDate(boolean uptodate)
This method is automatically called with a false argument
each time the value of a parameter is changed. |
void |
setPreserveFixedLinks(boolean option)
If the argument is true, specifies that the layout is not allowed to reshape
the links indicated as fixed by the user. |
void |
setStructureUpToDate(boolean uptodate)
This method is normally called with a false argument
if the structure of the graph changed. |
void |
setUseDefaultParameters(boolean option)
If the argument is true, specifies that the layout use the default
values of all the parameters; that is, the "get..." and "is..." methods
return the default values. |
void |
setVerticalGridBase(float coordinate)
Sets the vertical base coordinate of the grid. |
void |
setVerticalGridOffset(float offset)
Sets the vertical offset between the grid lines. |
void |
setVerticalMinOffset(float offset)
Sets the minimal vertical offset between the node border and a link segment that is (horizontally) parallel to the node border. |
boolean |
stopImmediately()
Stops the running layout algorithm as soon as possible. |
boolean |
supportsAllowedTime()
Indicates that this layout class can stop the layout computation in a proper manner when the user-defined allowed time is exceeded. |
boolean |
supportsAnimation()
Indicates that this layout class supports the animation mechanism; that is, it can perform redraws to animate the layout process in some way. |
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 |
supportsStopImmediately()
Indicates that this layout class can interrupt the current run of the layout immediately in a controlled way. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ORTHOGONAL_STYLE
setGlobalLinkStyle(int), all links have an orthogonal shape
(alternating horizontal and vertical segments).
To specify the style of an individual link, use this option as the
argument of the method setLinkStyle(Object, int).
public static final int DIRECT_STYLE
setGlobalLinkStyle(int), all links have a (semi)direct shape.
To specify the style of an individual link, use this option as the
argument of the method setLinkStyle(Object, int).
public static final int MIXED_STYLE
setGlobalLinkStyle(int), each link can have a different shape.
The shape of an individual link can be set by the method
setLinkStyle(java.lang.Object, int).
public static final int NO_RESHAPE_STYLE
MIXED_STYLE.
To specify the style of an individual link, use this option as the
argument of the method setLinkStyle(Object, int).
public static final int SHORT_LINKS
setLayoutMode(int),
links are placed freely in the plane by choosing the best shape from a
fixed number of link shapes. A link can have a maximum of 3 bends.
public static final int LONG_LINKS
When used as the argument of the method setLayoutMode(int),
links of link style ORTHOGONAL_STYLE are routed on a grid
and avoid obstacles.
By so doing, any orthogonal link shape can occur (that is, the number of
link shapes is unlimited) and a long link route can have many bends.
Links of link style DIRECT_STYLE are routed with the end
segments on the grid, but the middle segment may overlap obstacles.
| Constructor Detail |
|---|
public IltLinkLayout()
IlvGraphLayout.attach(ilog.views.IlvGrapher).
attach(ilog.views.graphlayout.IlvGraphModel).
IlvGraphLayout.performLayout().
IlvGraphLayout.attach(ilog.views.IlvGrapher),
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel),
IlvGraphLayout.performLayout(),
IlvGrapherAdapter.addLayer(ilog.views.IlvManagerLayer),
IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter)public IltLinkLayout(IltLinkLayout source)
copy() method.
Any subclass should provide a copy constructor.
The parameters of the source layout are copied using
the method copyParameters(ilog.views.graphlayout.IlvGraphLayout).
source - The layout instance that is copied.copy(),
copyParameters(ilog.views.graphlayout.IlvGraphLayout)| Method Detail |
|---|
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 IlvGraphLayoutpublic IlvGraphLayout copy()
This method copies the layout instance by calling the copy constructor.
When performing a recursive layout on a nested graph,
IlvLayoutProvider uses this method to
"clone" the layout instance of a parent graph.
Note that the parameters which are specific to a node or a link are
not copied. Only the global parameters are copied. The customization
interfaces (node side filter, node box interface) are also copied.
copy in class IlvGraphLayoutcopyParameters(ilog.views.graphlayout.IlvGraphLayout),
setNodeBoxInterface(ilog.views.graphlayout.IlvNodeBoxInterface),
setNodeSideFilter(ilog.tgo.graphic.graphlayout.IltNodeSideFilter)public void copyParameters(IlvGraphLayout source)
Note that the parameters which are specific to a node or a link are not copied. Only the global parameters are copied. The customization interfaces (node side filter, node box interface) are also copied.
copyParameters in class IlvGraphLayoutsource - The layout instance from which the parameters are copied.copy(),
setNodeBoxInterface(ilog.views.graphlayout.IlvNodeBoxInterface),
setNodeSideFilter(ilog.tgo.graphic.graphlayout.IltNodeSideFilter)public void attach(IlvGraphModel graphModel)
attach in class IlvGraphLayoutgraphModel - The graph model to lay out.detach(),
getLongLinkLayout(),
getShortLinkLayout()public void detach()
attach(ilog.views.graphlayout.IlvGraphModel).
The detach method performs cleaning operations on the
graph model.
In addition to the cleaning operations in the base class, the 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 IlvGraphLayoutattach(ilog.views.graphlayout.IlvGraphModel),
setLinkStyle(java.lang.Object, int),
getLongLinkLayout(),
getShortLinkLayout()public void setGraphModel(IlvGraphModel graphModel)
IlvGraphLayout.attach(IlvGrapher) or
attach(IlvGraphModel).
setGraphModel in class IlvGraphLayout
protected void layout(boolean redraw)
throws IlvGraphLayoutException
IlvGraphLayout.performLayout().
layout in class IlvGraphLayoutredraw - 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, float, float, 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 final void setLayoutMode(int mode)
SHORT_LINKS -
Links are placed freely in the plane by choosing the best shape from
a fixed number of link shapes. A link can have a maximum of 3 bends.
LONG_LINKS -
Orthogonal links are routed on a grid by avoiding obstacles.
Any orthogonal link shape can occur (that is, the number
of link shapes is not limited) but a long link route can have many
bends.
Direct links are routed with the end segments on the grid, but the
middle segment may overlap obstacles.
The default value is SHORT_LINKS.
getLayoutMode(),
setGlobalLinkStyle(int),
setLinkStyle(java.lang.Object, int),
getLongLinkLayout(),
getShortLinkLayout()public final int getLayoutMode()
setLayoutMode(int)public IltShortLinkLayout getShortLinkLayout()
SHORT_LINKS.
This allows you to access the internal parameter settings of the
Short Link Layout.
setLayoutMode(int),
getLongLinkLayout(),
IltShortLinkLayoutpublic IlvLongLinkLayout getLongLinkLayout()
LONG_LINKS.
This allows you to access the internal parameter settings of the
Long Link Layout.
setLayoutMode(int),
getShortLinkLayout(),
IlvLongLinkLayoutpublic void contentsChanged(GraphModelEvent event)
If auto layout is enabled (that is, IlvGraphLayout.isAutoLayout() returns
true) the method calls performAutoLayout()
to redo the layout.
contentsChanged in interface GraphModelListenercontentsChanged in class IlvGraphLayoutIlvGraphLayout.isAutoLayout(),
performAutoLayout()protected void performAutoLayout()
You should not call this method directly.
The method is called by contentsChanged(ilog.views.graphlayout.GraphModelEvent).
The default implementation simply calls the method
IlvGraphLayout.performLayout(boolean, boolean) with
both force and redraw arguments at
true.
The method can be overridden to catch the exception
IlvInappropriateLinkException thrown by the method
IlvGraphLayout.performLayout(boolean, boolean) and to execute
the most appropriate action.
The utility method IlvGraphLayoutUtil.EnsureAppropriateLinks(ilog.views.graphlayout.IlvGraphModel, ilog.views.graphlayout.IlvLayoutProvider)
can be used to replace the inappropriate links, and then the layout can be
restarted.
performAutoLayout in class IlvGraphLayoutsetAutoLayout(boolean),
contentsChanged(ilog.views.graphlayout.GraphModelEvent)public final void setAutoLayout(boolean enable)
true, the layout is automatically performed again
each time the layout instance is notified that the geometry
or the structure of the graph has changed.
It is disabled by default.
setAutoLayout in class IlvGraphLayoutIlvGraphLayout.isAutoLayout(),
contentsChanged(ilog.views.graphlayout.GraphModelEvent),
performAutoLayout()public final void setIncrementalMode(boolean enable)
true,
only those links that were affected by changes since the last layout are
rerouted. A link is rerouted under the following conditions:
In short link mode, the rerouted links keep their general shape but adjust the bends as necessary. The rerouted links do not change the side where they are connected to the end nodes.
In long link mode, the rerouted links can change shape completely. The rerouted links can change the side where they are connected to the end nodes if this is necessary to obtain a better route.
The incremental mode works only if the intergraph links mode is disabled or if there are no intergraph links. The incremental mode is disabled by default.
isIncrementalMode(),
markForIncremental(java.lang.Object),
setLayoutMode(int),
contentsChanged(ilog.views.graphlayout.GraphModelEvent),
setInterGraphLinksMode(boolean)public final boolean isIncrementalMode()
true if the incremental mode is enabled.
setIncrementalMode(boolean)public final void markForIncremental(Object link)
performLayout if incremental mode is enabled.
Normally, the incremental layout reroutes only those links that have
changed since the last layout. By setting a mark on the link, this link
will be rerouted even if it has not changed.
setIncrementalMode(boolean),
IlvGraphLayout.performLayout()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 a given graph that has an
origin or destination not stored in this graph.
If additionally the combined intergraph link routing is enabled, 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 the intergraph link mode is enabled and the graph actually contains 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 ensure that all graph models of
all subgraphers use the same coordinate system through appropriate
coordinate transformations.
isInterGraphLinksMode(),
setCombinedInterGraphLinksMode(boolean),
setAnimate(boolean),
setIncrementalMode(boolean),
IlvGraphModel.isInterGraphLink(java.lang.Object)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(java.lang.Object)public final boolean isCombinedInterGraphLinksMode()
true if the routing of normal links in addition to
intergraph links is enabled.
It returns false otherwise.
setInterGraphLinksMode(boolean),
setCombinedInterGraphLinksMode(boolean)public final void setLinkOffset(float offset)
SHORT_LINKS where the links
are placed freely. In the layout mode LONG_LINKS, the link offset
parameter is ignored, because the offset between links is implicitly
determined by the grid width.
The default value is 2.
getLinkOffset(),
setLayoutMode(int),
setHorizontalGridOffset(float),
setVerticalGridOffset(float)public final float getLinkOffset()
SHORT_LINKS.
setLinkOffset(float)public final void setHorizontalGridOffset(float offset)
LONG_LINKS where the links
are routed on an orthogonal grid. In the layout mode SHORT_LINKS,
links are placed freely and the grid parameters are ignored.
The default value is 5.
getHorizontalGridOffset(),
setHorizontalMinOffset(float),
setHorizontalGridBase(float),
setLinkOffset(float),
setLayoutMode(int)public final float getHorizontalGridOffset()
LONG_LINKS.
setHorizontalGridOffset(float)public final void setVerticalGridOffset(float offset)
LONG_LINKS where the links
are routed on an orthogonal grid. In the layout mode SHORT_LINKS,
links are placed freely and the grid parameters are ignored.
The default value is 5.
getVerticalGridOffset(),
setVerticalMinOffset(float),
setVerticalGridBase(float),
setLinkOffset(float),
setLayoutMode(int)public final float getVerticalGridOffset()
LONG_LINKS.
setVerticalGridOffset(float)public final void setHorizontalGridBase(float coordinate)
x coordinate of the first vertical grid line.
It affects only the layout mode LONG_LINKS where the links
are routed on an orthogonal grid. In the layout mode SHORT_LINKS,
links are placed freely and the grid parameters are ignored.
The default value is 0.
getHorizontalGridBase(),
setHorizontalGridOffset(float),
setLayoutMode(int)public final float getHorizontalGridBase()
LONG_LINKS.
setHorizontalGridBase(float)public final void setVerticalGridBase(float coordinate)
y coordinate of the first horizontal grid line.
It affects only the layout mode LONG_LINKS where the links
are routed on an orthogonal grid. In the layout mode SHORT_LINKS,
links are placed freely and the grid parameters are ignored.
The default value is 0.
getVerticalGridBase(),
setVerticalGridOffset(float),
setLayoutMode(int)public final float getVerticalGridBase()
LONG_LINKS.
setVerticalGridBase(float)public final void setHorizontalMinOffset(float offset)
LONG_LINKS where the links
are routed on an orthogonal grid. In the layout mode SHORT_LINKS,
links are placed freely and the grid parameters are ignored.
The default value is 3.
getHorizontalMinOffset(),
setHorizontalGridOffset(float),
setLayoutMode(int)public final float getHorizontalMinOffset()
LONG_LINKS.
setHorizontalMinOffset(float)public final void setVerticalMinOffset(float offset)
LONG_LINKS where the links
are routed on an orthogonal grid. In the layout mode SHORT_LINKS,
links are placed freely and the grid parameters are ignored.
The default value is 3.
getVerticalMinOffset(),
setVerticalGridOffset(float),
setLayoutMode(int)public final float getVerticalMinOffset()
LONG_LINKS.
setVerticalMinOffset(float)public final void setMinNodeCornerOffset(float offset)
0 enables the layout to start a link exactly
at a node corner.
It affects only the layout mode LONG_LINKS where the links
are routed on an orthogonal grid and always connect to the node border.
In the layout mode SHORT_LINKS, links are placed freely in the
plane, potentially connecting outside the node border.
The default value is 3.
getMinNodeCornerOffset(),
setLayoutMode(int)public final float getMinNodeCornerOffset()
LONG_LINKS.
setMinNodeCornerOffset(float)public final void setMinFinalSegmentLength(float length)
The default value is 10.
getMinFinalSegmentLength()public final float getMinFinalSegmentLength()
setMinFinalSegmentLength(float)public final void setGlobalLinkStyle(int style)
ORTHOGONAL_STYLE -
all links have an orthogonal shape, that is, a shape consisting of a
sequence of alternating horizontal and vertical line segments.
DIRECT_STYLE -
all links get a nearly straight-line shape. The shape of the links is
a polyline composed of a straight-line segment between the end nodes with
two short horizontal or vertical segments at its ends (their length is
controlled by the method setMinFinalSegmentLength
and may be 0).
MIXED_STYLE -
each link can have a different link style.
The style of each individual link can be set by the method
setLinkStyle(Object, int) so that different link shapes can
occur in the same graph.
Unless the global link style is MIXED_STYLE, all links
have the same shape style.
The default value is 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
IlvRelativeLinkConnector. Other link or connector types may cause
an IlvInappropriateLinkException during layout. You can use the
method IlvGraphLayoutUtil.EnsureAppropriateLinkTypes(ilog.views.graphlayout.IlvGraphLayout, boolean) and
method IlvGraphLayoutUtil.EnsureAppropriateLinkConnectors(ilog.views.graphlayout.IlvGraphLayout, boolean) before
layout, or the method IlvGraphLayoutUtil.EnsureAppropriateLinks(ilog.views.graphlayout.IlvGraphModel, ilog.views.graphlayout.IlvLayoutProvider)
when the exception is caught, to convert all links and link connectors
to an appropriate type.
getGlobalLinkStyle(),
setLinkStyle(java.lang.Object, int),
setLayoutMode(int)public final int getGlobalLinkStyle()
setGlobalLinkStyle(int)
public final void setLinkStyle(Object link,
int style)