|
||||||||||
| 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.IlvTunnelCrossings
public class IlvTunnelCrossings
An IlvTunnelCrossings is an auxiliary graphic object that is
used in combination with an IlvCrossingAwareLinkImage or
IlvEnhancedPolylineLinkImage.
The tunnel crossing graphic draws the tunnel 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 tunnel crossing graphic together with a crossing
link shape policy is automatically installed at an enhanced polyline link
image when the tunnel crossing mode is used,
via link.setCrossingMode(IlvEnhancedPolylineLinkImage.TUNNEL_CROSSINGS);.
Usually, it is not necessary to install the tunnel graphic explicitly. The following example illustrates how to install a tunnel 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 // tunnel crossing object IlvCrossingAwareLinkImage link = new IlvCrossingAwareLinkImage(node1, node2, true, null); link.setCrossingGraphic(new IlvTunnelCrossings(link)); link.setLinkShapePolicy(policy); ...
IlvEnhancedPolylineLinkImage,
IlvCrossingAwareLinkImage.getCrossingGraphic(),
IlvPolicyAwareLinkImage.getLinkShapePolicy(),
Serialized Form| Constructor Summary | |
|---|---|
IlvTunnelCrossings(IlvCrossingAwareLinkImage link)
Creates a new IlvTunnelCrossings. |
|
IlvTunnelCrossings(IlvInputStream stream)
Reads the object from an IlvInputStream. |
|
IlvTunnelCrossings(IlvTunnelCrossings source)
Creates a new IlvTunnelCrossings by copying an existing one. |
|
| 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. |
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 IlvTunnelCrossings(IlvCrossingAwareLinkImage link)
IlvTunnelCrossings.
link - The link this object belongs to.public IlvTunnelCrossings(IlvTunnelCrossings source)
IlvTunnelCrossings 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 IlvTunnelCrossings(IlvInputStream stream)
throws IlvReadFileException
IlvInputStream.
stream - The input stream.
IlvReadFileException - if the format is not correct.| Method Detail |
|---|
public IlvGraphic copy()
copy in class IlvGraphicIlvGraphic
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 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 | |||||||||