public class IlvSDMLinkConnector extends IlvLinkConnector implements IlvCachedLinkConnectionRectIndex
IlvSDMRenderer.getLinkConnectionRectangle(ilog.views.sdm.IlvSDMEngine, ilog.views.IlvGraphic, ilog.views.IlvTransformer)
of an SDM renderer.Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
void |
connectLink(IlvLinkImage link,
IlvPoint p,
boolean origin,
IlvTransformer t)
This method does nothing.
|
int |
getCachedLinkConnectionRectIndex()
Returns the cached link connection rectangle index.
|
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 |
setCachedLinkConnectionRectIndex(int index)
Caches the link connection rectangle index.
|
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 . |
allLinksRemoved, allowsConnectionPointMove, attach, attach, attach, detach, detach, disconnectLink, drawGhost, Get, Get, GetAttached, GetAttached, getNode, linkRemoved, read, supportsDrawGhost, write
public IlvSDMLinkConnector(IlvSDMEngine engine, boolean center)
IlvSDMLinkConnector
.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.public IlvSDMLinkConnector(IlvGraphic node, IlvSDMEngine engine, boolean center)
IlvSDMLinkConnector
attached to
a specified node.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.public IlvSDMLinkConnector(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if the format is not correct.public IlvSDMLinkConnector(boolean center)
IlvSDMLinkConnector
.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.public IlvSDMLinkConnector()
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.
public boolean isCenter()
public void setCenter(boolean center)
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.public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.
write
in interface IlvPersistentObject
write
in class IlvLinkConnector
stream
- The output stream.IOException
- if an I/O error occurs.IlvLinkConnector.read(ilog.views.io.IlvInputStream, IlvLinkImage, boolean)
,
IlvLinkConnector.write(ilog.views.io.IlvOutputStream, IlvLinkImage, boolean)
,
IlvLinkConnector.isPersistent()
public boolean isPersistent()
true
to ask that this link connector
be saved to an IVL file.isPersistent
in class IlvLinkConnector
write(ilog.views.io.IlvOutputStream)
public IlvPoint getConnectionPoint(IlvLinkImage link, boolean origin, IlvTransformer t)
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.getConnectionPoint
in class IlvLinkConnector
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.null
.IlvGraphic.boundingBox(ilog.views.IlvTransformer)
public IlvPoint getClosestConnectionPoint(IlvPoint p, Object orig, Object dest, Object linkOrClass, boolean origin, IlvTransformer t)
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.getClosestConnectionPoint
in class IlvLinkConnector
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.public void connectLink(IlvLinkImage link, IlvPoint p, boolean origin, IlvTransformer t)
connectLink
in class IlvLinkConnector
link
- The link to be connectedp
- 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 destinationt
- The transformer that is used to draw the nodeIlvLinkConnector.allowsConnectionPointMove(ilog.views.IlvLinkImage, boolean)
protected boolean zoomable()
true
.zoomable
in class IlvLinkConnector
public IlvRect getGhostBoundingBox(IlvTransformer t)
IlvLinkConnector
returns an empty IlvRect
. This method is not called
since IlvLinkConnector.supportsDrawGhost()
returns false
for this class.getGhostBoundingBox
in class IlvLinkConnector
t
- 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)
public void setCachedLinkConnectionRectIndex(int index)
setCachedLinkConnectionRectIndex
in interface IlvCachedLinkConnectionRectIndex
public int getCachedLinkConnectionRectIndex()
getCachedLinkConnectionRectIndex
in interface IlvCachedLinkConnectionRectIndex
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.