ilog.views.graphlayout.link
Class IlvLinkLayout

java.lang.Object
  extended by ilog.views.graphlayout.IlvGraphLayout
      extended by ilog.views.graphlayout.link.IlvLinkLayout
All Implemented Interfaces:
GraphModelListener, Serializable, EventListener

public class IlvLinkLayout
extends IlvGraphLayout

The main class for the Link Layout algorithm.

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 4 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 long link mode should be used if any of the following conditions apply: Here are sample drawings produced by the Link Layout algorithm:
Click on the image to see it in normal size.

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

Click on the image to see it in normal size.

Here are sample drawings produced by the Link Layout algorithm in long link mode:

Click on the image to see it in normal size.

The long link mode can be used to find a route through a labyrinth:

Click on the image to see it in normal size.

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 (IlvShortLinkLayout) 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:

Since:
JViews 3.5.
See Also:
Serialized Form

Field Summary
static int DIRECT_STYLE
          Direct link style option.
static int FIXED_MODE
          Fixed connection point mode.
static int FREE_MODE
          Free connection point mode.
static int LONG_LINKS
          Long links layout mode.
static int MIXED_MODE
          Mixed connection point 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
IlvLinkLayout()
          Creates a new instance of the Link Layout algorithm.
IlvLinkLayout(IlvLinkLayout 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.
 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 IlvLinkLayoutGrapherProperty that stores the parameter settings of this layout class.
protected  IlvGraphLayoutLinkProperty createLayoutLinkProperty(String name, IlvGraphic link, boolean withDefaults)
          Returns a new instance of IlvLinkLayoutLinkProperty that stores the parameter settings of this layout class for links.
 void detach()
          Detaches the graph model from the layout instance.
 int getDestinationPointMode(Object link)
          Returns the destination point mode of an individual link.
 int getGlobalDestinationPointMode()
          Returns the global mode for the connection points of the links on the destination nodes.
 int getGlobalLinkStyle()
          Returns the global style of the shapes of links.
 int getGlobalOriginPointMode()
          Returns the global mode for the connection points of the links on the origin nodes.
 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.
 IlvNodeSideFilter getNodeSideFilter()
          Returns the node-side filter used during layout, or null if none is specified.
 int getOriginPointMode(Object link)
          Returns the origin point mode of an individual link.
 IlvShortLinkLayout 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.
 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 setBalanceSplineCurveThreshold(float threshold)
          Sets the threshold for spline curves on arcs until the optimized spline control point routing tries to balance the curve.
 void setCombinedInterGraphLinksMode(boolean enable)
          Enables the routing of normal links in addition to intergraph links.
 void setCoordinatesMode(int mode)
          Sets the coordinates mode.
 void setDestinationPointMode(Object link, int mode)
          Sets the mode for the connection point on an individual link on the destination node.
 void setFixed(Object nodeOrLink, boolean fixed)
          Allows you to specify whether a link is fixed.
 void setGeometryUpToDate(boolean uptodate)
          This method is normally called with a false argument if the geometry of the graph changed.
 void setGlobalDestinationPointMode(int mode)
          Sets the global mode for the connection point of the links on the destination nodes.
 void setGlobalLinkStyle(int style)
          Sets the global style of the shapes of links.
 void setGlobalOriginPointMode(int mode)
          Sets the global mode for the connection point of the links on the origin nodes.
 void 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 setMaxSplineCurveSize(float size)
          Sets the maximum curve size used when optimized spline control point routing is enabled.
 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 setMinSplineCurveSize(float size)
          Sets the minimum curve size used when optimized spline control point routing is enabled.
 void setNodeBoxInterface(IlvNodeBoxInterface nodeBoxInterface)
          Allows you to specify a node box interface for the obstacle area.
 void setNodeSideFilter(IlvNodeSideFilter 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 setOriginPointMode(Object link, int mode)
          Sets the mode for the connection point on an individual link on the origin node.
 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 setSplineLinkFilter(IlvSplineLinkFilter filter)
          Sets the filter that detects which links are suitable for optimized spline routing.
 void setSplineRoutingEnabled(boolean flag)
          Sets whether the calculation of optimized spline control points is enabled.
 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 supportsSplineRouting()
          Indicates that 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.
 
Methods inherited from class ilog.views.graphlayout.IlvGraphLayout
addGraphLayoutEventListener, addGraphLayoutParameterEventListener, afterLayoutOfSubgraph, attach, beforeLayout, beforeLayoutOfSubgraph, callLayoutStepPerformedIfNeeded, cleanGraphModel, cleanLink, cleanNode, clipAllLinks, clipLink, contentsChanged, createLayoutNodeProperty, 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, isInputCheckEnabled, isLayoutNeeded, isLayoutOfConnectedComponentsEnabled, isLayoutOfConnectedComponentsEnabledByDefault, isLayoutRunning, isLayoutTimeElapsed, isMemorySavings, isPreserveFixedLinks, isPreserveFixedNodes, isSplineRoutingEnabled, isStoppedImmediately, isUseDefaultParameters, isUseSeedValueForRandomGenerator, layoutStepPerformed, onParameterChanged, onParameterChanged, performAutoLayout, performLayout, performLayout, performLayout, PerformLayout, performSublayout, removeGraphLayoutEventListener, removeGraphLayoutParameterEventListener, setAutoLayoutHandler, setGrapher, setLayoutOfConnectedComponents, setLayoutOfConnectedComponentsEnabled, setLayoutRegion, setLayoutRegion, setLayoutRegion, setLayoutReport, setLinkClipInterface, setMemorySavings, setParentLayout, setPreserveFixedNodes, setProperty, setProperty, setSeedValueForRandomGenerator, setUseSeedValueForRandomGenerator, supportsLayoutOfConnectedComponents, supportsLayoutRegion, supportsLinkClipping, supportsMemorySavings, supportsPercentageComplete, supportsPreserveFixedNodes, supportsRandomGenerator, unfixAllLinks, unfixAllNodes, useAnimateRedraw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORTHOGONAL_STYLE

public static final int ORTHOGONAL_STYLE
Orthogonal link style option. When used as the argument of the method 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).

See Also:
Constant Field Values

DIRECT_STYLE

public static final int DIRECT_STYLE
Direct link style option. When used as the argument of the method 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).

See Also:
Constant Field Values

MIXED_STYLE

public static final int MIXED_STYLE
Mixed link style option. When used as the argument of the method 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).

See Also:
Constant Field Values

NO_RESHAPE_STYLE

public static final int NO_RESHAPE_STYLE
No reshape link style option. This can be used for individual links if the global link style is MIXED_STYLE. To specify the style of an individual link, use this option as the argument of the method setLinkStyle(Object, int).

See Also:
Constant Field Values

SHORT_LINKS

public static final int SHORT_LINKS
Short links layout mode. When used as the argument of the method 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 4 bends.

See Also:
Constant Field Values

LONG_LINKS

public static final int LONG_LINKS
Long links layout mode.

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.

See Also:
Constant Field Values

FREE_MODE

public static final int FREE_MODE
Free connection point mode. When used as the argument of the method setGlobalOriginPointMode(int) or setGlobalDestinationPointMode(int), the layout is free to choose the appropriate position of the connection points, except for "pinned" connection points (see IlvGraphModel.hasPinnedConnectionPoint(java.lang.Object, boolean)). To specify the mode for the connection points of an individual link, use this mode as the argument of the method setOriginPointMode(java.lang.Object, int) or setDestinationPointMode(java.lang.Object, int).

Since:
JViews 5.5
See Also:
Constant Field Values

FIXED_MODE

public static final int FIXED_MODE
Fixed connection point mode. When used as the argument of the method setGlobalOriginPointMode(int) or setGlobalDestinationPointMode(int), the layout must keep the current position of the connection point. To specify the mode for the connection points of an individual link, use this mode as the argument of the method setOriginPointMode(java.lang.Object, int) or setDestinationPointMode(java.lang.Object, int).

Since:
JViews 5.5
See Also:
Constant Field Values

MIXED_MODE

public static final int MIXED_MODE
Mixed connection point mode. When used as the argument of the method setGlobalOriginPointMode(int) or setGlobalDestinationPointMode(int), the connection point of each link can have a different mode. The mode for the connection points of an individual link can be set by the method setOriginPointMode(java.lang.Object, int) or setDestinationPointMode(java.lang.Object, int).

Since:
JViews 5.5
See Also:
Constant Field Values
Constructor Detail

IlvLinkLayout

public IlvLinkLayout()
Creates a new instance of the Link Layout algorithm.
To indicate the grapher you want to lay out, use the method IlvGraphLayout.attach(ilog.views.IlvGrapher).
To indicate the graph model you want to lay out, use the method attach(ilog.views.graphlayout.IlvGraphModel).
To perform the layout, use the method IlvGraphLayout.performLayout().
To modify the layout parameters, use the different methods provided in this class and its superclass.

See Also:
IlvGraphLayout.attach(ilog.views.IlvGrapher), IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel), IlvGraphLayout.performLayout(), IlvGrapherAdapter.addLayer(ilog.views.IlvManagerLayer), IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter)

IlvLinkLayout

public IlvLinkLayout(IlvLinkLayout source)
Creates a new layout instance by copying an existing one. This constructor is used by the 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).

Parameters:
source - The layout instance that is copied.
Since:
JViews 5.0
See Also:
copy(), copyParameters(ilog.views.graphlayout.IlvGraphLayout)
Method Detail

init

protected void init()
Initializes instance variables.

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.

Overrides:
init in class IlvGraphLayout
Since:
JViews 5.0

copy

public IlvGraphLayout copy()
Copies the layout instance.

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.

Specified by:
copy in class IlvGraphLayout
Returns:
A copy of the layout instance.
Since:
JViews 5.0
See Also:
copyParameters(ilog.views.graphlayout.IlvGraphLayout), setNodeBoxInterface(ilog.views.graphlayout.IlvNodeBoxInterface), setNodeSideFilter(ilog.views.graphlayout.IlvNodeSideFilter)

copyParameters

public void copyParameters(IlvGraphLayout source)
Copies the parameters from a given layout instance.

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.

Overrides:
copyParameters in class IlvGraphLayout
Parameters:
source - The layout instance from which the parameters are copied.
Since:
JViews 5.0
See Also:
copy(), setNodeBoxInterface(ilog.views.graphlayout.IlvNodeBoxInterface), setNodeSideFilter(ilog.views.graphlayout.IlvNodeSideFilter)

attach

public void attach(IlvGraphModel graphModel)
Allows you to specify the graph model you want to lay out. In addition to the functionality in the base class, the Link Layout attaches its sublayouts, the Short Link Layout and the Long Link Layout.

Overrides:
attach in class IlvGraphLayout
Parameters:
graphModel - The graph model to lay out.
See Also:
detach(), getLongLinkLayout(), getShortLinkLayout()

detach

public void detach()
Detaches the graph model from the layout instance. It also detaches its sublayouts, the Short Link Layout and the Long Link Layout. When you attach a new graph model to the layout instance, you do not need to detach the old graph model because this is done automatically when you call attach(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.

Overrides:
detach in class IlvGraphLayout
See Also:
attach(IlvGraphModel), setLinkStyle(java.lang.Object, int), getLongLinkLayout(), getShortLinkLayout()

setGraphModel

public void setGraphModel(IlvGraphModel graphModel)
Sets the graph model to be laid out. You should not call this method directly. Instead, use the method IlvGraphLayout.attach(IlvGrapher) or attach(IlvGraphModel).

Overrides:
setGraphModel in class IlvGraphLayout
Since:
JViews 5.0

layout

protected void layout(boolean redraw)
               throws IlvGraphLayoutException
Computes the layout using the Link Layout algorithm. To start the layout, call the method IlvGraphLayout.performLayout().

Specified by:
layout in class IlvGraphLayout
Parameters:
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, float, float, boolean) and IlvGraphModel.reshapeLink(java.lang.Object, ilog.views.IlvPoint, ilog.views.IlvPoint[], int, int, ilog.views.IlvPoint, boolean).
Throws:
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.
See Also:
IlvGraphLayout.performLayout()

setLayoutMode

public final void setLayoutMode(int mode)
Sets the layout mode. Valid value are:

The default value is SHORT_LINKS.

See Also:
getLayoutMode(), setGlobalLinkStyle(int), setLinkStyle(java.lang.Object, int), getLongLinkLayout(), getShortLinkLayout()

getLayoutMode

public final int getLayoutMode()
Returns the current layout mode.

See Also:
setLayoutMode(int)

getShortLinkLayout

public IlvShortLinkLayout getShortLinkLayout()
Returns the Short Link Layout instance that is used internally by this Link Layout instance in layout mode SHORT_LINKS. This allows you to access the internal parameter settings of the Short Link Layout.

See Also:
setLayoutMode(int), getLongLinkLayout(), IlvShortLinkLayout

getLongLinkLayout

public IlvLongLinkLayout getLongLinkLayout()
Returns the Long Link Layout instance that is used internally by this Link Layout instance in layout mode LONG_LINKS. This allows you to access the internal parameter settings of the Long Link Layout.

See Also:
setLayoutMode(int), getShortLinkLayout(), IlvLongLinkLayout

setAutoLayout

public final void setAutoLayout(boolean enable)
Enables the auto layout mode. If the argument is 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.

Overrides:
setAutoLayout in class IlvGraphLayout
See Also:
IlvGraphLayout.isAutoLayout(), IlvGraphLayout.contentsChanged(ilog.views.graphlayout.GraphModelEvent), IlvGraphLayout.performAutoLayout()

setIncrementalMode

public final void setIncrementalMode(boolean enable)
Enables the incremental layout mode. If the argument is 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, links already laid out in the last layout keep their general shape (that is keep their number of bends and do not change the side where they connect to the end nodes), except if one or both of their end nodes have been moved or resized.

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.

Parameters:
enable - Set to true to enable incremental layout mode, or false to disable it.
See Also:
isIncrementalMode(), markForIncremental(java.lang.Object), setLayoutMode(int), IlvGraphLayout.contentsChanged(ilog.views.graphlayout.GraphModelEvent), setInterGraphLinksMode(boolean)

isIncrementalMode

public final boolean isIncrementalMode()
Returns true if the incremental mode is enabled.

See Also:
setIncrementalMode(boolean)

markForIncremental

public final void markForIncremental(Object link)
Marks the input link to be rerouted with the next call of 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.

See Also:
setIncrementalMode(boolean), IlvGraphLayout.performLayout()

setInterGraphLinksMode

public final void setInterGraphLinksMode(boolean enable)
Enables the routing of intergraph links. If the argument is 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 intergraph link mode is enabled and the graph actually contains some intergraph links, there are some restrictions:

Since:
JViews 5.0
See Also:
isInterGraphLinksMode(), setCombinedInterGraphLinksMode(boolean), setAnimate(boolean), setIncrementalMode(boolean), IlvGraphModel.isInterGraphLink(java.lang.Object)

isInterGraphLinksMode

public final boolean isInterGraphLinksMode()
Returns true if the routing of intergraph links is enabled. Returns false otherwise.

Since:
JViews 5.0
See Also:
setInterGraphLinksMode(boolean)

setCombinedInterGraphLinksMode

public final void setCombinedInterGraphLinksMode(boolean enable)
Enables the routing of normal links in addition to intergraph links. If intergraph link routing is disabled, the option has no effect. If intergraph link routing is enabled and the argument is 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.

Since:
JViews 5.0
See Also:
isCombinedInterGraphLinksMode(), setInterGraphLinksMode(boolean), IlvGraphModel.isInterGraphLink(java.lang.Object)

isCombinedInterGraphLinksMode

public final boolean isCombinedInterGraphLinksMode()
Returns true if the routing of normal links in addition to intergraph links is enabled. It returns false otherwise.

Since:
JViews 5.0
See Also:
setInterGraphLinksMode(boolean), setCombinedInterGraphLinksMode(boolean)

setLinkOffset

public final void setLinkOffset(float offset)
Sets the offset between links connected on the same side of the node. It affects only the layout mode 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.

See Also:
getLinkOffset(), setLayoutMode(int), setHorizontalGridOffset(float), setVerticalGridOffset(float)

getLinkOffset

public final float getLinkOffset()
Returns the offset between links connected on the same side of the node. This offset affects only the layout mode SHORT_LINKS.

See Also:
setLinkOffset(float)

setHorizontalGridOffset

public final void setHorizontalGridOffset(float offset)
Sets the horizontal offset between the grid lines. 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 5.

See Also:
getHorizontalGridOffset(), setHorizontalMinOffset(float), setHorizontalGridBase(float), setLinkOffset(float), setLayoutMode(int)

getHorizontalGridOffset

public final float getHorizontalGridOffset()
Returns the horizontal offset between the grid lines. This offset affects only the layout mode LONG_LINKS.

See Also:
setHorizontalGridOffset(float)

setVerticalGridOffset

public final void setVerticalGridOffset(float offset)
Sets the vertical offset between the grid lines. 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 5.

See Also:
getVerticalGridOffset(), setVerticalMinOffset(float), setVerticalGridBase(float), setLinkOffset(float), setLayoutMode(int)

getVerticalGridOffset

public final float getVerticalGridOffset()
Returns the vertical offset between the grid lines. This offset affects only the layout mode LONG_LINKS.

See Also:
setVerticalGridOffset(float)

setHorizontalGridBase

public final void setHorizontalGridBase(float coordinate)
Sets the horizontal base coordinate of the grid. This is the 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.

See Also:
getHorizontalGridBase(), setHorizontalGridOffset(float), setLayoutMode(int)

getHorizontalGridBase

public final float getHorizontalGridBase()
Returns the horizontal base coordinate of the grid. This value affects only the layout mode LONG_LINKS.

See Also:
setHorizontalGridBase(float)

setVerticalGridBase

public final void setVerticalGridBase(float coordinate)
Sets the vertical base coordinate of the grid. This is the 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.

See Also:
getVerticalGridBase(), setVerticalGridOffset(float), setLayoutMode(int)

getVerticalGridBase

public final float getVerticalGridBase()
Returns the vertical base coordinate of the grid. This value affects only the layout mode LONG_LINKS.

See Also:
setVerticalGridBase(float)

setHorizontalMinOffset

public final 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. 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 3.

See Also:
getHorizontalMinOffset(), setHorizontalGridOffset(float), setLayoutMode(int)

getHorizontalMinOffset

public final float getHorizontalMinOffset()
Returns the minimal horizontal offset between the node border and a link segment that is (vertically) parallel to the node border. This value affects only the layout mode LONG_LINKS.

See Also:
setHorizontalMinOffset(float)

setVerticalMinOffset

public final 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. 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 3.

See Also:
getVerticalMinOffset(), setVerticalGridOffset(float), setLayoutMode(int)

getVerticalMinOffset

public final float getVerticalMinOffset()
Returns the minimal vertical offset between the node border and a link segment that is (horizontally) parallel to the node border. This value affects only the layout mode LONG_LINKS.

See Also:
setVerticalMinOffset(float)

setMinNodeCornerOffset

public final void setMinNodeCornerOffset(float offset)
Sets the minimum offset between a node corner and a link starting at this node. Setting this to 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.

See Also:
getMinNodeCornerOffset(),