public abstract class IlvAbstractLinkShapePolicy extends Object implements IlvLinkShapePolicy
IlvAbstractLinkShapePolicy
can serve as base class for all
advanced link shape policies.
It implements a delegation facility to a child policy. This allows to
combine link shape policies easily, via setChildPolicy(ilog.views.graphic.linkpolicy.IlvLinkShapePolicy)
.Modifier | Constructor and Description |
---|---|
protected |
IlvAbstractLinkShapePolicy()
Creates a new instance of
IlvAbstractLinkShapePolicy . |
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.
|
IlvLinkShapePolicy |
getChildPolicy()
Returns the child policy.
|
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 |
setChildPolicy(IlvLinkShapePolicy policy)
Sets the child policy.
|
protected IlvAbstractLinkShapePolicy()
IlvAbstractLinkShapePolicy
.public void setChildPolicy(IlvLinkShapePolicy policy)
public final IlvLinkShapePolicy getChildPolicy()
public void afterAdd(IlvLinkImage link)
applyToObject
on the link.
afterAdd
in interface IlvLinkShapePolicy
link
- The link.public void beforeRemove(IlvLinkImage link)
applyToObject
on the link.
beforeRemove
in interface IlvLinkShapePolicy
link
- The link.public void onInstall(IlvLinkImage link)
onInstall
in interface IlvLinkShapePolicy
link
- The link.public void onUninstall(IlvLinkImage link)
onUninstall
in interface IlvLinkShapePolicy
link
- The link.public boolean allowSetIntermediateLinkPoints(IlvLinkImage link, IlvPoint[] points, int index, int length)
true
if the policy allows to set the intermediate
points.
Returns false
otherwise.
allowSetIntermediateLinkPoints
in interface IlvLinkShapePolicy
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.public void afterSetIntermediateLinkPoints(IlvLinkImage link)
afterSetIntermediateLinkPoints
in interface IlvLinkShapePolicy
link
- The link.public boolean allowInsertPoint(IlvLinkImage link, int index, double x, double y, IlvTransformer t)
true
if the policy allows to insert the point.
Returns false
otherwise.allowInsertPoint
in interface IlvLinkShapePolicy
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.public void afterInsertPoint(IlvLinkImage link, int index, IlvTransformer t)
afterInsertPoint
in interface IlvLinkShapePolicy
link
- The link.index
- The index at which the new point was inserted.t
- The transformer through which the link is drawn.public boolean allowRemovePoint(IlvLinkImage link, int index, IlvTransformer t)
true
if the policy allows to remove the point.
Returns false
otherwise.
allowRemovePoint
in interface IlvLinkShapePolicy
link
- The link.index
- The index of the point to be removed.t
- The transformer through which the link is drawn.public void afterRemovePoint(IlvLinkImage link, int index, IlvTransformer t)
afterRemovePoint
in interface IlvLinkShapePolicy
link
- The link.index
- The index at which a point was removed.t
- The transformer through which the link is drawn.public boolean allowMovePoint(IlvLinkImage link, int index, double x, double y, IlvTransformer t)
true
if the policy allows to move the point.
Returns false
otherwise.allowMovePoint
in interface IlvLinkShapePolicy
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.public void afterMovePoint(IlvLinkImage link, int index, IlvTransformer t)
afterMovePoint
in interface IlvLinkShapePolicy
link
- The link.index
- The index of the point that was moved.t
- The transformer through which the link is drawn.public boolean allowApplyTransform(IlvLinkImage link, IlvTransformer t)
true
if the policy allows to apply a transformation.
Returns false
otherwise.
allowApplyTransform
in interface IlvLinkShapePolicy
link
- The link.t
- The transformer to be applied.public void afterApplyTransform(IlvLinkImage link, IlvTransformer t)
afterApplyTransform
in interface IlvLinkShapePolicy
link
- The link.t
- The transformer to be applied.public void afterFromNodeMoved(IlvLinkImage link)
afterFromNodeMoved
in interface IlvLinkShapePolicy
link
- The link.public void afterToNodeMoved(IlvLinkImage link)
afterToNodeMoved
in interface IlvLinkShapePolicy
link
- The link.public 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 loops
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.
afterAny
in interface IlvLinkShapePolicy
link
- The link.public IlvPoint[] getLinkPoints(IlvLinkImage link, IlvTransformer t)
getLinkPoints
in interface IlvLinkShapePolicy
link
- The link.t
- The transformer to be applied.public IlvPoint getPointAt(IlvLinkImage link, int index, IlvTransformer t)
getPointAt
in interface IlvLinkShapePolicy
link
- The link.index
- The index of the point.t
- The transformer to be applied.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.