Advanced Features > Link Shape Policies > Defining Your Own Link Shape Policy > Callback Methods of IlvLinkShapePolicy

In general, when a method of IlvPolicyAwareLinkImage is called that may change the shape of the link, the following systematic is used by the policy-aware link image:

  1. The link shape policy is temporary disabled to avoid endless recursion when calling methods on the link inside the link shape policy.
  2. The link shape policy is asked whether the change is allowed. For instance, when the method link.insertPoint is called, it is asked via the method policy.allowInsertPoint whether inserting the point is allowed.
  3. If allowed, the change is done, (for example, the point is inserted).
  4. The "after change" callback method of the link shape policy is called. For instance, inside link.insertPoint, the call policy.afterInsertPoint is performed. This allows the policy to react to the change.
  5. The link shape policy is enabled again.
  6. 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.

Table 2.1 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