public class IlvCenterLinkConnector extends IlvLinkConnector
The center of the node is computed with respect to the bounding
box of the node, as returned by the method
IlvGraphic.boundingBox(IlvTransformer)
.
In many cases, it may be appropriate to place the links on layers below
the layer that contains the nodes. (See the methods
IlvGrapher.addNode(ilog.views.IlvGraphic, int, boolean)
and
IlvGrapher.addLink(ilog.views.IlvLinkImage, int, boolean)
.)
Constructor and Description |
---|
IlvCenterLinkConnector()
Creates an empty
IlvCenterLinkConnector . |
IlvCenterLinkConnector(IlvGraphic node)
Creates an
IlvCenterLinkConnector attached to the node
node . |
IlvCenterLinkConnector(IlvInputStream stream)
Reads the link connector from an
IlvInputStream . |
IlvCenterLinkConnector(IlvLinkImage link,
boolean origin)
Creates an
IlvCenterLinkConnector attached to the
origin or destination of the link link . |
Modifier and Type | Method and Description |
---|---|
boolean |
allowsConnectionPointMove(IlvLinkImage link,
boolean origin)
Indicates whether a connection point of a link can be moved by interactors.
|
void |
connectLink(IlvLinkImage link,
IlvPoint p,
boolean origin,
IlvTransformer t)
The implementation of this abstract method of
IlvLinkConnector
does nothing. |
IlvPoint |
getClosestConnectionPoint(IlvPoint p,
Object orig,
Object dest,
Object linkOrClass,
boolean origin,
IlvTransformer t)
Returns the connection point that is closest to a particular point.
|
IlvPoint |
getConnectionPoint(IlvLinkImage link,
boolean origin,
IlvTransformer t)
Returns the position of the point where
link is
connected to node . |
IlvRect |
getGhostBoundingBox(IlvTransformer t)
The implementation of this abstract method of
IlvLinkConnector
returns an empty IlvRect . |
boolean |
isPersistent()
Specifies whether the link connector must be saved to an IVL file.
|
protected boolean |
zoomable()
The implementation of this abstract method of
IlvLinkConnector
always returns true . |
allLinksRemoved, attach, attach, attach, detach, detach, disconnectLink, drawGhost, Get, Get, GetAttached, GetAttached, getNode, linkRemoved, read, supportsDrawGhost, write, write
public IlvCenterLinkConnector()
IlvCenterLinkConnector
. 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 IlvCenterLinkConnector(IlvGraphic node)
IlvCenterLinkConnector
attached to the node
node
.public IlvCenterLinkConnector(IlvLinkImage link, boolean origin)
IlvCenterLinkConnector
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 IlvCenterLinkConnector(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if the format is not correct.public boolean isPersistent()
true
, the link connector
is saved; otherwise it is not saved.
The default implementation always returns true
.
isPersistent
in class IlvLinkConnector
IlvLinkConnector.write(ilog.views.io.IlvOutputStream)
public IlvPoint getConnectionPoint(IlvLinkImage link, boolean origin, IlvTransformer t)
link
is
connected to node
.
This implementation of the abstract method of IlvLinkConnector
always returns the center of the bounding box of the node
to which the link connector is attached.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)
IlvLinkConnector
always returns the center of the bounding box of the node
to which the link connector is attached.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 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.t
- The transformer used to draw the node.public void connectLink(IlvLinkImage link, IlvPoint p, boolean origin, IlvTransformer t)
IlvLinkConnector
does nothing.connectLink
in class IlvLinkConnector
link
- The link to be connected.p
- The point where the link must be connected. The point must be
transformed by the 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.IlvLinkConnector.allowsConnectionPointMove(ilog.views.IlvLinkImage, boolean)
public boolean allowsConnectionPointMove(IlvLinkImage link, boolean origin)
In this class, the method always returns false
.
allowsConnectionPointMove
in class IlvLinkConnector
connectLink(ilog.views.IlvLinkImage, ilog.views.IlvPoint, boolean, ilog.views.IlvTransformer)
,
IlvLinkImage.allowsPointMove(int)
protected boolean zoomable()
IlvLinkConnector
always returns 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)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.