public class IlvFreeLinkConnector extends IlvCachingLinkConnector
connectLink(ilog.views.IlvLinkImage, ilog.views.IlvPoint, boolean, ilog.views.IlvTransformer). The connection
 points will be preserved with respect to the bounding box of the node
 for any change of the bounding box of the node. If the node is translated,
 the connection point is translated with the same distance. If the node grows
 or shrinks, the connection point moves proportionally.
 
 Note that, for links that have not been connected using
 connectLink(ilog.views.IlvLinkImage, ilog.views.IlvPoint, boolean, ilog.views.IlvTransformer) and for disconnected links (see disconnectLink(ilog.views.IlvLinkImage, boolean)
 and disconnectAllLinks()), the method IlvCachingLinkConnector.getConnectionPoint(ilog.views.IlvLinkImage, boolean, ilog.views.IlvTransformer)
 returns null.
 In this case, IlvLinkImage computes the connection point of the link
 using the default rules, at the center of one of the sides of the bounding
 box of the node or at its center.
 
This link connector can be used with the graph layout algorithms that need to change the connection points of the links.
| Constructor and Description | 
|---|
| IlvFreeLinkConnector()Creates an empty  IlvFreeLinkConnector. | 
| IlvFreeLinkConnector(IlvGraphic node)Creates an  IlvFreeLinkConnectorattached to the nodenode. | 
| IlvFreeLinkConnector(IlvInputStream stream)Reads the object from an  IlvInputStream. | 
| IlvFreeLinkConnector(IlvLinkImage link,
                    boolean origin)Creates an  IlvFreeLinkConnectorattached to the
 origin or destination of the linklink. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | allLinksRemoved()Called when all links are removed from the node. | 
| boolean | allowsConnectionPointMove(IlvLinkImage link,
                         boolean origin)Indicates whether a connection point of a link can be moved by interactors. | 
| protected IlvPoint | calcConnectionPoint(IlvLinkImage link,
                   boolean origin,
                   IlvTransformer transformer)Calculates the connection point of  link. | 
| void | connectionPointMoveAllowed(boolean allow)Deprecated. 
 Beginning with Perforce JViews 8.1, use the method
    setConnectionPointMoveAllowed(boolean)instead. | 
| void | connectLink(IlvLinkImage link,
           IlvPoint p,
           boolean origin,
           IlvTransformer t)Connects a link to a specified connection point. | 
| void | detach(boolean redraw)Detaches the link connector from the attached node. | 
| void | detach(IlvLinkImage link,
      boolean origin,
      boolean redraw)Detaches the link connector from the origin or the destination
 of a link. | 
| void | disconnectAllLinks()Disconnects all the links connected to the link connector. | 
| void | disconnectLink(IlvLinkImage link,
              boolean origin)Disconnects a link from the link connector. | 
| IlvPoint | getClosestConnectionPoint(IlvPoint p,
                         Object orig,
                         Object dest,
                         Object linkOrClass,
                         boolean origin,
                         IlvTransformer transformer)Returns the connection point that is closest to a particular point. | 
| IlvRect | getGhostBoundingBox(IlvTransformer t)Implements an abstract method of  IlvLinkConnectorto return an emptyIlvRect. | 
| protected IlvRect | getNodeBoundingBox(IlvTransformer t)Called by the  IlvFreeLinkConnectorwhen it needs to compute the bounding rectangle of the node. | 
| boolean | isConnectionPointMoveAllowed()Specifies whether the interactors are allowed to move the connection points
 of the links connected to the node to which this link connector is
 attached. | 
| boolean | isPersistent()Indicates whether the link connector must be saved to an
  .ivlfile. | 
| void | linkRemoved(IlvLinkImage link)Called when a link is removed from the node. | 
| void | read(IlvInputStream stream,
    IlvLinkImage link,
    boolean origin)Reads information associated
 with a link from an  IlvInputStream. | 
| void | setConnectionPointMoveAllowed(boolean allow)Allows or forbids the interactors to move the connection points
 of the links connected to the node to which this link connector is
 attached. | 
| protected boolean | useCache()Return  truebecause this link connector uses the cache. | 
| void | write(IlvOutputStream stream)Writes the object to an  IlvOutputStream. | 
| void | write(IlvOutputStream stream,
     IlvLinkImage link,
     boolean origin)Writes the information associated
 with a link to an  IlvOutputStream. | 
| protected boolean | zoomable()Indicates that this link connector is zoomable. | 
cleanCache, cleanCache, getCacheSize, getConnectionPoint, linkChanged, LinkChanged, LinkRemoved, setCacheSize, useCacheattach, attach, attach, drawGhost, Get, Get, GetAttached, GetAttached, getNode, supportsDrawGhostpublic IlvFreeLinkConnector()
IlvFreeLinkConnector. It can be
 attached either to a node (using
 IlvLinkConnector.attach(ilog.views.IlvGraphic,boolean)) or to an extremity
 of a link (using
 IlvLinkConnector.attach(ilog.views.IlvLinkImage,boolean,boolean)).public IlvFreeLinkConnector(IlvGraphic node)
IlvFreeLinkConnector attached to the node
 node.public IlvFreeLinkConnector(IlvLinkImage link, boolean origin)
IlvFreeLinkConnector attached to the
 origin or destination of the link link.
 If the argument origin is true,
 this creates a link connector for the origin of link.
 If the argument origin is false,
 this creates a link connector for the destination of link.public IlvFreeLinkConnector(IlvInputStream stream) throws IlvReadFileException
IlvInputStream.
 
 Note that any subclass (except one that overrides the method
 isPersistent() to return false) must provide a
 constructor with an IlvInputStream argument.
 The first line of the constructor must be super(stream).
stream - The input stream.IlvReadFileException - if the format is not correct.write(ilog.views.io.IlvOutputStream), 
isPersistent(), 
IlvLinkConnector.attach(IlvGraphic, boolean), 
detach(boolean)public void write(IlvOutputStream stream) throws IOException
IlvOutputStream.
 
 You must override this method if specific data is to be stored.
 Note that the first instruction in your implementation of the method must
 be super.write(stream).
 
 You should not
 call this method directly; instead, you should use the write
 methods of the IlvGrapher that contains the node
 to which the link connector is attached.
write in interface IlvPersistentObjectwrite in class IlvCachingLinkConnectorstream - The output stream.IOException - thrown when an exception occurs during
 the write operation for this object.isPersistent()protected boolean useCache()
true because this link connector uses the cache.useCache in class IlvCachingLinkConnectorpublic void detach(boolean redraw)
attach.
 For details, see the documentation of the method in the parent class.
detach in class IlvCachingLinkConnectorredraw - If true, the node to which the connector is
 attached and its adjacent links will be redrawn.IlvLinkConnector.attach(IlvGraphic, boolean)public void detach(IlvLinkImage link, boolean origin, boolean redraw)
 When you attach a new link to a link connector already attached to
 a different link but for the same extremity,
 it is not necessary to detach the old link because
 this is done automatically when you call
 IlvLinkConnector.attach(IlvLinkImage, boolean, boolean).
detach in class IlvCachingLinkConnectorlink - The link from which the link connector is detached.origin - If true, the link connector is detached
        from the origin of link. Otherwise, it is detached
        from the destination of link.redraw - If true, the node to which the connector is
 attached and its adjacent links will be redrawn.IlvLinkConnector.attach(IlvLinkImage, boolean, boolean), 
detach(boolean)public void write(IlvOutputStream stream, IlvLinkImage link, boolean origin) throws IOException
IlvOutputStream.
 
 If origin is true, the method saves the
 information about the connection point of the origin of link.
 Otherwise, it saves the information about the connection point of the
 destination of link.
 The method does nothing if link is not connected to
 the node using the method
 connectLink(ilog.views.IlvLinkImage, ilog.views.IlvPoint, boolean, ilog.views.IlvTransformer).
 
 You must override this method if specific data is to be stored.
 Note that the first instruction in your implementation of the method must
 be super.write(stream, link, origin).
 
 You should not call this
 method directly. You should use the write
 methods of the IlvGrapher that contains the node
 to which the link connector is attached.
write in class IlvLinkConnectorstream - The output stream.link - The link.origin - If true,
 information about the connection of the origin of link
 is written. Otherwise, the method writes information about
 the destination of link.IOExceptionread(ilog.views.io.IlvInputStream, ilog.views.IlvLinkImage, boolean), 
isPersistent()public void read(IlvInputStream stream, IlvLinkImage link, boolean origin) throws IlvReadFileException
IlvInputStream.
 
 You must override this method if specific data is to be read.
 Note that the first instruction in your implementation of the method must
 be super.read(stream, link, origin).
 
 You should not call this
 method directly; instead, you should use the read
 methods of the IlvGrapher that contains the node
 to which the link connector is attached.
read in class IlvLinkConnectorstream - The input stream.link - The link.origin - If true,
 information about the connection of the origin of link
 is read. Otherwise, the method reads information about
 the destination of link.IlvReadFileExceptionIlvLinkConnector.write(ilog.views.io.IlvOutputStream, IlvLinkImage, boolean), 
IlvLinkConnector.isPersistent()public boolean isPersistent()
.ivl file.
 If this method returns true, the link connector
 is saved; otherwise, it is not saved.
 
 The default implementation always returns true.
isPersistent in class IlvLinkConnectorwrite(ilog.views.io.IlvOutputStream)protected IlvPoint calcConnectionPoint(IlvLinkImage link, boolean origin, IlvTransformer transformer)
link.calcConnectionPoint in class IlvCachingLinkConnectorlink - The link.origin - If true, the position of the link
 connection point for the link origin is determined. Otherwise, the
 position of the link connection point for the link destination is found.transformer - The transformer that is used to draw the node.public void connectLink(IlvLinkImage link, IlvPoint p, boolean origin, IlvTransformer t)
 Notice that, for links that have not been connected using
 connectLink(ilog.views.IlvLinkImage, ilog.views.IlvPoint, boolean, ilog.views.IlvTransformer) and for disconnected links (see
 disconnectLink(ilog.views.IlvLinkImage, boolean) and disconnectAllLinks()),
 the method IlvCachingLinkConnector.getConnectionPoint(ilog.views.IlvLinkImage, boolean, ilog.views.IlvTransformer) returns null.
 In this case, IlvLinkImage computes the connection point of the
 link using the default rules, at the center of one of the sides of the
 bounding box of the node or at its center.
 
 Note also that, once a link connector has been attached to a node or a link
 contained in an IlvGrapher, this method must be called
 using the method IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean).
connectLink in class IlvLinkConnectorlink - The link to be connected.p - The point where the link must be connected. The point
 must be transformed by transformer t.origin - If true, the origin of the link will be
 connected. Otherwise, it is the destination.t - The transformer that is used to draw the node.disconnectLink(ilog.views.IlvLinkImage, boolean), 
disconnectAllLinks()public void disconnectLink(IlvLinkImage link, boolean origin)
 Notice that, for disconnected links and for links that have not been
 connected using connectLink(ilog.views.IlvLinkImage, ilog.views.IlvPoint, boolean, ilog.views.IlvTransformer), the method
 IlvCachingLinkConnector.getConnectionPoint(ilog.views.IlvLinkImage, boolean, ilog.views.IlvTransformer) returns null.
 In this case, IlvLinkImage computes the connection point of the
 link using the default rules, at the center of one of the sides of the
 bounding box of the node or at its center.
 
 Note also that, once a link connector has been attached to a node or a link
 contained in an IlvGrapher, this method must be called
 using the method IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean).
disconnectLink in class IlvCachingLinkConnectorlink - The link to be disconnected.origin - If true, the origin of the link will be
 disconnected. Otherwise, it is the destination.connectLink(ilog.views.IlvLinkImage, ilog.views.IlvPoint, boolean, ilog.views.IlvTransformer), 
disconnectAllLinks()public void disconnectAllLinks()
 Notice that, for disconnected links and for links that have not been
 connected using connectLink(ilog.views.IlvLinkImage, ilog.views.IlvPoint, boolean, ilog.views.IlvTransformer), the method
 IlvCachingLinkConnector.getConnectionPoint(ilog.views.IlvLinkImage, boolean, ilog.views.IlvTransformer) returns null.
 In this case, IlvLinkImage computes the connection point of the
 link using the default rules, at the center of one of the sides of the
 bounding box of the node or at its center.
 
 Note also that, once a link connector has been attached to a node or a link
 contained in an IlvGrapher, this method must be called
 using the method IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean).
public boolean allowsConnectionPointMove(IlvLinkImage link, boolean origin)
 In this class, the default implementation of the method always returns
 the value that was set using the method connectionPointMoveAllowed(boolean).
 
 Note that by default the connection points cannot be moved using the
 interactors. When this method returns false, only the
 interactors (namely, IlvLinkImageEditInteractor) are not
 allowed to move the connection points. The points can always be moved
 by calls to the method connectLink(ilog.views.IlvLinkImage, ilog.views.IlvPoint, boolean, ilog.views.IlvTransformer).
 
Subclasses can override this method to indicate that only the connection points of some links can (or cannot) be moved by the interactors.
allowsConnectionPointMove in class IlvLinkConnectorconnectionPointMoveAllowed(boolean), 
IlvLinkImage.allowsPointMove(int), 
isConnectionPointMoveAllowed()@Deprecated public void connectionPointMoveAllowed(boolean allow)
setConnectionPointMoveAllowed(boolean) instead.
 By default, moving a connection point using the interactors
 is not allowed.
 To enable the interactors to move connection points, call this
 method with a true argument.
 
 Note that subclasses can override the method
 allowsConnectionPointMove(ilog.views.IlvLinkImage, boolean)
 to indicate that only the connection points of some links can (or cannot)
 be moved using the interactors.
public final void setConnectionPointMoveAllowed(boolean allow)
 By default, moving a connection point using the interactors
 is not allowed.
 To enable the interactors to move connection points, call this
 method with a true argument.
 
 Note that subclasses can override the method
 allowsConnectionPointMove(ilog.views.IlvLinkImage, boolean)
 to indicate that only the connection points of some links can (or cannot)
 be moved using the interactors.
public final boolean isConnectionPointMoveAllowed()
 Note that, for each individual connection point, the
 interactors decide whether they are allowed to move the connection 
 point by calling the method 
 allowsConnectionPointMove(IlvLinkImage, boolean).
 The default implementation of this method relies on the value returned
 by isConnectionPointMoveAllowed(), but subclasses
 can provide an overridden implementation.
protected boolean zoomable()
true.zoomable in class IlvLinkConnectorpublic IlvPoint getClosestConnectionPoint(IlvPoint p, Object orig, Object dest, Object linkOrClass, boolean origin, IlvTransformer transformer)
p without any transformation.getClosestConnectionPoint in class IlvLinkConnectorp - The transformed point.orig - The graphic object origin of the link or the class of the
 origin object. This depends on whether the link has already been 
 created or not.dest - The graphic object destination of the link or the class of 
 the destination object. This depends on whether the link has already 
 been created or not.linkOrClass - An instance of IlvLinkImage or 
 an instance of the class.
 This parameter enables you to allow or inhibit connection points,
 depending on the link or the class of link. The class is useful when the
 link is not already created.origin - If true, the position of the link 
 connection point for the link origin is determined. Otherwise the 
 position of the link connection point 
 for the link destination is found.transformer - The transformer used to draw the node.public void linkRemoved(IlvLinkImage link)
linkRemoved in class IlvCachingLinkConnectorprotected void allLinksRemoved()
allLinksRemoved in class IlvCachingLinkConnectorprotected IlvRect getNodeBoundingBox(IlvTransformer t)
IlvFreeLinkConnector
 when it needs to compute the bounding rectangle of the node. By default,
 it returns getNode().boundingBox(t). You can
 override this method to return a different bounding rectangle. This is
 useful, in particular, if you use a link layout algorithm and you
 specified an IlvNodeBoxInterface.t - The transformer used to compute the bounding rectangle of
 the node.public IlvRect getGhostBoundingBox(IlvTransformer t)
IlvLinkConnector
 to return an empty IlvRect. This method is not called
 since IlvLinkConnector.supportsDrawGhost() returns false for this class.getGhostBoundingBox in class IlvLinkConnectort - The transformer used to draw the connection points.IlvLinkConnector.supportsDrawGhost(), 
IlvLinkConnector.drawGhost(java.awt.Graphics, ilog.views.IlvTransformer, java.lang.Object, java.lang.Object, java.lang.Object, boolean)© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.