ilog.views.graphic.linkbundle
Class IlvLinkBundle

java.lang.Object
  extended by ilog.views.IlvGraphic
      extended by ilog.views.IlvLinkImage
          extended by ilog.views.graphic.IlvPolylineLinkImage
              extended by ilog.views.graphic.linkbundle.IlvLinkBundle
All Implemented Interfaces:
IlvGraphicBag, IlvPolyPointsInterface, IlvPersistentObject, Transferable, Serializable

public class IlvLinkBundle
extends IlvPolylineLinkImage
implements IlvGraphicBag

The IlvLinkBundle class provides a link object that stores and represents a bundle of individual links ("sublinks").

This link class can be used to force the display of a collection of links between two nodes in a fixed order and with a specified distance between them. A link bundle groups a number of links that are laid out in the order in which they are added to the link bundle. The spacing between the links is known as the link offset (see setOffset(float). This value is specific to each link bundle: in the same grapher, different bundles can have different offsets.

The extremities of a link bundle and of the sublinks it gathers must match in the sense that, for each sublink, the origin and the destination nodes of the link must either:

When a link is added to a link bundle, its origin and destination nodes are forced to those of the link bundle if they do not match. Finally, when the origin or destination nodes of a link bundle is changed, the corresponding origin or destination node of the sublinks are changed accordingly.

The sublinks can be of any class. Notice however that the link bundle must be allowed to move the points of the link (connection points and intermediate points if any). Hence, links of type IlvOneLinkImage, IlvDoubleLinkImage, IlvOneSplineLinkImage and IlvDoubleSplineLinkImage are usually not appropriate, because they don't allow the intermediate points to be moved freely.

To obtain a consistent layout, it is not recommended to mix in the same bundle spline links (IlvSplineLinkImage) with polyline links (IlvSplineLinkImage etc.). Either use only polyline links, or use only spline links for both the sublinks and for the overview link. An overview link of type IlvSplineLinkImage should be set on the link bundle when the sublinks are splines.

Also, a link connector class allowing the connection points to be moved freely must be installed either

For details on how to attach a link connector to nodes or links, see the documentation of (@link IlvLinkConnector}. The recommended link connector is IlvClippingLinkConnector.

Similar to submanagers and subgraphs, the link bundle has two states:

The link bundle gives the sublinks a polyline shape when no overview link is specified. If an overview link is specified, the shape of the sublinks depends on the type of the specified overview link: spline shape for IlvSplineLinkImage and subclasses, otherwise polyline shape.

The following code sample shows an example of how to build a link bundle:

 // Create the origin and destination nodes of the link
 IlvGraphic origin = new IlvReliefRectangle(new IlvRect(50, 50, 40, 40));
 IlvGraphic dest = new IlvReliefRectangle(new IlvRect(350, 50, 40, 40));

 // Create the sublinks
 IlvLinkImage sublink1 = new IlvPolylineLinkImage(origin, dest, false, null);
 // If appropriate, some sublinks can have the reversed orientation:
 IlvLinkImage sublink2 = new IlvPolylineLinkImage(dest, origin, false, null);

 // Ensure that the connection points of all links can be freely moved
 // and are clipped on the border of their adjacent nodes. For instance:
 new IlvClippingLinkConnector(origin);
 new IlvClippingLinkConnector(dest);*

 // Alternatively, if a different type of link connector is needed on links that
 // are not sublinks in bundles, the IlvClippingLinkConnector can be installed
 // directly on the sublinks of the bundle, while a different type of link
 // connector can exist on the nodes:
 // new IlvClippingLinkConnector(sublink1, true);  // origin of sublink1
 // new IlvClippingLinkConnector(sublink1, false); // destination of sublink1
 // new IlvClippingLinkConnector(sublink2, true);  // origin of sublink2
 // new IlvClippingLinkConnector(sublink2, false); // destination of sublink2

 // Create the link bundle
 IlvLinkBundle linkBundle = new IlvLinkBundle(origin, dest, false);

 // Add the sublinks to the link bundle
 linkBundle.addSublink(sublink1);
 linkBundle.addSublink(sublink2);

 // Alternatively, and more efficiently, the sublinks can be specified
 // at once using the method addSublinks(IlvLinkImage[] sublinks).

 // Optional: specify the overview link
 linkBundle.setOverviewLink(new IlvPolylineLinkImage(origin, dest, false,  null);

 // Add the nodes and links to the grapher
 grapher.addNode(origin, false);
 grapher.addNode(dest, false);
 grapher.addLink(linkBundle, false);
 

On links of the type IlvEnhancedPolylineLinkImage and subclasses, a complementary bundling mechanism (with some restrictions) can be activated using IlvEnhancedPolylineLinkImage.setMultiLinkBundled(boolean). See also IlvBundleLinkShapePolicy.

Since:
JViews 8.0
See Also:
Serialized Form

Constructor Summary
IlvLinkBundle()
          Creates a new empty IlvLinkBundle instance.
IlvLinkBundle(IlvGraphic from, IlvGraphic to, boolean oriented)
          Creates a new IlvLinkBundle instance with no intermediate points and no overview link.
IlvLinkBundle(IlvGraphic from, IlvGraphic to, boolean oriented, IlvPoint[] points)
          Creates a new IlvLinkBundle instance with no overview link.
IlvLinkBundle(IlvGraphic from, IlvGraphic to, boolean oriented, IlvPoint[] points, IlvLinkImage overviewLink)
          Creates a new IlvLinkBundle instance.
IlvLinkBundle(IlvInputStream stream)
          Reads the object from an IlvInputStream.
IlvLinkBundle(IlvLinkBundle source)
          Creates an IlvLinkBundle by copying an existing one.
 
Method Summary
 void addLinkBundleSelectionChangedListener(LinkBundleSelectionChangedListener listener)
          Adds the specified listener to receive events from the link bundle when the selection of sublinks changes.
 void addObject(IlvGraphic obj, boolean redraw)
          You should not call this method.
 void addSublink(IlvLinkImage sublink)
          Adds a sublink at the end of the link bundle.
 void addSublink(int index, IlvLinkImage sublink)
          Adds a sublink at the specified index in the link bundle.
 boolean allowsPointInsertion()
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 boolean allowsPointMove(int index)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 boolean allowsPointRemoval()
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 void applyToObject(IlvGraphic obj, IlvApplyObject f, Object arg, boolean redraw)
          Applies a method to an object of this bag, that is to a sublink of this link bundle.
 IlvRect boundingBox(IlvTransformer t)
          Returns the bounding rectangle of the link bundle.
 boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Tests if a point lies within the outline of the link.
 boolean containsFrame(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Tests if the specified point lie within the link bundle frame.
 IlvGraphic copy()
          Copies the object.
 void deSelectAll()
          Deselects all the sublinks in the link bundle.
 void deSelectAll(boolean traverse)
          Deselects all the sublinks in the link bundle.
 void draw(Graphics dst, IlvTransformer t)
          Draws the link bundle.
 void getConnectionPoints(IlvPoint src, IlvPoint dst, IlvTransformer t)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 IlvPoint getConnectionReferencePoint(boolean origin, IlvTransformer t)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 int getEndCap()
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 Color getForeground()
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 IlvLinkBundleFrame getFrame()
          Returns the frame of the link bundle or null.
 int getLineJoin()
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 float[] getLineStyle()
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 float getLineWidth()
          Returns the line width of the object.
 float getLineWidth(IlvTransformer t)
          Returns the line width that is actually displayed when the link bundle is drawn with the specified transformer.
 float getLineWidth(IlvTransformer t, boolean includingFrameMargin)
          Returns the line width that is actually displayed when the link bundle is drawn with the specified transformer.
 IlvGraphicEnumeration getLinkBundles()
          Returns an enumeration of all the link bundles that have been added as sublinks in this link bundle.
 int getLinkBundlesCount()
          Returns the number of link bundles that have been added in this link bundle.
 IlvPoint[] getLinkPoints(IlvTransformer t)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 float getMaximumLineWidth()
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 IlvGraphic getObject(String name)
          Returns the sublink or overview link with the specified name, or null if there is no sublink with this name and the overview link does not have this name.
 String getObjectName(IlvGraphic obj)
          Returns the name of the specified graphic object.
 IlvGraphicEnumeration getObjects()
          You should not call this method.
 float getOffset()
          Returns the offset between the individual links of the bundle.
 IlvLinkImage getOverviewLink()
          Returns the overview link.
 IlvPoint getPointAt(int index, IlvTransformer t)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 int getPointsCardinal()
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 IlvLinkBundle getRootLinkBundle()
          Returns the root link bundle.
 IlvManager getRootManager()
          Returns the manager which contains the root link bundle, or null if the root link bundle is null or is not contained in a manager.
 IlvGraphicEnumeration getSelectedSublinks()
          Returns an enumeration of all the selected sublinks of this link bundle.
 IlvGraphicEnumeration getSelectedSublinks(boolean traverse)
          Returns an enumeration of all the selected sublinks in this link bundle.
 int getSelectedSublinksCount()
          Returns the number of selected sublinks of this link bundle.
 int getSelectedSublinksCount(boolean traverse)
          Returns the number of selected sublinks.
 IlvSelection getSelection(IlvLinkImage sublink)
          Returns the selection object (instance of IlvSelection) associated with the specified sublink, or null if the sublink is not selected.
 IlvSelection getSelection(IlvPoint tp, IlvTransformer t)
          Returns the selection object (instance of IlvSelection) located at the specified transformed point.
 IlvSelection getSelection(IlvPoint tp, IlvTransformer t, boolean traverse)
          Returns the selection object (instance of IlvSelection) located at the specified transformed point.
 IlvSelectionFactory getSelectionFactory()
          Returns the selection factory installed in the grapher that contains the root link bundle of this link bundle, or null if no factory is installed or the link bundle is not added to a grapher.
 IlvLinkImage getSublink(IlvPoint tp, IlvTransformer t)
          Returns the sublink located at the specified transformed point, or null if any.
 IlvLinkImage getSublink(IlvPoint tp, IlvTransformer t, boolean traverse)
          Returns the sublink located at the specified transformed point, or null if any.
 IlvLinkImage getSublink(int index)
          Returns the sublink of this bundle at the given position.
 IlvLinkImage[] getSublinks()
          Returns the sublinks of this object.
 int getSublinksCount()
          Returns the number of sublinks of this link bundle.
 IlvGraphicEnumeration getSublinksEnum()
          Returns an enumeration of the sublinks of this link bundle.
 String getToolTipText()
          Returns the tooltip text set by setToolTipText(java.lang.String).
 String getToolTipText(IlvPoint p, IlvTransformer t)
          Returns the tooltip text to display when the mouse pointer is at a specified location inside the link bundle.
 Object getTreeLock()
          Returns the object used to synchronize the content of the link bundle for multi-threaded environment.
 void insertPoint(int index, float x, float y, IlvTransformer t)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 void invalidateLayout()
          Invalidates the internal layout of this link bundle.
 boolean isCollapsed()
          Returns the collapsed/expanded status of the link bundle.
 boolean isLayoutValid()
          Determines whether the internal layout of this link bundle is valid.
 boolean isOriented()
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 boolean isSelected(IlvLinkImage sublink)
          Returns true if the specified sublink is selected.
 boolean isSelectionAdjusting()
          Returns whether we are currently selecting or deselecting a series of sublinks.
 boolean isSingleConnectionPoint()
          Returns true if the single connection point mode is enabled, and returns false otherwise.
 void moveObject(IlvGraphic obj, float x, float y, boolean redraw)
          Changes the location of a graphic object.
 void movePoint(int index, float x, float y, IlvTransformer t)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 boolean pointsInBBox()
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 void reDrawObj(IlvGraphic obj)
          Redraws a graphic object contained in the set.
 void reDrawRegion(IlvRegion region)
          Redraws a region of the link bundle.
 void removeLinkBundleSelectionChangedListener(LinkBundleSelectionChangedListener listener)
          Removes the specified selection listener so that it no longer receives events from the link bundle when the selection of sublinks changes.
 void removeObject(IlvGraphic obj, boolean redraw)
          You should not call this method.
 void removePoint(int index, IlvTransformer t)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 void removeSublink(IlvLinkImage sublink)
          Removes a sublink from the link bundle.
 void reshapeObject(IlvGraphic obj, IlvRect newrect, boolean redraw)
          Changes the size of a graphic object located in the link bundle.
 void selectAll()
          Selects all the visible sublinks in this link bundle.
 void selectAll(boolean traverse)
          Selects all the visible sublinks in the link bundle.
protected  void selectionChanged(IlvLinkImage sublink)
          Called when a selection changes in the link bundle.
 void setCollapsed(boolean collapsed)
          Collapses or expands the link bundle.
 void setEndCap(int endCap)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 void setForeground(Color c)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 void setFrame(IlvLinkBundleFrame frame)
          Sets the frame of the link bundle.
 void setGraphicBag(IlvGraphicBag bag)
          Changes the bag that contains the link bundle.
 void setIntermediateLinkPoints(IlvPoint[] points, int index, int length)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 void setLineJoin(int lineJoin)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 void setLineStyle(float[] lineStyle)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 void setLineWidth(float lineWidth)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 void setMaximumLineWidth(float maximumLineWidth)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 boolean setObjectName(IlvGraphic obj, String name)
          Changes the name of a sublink or overview link of this link bundle.
 void setOffset(float offset)
          Sets the offset between the individual links of the bundle.
 void setOriented(boolean oriented)
          This method delegates to the link supplied with the method setOverviewLink(ilog.views.IlvLinkImage).
 void setOverviewLink(IlvLinkImage link)
          Sets the link responsible for the rendering of the link bundle in collapsed state (see isCollapsed()).
 void setSelected(IlvLinkImage sublink, boolean select)
          Selects or deselects the specified sublink.
 void setSelectionAdjusting(boolean set)
          Starts a series of selection events.
 void setSelectionEventSource(Object source)
          Changes the source for selection events.
 void setSingleConnectionPoint(boolean single)
          Enables the single connection point mode.
 void setSublink(int index, IlvLinkImage sublink)
          Sets the given sublink at the supplied position.
 void setSublinks(IlvLinkImage[] sublinks)
          Sets a new collection of sublinks for this link bundle.
 void setToolTipText(String text)
          Sets the text to display in the tooltip of this link bundle.
 void write(IlvOutputStream stream)
          Writes the object to an IlvOutputStream.
 boolean zoomable()
          Returns false, since this graphic object is not zoomable.
 
Methods inherited from class ilog.views.graphic.IlvPolylineLinkImage
applyTransform
 
Methods inherited from class ilog.views.IlvLinkImage
arrowBBox, drawArrow, finalize, getArrowSize, getFrom, getFromBoundingBox, getFromTransformer, getLinkConnectorConnectionPoint, getLocalTransformerOf, getOpposite, getTo, getToBoundingBox, getToTransformer, getVisibleFrom, getVisibleTo, isPersistent, isSpline, makeSelection, setFrom, setTo
 
Methods inherited from class ilog.views.IlvGraphic
addActionListener, addNamedPropertyListener, boundingBox, getAndAssociateObjectInteractor, getCenter, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, hasProperty, inside, intersects, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isSelectable, isVisible, move, move, moveResize, notifyObjectInteractorToManager, processActionEvent, reDraw, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setEditable, setFillOn, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setVisible, toString, translate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ilog.views.IlvGraphicBag
getGraphicBag
 

Constructor Detail

IlvLinkBundle

public IlvLinkBundle()
Creates a new empty IlvLinkBundle instance. This default bean constructor exists only for internal use. Do not call it.


IlvLinkBundle

public IlvLinkBundle(IlvGraphic from,
                     IlvGraphic to,
                     boolean oriented)
Creates a new IlvLinkBundle instance with no intermediate points and no overview link.

Parameters:
from - The origin node of the bundle.
to - The destination node of the bundle.
oriented - If true, an arrow is drawn at the destination point.

IlvLinkBundle

public IlvLinkBundle(IlvGraphic from,
                     IlvGraphic to,
                     boolean oriented,
                     IlvPoint[] points)
Creates a new IlvLinkBundle instance with no overview link.

Parameters:
from - The origin node of the bundle.
to - The destination node of the bundle.
oriented - If true, an arrow is drawn at the destination point.
points - The intermediate points of the polylink. If the array is null or its length is 0, the link is created without intermediate points.

IlvLinkBundle

public IlvLinkBundle(IlvGraphic from,
                     IlvGraphic to,
                     boolean oriented,
                     IlvPoint[] points,
                     IlvLinkImage overviewLink)
Creates a new IlvLinkBundle instance.

Parameters:
from - The origin node of the bundle.
to - The destination node of the bundle.
oriented - If true, an arrow is drawn at the destination point.
points - The intermediate points of the polylink. If the array is null or its length is 0, the link is created without intermediate points.
overviewLink - The overview link (see setOverviewLink(ilog.views.IlvLinkImage)).

IlvLinkBundle

public IlvLinkBundle(IlvInputStream stream)
              throws IlvReadFileException
Reads the object from an IlvInputStream.

Parameters:
stream - The input stream.
Throws:
IlvReadFileException - if the format is not correct.

IlvLinkBundle

public IlvLinkBundle(IlvLinkBundle source)
Creates an IlvLinkBundle by copying an existing one.

Parameters:
source - The origin of the copy.
Method Detail

copy

public IlvGraphic copy()
Copies the object.

Overrides:
copy in class IlvPolylineLinkImage
Returns:
A copy of this IlvGraphic instance.
See Also:
IlvGraphic

getLinkBundles

public final IlvGraphicEnumeration getLinkBundles()
Returns an enumeration of all the link bundles that have been added as sublinks in this link bundle.

Returns:
An enumeration of the IlvLinkBundle objects added in this link bundle.

getLinkBundlesCount

public final int getLinkBundlesCount()
Returns the number of link bundles that have been added in this link bundle.


setGraphicBag

public void setGraphicBag(IlvGraphicBag bag)
Changes the bag that contains the link bundle. For example, this method is used when the link bundle is added to, or removed from, an IlvGraphicBag such as an IlvGrapher. It is also used when the link bundle is added to, or removed from, the sublinks of another link bundle.

You should not call this method directly unless you are creating a new type of bag. This method checks that the link bundle is added in a bag that is either an IlvGrapher or an IlvLinkBundle. Other bags are not allowed.

Overrides:
setGraphicBag in class IlvGraphic
Parameters:
bag - The graphic bag.
See Also:
IlvGraphic

getTreeLock

public final Object getTreeLock()
Returns the object used to synchronize the content of the link bundle for multi-threaded environment.


getRootLinkBundle

public final IlvLinkBundle getRootLinkBundle()
Returns the root link bundle. If a link bundle is not a sublink of another link bundle, this method returns null. Otherwise, it returns the link bundle which is on top of the containment hierarchy.


getRootManager

public final IlvManager getRootManager()
Returns the manager which contains the root link bundle, or null if the root link bundle is null or is not contained in a manager.


setOverviewLink

public final void setOverviewLink(IlvLinkImage link)
Sets the link responsible for the rendering of the link bundle in collapsed state (see isCollapsed()).

By default, there is no overview link and the method getOverviewLink() returns null. In this case, the rendering of the link bundle in collapsed state is done by the link bundle class itself.

When a link bundle has an overview link, any modification of the points of the link bundle is replicated by the link bundle on the overview link. Hence, the connection points and the intermediate points of the link bundle are always the same as those of the overview link.

To remove the overview link that has been previously specified, you can call this method with a null argument.

The following properties of the supplied link (if not null):

are overridden by the corresponding properties of this IlvLinkBundle instance.

Note that a call to this method can modify the bounding box of the link bundle. For this reason, if the link bundle is contained inside an IlvGrapher, this method must be called only using the method IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean) of the grapher.

See Also:
setCollapsed(boolean), getOverviewLink()

getOverviewLink

public final IlvLinkImage getOverviewLink()
Returns the overview link.

See Also:
setOverviewLink(ilog.views.IlvLinkImage)

addObject

public void addObject(IlvGraphic obj,
                      boolean redraw)
You should not call this method. To add sublinks, use the method addSublink(ilog.views.IlvLinkImage). To specify the overview link, use the method setOverviewLink(ilog.views.IlvLinkImage).

Specified by:
addObject in interface IlvGraphicBag
Parameters:
obj - The graphic object.
redraw - If true the object is redrawn.

removeObject

public void removeObject(IlvGraphic obj,
                         boolean redraw)
You should not call this method. To remove a sublink, use the method removeSublink(ilog.views.IlvLinkImage).

Specified by:
removeObject in interface IlvGraphicBag
Parameters:
obj - The graphic object.
redraw - If true the object is redrawn.

addSublink

public void addSublink(IlvLinkImage sublink)
Adds a sublink at the end of the link bundle. Note that a sublink can be contained in only one link bundle, and the sublink cannot be contained by a grapher and a IlvLinkBundle at the same time.

The sublinks can be of any class. Notice however that the link bundle must be allowed to move the points of the link (connection points and intermediate points if any). Hence, links of type IlvOneLinkImage, IlvDoubleLinkImage, IlvOneSplineLinkImage and IlvDoubleSplineLinkImage are usually not appropriate, because they don't allow the intermediate points to be moved freely.

To obtain a consistent layout, it is not recommended to mix in the same bundle spline links (IlvSplineLinkImage) with polyline links (IlvSplineLinkImage etc.). Either use only polyline links, or use only spline links for both the sublinks and for the overview link. An overview link of type IlvSplineLinkImage should be set on the link bundle when the sublinks are splines.

Also, a link connector class allowing the connection points to be moved freely must be installed either

For details on how to attach a link connector to nodes or links, see the documentation of (@link IlvLinkConnector}. The recommended link connector is IlvClippingLinkConnector.

Note that a call to this method can modify the bounding box of the link bundle. For this reason, if the link bundle is contained inside an IlvGrapher, this method can be called only using the method IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean) of the grapher.

Parameters:
sublink - The sublink to be added. The value null is not allowed.

addSublink

public void addSublink(int index,
                       IlvLinkImage sublink)
Adds a sublink at the specified index in the link bundle. This method inserts the specified sublink at the specified position in the array of sublinks. It shifts the sublink currently at that position (if any) and any subsequent sublink to the right (adds one to their indices).

Note that a sublink can be contained in only one link bundle, and the sublink cannot be contained by a grapher and a IlvLinkBundle at the same time.

The sublinks can be of any class. Notice however that the link bundle must be allowed to move the points of the link (connection points and intermediate points if any). Hence, links of type IlvOneLinkImage, IlvDoubleLinkImage, IlvOneSplineLinkImage and IlvDoubleSplineLinkImage are usually not appropriate, because they don't allow the intermediate points to be moved freely.

To obtain a consistent layout, it is not recommended to mix in the same bundle spline links (IlvSplineLinkImage) with polyline links (IlvSplineLinkImage etc.). Either use only polyline links, or use only spline links for both the sublinks and for the overview link. An overview link of type IlvSplineLinkImage should be set on the link bundle when the sublinks are splines.

Also, a link connector class allowing the connection points to be moved freely must be installed either

For details on how to attach a link connector to nodes or links, see the documentation of (@link IlvLinkConnector}. The recommended link connector is IlvClippingLinkConnector.

Note that a call to this method can modify the bounding box of the link bundle. For this reason, if the link bundle is contained inside an IlvGrapher, this method can be called only using the method IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean) of the grapher.

Parameters:
index - The index at which the specified sublink is to be inserted. If the index is equal to getSublinksCount(), the specified sublink is added to the end.
sublink - The sublink. The value null is not allowed.
Throws:
IndexOutOfBoundsException - if index is out of range (index< 0 || index >= getSublinksCount()).

removeSublink

public void removeSublink(IlvLinkImage sublink)
Removes a sublink from the link bundle.

Note that a call to this method can modify the bounding box of the link bundle. For this reason, if the link bundle is contained inside an IlvGrapher, this method can be called only using the method IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean) of the grapher.

Parameters:
sublink - The sublink.

getSublink

public IlvLinkImage getSublink(IlvPoint tp,
                               IlvTransformer t)
Returns the sublink located at the specified transformed point, or null if any.

Parameters:
tp - The point transformed by t.
t - The transformer used to draw the object.
See Also:
getSublink(IlvPoint, IlvTransformer, boolean)

getSublink

public IlvLinkImage getSublink(IlvPoint tp,
                               IlvTransformer t,
                               boolean traverse)
Returns the sublink located at the specified transformed point, or null if any. This method will traverse the link bundles that have been added as sublinks in this link bundle if the traverse parameter is set to true.

Parameters:
tp - The point transformed by t.
t - The transformer used to draw the object.
traverse - If true, this method will recursively traverse the link bundles added as sublinks of this link bundle to find the sublink located at the specified point.
See Also:
getSublink(IlvPoint, IlvTransformer), getSelection(IlvPoint, IlvTransformer), getSelection(IlvPoint, IlvTransformer, boolean), getLinkBundles()

getSelection

public IlvSelection getSelection(IlvPoint tp,
                                 IlvTransformer t)
Returns the selection object (instance of IlvSelection) located at the specified transformed point.

Parameters:
tp - The transformed point.
t - The transformer used for drawing the object.
See Also:
getSelection(IlvPoint, IlvTransformer, boolean), getSublink(IlvPoint, IlvTransformer), getSublink(IlvPoint, IlvTransformer, boolean), setSelected(ilog.views.IlvLinkImage, boolean)

getSelection

public IlvSelection getSelection(IlvPoint tp,
                                 IlvTransformer t,
                                 boolean traverse)
Returns the selection object (instance of IlvSelection) located at the specified transformed point. If the traverse parameter is set to true, this method will traverse the link bundles added in this link bundle.

Parameters:
tp - The transformed point.
t - The transformer used for drawing the object.
traverse - If true, the method will recursively traverse the link bundles added in this link bundle to find the selection object located at the specified point.
See Also:
getSublink(IlvPoint, IlvTransformer), getSublink(IlvPoint, IlvTransformer, boolean), setSelected(ilog.views.IlvLinkImage, boolean), getLinkBundles()

getObject

public IlvGraphic getObject(String name)
Returns the sublink or overview link with the specified name, or null if there is no sublink with this name and the overview link does not have this name.

Specified by:
getObject in interface IlvGraphicBag
Parameters:
name - The name.
See Also:
getObjectName(ilog.views.IlvGraphic), setObjectName(ilog.views.IlvGraphic, java.lang.String)

setObjectName

public boolean setObjectName(IlvGraphic obj,
                             String name)
Changes the name of a sublink or overview link of this link bundle. Note that the link bundle makes sure that there are never two objects with the same name, so this method may return false if an object already has the specified name. In this case the name is not changed.

Specified by:
setObjectName in interface IlvGraphicBag
Parameters:
obj - The graphic object. This object must be already added to this link bundle (as a sublink or as its overview link); otherwise, an IllegalArgumentException is thrown.
name - The desired name.
Returns:
false if the name could not be changed.
See Also:
getObjectName(ilog.views.IlvGraphic), getObject(java.lang.String)

getObjectName

public String getObjectName(IlvGraphic obj)
Returns the name of the specified graphic object. If no name was given to the object using setObjectName, then this method returns null.

Parameters:
obj - The graphic object.
See Also:
setObjectName(ilog.views.IlvGraphic, java.lang.String), getObject(String)

setToolTipText

public void setToolTipText(String text)
Sets the text to display in the tooltip of this link bundle. Notice that, if the mouse is over a sublink that has a tooltip, its tooltip is shown. The tooltip of the link bundle itself is shown if the mouse is over the link bundle but not over a sublink, or the sublink doesn't have a tootip.

Tooltips for ILOG JViews graphic objects will work only if your manager view is contained in a hierarchy of Swing components. In addition, you must enable the tooltip mechanism for the manager view by calling the static method IlvToolTipManager.registerView(IlvManagerView).

Overrides:
setToolTipText in class IlvGraphic
Parameters:
text - The tooltip string to display. If text is null, the tooltip is turned off for this link bundle.
See Also:
IlvToolTipManager, getToolTipText(), getToolTipText(IlvPoint, IlvTransformer)

getToolTipText

public String getToolTipText()
Returns the tooltip text set by setToolTipText(java.lang.String).

Overrides:
getToolTipText in class IlvGraphic
Returns:
The tooltip string, which can be null.
See Also:
getToolTipText(IlvPoint, IlvTransformer)

getToolTipText

public String getToolTipText(IlvPoint p,
                             IlvTransformer t)
Returns the tooltip text to display when the mouse pointer is at a specified location inside the link bundle. The method returns the tooltip of a sublink over which the point is located, if any. Otherwise, it returns the tooltip of the link bundle itself.

You can override this method to display different tooltip texts over different parts of your link bundle object.

If this method returns null, no tooltip is shown for this link bundle.

Note that you must enable the tooltip mechanism for the manager view by calling the static method IlvToolTipManager.registerView(IlvManagerView).

Overrides:
getToolTipText in class IlvGraphic
Parameters:
p - The location of the mouse (in view coordinates).
t - The transformer of the manager view in which the tooltip is about to be displayed.
Returns:
The tool tip at point p for transformation t, or null if no tool tip should be displayed.
See Also:
getToolTipText()

setSelected

public void setSelected(IlvLinkImage sublink,
                        boolean select)
Selects or deselects the specified sublink.

When a sublink is selected, another graphic object is created to show that this object is selected. This new graphic object is called the selection object and is an instance of the cla