ibm_ilog.graphlayout.longlink.ILongLinkTerminationPointFilter (version 1.1-SNAPSHOT)
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
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);
Parameter | Type | Description |
---|---|---|
graphModel | ibm_ilog.graphlayout.AbstractGraphLayoutModel | The graph model to which the node belongs. |
link | Object | The link to be connected to the node. |
origin | Boolean | If 'origin' is 'true', the method determines whether the link origin can be connected. Otherwise, the method determines whether the link destination can be connected. |
node | Object | The node. |
point | Point | The proposed termination point for the link. |
side | int | The 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'. |
proposedPenalty | int | The proposed penalty for the termination point. |