ilog.views.sdm.renderer
Class IlvSDMLinkConnector

java.lang.Object
  extended by ilog.views.IlvLinkConnector
      extended by ilog.views.sdm.renderer.IlvSDMLinkConnector
All Implemented Interfaces:
IlvPersistentObject, Serializable

public class IlvSDMLinkConnector
extends IlvLinkConnector

This link connector subclass is designed to be used in an SDM engine. It connects the link to a side of the node's "base", as returned by the method IlvSDMRenderer.getLinkConnectionRectangle(ilog.views.sdm.IlvSDMEngine, ilog.views.IlvGraphic, ilog.views.IlvTransformer) of an SDM renderer.

Since:
JViews 4.0
See Also:
Serialized Form

Constructor Summary
IlvSDMLinkConnector()
          Creates a new IlvSDMLinkConnector.
IlvSDMLinkConnector(boolean center)
          Creates a new IlvSDMLinkConnector.
IlvSDMLinkConnector(IlvGraphic node, IlvSDMEngine engine, boolean center)
          Creates a new IlvSDMLinkConnector attached to a specified node.
IlvSDMLinkConnector(IlvInputStream stream)
          Reads the link connector from an IlvInputStream.
IlvSDMLinkConnector(IlvSDMEngine engine, boolean center)
          Creates a new IlvSDMLinkConnector.
 
Method Summary
 void connectLink(IlvLinkImage link, IlvPoint p, boolean origin, IlvTransformer t)
          This method does nothing.
 IlvPoint getClosestConnectionPoint(IlvPoint p, Object orig, Object dest, Object linkOrClass, boolean origin, IlvTransformer t)
          This method calls IlvSDMRenderer.getLinkConnectionRectangle(ilog.views.sdm.IlvSDMEngine, ilog.views.IlvGraphic, ilog.views.IlvTransformer) and connects the link to the closest side of the link connection rectangle, or to its center depending on the center argument of the constructor.
 IlvPoint getConnectionPoint(IlvLinkImage link, boolean origin, IlvTransformer t)
          This method calls IlvSDMRenderer.getLinkConnectionRectangle(ilog.views.sdm.IlvSDMEngine, ilog.views.IlvGraphic, ilog.views.IlvTransformer) and connects the link to the closest side of the link connection rectangle, or to its center depending on the center argument of the constructor.
 IlvRect getGhostBoundingBox(IlvTransformer t)
          The implementation of this abstract method of IlvLinkConnector returns an empty IlvRect.
 boolean isCenter()
          Returns if the link is connected to the center of the node's base.
 boolean isPersistent()
          Returns true to ask that this link connector be saved to an IVL file.
 void setCenter(boolean center)
          Defines if the link is connected to the center of the node's base.
 void write(IlvOutputStream stream)
          Writes the object to an IlvOutputStream.
protected  boolean zoomable()
          This method returns true.
 
Methods inherited from class ilog.views.IlvLinkConnector
allLinksRemoved, allowsConnectionPointMove, attach, attach, detach, detach, disconnectLink, drawGhost, Get, Get, GetAttached, GetAttached, getNode, linkRemoved, read, supportsDrawGhost, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvSDMLinkConnector

public IlvSDMLinkConnector(IlvSDMEngine engine,
                           boolean center)
Creates a new IlvSDMLinkConnector.

Parameters:
engine - The SDM engine.
center - If true, the link is connected to the center of the node's base. Otherwise, the link is connected to the nearest side of the base.

IlvSDMLinkConnector

public IlvSDMLinkConnector(IlvGraphic node,
                           IlvSDMEngine engine,
                           boolean center)
Creates a new IlvSDMLinkConnector attached to a specified node.

Parameters:
node - The node to attach the link connector to.
engine - The SDM engine.
center - If true, the link is connected to the center of the node's base. Otherwise, the link is connected to the nearest side of the base.

IlvSDMLinkConnector

public IlvSDMLinkConnector(IlvInputStream stream)
                    throws IlvReadFileException
Reads the link connector from an IlvInputStream.

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

IlvSDMLinkConnector

public IlvSDMLinkConnector(boolean center)
Creates a new IlvSDMLinkConnector.

Parameters:
center - If true, the link is connected to the center of the node's base. Otherwise, the link is connected to the nearest side of the base.
Since:
JViews 8.1

IlvSDMLinkConnector

public IlvSDMLinkConnector()
Creates a new IlvSDMLinkConnector.

It connects the link to a side of the node's "base", as returned by the method IlvSDMRenderer.getLinkConnectionRectangle(ilog.views.sdm.IlvSDMEngine, ilog.views.IlvGraphic, ilog.views.IlvTransformer) of an SDM renderer.

Since:
JViews 8.1
Method Detail

isCenter

public boolean isCenter()
Returns if the link is connected to the center of the node's base.

Since:
JViews 8.1

setCenter

public void setCenter(boolean center)
Defines if the link is connected to the center of the node's base.

Parameters:
center - If true, the link is connected to the center of the node's base. Otherwise, the link is connected to the nearest side of the base.
Since:
JViews 8.1

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the object to an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvLinkConnector
Parameters:
stream - The output stream.
Throws:
IOException - if an I/O error occurs.
See Also:
IlvLinkConnector.read(ilog.views.io.IlvInputStream, IlvLinkImage, boolean), IlvLinkConnector.write(ilog.views.io.IlvOutputStream, IlvLinkImage, boolean), IlvLinkConnector.isPersistent()

isPersistent

public boolean isPersistent()
Returns true to ask that this link connector be saved to an IVL file.

Overrides:
isPersistent in class IlvLinkConnector
See Also:
write(ilog.views.io.IlvOutputStream)

getConnectionPoint

public IlvPoint getConnectionPoint(IlvLinkImage link,
                                   boolean origin,
                                   IlvTransformer t)
This method calls IlvSDMRenderer.getLinkConnectionRectangle(ilog.views.sdm.IlvSDMEngine, ilog.views.IlvGraphic, ilog.views.IlvTransformer) and connects the link to the closest side of the link connection rectangle, or to its center depending on the center argument of the constructor.

Specified by:
getConnectionPoint in class IlvLinkConnector
Parameters:
link - The link.
origin - If true, the position of the connection point for the link origin is determined. Otherwise the position of the connection point for the link destination is determined.
t - The transformer that is used to draw the node.
Returns:
The connection point or null.
See Also:
IlvGraphic.boundingBox(ilog.views.IlvTransformer)

getClosestConnectionPoint

public IlvPoint getClosestConnectionPoint(IlvPoint p,
                                          Object orig,
                                          Object dest,
                                          Object linkOrClass,
                                          boolean origin,
                                          IlvTransformer t)
This method calls IlvSDMRenderer.getLinkConnectionRectangle(ilog.views.sdm.IlvSDMEngine, ilog.views.IlvGraphic, ilog.views.IlvTransformer) and connects the link to the closest side of the link connection rectangle, or to its center depending on the center argument of the constructor.

Specified by:
getClosestConnectionPoint in class IlvLinkConnector
Parameters:
p - 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 Class. This parameter enables you to allow or inhibit connection points, depending on the link or the class of the 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.
t - The transformer used to draw the node.
Returns:
The closest connection point already transformed.

connectLink

public void connectLink(IlvLinkImage link,
                        IlvPoint p,
                        boolean origin,
                        IlvTransformer t)
This method does nothing.

Specified by:
connectLink in class IlvLinkConnector
Parameters:
link - 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
See Also:
IlvLinkConnector.allowsConnectionPointMove(ilog.views.IlvLinkImage, boolean)

zoomable

protected boolean zoomable()
This method returns true.

Specified by:
zoomable in class IlvLinkConnector

getGhostBoundingBox

public IlvRect getGhostBoundingBox(IlvTransformer t)
The implementation of this abstract method of IlvLinkConnector returns an empty IlvRect. This method is not called since IlvLinkConnector.supportsDrawGhost() returns false for this class.

Specified by:
getGhostBoundingBox in class IlvLinkConnector
Parameters:
t - The transformer used to draw the connection points.
Since:
JViews 5.0
See Also:
IlvLinkConnector.supportsDrawGhost(), IlvLinkConnector.drawGhost(java.awt.Graphics, ilog.views.IlvTransformer, java.lang.Object, java.lang.Object, java.lang.Object, boolean)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.