public interface IlvNodeSideFilter
The filter is used by some layout algorithms to provide the user the capability to allow or prohibit the links to be connected on given sides (top/bottom/right/left) of the nodes.
Modifier and Type | Method and Description |
---|---|
boolean |
accept(IlvGraphModel graphModel,
Object link,
boolean origin,
Object node,
int side)
Allows or prohibits the connection of
link on a given
side of the node . |
boolean accept(IlvGraphModel graphModel, Object link, boolean origin, Object node, int side)
link
on a given
side of the node
.
Returns true
when the specified end of link
can be connected on node
on the side defined by the
argument side
. Returns false
otherwise.
The values for side
are defined in IlvDirection
. Valid values are Top
,
Bottom
, Left
, and Right
.
This method is called by those layout algorithms that allow you to specify a node side filter. 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 != IlvDirection.Top);
graphModel
- The graph model to which the node belongs.link
- The link to be connected to the node.origin
- 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
- The node.side
- The side of the node. The values are defined in IlvDirection
. Valid values are Top
,
Bottom
, Left
, and Right
.true
if the connection is allowed and
false
otherwise.IlvDirection
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.