ilog.views.graphlayout.link.shortlink
Class IlvShortLinkLayout

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

public class IlvShortLinkLayout
extends IlvGraphLayout

This class is the main class for the Short Link Layout algorithm.

This algorithm reshapes the links of a graph without moving the nodes. By default, the algorithm computes orthogonal links (that is, links composed of alternating horizontal and vertical segments). Optionally, direct links can be computed. (See setGlobalLinkStyle(int) and setLinkStyle(java.lang.Object, int).)

The links are placed freely in the plane by choosing the best shape from a fixed number of link shapes. Orthogonal links can a maximum of 4 bends. Direct links have 3 bends.
This layout algorithm is recommended when any of the following apply:

Otherwise, the IlvLongLinkLayout may be more suitable.

Here are sample drawings produced by the Short Link Layout algorithm:

See the corresponding chapter of the User's Manual for details on the algorithm, the types of graphs for which this algorithm can be used, the features and limitations, code samples, and so on.

Note the following points:

Since:
JViews 3.5. This class is the renamed and improved version of the class ilog.views.graphlayout.orthogonallink.IlvOrthogonalLinkLayout provided by ILOG JViews 3.0
See Also:
Serialized Form

Field Summary
static int AUTOMATIC_PINS
          Automatic pin style.
static int DIRECT_STYLE
          Direct link style.
static int EVENLY_SPACED_PINS
          Evenly spaced connector pin style.
static int FIRST_LAST_SEGMENT
          Simple link bundles.
static int FIXED_CONNECTION_POINTS_MODE
          Fixed connection points mode.
static int FIXED_MODE
          Fixed mode.
static int FIXED_NODE_SIDES_MODE
          Fixed node side mode.
static int FIXED_OFFSET_PINS
          Fixed offset pin style.
static int FIXED_SHAPE_TYPE_MODE
          Fixed shape type mode.
static int FREE_MODE
          Free mode.
static int IMPROVED_FIRST_LAST_SEGMENT
          Improved link bundles.
static int MIXED_MODE
          Mixed mode.
static int MIXED_STYLE
          Mixed link shape.
static int NO_BUNDLE
          No link bundles.
static int NO_RESHAPE_STYLE
          No reshape link style.
static int ORTHOGONAL_STYLE
          Orthogonal link style.
static int THREE_BENDS_ORTHOGONAL_STYLE
          Three-bends orthogonal self-link.
static int TWO_BENDS_ORTHOGONAL_STYLE
          Two-bends orthogonal self-link.
 
Fields inherited from class ilog.views.graphlayout.IlvGraphLayout
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES
 
Constructor Summary
IlvShortLinkLayout()
          Creates a new instance of the Short Link Layout algorithm.
IlvShortLinkLayout(IlvShortLinkLayout source)
          Creates a new layout instance by copying an existing one.
 
Method Summary
 int checkAppropriateLink(Object link)
          Checks whether the input link is appropriate for this layout.
 void checkAppropriateLinks()
          Throws an exception if the links are not appropriate for the layout.
 IlvGraphLayout copy()
          Copies the layout instance.
 void copyParameters(IlvGraphLayout source)
          Copies the parameters from a given layout instance.
protected  IlvGraphLayoutGrapherProperty createLayoutGrapherProperty(String name, boolean withDefaults)
          Returns a new instance of IlvShortLinkLayoutGrapherProperty that stores the parameter settings of this layout class.
protected  IlvGraphLayoutLinkProperty createLayoutLinkProperty(String name, IlvGraphic link, boolean withDefaults)
          Returns a new instance of IlvShortLinkLayoutLinkProperty that stores the parameter settings of this layout class for links.
protected  IlvGraphLayoutNodeProperty createLayoutNodeProperty(String name, IlvGraphic node, boolean withDefaults)
          Returns a new instance of IlvShortLinkLayoutNodeProperty that stores the parameter settings of this layout class for nodes.
 void detach()
          Detaches the graph model from the layout instance.
 int getAllowedNumberOfIterations()
          Returns the maximum number of allowed optimization iterations.
 IlvLongLinkLayout getAuxiliaryLongLinkLayout()
          Returns the instance of IlvLongLinkLayout that is used for avoiding overlaps between links and nodes when isLinkOverlapNodesForbidden() returns true.
 float getBypassDistance()
          Returns the minimum distance between the origin and destination node for which a link shape going directly from one node to another is allowed.
 int getConnectorStyle(Object node)
          Returns the connector style of an individual node.
 int getDestinationPointMode(Object link)
          Returns the destination point mode of an individual link.
 float getEvenlySpacedPinsMarginRatio()
          Returns the margin ratio for the evenly spaced pins connector style.
 int getGlobalConnectorStyle()
          Returns the global style of the connectors.
 int getGlobalDestinationPointMode()
          Returns the global mode for the connection points of the links on the destination nodes.
 int getGlobalIncrementalModifiedLinkReshapeMode()
          Returns the link reshape mode used during incremental layout for modified links.
 int getGlobalIncrementalUnmodifiedLinkReshapeMode()
          Returns the link reshape mode used during incremental layout for unmodified links.
 int getGlobalLinkStyle()
          Returns the current choice for the style of the shape of the links.
 int getGlobalOriginPointMode()
          Returns the global mode for the connection points of the links on the origin nodes.
 int getGlobalSelfLinkStyle()
          Returns the current choice for the style of the shape of the self-links.
 int getIncrementalModifiedLinkReshapeMode(Object link)
          Returns the link reshape mode of an individual link used during incremental layout for modified links.
 int getIncrementalUnmodifiedLinkReshapeMode(Object link)
          Returns the link reshape mode of an individual link used during incremental layout for unmodified links.
 int getLinkBundlesMode()
          Returns the current choice for the link bundles mode.
 float getLinkOffset()
          Returns the offset between links connected on the same side of the node.
 int getLinkStyle(Object link)
          Returns the style of the shape of an individual link.
 float getLinkToLinkCrossingPenalty()
          Returns the link-to-link crossing penalty factor.
 float getLinkToNodeCrossingPenalty()
          Returns the link-to-node crossing penalty factor.
 float getMinFinalSegmentLength()
          Returns the minimum length of the final segment of the links.
 IlvNodeBoxInterface getNodeBoxInterface()
          Returns the node box interface used during the layout.
 IlvNodeSideFilter getNodeSideFilter()
          Returns the node-side filter used during layout.
 int getOriginPointMode(Object link)
          Returns the origin point mode of an individual link.
protected  void init()
          Initializes instance variables.
 boolean isCombinedInterGraphLinksMode()
          Returns true if the routing of normal links in addition to intergraph links is enabled.
 boolean isIncrementalMode()
          Returns true if the incremental mode is enabled.
 boolean isInterGraphLinksMode()
          Returns true if the routing of intergraph links is enabled.
 boolean isLinkOverlapNodesForbidden()
          Returns true if the overlap of links with nodes is forbidden, and returns false otherwise.
 boolean isSameShapeForMultipleLinks()
          Returns true if the algorithm that ensures that multiple links are reshaped in the same manner is enabled, and false otherwise.
protected  void layout(boolean redraw)
          Computes the layout using the Short Link Layout algorithm.
 void setAllowedNumberOfIterations(int iterations)
          Sets the maximum number of iterations of the layout algorithm.
 void setBypassDistance(float dist)
          Sets the minimum distance between the origin and destination node for which a link shape going directly from one node to another is allowed.
 void setCombinedInterGraphLinksMode(boolean enable)
          Sets the routing of normal links in addition to intergraph links.
 void setConnectorStyle(Object node, int style)
          Sets the connector style of an individual node.
 void setDestinationPointMode(Object link, int mode)
          Sets the mode for the connection point on an individual link on the destination node.
 void setEvenlySpacedPinsMarginRatio(float ratio)
          Sets the margin ratio for the evenly spaced pins connector style.
 void setGlobalConnectorStyle(int style)
          Sets the global style of connectors.
 void setGlobalDestinationPointMode(int mode)
          Sets the global mode for the connection point of the links on the destination nodes.
 void setGlobalIncrementalModifiedLinkReshapeMode(int mode)
          Sets the link reshape mode used during incremental layout for modified links, that is links that have been already laid out in the previous layout execution and for which the bounding box (see getNodeBoxInterface() or the "link connection box" (see @link #getLinkConnectionBoxInterface}) of their origin and destination nodes have been modified.
 void setGlobalIncrementalUnmodifiedLinkReshapeMode(int mode)
          Sets the link reshape mode used during incremental layout for unmodified links, that is links that have been already laid out in the previous layout execution and for which the bounding box (see getNodeBoxInterface() nor the "link connection box" (see @link #getLinkConnectionBoxInterface}) of their origin and destination nodes have not been modified.
 void setGlobalLinkStyle(int style)
          Sets the global style of the shape of the links.
 void setGlobalOriginPointMode(int mode)
          Sets the global mode for the connection point of the links on the origin nodes.
 void setGlobalSelfLinkStyle(int style)
          Sets the global style of the shape of the self-links.
 void setIncrementalMode(boolean enable)
          Sets the incremental layout mode.
 void setIncrementalModifiedLinkReshapeMode(Object link, int mode)
          Sets the link reshape mode of an individual link used during incremental layout for modified links, that is links that have been already laid out in the previous layout execution and for which the bounding box (see getNodeBoxInterface() or the "link connection box" (see @link #getLinkConnectionBoxInterface}) of their origin and destination nodes have been modified.
 void setIncrementalUnmodifiedLinkReshapeMode(Object link, int mode)
          Sets the link reshape mode of an individual link used during incremental layout for unmodified links, that is links that have been already laid out in the previous layout execution and for which the bounding box (see getNodeBoxInterface() nor the "link connection box" (see @link #getLinkConnectionBoxInterface}) of their origin and destination nodes have not been modified.
 void setInterGraphLinksMode(boolean enable)
          Sets the routing of intergraph links.
 void setLinkBundlesMode(int mode)
          Sets the link bundles mode.
 void setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface connectionBoxInterface)
          Sets the link connection box interface for the connection points of links.
 void setLinkOffset(float offset)
          Sets the offset between links connected on the same side of the node.
 void setLinkOverlapNodesForbidden(boolean set)
          Sets whether it is forbidden for the layout to reshape links such that they overlap nodes.
 void setLinkStyle(Object link, int style)
          Sets the style of the shape of an individual link.
 void setLinkToLinkCrossingPenalty(float penalty)
          Sets the link-to-link crossing penalty factor.
 void setLinkToNodeCrossingPenalty(float penalty)
          Sets the link-to-node crossing penalty factor.
 void setMinFinalSegmentLength(float length)
          Sets the minimum length of the final (first and last) segment of the links.
 void setNodeBoxInterface(IlvNodeBoxInterface nodeBoxInterface)
          Sets an object that provides the rectangle defining the position and size of each node.
 void setNodeSideFilter(IlvNodeSideFilter filter)
          Sets the node-side filter, that is, an object that allows or prohibits the connection of the links on a given side of the nodes.
 void setOriginPointMode(Object link, int mode)
          Sets the mode for the connection point on an individual link on the origin node.
 void setSameShapeForMultipleLinks(boolean option)
          Sets whether the layout algorithm must ensure that all multiple links have the same type of shape, that is a shape with the same number of bends and with parallel segments.
 boolean stopImmediately()
          Overridden version of the base class method.
 boolean supportsAllowedTime()
          Indicates that this layout class can stop the layout computation in the proper manner when the user-defined allowed time is exceeded.
 boolean supportsAnimation()
          Indicates that this layout class supports the animation mechanism; that is, it performs a redraw of the grapher after each iteration if the method {#@link #setAnimate(boolean)} is called with a true argument.
 boolean supportsLinkConnectionBox()
          Indicates that this layout class can use a link connection box interface to calculate the end points of a link.
 boolean supportsPreserveFixedLinks()
          Indicates that this layout class allows the user to specify fixed links.
 boolean supportsSaveParametersToNamedProperties()
          Indicates that this layout class can transfer the layout parameters to named properties.
 boolean supportsSplineRouting()
          Tests if this class supports the generic optimization of spline control points.
 boolean supportsStopImmediately()
          Indicates that this layout class can interrupt the current run of the layout immediately in a controlled way.
 
Methods inherited from class ilog.views.graphlayout.IlvGraphLayout
addGraphLayoutEventListener, addGraphLayoutParameterEventListener, afterLayoutOfSubgraph, attach, attach, beforeLayout, beforeLayoutOfSubgraph, callLayoutStepPerformedIfNeeded, cleanGraphModel, cleanLink, cleanNode, clipAllLinks, clipLink, contentsChanged, createLayoutReport, getAllowedTime, getAutoLayoutHandler, getBalanceSplineCurveThreshold, getCalcLayoutRegion, getCoordinatesMode, getGrapher, getGraphModel, getInstanceId, getLayout, getLayoutOfConnectedComponents, getLayoutOfConnectedComponentsReport, getLayoutRegion, getLayoutReport, getLayouts, getLinkClipInterface, getLinkConnectionBoxInterface, getMaxSplineCurveSize, getMinBusyTime, getMinSplineCurveSize, getMovingNodes, getParentLayout, getProperty, getProperty, getRecursiveLayout, getRemainingAllowedTime, getSeedValueForRandomGenerator, getSpecLayoutRegion, getSplineLinkFilter, increasePercentageComplete, isAnimate, isAutoLayout, isFitToView, isFixed, isGeometryUpToDate, isInputCheckEnabled, isLayoutNeeded, isLayoutOfConnectedComponentsEnabled, isLayoutOfConnectedComponentsEnabledByDefault, isLayoutRunning, isLayoutTimeElapsed, isMemorySavings, isParametersUpToDate, isPreserveFixedLinks, isPreserveFixedNodes, isSplineRoutingEnabled, isStoppedImmediately, isStructureUpToDate, isUseDefaultParameters, isUseSeedValueForRandomGenerator, layoutStepPerformed, onParameterChanged, onParameterChanged, performAutoLayout, performLayout, performLayout, performLayout, PerformLayout, performSublayout, removeGraphLayoutEventListener, removeGraphLayoutParameterEventListener, setAllowedTime, setAnimate, setAutoLayout, setAutoLayoutHandler, setBalanceSplineCurveThreshold, setCoordinatesMode, setFixed, setGeometryUpToDate, setGrapher, setGraphModel, setInputCheckEnabled, setLayoutOfConnectedComponents, setLayoutOfConnectedComponentsEnabled, setLayoutRegion, setLayoutRegion, setLayoutRegion, setLayoutReport, setLinkClipInterface, setMaxSplineCurveSize, setMemorySavings, setMinBusyTime, setMinSplineCurveSize, setParametersUpToDate, setParentLayout, setPreserveFixedLinks, setPreserveFixedNodes, setProperty, setProperty, setSeedValueForRandomGenerator, setSplineLinkFilter, setSplineRoutingEnabled, setStructureUpToDate, setUseDefaultParameters, setUseSeedValueForRandomGenerator, supportsLayoutOfConnectedComponents, supportsLayoutRegion, supportsLinkClipping, supportsMemorySavings, supportsPercentageComplete, supportsPreserveFixedNodes, supportsRandomGenerator, unfixAllLinks, unfixAllNodes, useAnimateRedraw
 
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. When used as the argument of the method setGlobalLinkStyle(int), all links get an orthogonal shape (alternating horizontal and vertical segments). To specify the style of an individual link, use this style as the argument of the method setLinkStyle(Object, int).

See Also:
Constant Field Values

DIRECT_STYLE

public static final int DIRECT_STYLE
Direct link style. When used as the argument of the method setGlobalLinkStyle(int), all links get a (semi)direct shape. To specify the style of an individual link, use this style as the argument of the method setLinkStyle(Object, int).

See Also:
Constant Field Values

MIXED_STYLE

public static final int MIXED_STYLE
Mixed link shape. It can be used with the following meanings:

See Also:
Constant Field Values

NO_RESHAPE_STYLE

public static final int NO_RESHAPE_STYLE
No reshape link style. 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 style as the argument of the method setLinkStyle(Object, int).

See Also:
Constant Field Values

NO_BUNDLE

public static final int NO_BUNDLE
No link bundles. When used as the argument of the method setLinkBundlesMode(int), no link bundles are computed.

See Also:
Constant Field Values

FIRST_LAST_SEGMENT

public static final int FIRST_LAST_SEGMENT
Simple link bundles. When used as the argument of the method setLinkBundlesMode(int), only first and last segments of the links are bundled.

See Also:
Constant Field Values

IMPROVED_FIRST_LAST_SEGMENT

public static final int IMPROVED_FIRST_LAST_SEGMENT
Improved link bundles. When used as the argument of the method setLinkBundlesMode(int), the first and the last segments of the links are bundled.

See Also:
Constant Field Values

TWO_BENDS_ORTHOGONAL_STYLE

public static final int TWO_BENDS_ORTHOGONAL_STYLE
Two-bends orthogonal self-link. When used as the argument of the method setGlobalSelfLinkStyle(int), a two-bend shape is given to the self-links, that is, links with the same origin and destination node.

See Also:
Constant Field Values

THREE_BENDS_ORTHOGONAL_STYLE

public static final int THREE_BENDS_ORTHOGONAL_STYLE
Three-bends orthogonal self-link. When used as the argument of the method setGlobalSelfLinkStyle(int), a three-bend shape is given to the self-links, that is, links with the same origin and destination node.

See Also:
Constant Field Values

FREE_MODE

public static final int FREE_MODE
Free mode. It can be used with the following meanings:

Since:
JViews 5.5
See Also:
Constant Field Values

FIXED_MODE

public static final int FIXED_MODE
Fixed mode. It can be used with the following meanings:

Since:
JViews 5.5
See Also:
Constant Field Values

FIXED_SHAPE_TYPE_MODE

public static final int FIXED_SHAPE_TYPE_MODE
Fixed shape type mode. When used as the argument of the method setGlobalIncrementalUnmodifiedLinkReshapeMode(int) or setIncrementalModifiedLinkReshapeMode(java.lang.Object, int), in incremental mode the layout preserves the shape type of the link. This means that both the number of bends and the node sides to which the links are connected are preserved. To specify the mode for the incremental reshape of an individual link, use this mode as the argument of the methods setIncrementalUnmodifiedLinkReshapeMode(java.lang.Object, int) or setIncrementalModifiedLinkReshapeMode(java.lang.Object, int).

Since:
JViews 6.0
See Also:
Constant Field Values

FIXED_NODE_SIDES_MODE

public static final int FIXED_NODE_SIDES_MODE
Fixed node side mode. When used as the argument of the methods setGlobalIncrementalUnmodifiedLinkReshapeMode(int) or setIncrementalModifiedLinkReshapeMode(java.lang.Object, int), in incremental mode the layout preserves the node sides to which the links are connected. To specify the mode for the incremental reshape of an individual link, use this mode as the argument of the methods setIncrementalUnmodifiedLinkReshapeMode(java.lang.Object, int) or setIncrementalModifiedLinkReshapeMode(java.lang.Object, int).

Since:
JViews 6.0
See Also:
Constant Field Values

FIXED_CONNECTION_POINTS_MODE

public static final int FIXED_CONNECTION_POINTS_MODE
Fixed connection points mode. When used as the argument of the methods setGlobalIncrementalUnmodifiedLinkReshapeMode(int) or setIncrementalModifiedLinkReshapeMode(java.lang.Object, int), in incremental mode the layout preserves the connection points of the links. To specify the mode for the incremental reshape of an individual link, use this mode as the argument of the methods setIncrementalUnmodifiedLinkReshapeMode(java.lang.Object, int) or setIncrementalModifiedLinkReshapeMode(java.lang.Object, int).

Since:
JViews 6.0
See Also:
Constant Field Values

MIXED_MODE

public static final int MIXED_MODE
Mixed mode. It can be used with the following meanings:

Since:
JViews 5.5
See Also:
Constant Field Values

AUTOMATIC_PINS

public static final int AUTOMATIC_PINS
Automatic pin style. When used as the argument of the method setGlobalConnectorStyle(int), the connector style of all nodes is automatically selected as follows: The connection points are dispatched in the style FIXED_OFFSET_PINS if doing so no connection point goes outside the border the link is attached to. Otherwise, the connection points are dispatched using the style EVENLY_SPACED_PINS.

To specify the automatic pins connector style for an individual node, use this style as the argument of the method setConnectorStyle(Object, int).

Since:
JViews 6.0
See Also:
Constant Field Values

FIXED_OFFSET_PINS

public static final int FIXED_OFFSET_PINS
Fixed offset pin style. When used as the argument of the method setGlobalConnectorStyle(int), the connector pins of all the links are placed at a fixed distance, given by the method getLinkOffset().

To specify the fixed offset pin style for an individual node, use this style as the argument of the method setConnectorStyle(Object, int).

Since:
JViews 6.0
See Also:
Constant Field Values

EVENLY_SPACED_PINS

public static final int EVENLY_SPACED_PINS
Evenly spaced connector pin style. When used as the argument of the method setGlobalConnectorStyle(int), the connector pins of all the links are evenly spaced along the node border the link is attached to.

To specify the evenly spaced pin style for an individual node, use this style as the argument of the method setConnectorStyle(Object, int).

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

IlvShortLinkLayout

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

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)

IlvShortLinkLayout

public IlvShortLinkLayout(IlvShortLinkLayout 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, 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.

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

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. The other parameters, including the customization interfaces, are also copied.

If a method of the type supportsXXX is associated with a parameter, the parameter is copied only if the corresponding method returns true.

Overrides:
copyParameters in class IlvGraphLayout
Parameters:
source - The layout instance from which the parameters are copied.
Since:
JViews 5.0
See Also:
copy()

detach

public void detach()
Detaches the graph model from the layout instance. 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 IlvGraphLayout.attach(IlvGraphModel).

The method performs cleaning operations on the graph model. In addition to the cleaning operations in the base class, the Short Link Layout removes the link style specifications of individual links.

Note that you must call this method when you no longer need the layout instance. Otherwise, some objects may not be garbage collected.

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

layout

protected void layout(boolean redraw)
               throws IlvGraphLayoutException
Computes the layout using the Short 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()

setLinkOverlapNodesForbidden

public void setLinkOverlapNodesForbidden(boolean set)
Sets whether it is forbidden for the layout to reshape links such that they overlap nodes.

The default value of this parameter is false.

If overlaps are not forbidden, the algorithm tries to avoid overlaps anyway, but may create overlaps, for instance in order to avoid crossings of the link with other links.

If overlaps are forbidden, the algorithm uses the auxiliary link layout (see getAuxiliaryLongLinkLayout() for laying out, in an orthogonal shape, those links that overlap nodes.

Notice that the auxiliary long link works on a grid and the default grid size may need to be reduced to allow this algorithm to avoid the overlaps (see IlvLongLinkLayout.setHorizontalGridOffset(float) and IlvLongLinkLayout.setVerticalGridOffset(float)).

Notice also that forbidding the overlaps can slow down the layout and can produce additional link bends and link crossings.

Since:
JViews 6.0
See Also:
isLinkOverlapNodesForbidden(), getAuxiliaryLongLinkLayout()

isLinkOverlapNodesForbidden

public boolean isLinkOverlapNodesForbidden()
Returns true if the overlap of links with nodes is forbidden, and returns false otherwise.

Since:
JViews 6.0
See Also:
setLinkOverlapNodesForbidden(boolean)

getAuxiliaryLongLinkLayout

public final IlvLongLinkLayout getAuxiliaryLongLinkLayout()
Returns the instance of IlvLongLinkLayout that is used for avoiding overlaps between links and nodes when isLinkOverlapNodesForbidden() returns true.

This method allows you to get this auxiliary layout instance and to customize its parameters if needed. In particular, you can reduce or increase the grid size (see IlvLongLinkLayout.setHorizontalGridOffset(float) and IlvLongLinkLayout.setVerticalGridOffset(float)).

Notice that you should not modify the origin and destination point mode, nor to disable the preservation of fixed links. Notice also that an IlvGraphModel is attached to the IlvLongLinkLayout only if needed, therefore

 getAuxiliaryLongLinkLayout().getGraphModel()
 
can return null.

Since:
JViews 6.0
See Also:
setLinkOverlapNodesForbidden(boolean)

setLinkConnectionBoxInterface

public void setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface connectionBoxInterface)
Sets the link connection box interface for the connection points of links. The link connection box interface is an object that provides the rectangle to which the links are connected for each node, and the tangential shift offset at each side for the connection points.

By default, the layout algorithm places the connection points of the links relative to the bounding box of the nodes (see IlvGraphic.boundingBox() and IlvGraphModel.boundingBox(Object)).

By setting a link connection box interface, the links can be connected relative to a different box (see getBox).

By default, the links are connected symmetrically to the middle of the box, and it is possible to "shift" the links tangentially by using the method getTangentialOffset from the interface IlvLinkConnectionBoxInterface:

This method must return 0 if no offset is necessary on a certain node and/or side.

If you do not call this method, the layout algorithm places the connection points on the node box that has been customized using the method setNodeBoxInterface(ilog.views.graphlayout.IlvNodeBoxInterface). If this method has not been used, the bounding box of the node in the graph model (see IlvGraphModel.boundingBox(Object)) is used.

You can call this method with a null argument to go back to the default behavior.

Overrides:
setLinkConnectionBoxInterface in class IlvGraphLayout
Since:
JViews 3.5 This method replaces the method setLinkConnectionRectangle
See Also:
IlvGraphLayout.getLinkConnectionBoxInterface(), supportsLinkConnectionBox(), IlvGraphLayout.getLinkConnectionBoxInterface(), setNodeBoxInterface(ilog.views.graphlayout.IlvNodeBoxInterface)

setNodeBoxInterface

public void setNodeBoxInterface(IlvNodeBoxInterface nodeBoxInterface)
Sets an object that provides the rectangle defining the position and size of each node.

If you do not call this method, the layout algorithm uses the bounding box of the node (see IlvGraphModel.boundingBox(Object)).

You can call this method with a null argument to go back to the default behavior.

Since:
JViews 3.5
See Also:
getNodeBoxInterface()

getNodeBoxInterface

public IlvNodeBoxInterface getNodeBoxInterface()
Returns the node box interface used during the layout. Returns null if none is specified.

Since:
JViews 3.5
See Also:
setNodeBoxInterface(ilog.views.graphlayout.IlvNodeBoxInterface)

setNodeSideFilter

public void setNodeSideFilter(IlvNodeSideFilter filter)
Sets the node-side filter, that is, an object that allows or prohibits the connection of the links on a given side of the nodes.

If a node-side filter is not installed, and the connection points of the links are not fixed (see setOriginPointMode(java.lang.Object, int), setDestinationPointMode(java.lang.Object, int)), the layout algorithm is free to choose any side of the nodes, except for "pinned" connection points (see IlvGraphModel.hasPinnedConnectionPoint(java.lang.Object, boolean)).

When a filter is installed, the layout algorithm asks the filter at which side of its end node each link is allowed to attach to.

Note the following points: