public class IlvGeneralLinkTunnelCrossings extends IlvAbstractCrossingGraphic
IlvGeneralLinkTunnelCrossings
instance is an auxiliary graphic
that is used in combination with an IlvGeneralLink
.
The tunnel crossing graphic draws the tunnel shapes for link crossings.
It must be in a manager layer that is above all layers that contain links.
Normally, the crossing link shape policy takes care of this automatically.
Notice that each link needs its own crossing graphic. Crossing graphics cannot be
shared by several links. A new tunnel crossing graphic together with a crossing
link shape policy are automatically installed at a general link when the
tunnel crossing mode is set,
by link.setCrossingMode(IlvGeneralLink.TUNNEL_CROSSINGS)
.
Usually, it is not necessary to install the tunnel graphic explicitly,
because the crossing mode of IlvGeneralLink
handles it automatically.
The following example illustrates how to install a tunnel crossing
graphic that is updated by the crossing link shape policy explicitly:
IlvCrossingLinkShapePolicy policy = new IlvCrossingLinkShapePolicy(); // the policy can be shared by links, but each link needs its own // tunnel crossing object IlvGeneralLink link = new IlvGeneralLink(node1, node2, true, null); link.setCrossingGraphic(new IlvGeneralLinkTunnelCrossings(link)); link.setLinkShapePolicy(policy); ...
IlvGeneralLink
,
IlvCrossingAwareLinkImage.getCrossingGraphic()
,
IlvPolicyAwareLinkImage.getLinkShapePolicy()
,
Serialized FormConstructor and Description |
---|
IlvGeneralLinkTunnelCrossings(IlvCrossingAwareLinkImage link)
Creates a new
IlvGeneralLinkTunnelCrossings instance. |
IlvGeneralLinkTunnelCrossings(IlvGeneralLinkTunnelCrossings source)
Creates a new
IlvGeneralLinkTunnelCrossings instance by copying an
existing one. |
IlvGeneralLinkTunnelCrossings(IlvInputStream stream)
Reads the object from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
void |
addCrossingBound(IlvRect boundingRect,
IlvTransformer t,
IlvLinkImage link1,
IlvLinkImage link2,
IlvPoint p0,
IlvPoint p1,
IlvPoint p2,
IlvPoint p3,
double startGap,
double endGap,
double normalGap)
Adds the bound of the crossing to the input bounding rectangle.
|
boolean |
contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests whether a point lies within the outline of this object.
|
boolean |
containsAtCrossing(IlvPoint p,
IlvPoint tp,
IlvTransformer t,
IlvLinkImage link1,
IlvLinkImage link2,
IlvPoint p0,
IlvPoint p1,
IlvPoint p2,
IlvPoint p3,
double startGap,
double endGap,
double normalGap)
Tests whether a point lies within the drawing of a crossing.
|
IlvGraphic |
copy()
Copies the crossing graphic.
|
void |
draw(Graphics dst,
IlvTransformer t)
Draws the object.
|
void |
drawCrossing(Graphics dst,
IlvTransformer t,
IlvLinkImage link1,
IlvLinkImage link2,
IlvPoint p0,
IlvPoint p1,
IlvPoint p2,
IlvPoint p3,
double startGap,
double endGap,
double normalGap)
Draws the crossing of the input links.
|
IlvRect |
expandLinkBoundingBox(IlvRect linkBounds,
IlvTransformer t)
Expands the input bounding box, which is the bounds of the link
without crossing shape, by a margin that is large enough to
contain all drawings of crossings displayed by this crossing graphic.
|
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
boolean |
zoomable()
Returns
true if the object is zoomable; otherwise
returns false . |
applyTransform, boundingBox, calcBoundingBox, calcBoundingBoxOfLink, crossingChanged, getBoundingBoxCacheSize, getRelatedLinkImage, setBoundingBoxCacheSize, setGraphicBag, setRelatedLinkImage
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, isPersistent, isSelectable, isVisible, localeChanged, makeSelection, move, move, moveResize, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setBaseTextDirection, setBaseTextDirectionDuringConstruction, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setForeground, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved
public IlvGeneralLinkTunnelCrossings(IlvCrossingAwareLinkImage link)
IlvGeneralLinkTunnelCrossings
instance.link
- The link to which this object belongs.public IlvGeneralLinkTunnelCrossings(IlvGeneralLinkTunnelCrossings source)
IlvGeneralLinkTunnelCrossings
instance by copying an
existing one.
The reference to the link to which this object belongs is not copied.source
- The object to be copied.public IlvGeneralLinkTunnelCrossings(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if the format is not correct.public IlvGraphic copy()
copy
in class IlvGraphic
IlvGraphic
public void draw(Graphics dst, IlvTransformer t)
draw
in class IlvAbstractCrossingGraphic
dst
- The destination Graphics object.t
- The transformation used to draw the object.IlvCrossingAwareLinkImage.drawCrossingGraphic(java.awt.Graphics, ilog.views.IlvTransformer)
public void drawCrossing(Graphics dst, IlvTransformer t, IlvLinkImage link1, IlvLinkImage link2, IlvPoint p0, IlvPoint p1, IlvPoint p2, IlvPoint p3, double startGap, double endGap, double normalGap)
dst
- The destination Graphics object.t
- The transformation used to draw the first link.link1
- The first link, which is the link containing the
crossing graphic.link2
- The second link.p0
- The point before the start point of the crossing
picture inside the first link.p1
- The start point of the crossing picture inside the
first link.p2
- The end point of the crossing picture inside the
first link.p3
- The point after the end point of the crossing picture
inside the first link.startGap
- The real gap between the start point and the link crossing.endGap
- The real gap between the end point and the link crossing.normalGap
- The desired normal gap at the link crossing. The start
gap and end gap may be smaller than the normal gap.public boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
contains
in class IlvAbstractCrossingGraphic
p
- The point to be tested.tp
- The point p
transformed by the
transformer t
.t
- The transformation used to draw the object.true
if the point lies inside this graphic object.IlvCrossingAwareLinkImage.containsAtCrossingGraphic(ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvTransformer)
public boolean containsAtCrossing(IlvPoint p, IlvPoint tp, IlvTransformer t, IlvLinkImage link1, IlvLinkImage link2, IlvPoint p0, IlvPoint p1, IlvPoint p2, IlvPoint p3, double startGap, double endGap, double normalGap)
containsAtCrossing
in interface IlvCrossingGraphic
containsAtCrossing
in class IlvAbstractCrossingGraphic
p
- The point to be tested. This point is untransformed.tp
- The point p
transformed by the
transformer t
.t
- The transformation used to draw the first link.link1
- The first link, which is the link containing the
crossing graphic.link2
- The second link.p0
- The point before the start point of the crossing
picture inside the first link.p1
- The start point of the crossing picture inside the
first link.p2
- The end point of the crossing picture inside the
first link.p3
- The point after the end point of the crossing picture
inside the first link.startGap
- The real gap between the start point and the link crossing.endGap
- The real gap between the end point and the link crossing.normalGap
- The desired normal gap at the link crossing. The start
gap and end gap may be smaller than the normal gap.public IlvRect expandLinkBoundingBox(IlvRect linkBounds, IlvTransformer t)
linkBounds
- The bounds of the linkt
- The transformer to draw the linkpublic void addCrossingBound(IlvRect boundingRect, IlvTransformer t, IlvLinkImage link1, IlvLinkImage link2, IlvPoint p0, IlvPoint p1, IlvPoint p2, IlvPoint p3, double startGap, double endGap, double normalGap)
boundingRect
- The bounding rectangle containing the result.t
- The transformation used to draw the first link.link1
- The first link, which is the link containing the
crossing graphic.link2
- The second link.p0
- The point before the start point of the crossing
picture inside the first link.p1
- The start point of the crossing picture inside the
first link.p2
- The end point of the crossing picture inside the
first link.p3
- The point after the end point of the crossing picture
inside the first link.startGap
- The real gap between the start point and the link crossing.endGap
- The real gap between the end point and the link crossing.normalGap
- The desired normal gap at the link crossing. The start
gap and end gap may be smaller than the normal gap.public boolean zoomable()
true
if the object is zoomable; otherwise
returns false
.zoomable
in class IlvAbstractCrossingGraphic
IlvCrossingAwareLinkImage.isGapZoomable()
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 IlvAbstractCrossingGraphic
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.