public class IlvBridgeCrossings extends IlvAbstractCrossingGraphic
IlvBridgeCrossings
is an auxiliary graphic object that is
used in combination with an IlvCrossingAwareLinkImage
or
IlvEnhancedPolylineLinkImage
.
The bridge crossing graphic draws the bridge shapes of the link crossings.
It must be in a manager layer that is above all layers that contain links.
Normally, the crossing link shape policy take care of this automatically.
link.setCrossingMode(IlvEnhancedPolylineLinkImage.BRIDGE_CROSSINGS);
.
IlvCrossingLinkShapePolicy policy = new IlvCrossingLinkShapePolicy(); // the policy can be shared among links, but each link needs its own // bridge crossing object IlvCrossingAwareLinkImage link = new IlvCrossingAwareLinkImage(node1, node2, true, null); link.setCrossingGraphic(new IlvBridgeCrossings(link)); link.setLinkShapePolicy(policy); ...
IlvEnhancedPolylineLinkImage
,
IlvCrossingAwareLinkImage.getCrossingGraphic()
,
IlvPolicyAwareLinkImage.getLinkShapePolicy()
,
Serialized FormConstructor and Description |
---|
IlvBridgeCrossings(IlvBridgeCrossings source)
Creates a new
IlvBridgeCrossings by copying an existing one. |
IlvBridgeCrossings(IlvCrossingAwareLinkImage link)
Creates a new
IlvBridgeCrossings . |
IlvBridgeCrossings(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 |
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 if a point lies within the drawing of a crossing.
|
IlvGraphic |
copy()
Copies the crossing graphic.
|
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 between 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.
|
double |
getBridgeLengthFactor()
Returns the bridge length factor.
|
void |
setBridgeLengthFactor(double factor)
Sets the bridge length factor.
|
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
applyTransform, boundingBox, calcBoundingBox, calcBoundingBoxOfLink, contains, crossingChanged, draw, getBoundingBoxCacheSize, getRelatedLinkImage, setBoundingBoxCacheSize, setGraphicBag, setRelatedLinkImage, 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, 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 IlvBridgeCrossings(IlvCrossingAwareLinkImage link)
IlvBridgeCrossings
.
link
- The link this object belongs to.public IlvBridgeCrossings(IlvBridgeCrossings source)
IlvBridgeCrossings
by copying an existing one.
It does not copy the reference to the link this object belongs to.
source
- The origin object for the copy.public IlvBridgeCrossings(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 setBridgeLengthFactor(double factor)
3
.getBridgeLengthFactor()
public final double getBridgeLengthFactor()
setBridgeLengthFactor(double)
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.t
- The transformation used to draw the first link.link1
- The first link, which is the link containing this
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 start point and the link crossing.endGap
- The real gap between 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 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 this
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 start point and the link crossing.endGap
- The real gap between 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 this
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 start point and the link crossing.endGap
- The real gap between 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 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 Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.