|
||||||||||
| PREV CLASS Documentation homepage. NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvGraphic
ilog.views.graphic.linkpolicy.IlvAbstractCrossingGraphic
ilog.views.graphic.linkpolicy.IlvBridgeCrossings
public class IlvBridgeCrossings
An 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.
Notice that each link needs its own crossing graphic. It cannot be
shared among links. A new bridge crossing graphic together with a crossing
link shape policy is automatically installed at an enhanced link image
when the bridge crossing mode is used,
via link.setCrossingMode(IlvEnhancedPolylineLinkImage.BRIDGE_CROSSINGS);.
Usually, it is not necessary to install the bridge graphic explicitly. The following example illustrates how to install a bridge crossing graphic explicitly that is updated by the crossing link shape policy:
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 Form| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
void |
addCrossingBound(IlvRect boundingRect,
IlvTransformer t,
IlvLinkImage link1,
IlvLinkImage link2,
IlvPoint p0,
IlvPoint p1,
IlvPoint p2,
IlvPoint p3,
float startGap,
float endGap,
float normalGap)
Adds the bound of the crossing to the input bounding rectangle. |
protected IlvRect |
calcBoundingBox(IlvTransformer t)
Calculate the bounding rectangle of the object. |
boolean |
containsAtCrossing(IlvPoint p,
IlvPoint tp,
IlvTransformer t,
IlvLinkImage link1,
IlvLinkImage link2,
IlvPoint p0,
IlvPoint p1,
IlvPoint p2,
IlvPoint p3,
float startGap,
float endGap,
float 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,
float startGap,
float endGap,
float normalGap)
Draws the crossing between the input links. |
float |
getBridgeLengthFactor()
Returns the bridge length factor. |
void |
setBridgeLengthFactor(float factor)
Sets the bridge length factor. |
void |
write(IlvOutputStream stream)
Writes the object to an IlvOutputStream. |
boolean |
zoomable()
Returns true if the object is zoomable; otherwise it
returns false. |
| Methods inherited from class ilog.views.graphic.linkpolicy.IlvAbstractCrossingGraphic |
|---|
applyTransform, boundingBox, calcBoundingBoxOfLink, contains, crossingChanged, draw, getBoundingBoxCacheSize, getRelatedLinkImage, setBoundingBoxCacheSize, setGraphicBag, setRelatedLinkImage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
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.| Method Detail |
|---|
public IlvGraphic copy()
copy in class IlvGraphicIlvGraphicpublic void setBridgeLengthFactor(float factor)
3.
getBridgeLengthFactor()public final float getBridgeLengthFactor()
setBridgeLengthFactor(float)
public void drawCrossing(Graphics dst,
IlvTransformer t,
IlvLinkImage link1,
IlvLinkImage link2,
IlvPoint p0,
IlvPoint p1,
IlvPoint p2,
IlvPoint p3,
float startGap,
float endGap,
float 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,
float startGap,
float endGap,
float normalGap)
containsAtCrossing in interface IlvCrossingGraphiccontainsAtCrossing in class IlvAbstractCrossingGraphicp - 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.protected IlvRect calcBoundingBox(IlvTransformer t)
IlvAbstractCrossingGraphic.boundingBox(ilog.views.IlvTransformer) when the bounding box for the input
transformer is not internally cached.
calcBoundingBox in class IlvAbstractCrossingGraphicIlvAbstractCrossingGraphic.boundingBox(ilog.views.IlvTransformer),
IlvAbstractCrossingGraphic.setBoundingBoxCacheSize(int)
public void addCrossingBound(IlvRect boundingRect,
IlvTransformer t,
IlvLinkImage link1,
IlvLinkImage link2,
IlvPoint p0,
IlvPoint p1,
IlvPoint p2,
IlvPoint p3,
float startGap,
float endGap,
float 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 boolean zoomable()
true if the object is zoomable; otherwise it
returns false.
The object is zoomable if the related link is zoomable, has a
nonzero line width, and the gap is zoomable.
zoomable in class IlvAbstractCrossingGraphicIlvCrossingAwareLinkImage.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 IlvPersistentObjectwrite in class IlvAbstractCrossingGraphicstream - The output stream.
IOException - thrown when an exception occurs during
the write operation for this object.
|
||||||||||
| PREV CLASS Documentation homepage. NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||