In addition to the predefined link shape policies, the JViews Framework allows you
to define your own link shape policies.
In general, when a method of IlvPolicyAwareLinkImage is called that may
change the shape of the link, the following procedure is used by
the policy-aware link image:
- The link shape policy is temporary disabled to avoid endless recursion when calling methods on the link inside the link shape policy.
- The link shape policy is asked whether the change is allowed. For instance, when the method
link.insertPoint
is called, the policy is asked by methodpolicy.allowInsertPoint
whether inserting the point is allowed. - If the change is allowed, it is done (for example, the point is inserted).
- The “after change” callback method of the link shape policy is called. For instance, inside
link.insertPoint
, the methodpolicy.afterInsertPoint
is called. This allows the policy to react to the change. - The link shape policy is enabled again.
- The method
afterAny
is called at the end. Since, at this point, the link shape policy is enabled, this method should not reshape the link any further. It can however perform cleanup operations.
Callback methods of IlvLinkShapePolicy
used by IlvPolicyAwareLinkImage
Method
of IlvPolicyAwareLinkImage |
Test
Method in IlvLinkShapePolicy |
After
Method in IlvLinkShapePolicy |
Comment
|
---|---|---|---|
setLinkShapePolicy
|
onInstall
|
Applied
to the new policy |
|
setLinkShapePolicy
|
onUninstall
|
Applied
to the old policy |
|
insertPoint
|
allowInsertPoint
|
afterInsertPoint
|
|
removePoint
|
allowRemovePoint
|
afterRemovePoint
|
|
movePoint
|
allowMovePoint
|
afterMovePoint
|
|
setIntermediateLinkPoints
|
allowSetIntermediateLinkPoints
|
afterSetIntermediateLinkPoints
|
|
applyTransform
|
allowApplyTransform
|
afterApplyTransform
|
|
afterAdd
|
Applied
after a link has been added to a grapher |
||
beforeRemove
|
Applied
before a link is removed from a grapher |
||
afterFromNodeMoved
|
Applied
when the source node of the link has been moved |
||
afterToNodeMoved
|
Applied
when the destination node of the link has been moved |
||
afterAny
|
Applied
after any of the methods mentioned above |