public interface IlvLinkShapePolicy
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
).Modifier and Type | Method and Description |
---|---|
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,
double x,
double y,
IlvTransformer t)
Returns
true if the policy allows to insert the point. |
boolean |
allowMovePoint(IlvLinkImage link,
int index,
double x,
double 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.
|
void afterAdd(IlvLinkImage link)
applyToObject
on the link.
link
- The link.void beforeRemove(IlvLinkImage link)
applyToObject
on the link.
link
- The link.void onInstall(IlvLinkImage link)
link
- The link.void onUninstall(IlvLinkImage link)
link
- The link.boolean allowSetIntermediateLinkPoints(IlvLinkImage link, IlvPoint[] points, int index, int length)
true
if the policy allows to set the intermediate
points.
Returns false
otherwise.
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.void afterSetIntermediateLinkPoints(IlvLinkImage link)
link
- The link.boolean allowInsertPoint(IlvLinkImage link, int index, double x, double y, IlvTransformer t)
true
if the policy allows to insert the point.
Returns false
otherwise.
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.void afterInsertPoint(IlvLinkImage link, int index, IlvTransformer t)
link
- The link.index
- The index at which the new point was inserted.t
- The transformer through which the link is drawn.boolean allowRemovePoint(IlvLinkImage link, int index, IlvTransformer t)
true
if the policy allows to remove the point.
Returns false
otherwise.
link
- The link.index
- The index of the point to be removed.t
- The transformer through which the link is drawn.void afterRemovePoint(IlvLinkImage link, int index, IlvTransformer t)
link
- The link.index
- The index at which a point was removed.t
- The transformer through which the link is drawn.boolean allowMovePoint(IlvLinkImage link, int index, double x, double y, IlvTransformer t)
true
if the policy allows to move the point.
Returns false
otherwise.
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.void afterMovePoint(IlvLinkImage link, int index, IlvTransformer t)
link
- The link.index
- The index of the point that was moved.t
- The transformer through which the link is drawn.boolean allowApplyTransform(IlvLinkImage link, IlvTransformer t)
true
if the policy allows to apply a transformation.
Returns false
otherwise.
link
- The link.t
- The transformer to be applied.void afterApplyTransform(IlvLinkImage link, IlvTransformer t)
link
- The link.t
- The applied transformer.void afterFromNodeMoved(IlvLinkImage link)
link
- The link.void afterToNodeMoved(IlvLinkImage link)
link
- The link.void afterAny(IlvLinkImage link)
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.
link
- The link.IlvPoint[] getLinkPoints(IlvLinkImage link, IlvTransformer t)
link
- The link.t
- The transformer to be applied.IlvPoint getPointAt(IlvLinkImage link, int index, IlvTransformer t)
link
- The link.index
- The index of the point.t
- The transformer to be applied.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.