ilog.views.graphic.linkpolicy
Interface IlvLinkShapePolicy

All Known Implementing Classes:
IlvAbstractLinkShapePolicy, IlvBundleLinkShapePolicy, IlvCrossingLinkShapePolicy, IlvOrthogonalLinkShapePolicy

public interface IlvLinkShapePolicy

A link shape policy gets notified by the IlvPolicyAwareLinkImage whenever the link shape changes. It allows to add a policy for the shape to the link. For instance, a link shape policy could be that the link must remain orthogonal (see IlvOrthogonalLinkShapePolicy).

Since:
JViews 6.0

Method Summary
 void afterAdd(IlvLinkImage link)
          Allows the policy to react after a link with installed policy is added to a grapher.
 void afterAny(IlvLinkImage link)
          Allows the policy to react after any of onInstall, onUninstall, afterAdd, beforeRemove, afterSetIntermediateLinkPoints, afterInsertPoint, afterRemovePoint, afterMovePoint, afterApplyTransform, afterFromNodeMoved, and afterToNodeMoved.
 void afterApplyTransform(IlvLinkImage link, IlvTransformer t)
          Allows the policy to react after a transformation was applied.
 void afterFromNodeMoved(IlvLinkImage link)
          Allows the policy to react after the source node of the link was moved.
 void afterInsertPoint(IlvLinkImage link, int index, IlvTransformer t)
          Allows the policy to react after a point was inserted.
 void afterMovePoint(IlvLinkImage link, int index, IlvTransformer t)
          Allows the policy to react after a point was moved.
 void afterRemovePoint(IlvLinkImage link, int index, IlvTransformer t)
          Allows the policy to react after a point was removed.
 void afterSetIntermediateLinkPoints(IlvLinkImage link)
          Allows the policy to react after the intermediate points were set.
 void afterToNodeMoved(IlvLinkImage link)
          Allows the policy to react after the target node of the link was moved.
 boolean allowApplyTransform(IlvLinkImage link, IlvTransformer t)
          Returns true if the policy allows to apply a transformation.
 boolean allowInsertPoint(IlvLinkImage link, int index, float x, float y, IlvTransformer t)
          Returns true if the policy allows to insert the point.
 boolean allowMovePoint(IlvLinkImage link, int index, float x, float y, IlvTransformer t)
          Returns true if the policy allows to move the point.
 boolean allowRemovePoint(IlvLinkImage link, int index, IlvTransformer t)
          Returns true if the policy allows to remove the point.
 boolean allowSetIntermediateLinkPoints(IlvLinkImage link, IlvPoint[] points, int index, int length)
          Returns true if the policy allows to set the intermediate points.
 void beforeRemove(IlvLinkImage link)
          Allows the policy to react before a link with installed policy is removed from a grapher.
 IlvPoint[] getLinkPoints(IlvLinkImage link, IlvTransformer t)
          Returns the points that define the link.
 IlvPoint getPointAt(IlvLinkImage link, int index, IlvTransformer t)
          Returns the point at a given index.
 void onInstall(IlvLinkImage link)
          Allows the policy to react immediately when it is installed at a link.
 void onUninstall(IlvLinkImage link)
          Allows the policy to react immediately when it is removed from a link.
 

Method Detail

afterAdd

void afterAdd(IlvLinkImage link)
Allows the policy to react after a link with installed policy is added to a grapher. Notice that if this method changes the shape of the link, it has to call applyToObject on the link.

Parameters:
link - The link.

beforeRemove

void beforeRemove(IlvLinkImage link)
Allows the policy to react before a link with installed policy is removed from a grapher. Notice that if this method changes the shape of the link, it has to call applyToObject on the link.

Parameters:
link - The link.

onInstall

void onInstall(IlvLinkImage link)
Allows the policy to react immediately when it is installed at a link.

Parameters:
link - The link.

onUninstall

void onUninstall(IlvLinkImage link)
Allows the policy to react immediately when it is removed from a link.

Parameters:
link - The link.

allowSetIntermediateLinkPoints

boolean allowSetIntermediateLinkPoints(IlvLinkImage link,
                                       IlvPoint[] points,
                                       int index,
                                       int length)
Returns true if the policy allows to set the intermediate points. Returns false otherwise.

Parameters:
link - The link.
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.

afterSetIntermediateLinkPoints

void afterSetIntermediateLinkPoints(IlvLinkImage link)
Allows the policy to react after the intermediate points were set.

Parameters:
link - The link.

allowInsertPoint

boolean allowInsertPoint(IlvLinkImage link,
                         int index,
                         float x,
                         float y,
                         IlvTransformer t)
Returns true if the policy allows to insert the point. Returns false otherwise.

Parameters:
link - The link.
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 through which the link is drawn.

afterInsertPoint

void afterInsertPoint(IlvLinkImage link,
                      int index,
                      IlvTransformer t)
Allows the policy to react after a point was inserted.

Parameters:
link - The link.
index - The index at which the new point was inserted.
t - The transformer through which the link is drawn.

allowRemovePoint

boolean allowRemovePoint(IlvLinkImage link,
                         int index,
                         IlvTransformer t)
Returns true if the policy allows to remove the point. Returns false otherwise.

Parameters:
link - The link.
index - The index of the point to be removed.
t - The transformer through which the link is drawn.

afterRemovePoint

void afterRemovePoint(IlvLinkImage link,
                      int index,
                      IlvTransformer t)
Allows the policy to react after a point was removed.

Parameters:
link - The link.
index - The index at which a point was removed.
t - The transformer through which the link is drawn.

allowMovePoint

boolean allowMovePoint(IlvLinkImage link,
                       int index,
                       float x,
                       float y,
                       IlvTransformer t)
Returns true if the policy allows to move the point. Returns false otherwise.

Parameters:
link - The link.
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 link is drawn.

afterMovePoint

void afterMovePoint(IlvLinkImage link,
                    int index,
                    IlvTransformer t)
Allows the policy to react after a point was moved.

Parameters:
link - The link.
index - The index of the point that was moved.
t - The transformer through which the link is drawn.

allowApplyTransform

boolean allowApplyTransform(IlvLinkImage link,
                            IlvTransformer t)
Returns true if the policy allows to apply a transformation. Returns false otherwise.

Parameters:
link - The link.
t - The transformer to be applied.

afterApplyTransform

void afterApplyTransform(IlvLinkImage link,
                         IlvTransformer t)
Allows the policy to react after a transformation was applied.

Parameters:
link - The link.
t - The applied transformer.

afterFromNodeMoved

void afterFromNodeMoved(IlvLinkImage link)
Allows the policy to react after the source node of the link was moved.

Parameters:
link - The link.

afterToNodeMoved

void afterToNodeMoved(IlvLinkImage link)
Allows the policy to react after the target node of the link was moved.

Parameters:
link - The link.

afterAny

void afterAny(IlvLinkImage link)
Allows the policy to react after any of onInstall, onUninstall, afterAdd, beforeRemove, afterSetIntermediateLinkPoints, afterInsertPoint, afterRemovePoint, afterMovePoint, afterApplyTransform, afterFromNodeMoved, and afterToNodeMoved. While during the methods above, the policy is temporarily deactivated at the link to avoid that link shape changes done by the policy calls the policy again in an infinite loop, the method afterAny is called when the policy is again activated. Hence, the policy should not change the link shape inside this method, but rather can perform cleanup methods needed for the methods above.

Parameters:
link - The link.

getLinkPoints

IlvPoint[] getLinkPoints(IlvLinkImage link,
                         IlvTransformer t)
Returns the points that define the link. By overriding this method, the link shape policy can be enabled to change the default behavior of the points of the links.

Parameters:
link - The link.
t - The transformer to be applied.

getPointAt

IlvPoint getPointAt(IlvLinkImage link,
                    int index,
                    IlvTransformer t)
Returns the point at a given index. By overriding this method, the link shape policy can be enabled to change the default behavior of the points of the links.

Parameters:
link - The link.
index - The index of the point.
t - The transformer to be applied.


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