public class IlvBusLinkConnector extends IlvLinkConnector
This link connector must be attached to the bus object. The bus object
must be a graphic object (subclass of IlvGraphic
) that
implements the interface IlvPolyPointsInterface
. Usually, an
is
used for the bus object.
IlvPolyline
Note that the bus link connector should be installed only on the bus node. For the nodes connected to the bus, you usually do not need link connectors because the default connection points are appropriate.
IlvBusLayout
,
Serialized FormConstructor and Description |
---|
IlvBusLinkConnector()
Creates an
IlvBusLinkConnector . |
IlvBusLinkConnector(IlvInputStream stream)
Reads the link connector from an
IlvInputStream . |
IlvBusLinkConnector(IlvPolyPointsInterface busNode)
Creates an
IlvBusLinkConnector and installs it on the
busNode . |
Modifier and Type | Method and Description |
---|---|
void |
attach(IlvGraphic busNode,
boolean redraw)
Installs the link connector on the node
busNode . |
void |
connectLink(IlvLinkImage link,
IlvPoint p,
boolean origin,
IlvTransformer t)
This implementation of the abstract method does nothing.
|
IlvPoint |
getClosestConnectionPoint(IlvPoint p,
Object orig,
Object dest,
Object linkOrClass,
boolean origin,
IlvTransformer transformer)
Implements an abstract method to return the center of the bus object.
|
IlvPoint |
getConnectionPoint(IlvLinkImage link,
boolean origin,
IlvTransformer transformer)
Returns the connection point of
link on the bus. |
IlvRect |
getGhostBoundingBox(IlvTransformer t)
Implements an abstract method of
IlvLinkConnector to return an
empty IlvRect . |
double |
getMargin()
Returns the horizontal offset between the first/last connection point
on a given level and the left/right margin of the level.
|
boolean |
isPersistent()
Indicates whether the link connector must be saved to an
.ivl file. |
void |
setMargin(double margin)
Sets the horizontal offset between the first/last node on a given
level and the left/right margin of the level.
|
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
protected boolean |
zoomable()
Indicates that this link connector is zoomable.
|
allLinksRemoved, allowsConnectionPointMove, attach, attach, detach, detach, disconnectLink, drawGhost, Get, Get, GetAttached, GetAttached, getNode, linkRemoved, read, supportsDrawGhost, write
public IlvBusLinkConnector()
IlvBusLinkConnector
.public IlvBusLinkConnector(IlvPolyPointsInterface busNode)
IlvBusLinkConnector
and installs it on the
busNode
. The bus node must be a graphic object (that is,
a subclass of IlvGraphic
) that implements the interface
IlvPolyPointsInterface
.busNode
- The bus node on which the link connector is installed.public IlvBusLinkConnector(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if the format is not correct.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 IlvLinkConnector
write(ilog.views.io.IlvOutputStream)
public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
. You should not
call this method directly; instead, you should use the
write
methods of the manager.write
in interface IlvPersistentObject
write
in class IlvLinkConnector
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.IlvLinkConnector.read(ilog.views.io.IlvInputStream, IlvLinkImage, boolean)
,
IlvLinkConnector.write(ilog.views.io.IlvOutputStream, IlvLinkImage, boolean)
,
IlvLinkConnector.isPersistent()
public void attach(IlvGraphic busNode, boolean redraw)
busNode
. The
method detach
is automatically called to detach the old
attached node, if it exists.attach
in class IlvLinkConnector
busNode
- The bus node on which the link connector is installed.
This node must be an instance of
IlvPolyPointsInterface
.redraw
- If true
, the node to which the connector is
attached and the links connected to the node will be redrawn.IllegalArgumentException
- if busNode
is not an
instance of IlvPolyPointsInterface
.IlvLinkConnector.detach(boolean)
public IlvPoint getConnectionPoint(IlvLinkImage link, boolean origin, IlvTransformer transformer)
link
on the bus.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.transformer
- The transformer that is used to draw the node.null
.protected boolean zoomable()
true
.zoomable
in class IlvLinkConnector
public IlvPoint getClosestConnectionPoint(IlvPoint p, Object orig, Object dest, Object linkOrClass, boolean origin, IlvTransformer transformer)
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.transformer
- 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 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 final void setMargin(double margin)
IlvGrapher.reDraw()
.getMargin()
public final double getMargin()
setMargin(double)
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 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.