IBM ILOG Dojo Diagrammer 1.1 API Documentation
Legend: Array Boolean Constructor Date DomNode Error Function Namespace Number Object RegExp Singleton String

ibm_ilog.graphlayout.longlink.ILongLinkTerminationPointFilter

Object » ibm_ilog.graphlayout.longlink.ILongLinkTerminationPointFilter
dojo.require("ibm_ilog.graphlayout.longlink.ILongLinkTerminationPointFilter");

An interface used to define complex requirements concerning the connection of the links to specific point at the nodes.

The filter can be used instead of ibm_ilog.graphlayout.INodeSideFilter to allow more precisely which termination points can be used when routing a link. For each link, the layout algorithm proposes certain termination points that are on the grid at any of the four sides of the corresponding end node. The termination point filter allows you to assign a penalty to the termination points. The termination point with the lowest penalty is most likely to be used. Termination points with penalty Number.MAX_VALUE are never chosen for the link routing.

The penalty affects which termination point is used, but this also depends whether a route from the "start" termination point to the "end" termination point of the link is possible at all without overlapping obstacles.

Method Summary

  • getPenalty(graphModel, link, origin, node, point, side, proposedPenalty) Allows you to assign a penalty to the termination point of 'link' at a given start point which is on the given side of the node 'node'.

Methods

getPenalty
The new penalty.

Allows you to assign a penalty to the termination point of link at a given start point which is on the given side of the node node.

Returns a number between 0 and Number.MAX_VALUE . As smaller the number, as more likely the termination point will be chosen for the link routing. Termination points with penalty Number.MAX_VALUE are never chosen for the link routing.

The values for side are defined in the class ilog.views.Direction . Valid values are Top, Bottom, Left, and Right.

This method is called by LongLinkLayout if a termination point filter is installed. You can implement this method in order to define complex requirements concerning the connection of the links to the different sides of nodes. For example, if you want all links to be connected to any side except the top side of the nodes, you could use:

return (side != ibm_ilog.graphlayout.Direction.TOP ? proposedPenalty : Number.MAX_VALUE);

ParameterTypeDescription
graphModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model to which the node belongs.
linkObjectThe link to be connected to the node.
originBooleanIf 'origin' is 'true', the method determines whether the link origin can be connected. Otherwise, the method determines whether the link destination can be connected.
nodeObjectThe node.
pointPointThe proposed termination point for the link.
sideintThe side of the node where the proposed termination point is placed. The values are defined in the class 'ilog.views.Direction' . Valid values are 'Top', 'Bottom', 'Left', and 'Right'.
proposedPenaltyintThe proposed penalty for the termination point.