ilog.views.graphic.linkpolicy
Class IlvCrossingAwareLinkImage

java.lang.Object
  extended by ilog.views.IlvGraphic
      extended by ilog.views.IlvLinkImage
          extended by ilog.views.graphic.IlvPolylineLinkImage
              extended by ilog.views.graphic.linkpolicy.IlvPolicyAwareLinkImage
                  extended by ilog.views.graphic.linkpolicy.IlvCrossingAwareLinkImage
All Implemented Interfaces:
IlvPolyPointsInterface, IlvPersistentObject, Transferable, Serializable
Direct Known Subclasses:
IlvEnhancedPolylineLinkImage

public class IlvCrossingAwareLinkImage
extends IlvPolicyAwareLinkImage

An IlvCrossingAwareLinkImage is a link between two nodes of a grapher with several bend points, that is is aware of link crossings. It allows to display the link crossings in different styles. The link crossings get automatically updated if you install a link shape policy of type IlvCrossingLinkShapePolicy.

The most methods are just the standard methods of polyline links. The interesting methods of this class are:

If crossings should be drawn in a specific style, you first have to install a crossing graphic. In this case, the crossings registered at the link are drawn in a special way, e.g. as tunnel or bridge. In order to update the crossings on the fly, you have to install additional the crossing link shape policy. The following example illustrates how to install a tunnel crossing shape 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 link1 = new IlvCrossingAwareLinkImage(node1, node2, true, null);
 link1.setCrossingGraphic(new IlvTunnelCrossings(link1));
 link1.setLinkShapePolicy(policy);
 IlvCrossingAwareLinkImage link2 = new IlvCrossingAwareLinkImage(node3, node4, true, null);
 link2.setCrossingGraphic(new IlvTunnelCrossings(link2));
 link2.setLinkShapePolicy(policy);
 ...
 // insert the links into the grapher only AFTER installing the policy
 grapher.addLink(link1, redraw);
 grapher.addLink(link2, redraw);
 ...
 
If you want to install the crossing link shape policy and the orthogonal link shape policy together at the same link, this is easily possible:
 IlvOrthogonalLinkShapePolicy policy = new IlvOrthogonalLinkShapePolicy();
 policy.setChildPolicy(new IlvCrossingLinkShapePolicy());
 IlvCrossingAwareLinkImage link = new IlvCrossingAwareLinkImage(node1, node2, true, null);
 link.setCrossingGraphic(new IlvTunnelCrossings(link));
 link.setLinkShapePolicy(policy);
 ...
 // insert the links into the grapher only AFTER installing the policy
 grapher.addLink(link, redraw);
 ...
 
The class is designed to work for nested graphs, if the views are attached to the topmost grapher. If any view is attached to a subgrapher, it may show crossings between a link in the subgrapher and a link of any ancestor grapher that is not visible in this view.

Since:
JViews 6.0
See Also:
Serialized Form

Constructor Summary
IlvCrossingAwareLinkImage(IlvCrossingAwareLinkImage source)
          Creates and initializes a new IlvCrossingAwareLinkImage by copying an existing one.
IlvCrossingAwareLinkImage(IlvGraphic from, IlvGraphic to, boolean backoriented, boolean oriented, IlvPoint[] points)
          Creates and initializes a new IlvCrossingAwareLinkImage.
IlvCrossingAwareLinkImage(IlvGraphic from, IlvGraphic to, boolean oriented, IlvPoint[] points)
          Creates and initializes a new IlvCrossingAwareLinkImage.
IlvCrossingAwareLinkImage(IlvInputStream stream)
          Reads the object from an IlvInputStream.
 
Method Summary
 void applyTransform(IlvTransformer t)
          Applies a transformation to the shape of the link.
protected  IlvRect arrowBBox(IlvPoint from, IlvPoint to, IlvTransformer t)
          Computes the bounding rectangle of the arrow when the link is oriented.
protected  IlvRect backArrowBBox(IlvPoint from, IlvPoint to, IlvTransformer t)
          Computes the bounding rectangle of the backward arrow when the link is backward oriented.
 IlvRect boundingBox(IlvTransformer t)
          Returns the bounding rectangle of the object.
protected  boolean boundingBoxCacheContains(IlvTransformer t)
          Checks whether the input transformer is cached in the bounding box cache.
 IlvRect boundingBoxCrossingGraphic(IlvTransformer t)
          Returns the bounding rectangle of the crossing graphic that belongs to this link.
protected  IlvRect calcBoundingBox(IlvTransformer t)
          Calculate the bounding rectangle of the link.
 boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Tests if a point lies within the outline of the link.
 boolean containsAtCrossingGraphic(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Tests if a point lies within the outline of the crossing graphic that belongs to this link.
 IlvGraphic copy()
          Copies the object.
 void draw(Graphics dst, IlvTransformer t)
          Draws the link.
protected  void drawBackArrow(Graphics dst, IlvPoint from, IlvPoint to, IlvTransformer t)
          Draws the arrow of the link if the link is backward oriented.
 void drawCrossingGraphic(Graphics dst, IlvTransformer t)
          Draws the crossing graphic that belongs to this link.
protected  void drawPolyline(Graphics dst, IlvPoint[] pts, int length, float lineWidth, int lineJoin, int endCap, float[] lineStyle, IlvTransformer t, boolean pointsTransformed)
          Draws a polyline that is part of the link.
protected  float getBackArrowSize(float lineWidth, IlvTransformer t)
          Returns the size of the backward arrow for the corresponding IlvTransformer and lineWidth.
 int getBoundingBoxCacheSize()
          Returns the size of the bounding box cache.
 IlvGraphic getCrossingGraphic()
          Returns the graphic object that draws the crossings.
 IlvCrossingLinkShapePolicy getCrossingPolicy()
          Returns the crossing link shape policy that controls this link.
protected  IlvPoint[] getDrawingLinkPoints(IlvTransformer t)
          Returns the link points used to draw the polyline of the link.
 float getGap()
          Returns the gap width of the link crossings.
 int getLayerOfCrossingGraphic()
          Returns the default layer of the graphic object that draws the crossings.
protected  Shape getSimpleShape(IlvPoint[] points, IlvTransformer t)
          Returns the shape of the link, according to the given intermediate points.
protected  Shape getStrokeShape(IlvPoint[] points, IlvTransformer t)
          Returns the stroke shape of the link.
 boolean hasCrossings(IlvTransformer t)
          Returns true if the link has crossings that cut the link into subparts.
 void insertPoint(int index, float x, float y, IlvTransformer t)
          Inserts a point at a specified index.
protected  void invalidateBoundingBoxCache()
          Invalidate the bounding box cache of the link.
 boolean isBackOriented()
          Returns true if the link is backward oriented, and false otherwise.
 boolean isCrossingEnabled()
          Returns true if crossings are shown on the link.
 boolean isGapZoomable()
          Returns true if the gap of the link crossings is zoomable.
protected  boolean mergeCrossings(float dist, float gap, float lineWidth, IlvTransformer t)
          Returns whether to merge two subsequent crossings.
 void movePoint(int index, float x, float y, IlvTransformer t)
          Changes the position of a point.
 void removePoint(int index, IlvTransformer t)
          Removes the point at a specified index.
 void setBackOriented(boolean oriented)
          Sets whether the link is backward oriented.
 void setBoundingBoxCacheSize(int size)
          Sets the size of the bounding box cache.
 void setCrossingEnabled(boolean flag)
          Sets whether crossings are shown on the link.
 void setCrossingGraphic(IlvGraphic g)
          Sets the graphic object that draws the crossings.
 void setCrossingGraphic(IlvGraphic g, int layerNumber)
          Sets the graphic object that draws the crossings.
 void setEndCap(int endCap)
          Changes the decoration applied at the end of the polyline.
 void setGap(float gap)
          Sets the gap width of the link crossings.
 void setGapZoomable(boolean zoomable)
          Sets whether the gap of the link crossings is zoomable.
 void setGraphicBag(IlvGraphicBag bag)
          Changes the bag that contains the object.
 void setIntermediateLinkPoints(IlvPoint[] points, int index, int length)
          Changes the intermediate points that define the link.
 void setLayerOfCrossingGraphic(int layerNumber)
          Sets the default layer of the graphic object that draws the crossings.
 void setLineJoin(int lineJoin)
          Changes the decoration applied when two segments are joined.
 void setLineWidth(float lineWidth)
          Changes the line width of the object.
 void setMaximumLineWidth(float maximumLineWidth)
          Changes the maximum line width of the link.
 void setOriented(boolean oriented)
          Sets the link as oriented or nonoriented.
 void write(IlvOutputStream stream)
          Writes the object to an IlvOutputStream.
 
Methods inherited from class ilog.views.graphic.linkpolicy.IlvPolicyAwareLinkImage
getLinkPoints, getLinkShapePolicy, getPointAt, setLinkShapePolicy
 
Methods inherited from class ilog.views.graphic.IlvPolylineLinkImage
allowsPointInsertion, allowsPointRemoval, getPointsCardinal
 
Methods inherited from class ilog.views.IlvLinkImage
allowsPointMove, drawArrow, finalize, getArrowSize, getConnectionPoints, getConnectionReferencePoint, getEndCap, getForeground, getFrom, getFromBoundingBox, getFromTransformer, getLineJoin, getLineStyle, getLineWidth, getLineWidth, getLinkConnectorConnectionPoint, getLocalTransformerOf, getMaximumLineWidth, getOpposite, getTo, getToBoundingBox, getToTransformer, getVisibleFrom, getVisibleTo, isOriented, isPersistent, isSpline, makeSelection, pointsInBBox, setForeground, setFrom, setLineStyle, setTo, zoomable
 
Methods inherited from class ilog.views.IlvGraphic
addActionListener, addNamedPropertyListener, boundingBox, getAndAssociateObjectInteractor, getCenter, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, hasProperty, inside, intersects, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isSelectable, isVisible, move, move, moveResize, notifyObjectInteractorToManager, processActionEvent, reDraw, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setEditable, setFillOn, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipText, setVisible, toString, translate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvCrossingAwareLinkImage

public IlvCrossingAwareLinkImage(IlvGraphic from,
                                 IlvGraphic to,
                                 boolean oriented,
                                 IlvPoint[] points)
Creates and initializes a new IlvCrossingAwareLinkImage.

Parameters:
from - The origin object.
to - The destination object.
oriented - Specifies whether an arrow is drawn at the end of the link or not.
points - The intermediate points of the polylink.

IlvCrossingAwareLinkImage

public IlvCrossingAwareLinkImage(IlvGraphic from,
                                 IlvGraphic to,
                                 boolean backoriented,
                                 boolean oriented,
                                 IlvPoint[] points)
Creates and initializes a new IlvCrossingAwareLinkImage.

Parameters:
from - The origin object.
to - The destination object.
backoriented - Specifies whether an arrow is drawn at the start of the link or not.
oriented - Specifies whether an arrow is drawn at the end of the link or not.
points - The intermediate points of the polylink.

IlvCrossingAwareLinkImage

public IlvCrossingAwareLinkImage(IlvCrossingAwareLinkImage source)
Creates and initializes a new IlvCrossingAwareLinkImage by copying an existing one.

Parameters:
source - The copied object.

IlvCrossingAwareLinkImage

public IlvCrossingAwareLinkImage(IlvInputStream stream)
                          throws IlvReadFileException
Reads the object from an IlvInputStream.

Parameters:
stream - The input stream.
Throws:
IlvReadFileException - if the format is not correct.
Method Detail

copy

public IlvGraphic copy()
Copies the object.

Overrides:
copy in class IlvPolicyAwareLinkImage
Returns:
A copy of this IlvGraphic instance.
See Also:
IlvGraphic

setCrossingEnabled

public void setCrossingEnabled(boolean flag)
Sets whether crossings are shown on the link.

See Also:
isCrossingEnabled()

isCrossingEnabled

public boolean isCrossingEnabled()
Returns true if crossings are shown on the link.


setGap

public void setGap(float gap)
Sets the gap width of the link crossings. The default value is 2.

See Also:
getGap()

getGap

public final float getGap()
Returns the gap width of the link crossings.

See Also:
setGap(float)

setGapZoomable

public void setGapZoomable(boolean zoomable)
Sets whether the gap of the link crossings is zoomable. If the gap is zoomable, the gap width follows the zoom level. If the gap is not zoomable, the gap width is the same for all zoom levels. In particular in nested graphers where links of different graphers cross each other, it is visually more appealing if the gap is not zoomable.

The option is enabled by default.

See Also:
isGapZoomable()

isGapZoomable

public final boolean isGapZoomable()
Returns true if the gap of the link crossings is zoomable.

See Also:
setGapZoomable(boolean)

setCrossingGraphic

public void setCrossingGraphic(IlvGraphic g)
Sets the graphic object that draws the crossings. This should be a subclass of IlvGraphic that can draw all the crossing points of this link. It must implement the IlvCrossingGraphic interface.

This operation does not change the shape of this link, but it changes bounds of the crossing graphic. It is recommended to set a crossing graphic only when the crossing graphic is outside any grapher. If the crossing graphic is already inside a grapher, you need to encapsulate the operation into applyToObject for the crossing graphic (that is, not for the link).

See Also:
getCrossingGraphic()

setCrossingGraphic

public void setCrossingGraphic(IlvGraphic g,
                               int layerNumber)
Sets the graphic object that draws the crossings. This should be a subclass of IlvGraphic that can draw all the crossing points of this link. It must implement the IlvCrossingGraphic interface.

When the crossing graphic becomes active due to crossings, it is automatically inserted into an appropriate grapher into the specified layer. The layer number should be above the layer that contains the links. If the layer number is -1, an appropriate layer is automatically calculated.

This operation does not change the shape of this link, but it changes bounds of the crossing graphic. It is recommended to set a crossing graphic only when the crossing graphic is outside any grapher. If the crossing graphic is already inside a grapher, you need to encapsulate the operation into applyToObject for the crossing graphic (that is, not for the link).

See Also:
getCrossingGraphic()

getCrossingGraphic

public final IlvGraphic getCrossingGraphic()
Returns the graphic object that draws the crossings.

See Also:
setCrossingGraphic(ilog.views.IlvGraphic)

setLayerOfCrossingGraphic

public void setLayerOfCrossingGraphic(int layerNumber)
Sets the default layer of the graphic object that draws the crossings. The layer number should be above the layer that contains the links. If the default layer is -1, an appropriate layer is automatically calculated.

See Also:
getLayerOfCrossingGraphic(), setCrossingGraphic(IlvGraphic, int)

getLayerOfCrossingGraphic

public final int getLayerOfCrossingGraphic()
Returns the default layer of the graphic object that draws the crossings. Returns -1 if the layer is automatically calculated.

See Also:
setLayerOfCrossingGraphic(int)

setGraphicBag

public void setGraphicBag(IlvGraphicBag bag)
Changes the bag that contains the object. You should not call this method directly.

Overrides:
setGraphicBag in class IlvPolicyAwareLinkImage
Parameters:
bag - The graphic bag.
See Also:
IlvGraphic

getCrossingPolicy

public IlvCrossingLinkShapePolicy getCrossingPolicy()
Returns the crossing link shape policy that controls this link.


write

public void write(IlvOutputStream stream)
           throws IOException
Writes the object to an IlvOutputStream. You should not call this method directly; instead, you should use the write methods of the manager.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvPolicyAwareLinkImage
Parameters:
stream - The output stream.
Throws:
IOException - thrown when an exception occurs during the write operation for this object.

draw

public void draw(Graphics dst,
                 IlvTransformer t)
Draws the link.

Overrides:
draw in class IlvLinkImage
Parameters:
dst - The destination Graphics.
t - The transformation used to draw the object.
See Also:
IlvGraphic.boundingBox(ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic

getDrawingLinkPoints

protected IlvPoint[] getDrawingLinkPoints(IlvTransformer t)
Returns the link points used to draw the polyline of the link. This may differ from IlvPolicyAwareLinkImage.getLinkPoints(ilog.views.IlvTransformer) as the line must be shortened to draw the end arrows correctly.

Parameters:
t - The transformer to draw the link.

hasCrossings

public final boolean hasCrossings(IlvTransformer t)
Returns true if the link has crossings that cut the link into subparts. If nonzoomable links exist, then the link may have crossings in one transformer but no crossings in another transformer.

Parameters:
t - The transformer to draw the link.

getStrokeShape

protected Shape getStrokeShape(IlvPoint[] points,
                               IlvTransformer t)
Returns the stroke shape of the link.

Parameters:
points - The transformed link points.
t - The transformer to draw the link.

getSimpleShape

protected Shape getSimpleShape(IlvPoint[] points,
                               IlvTransformer t)
Returns the shape of the link, according to the given intermediate points. Crossings are not considered.

Parameters:
points - The transformed link points.
t - The transformer to draw the link.

drawBackArrow

protected void drawBackArrow(Graphics dst,
                             IlvPoint from,
                             IlvPoint to,
                             IlvTransformer t)
Draws the arrow of the link if the link is backward oriented. This method is called to draw the arrow of the link. The arrow is drawn on the line defined by the points from and to. The head of the arrow is on point to. Note that the points are already transformed by the transformer.

See Also:
backArrowBBox(ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvTransformer)

drawPolyline

protected void drawPolyline(Graphics dst,
                            IlvPoint[] pts,
                            int length,
                            float lineWidth,
                            int lineJoin,
                            int endCap,
                            float[] lineStyle,
                            IlvTransformer t,
                            boolean pointsTransformed)
Draws a polyline that is part of the link. Subclasses can override this method if a different appearance of the link is desired while crossings are registered at the link.

Parameters:
dst - The destination Graphics.
pts - The control points of the polyline.
length - The number of significant points in pts.
lineWidth - The width of the pen used to draw the polyline.
lineJoin - The 'line join' style used to draw the polyline. The valid values are defined in the interface IlvStroke.
endCap - The 'end cap' style used to draw the polyline. The valid values are defined in the interface IlvStroke.
lineStyle - The array representing the dashing pattern.
t - The transformer used to draw the polyline.
pointsTransformed - true if the points are transformed by the transformer, false otherwise.
See Also:
hasCrossings(ilog.views.IlvTransformer)

mergeCrossings

protected boolean mergeCrossings(float dist,
                                 float gap,
                                 float lineWidth,
                                 IlvTransformer t)
Returns whether to merge two subsequent crossings.

Parameters:
dist - The distance between this crossing and the next crossing.
gap - The desired gap for the crossing.
lineWidth - The line width of the other link that crosses this link.
t - The transformer to draw the link;

drawCrossingGraphic

public void drawCrossingGraphic(Graphics dst,
                                IlvTransformer t)
Draws the crossing graphic that belongs to this link. Crossing graphics can delegate their draw method to this method if necessary.

Parameters:
dst - The destination Graphics.
t - The transformation used to draw the link.
See Also:
IlvAbstractCrossingGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer)

boundingBoxCrossingGraphic

public IlvRect boundingBoxCrossingGraphic(IlvTransformer t)
Returns the bounding rectangle of the crossing graphic that belongs to this link. Crossing graphics can delegate their boundingBox method to this method if necessary.

Parameters:
t - The transformer used to draw the link.
See Also:
IlvAbstractCrossingGraphic.boundingBox(ilog.views.IlvTransformer)

containsAtCrossingGraphic

public boolean containsAtCrossingGraphic(IlvPoint p,
                                         IlvPoint tp,
                                         IlvTransformer t)
Tests if a point lies within the outline of the crossing graphic that belongs to this link. Crossing graphics can delegate their contains method to this method if necessary.

Parameters:
p - The point to be tested in the coordinate system of the link.
tp - The point p transformed by the transformer t.
t - The transformation that was applied to the link object when it was drawn.
See Also:
IlvAbstractCrossingGraphic.contains(ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvTransformer)

boundingBox

public IlvRect boundingBox(IlvTransformer t)
Returns the bounding rectangle of the object.

Specified by:
boundingBox in interface IlvPolyPointsInterface
Overrides:
boundingBox in class IlvLinkImage
Parameters:
t - The transformer used to draw the object.
See Also:
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic

setBoundingBoxCacheSize

public void setBoundingBoxCacheSize(int size)
Sets the size of the bounding box cache. This object uses a bounding box cache in order to speed up bounding box calculations. For good performance, it is recommended to use a cache size that is at least number of views showing this object + 1.


getBoundingBoxCacheSize

public int getBoundingBoxCacheSize()
Returns the size of the bounding box cache. This object uses a bounding box cache in order to speed up bounding box calculations.


calcBoundingBox

protected IlvRect calcBoundingBox(IlvTransformer t)
Calculate the bounding rectangle of the link. This is called by boundingBox(ilog.views.IlvTransformer) when the bounding box for the input transformer is not internally cached.


boundingBoxCacheContains

protected boolean boundingBoxCacheContains(IlvTransformer t)
Checks whether the input transformer is cached in the bounding box cache.

Since:
JViews 8.1

invalidateBoundingBoxCache

protected void invalidateBoundingBoxCache()
Invalidate the bounding box cache of the link.


arrowBBox

protected IlvRect arrowBBox(IlvPoint from,
                            IlvPoint to,
                            IlvTransformer t)
Computes the bounding rectangle of the arrow when the link is oriented. The arrow is drawn on the line defined by the points from and to. The head of the arrow is on point to. Note that the points are already transformed by the transformer.

Overrides:
arrowBBox in class IlvLinkImage
See Also:
IlvLinkImage.drawArrow(java.awt.Graphics, ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvTransformer)

backArrowBBox

protected IlvRect backArrowBBox(IlvPoint from,
                                IlvPoint to,
                                IlvTransformer t)
Computes the bounding rectangle of the backward arrow when the link is backward oriented. The arrow is drawn on the line defined by the points from and to. The head of the arrow is on point to. Note that the points are already transformed by the transformer.

See Also:
drawBackArrow(java.awt.Graphics, ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvTransformer)

getBackArrowSize

protected float getBackArrowSize(float lineWidth,
                                 IlvTransformer t)
Returns the size of the backward arrow for the corresponding IlvTransformer and lineWidth. By redefining this method the subclass can change the size of the arrow which by default is proportional to the link line width and the transformer zoom factor. If this method returns a size that is not anymore proportional to the transformer zoom factor, this may change the zoomability of this object and the IlvLinkImage.zoomable() method may also have to return something different.

Parameters:
lineWidth - the actual line width used to drawn the object in manager coordinates.
t - the transformer used to draw the object.
See Also:
IlvLinkImage.getLineWidth()

contains

public boolean contains(IlvPoint p,
                        IlvPoint tp,
                        IlvTransformer t)
Tests if a point lies within the outline of the link.

Overrides:
contains in class IlvLinkImage
Parameters:
p - The point to be tested.
tp - The point p transformed by the transformer t.
t - The transformation used to draw the link.
Returns:
true if the point lies inside this graphic object.
See Also:
IlvGraphic

insertPoint

public void insertPoint(int index,
                        float x,
                        float y,
                        IlvTransformer t)
Inserts a point at a specified index. Elements with an index greater than or equal to the current index are shifted up.

Specified by:
insertPoint in interface IlvPolyPointsInterface
Overrides:
insertPoint in class IlvPolicyAwareLinkImage
Parameters:
index - The index at which the new point will be inserted.
x - The x coordinate of the new point (in manager coordinates).
y - The y coordinate of the new point (in manager coordinates).
t - The transformer used to draw the polypoint.

removePoint

public void removePoint(int index,
                        IlvTransformer t)
Removes the point at a specified index. Note that the first and last points cannot be removed because they are the connection points of the link.

Specified by:
removePoint in interface IlvPolyPointsInterface
Overrides:
removePoint in class IlvPolicyAwareLinkImage
Parameters:
index - The index of the point to be removed.
t - The transformer used to draw the polypoint.

movePoint

public void movePoint(int index,
                      float x,
                      float y,
                      IlvTransformer t)
Changes the position of a point. If index is the index of the first or last point, this method calls the movePoint method of the superclass. Otherwise, the method simply moves the point to the new coordinates.

Specified by:
movePoint in interface IlvPolyPointsInterface
Overrides:
movePoint in class IlvPolicyAwareLinkImage
Parameters:
index - The index of the point to be moved.
x - The new x coordinate (in manager coordinates).
y - The new y coordinate (in manager coordinates).
t - The transformer through which the object is drawn.
See Also:
IlvApplyObject, IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)

setIntermediateLinkPoints

public void setIntermediateLinkPoints(IlvPoint[] points,
                                      int index,
                                      int length)
Changes the intermediate points that define the link. This method will take length points in the points array beginning at the index point and will use them for a new intermediate points array. If the array is null or the length parameter is 0, intermediate points are removed.

Overrides:
setIntermediateLinkPoints in class IlvPolicyAwareLinkImage
Parameters:
points - An array of points.
index - The index of the point that will be the first intermediate point.
length - The number of intermediate points taken in the points array.
See Also:
IlvApplyObject, IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)

setOriented

public void setOriented(boolean oriented)
Sets the link as oriented or nonoriented. An oriented link has an arrow drawn at the destination.

Overrides:
setOriented in class IlvLinkImage
See Also:
IlvLinkImage.isOriented()

setBackOriented

public void setBackOriented(boolean oriented)
Sets whether the link is backward oriented. A backward oriented link has an arrow drawn at the origin.

See Also:
isBackOriented()

isBackOriented

public boolean isBackOriented()
Returns true if the link is backward oriented, and false otherwise. A backward oriented link has an arrow drawn at the origin.

See Also:
setBackOriented(boolean)

setLineWidth

public void setLineWidth(float lineWidth)
Changes the line width of the object.

Overrides:
setLineWidth in class IlvLinkImage
Parameters:
lineWidth - The new line width.
See Also:
IlvLinkImage.getLineWidth()

setMaximumLineWidth

public void setMaximumLineWidth(float maximumLineWidth)
Changes the maximum line width of the link. If the maximum line width is specified and not equal to zero, then the width of the link will stop zooming when the maximum line width is reached. A value of zero means that there is no limit.

Overrides:
setMaximumLineWidth in class IlvLinkImage
Parameters:
maximumLineWidth - The maximum line width, or 0 to indicate no limit.
See Also:
IlvLinkImage.getMaximumLineWidth()

setEndCap

public void setEndCap(int endCap)
Changes the decoration applied at the end of the polyline.

Overrides:
setEndCap in class IlvLinkImage
Parameters:
endCap - The new decoration style. The values are defined in the class IlvStroke. The default value is CAP_SQUARE.
See Also:
IlvStroke

setLineJoin

public void setLineJoin(int lineJoin)
Changes the decoration applied when two segments are joined.

Overrides:
setLineJoin in class IlvLinkImage
Parameters:
lineJoin - The new decoration style. The values are defined in the class IlvStroke. The default value is JOIN_MITER.
See Also:
IlvStroke

applyTransform

public void applyTransform(IlvTransformer t)
Applies a transformation to the shape of the link. The method applies the transformer t to the intermediate points of the link, if any.

Overrides:
applyTransform in class IlvPolicyAwareLinkImage
Parameters:
t - The transformer to be applied.
See Also:
IlvGraphic


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.