public class IlvDoubleLinkImage extends IlvLinkImage
IlvDoubleLinkImage
represents the connection between two
nodes in a grapher
; the link is displayed as
three lines containing two right angles.
For more information about specialized link graphic objects, see
IlvLinkImage.
The default values for an IlvDoubleLinkImage
instance are as
follows:
Color.black
0
IlvStroke.CAP_SQUARE
The following code example shows how to use an
IlvDoubleLinkImage
in a simple Java application:
IlvGraphic node1, node2; IlvGrapher grapher = new IlvGrapher(); IlvDoubleLinkImage link; //Create new ellipse node and add it to the grapher. node1 = new IlvEllipse(new IlvRect(30,10,50,50), true, false); grapher.addNode(node1,false); //Add a new rectangular node to the grapher. node2 = new IlvRectangle(new IlvRect(220,90,50,50), false, true); grapher.addNode(node2, 2, true); //Link the two nodes and add them to a grapher. link = new IlvDoubleLinkImage( node1, node2, IlvDoubleLinkImage.VerticalLink, true); grapher.addLink(link,true);
The following image shows the graphic object created in the code example:
>
IlvDoubleLinkImage
is a custom graphic object, that is, a
subclass of IlvGraphic
. Graphic objects are controlled using
an IlvManager
instance and displayed using one or more
IlvManagerView
instances in a Java Swing application.
For information about generic features for graphic objects, see
IlvGraphic.
IlvPoint
,
IlvManager
,
IlvManagerView
,
r
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
HorizontalLink
HORIZONTAL orientation of the link.
|
static int |
VerticalLink
Vertical orientation of the link.
|
Constructor and Description |
---|
IlvDoubleLinkImage(IlvDoubleLinkImage source)
Create a new
IlvDoubleLinkImage by copying the specified one. |
IlvDoubleLinkImage(IlvGraphic from,
IlvGraphic to,
boolean oriented)
Creates a new double link image.
|
IlvDoubleLinkImage(IlvGraphic from,
IlvGraphic to,
int orientation,
boolean oriented)
Creates a new double link image.
|
IlvDoubleLinkImage(IlvInputStream stream)
Reads the object from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
IlvGraphic |
copy()
Copies the object.
|
void |
getConnectionPoints(IlvPoint src,
IlvPoint dst,
IlvTransformer t)
Computes the origin and destination point to draw the link.
|
IlvPoint |
getConnectionReferencePoint(boolean origin,
IlvTransformer t)
Returns the reference connection point.
|
IlvPoint[] |
getLinkPoints(IlvTransformer t)
Returns the points that define the link.
|
int |
getOrientation()
Returns the orientation of the link.
|
IlvPoint |
getPointAt(int index,
IlvTransformer t)
Returns the point at a specified index.
|
int |
getPointsCardinal()
Returns the number of points.
|
void |
setOrientation(int orientation)
Changes the orientation of the link.
|
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
allowsPointInsertion, allowsPointMove, allowsPointRemoval, applyTransform, arrowBBox, arrowContains, boundingBox, contains, draw, drawArrow, finalize, getArrowSize, getEndCap, getForeground, getFrom, getFromBoundingBox, getFromTransformer, getLineJoin, getLineStyle, getLineWidth, getLineWidth, getLinkConnectorConnectionPoint, getLinkPoints, getLocalTransformerOf, getMaximumLineWidth, getOpposite, getTo, getToBoundingBox, getToTransformer, getVisibleFrom, getVisibleTo, insertPoint, isOriented, isPersistent, isSpline, makeSelection, movePoint, pointsInBBox, removePoint, setEndCap, setForeground, setFrom, setIntermediateLinkPoints, setLineJoin, setLineStyle, setLineWidth, setLinkPoints, setMaximumLineWidth, setOriented, setTo, zoomable
addActionListener, addNamedPropertyListener, allViewsRemoved, baseTextDirectionChanged, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, getAndAssociateObjectInteractor, getBaseTextDirection, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getComponentOrientation, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getResolvedBaseTextDirection, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getULocale, getZOrderIndex, hasProperty, inside, intersects, invalidateBBoxCache, invalidateBidiCache, isBaseTextDirectionSensitive, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isSelectable, isVisible, localeChanged, move, move, moveResize, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setBaseTextDirection, setBaseTextDirectionDuringConstruction, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved
public static final int VerticalLink
public static final int HorizontalLink
public IlvDoubleLinkImage(IlvGraphic from, IlvGraphic to, boolean oriented)
from
- the origin object.to
- the destination object.oriented
- if oriented
is true then an arrow is drawn at the
destination point.public IlvDoubleLinkImage(IlvGraphic from, IlvGraphic to, int orientation, boolean oriented)
from
- the origin object.to
- the destination object.orientation
- the valid values for this may be
IlvDoubleLinkImage.VerticalLink
or
IlvDoubleLinkImage.HorizontalLink
.
It specifies the direction the link takes upon leaving the
from
node.oriented
- if oriented
is true then an arrow is drawn at the
destination point.public IlvDoubleLinkImage(IlvDoubleLinkImage source)
IlvDoubleLinkImage
by copying the specified one.public IlvDoubleLinkImage(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- the input stream.IlvReadFileException
- if the format is not correct.public IlvGraphic copy()
copy
in class IlvLinkImage
IlvGraphic
instance.IlvGraphic
public void setOrientation(int orientation)
IlvDoubleLinkImage.VerticalLink
or
IlvDoubleLinkImage.HorizontalLink
.
It specifies the direction the link takes upon leaving the
origin
node.public int getOrientation()
public int getPointsCardinal()
getPointsCardinal
in interface IlvPolyPointsInterface
getPointsCardinal
in class IlvLinkImage
public IlvPoint getPointAt(int index, IlvTransformer t)
index
is 0 or 1 because
the object defines a polypoints of 2 points event is the
method getLinkPoints
returns 4 points. The reason
is that we only want to edit the extremity points.getPointAt
in interface IlvPolyPointsInterface
getPointAt
in class IlvLinkImage
index
- the index of the point.t
- the transformer through which the object is drawn.public IlvPoint getConnectionReferencePoint(boolean origin, IlvTransformer t)
getConnectionReferencePoint
in class IlvLinkImage
origin
- If origin
is true
, then the connection
point of the origin is searched for. If origin
is false
then
the connection point of the destination is searched for.t
- The transformer that is used to draw the link.IlvLinkConnector
public void getConnectionPoints(IlvPoint src, IlvPoint dst, IlvTransformer t)
getConnectionPoints
in class IlvLinkImage
src
- a point to store the origin.dst
- a point to store the destination.t
- the transformer used to draw the link.IlvLinkConnector.getConnectionPoint(ilog.views.IlvLinkImage, boolean, ilog.views.IlvTransformer)
public IlvPoint[] getLinkPoints(IlvTransformer t)
getConnectionPoints
member function
and the intermediate points for the angles.getLinkPoints
in class IlvLinkImage
public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.
Note that even if this is a public method, you should not
call it directly, you should use the write
methods of the manager.write
in interface IlvPersistentObject
write
in class IlvLinkImage
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.