public class IltDefaultNodeSideFilter extends Object implements IltNodeSideFilter
IltObject.LinkPorts
,
IltAbstractLink.FromPort
, IltAbstractLink.ToPort
.IltNodeSideFilter
,
IltObject.LinkPorts
,
IltAbstractLink.FromPort
,
IltAbstractLink.ToPort
Constructor and Description |
---|
IltDefaultNodeSideFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(IlvGraphModel graphModel,
Object link,
boolean origin,
Object node,
IltNodeSide 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)
Allows or prohibits the connection of
link on a given
side of the node . |
IltNodeSide[] |
acceptedSides(IlvGraphModel model,
Object link,
boolean origin,
Object node)
Returns the node sides where a link is allowed to connect to
one of its end nodes.
|
public boolean accept(IlvGraphModel graphModel, Object link, boolean origin, Object node, int side)
IlvNodeSideFilter
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);
accept
in interface IlvNodeSideFilter
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
public boolean accept(IlvGraphModel graphModel, Object link, boolean origin, Object node, IltNodeSide side)
IltNodeSideFilter
link
on a given
side of the node
.accept
in interface IltNodeSideFilter
public IltNodeSide[] acceptedSides(IlvGraphModel model, Object link, boolean origin, Object node)
IltNodeSideFilter
acceptedSides
in interface IltNodeSideFilter
IltNodeSide
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.