public class VisualComponentConnectionUtils
extends java.lang.Object
VisualComponentConnection
managing. MappingsPanel
MappingsPanel
MappingsPanel
VisualComponentConnection
,
MappingsPanel
Modifier and Type | Field and Description |
---|---|
static int |
ALL_AND_CANCELED_CONNECTIONS |
static int |
ALL_CONNECTIONS |
static int |
DESTINATION |
static int |
EXISTING_AND_FOR_ADDITION_CONNECTIONS |
static int |
EXISTING_AND_FOR_DELETION_CONNECTIONS |
static int |
EXISTING_CONNECTIONS |
static int |
FOR_ADDITION_CONNECTIONS |
static int |
FOR_DELETION_CONNECTIONS |
static int |
SOURCE |
Constructor and Description |
---|
VisualComponentConnectionUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
connectionIsContained(MappingsPanel container,
int choice,
VisualComponentConnection connection)
Returns
true if the specified connection component is
contained in one of the VisualComponentConnection lists of container depending from choice . |
static java.util.ArrayList<VisualComponentConnection> |
findConnectionsWith(MappingsPanel container,
int choice,
javax.swing.tree.DefaultMutableTreeNode source,
javax.swing.tree.DefaultMutableTreeNode dest)
Finds and returns all
VisualComponentConnection components
with source as their source node and dest
as their destination node. |
static void |
moveBelowAncestorsConnectionsBy(MappingsPanel container,
javax.swing.tree.DefaultMutableTreeNode aNode,
int yDiff)
Moves the
connection components with source or destination
nodes to any of aNodes 's next siblings and ancestors by yDiff |
static void |
moveBelowConnectionsBy(MappingsPanel container,
int endPoint,
int yDiff,
javax.swing.tree.DefaultMutableTreeNode aNode)
Moves the
connection components within container with end points to the ones
specified by endPoint ) below aNode by yDiff |
static void |
moveDescendantsConnectionsBy(MappingsPanel container,
javax.swing.tree.DefaultMutableTreeNode aNode,
int yDiff)
Moves the
connection components with source or destination
nodes to aNode and any of its descendants by yDiff |
static void |
setDescendantsConnectionCollapsion(MappingsPanel container,
int endPoint,
boolean state,
javax.swing.tree.DefaultMutableTreeNode aNode)
Sets the collapsion property of all
connection components
with endPoint nodes
to any of aNode's descendant nodes to state |
static void |
updateConnectionsVisibility(MappingsPanel container,
int endPoint)
Updates the visibility of all
VisualComponentConnection s' sources or
destinations(depending on endPoint ) contained in
container . |
public static final int SOURCE
public static final int DESTINATION
public static final int ALL_CONNECTIONS
public static final int EXISTING_AND_FOR_DELETION_CONNECTIONS
public static final int EXISTING_AND_FOR_ADDITION_CONNECTIONS
public static final int EXISTING_CONNECTIONS
public static final int FOR_ADDITION_CONNECTIONS
public static final int FOR_DELETION_CONNECTIONS
public static final int ALL_AND_CANCELED_CONNECTIONS
public static void updateConnectionsVisibility(MappingsPanel container, int endPoint)
VisualComponentConnection
s' sources or
destinations(depending on endPoint
) contained in
container
. This method simply checks
if a VisualComponentConnection
's specified endpoint should be visible after
some Component movement has occured.container
- An instance of MappingsPanel
endPoint
- An integer indicating which endpoint should be used
for checking its visibility for each VisualComponentConnection
Valid IDs are:
- VisualComponentConnectionUtils.SOURCE
- VisualComponentConnectionUtils.DESTINATION
public static void moveBelowConnectionsBy(MappingsPanel container, int endPoint, int yDiff, javax.swing.tree.DefaultMutableTreeNode aNode)
connection
components within container
with end points to the ones
specified by endPoint
) below aNode
by yDiff
container
- An instance of MappingsPanel
endPoint
- An integer indicating which end point should be used.
yDiff
- An integer specifing the distace the endpoints are to be movedaNode
- A TreeNodepublic static void moveBelowAncestorsConnectionsBy(MappingsPanel container, javax.swing.tree.DefaultMutableTreeNode aNode, int yDiff)
connection
components with source or destination
nodes to any of aNodes
's next siblings and ancestors by yDiff
container
- An instance of MappingsPanel
yDiff
- The distance the source or destination of the connections are to be movedaNode
- The parent TreeNodepublic static void moveDescendantsConnectionsBy(MappingsPanel container, javax.swing.tree.DefaultMutableTreeNode aNode, int yDiff)
connection
components with source or destination
nodes to aNode
and any of its descendants by yDiff
container
- An instance of MappingsPanel
yDiff
- The distance the source or destination of the connections are to be movedaNode
- The parent TreeNodepublic static void setDescendantsConnectionCollapsion(MappingsPanel container, int endPoint, boolean state, javax.swing.tree.DefaultMutableTreeNode aNode)
connection
components
with endPoint
nodes
to any of aNode's descendant nodes to state
container
- An instance of MappingsPanel
endPoint
- An integer indicating which end point
should be used.
state
- The collapsion stateaNode
- The parent TreeNodepublic static java.util.ArrayList<VisualComponentConnection> findConnectionsWith(MappingsPanel container, int choice, javax.swing.tree.DefaultMutableTreeNode source, javax.swing.tree.DefaultMutableTreeNode dest)
VisualComponentConnection
components
with source
as their source node and dest
as their destination node.
Note: By setting one of source or dest
null, this method searchs
for VisualComponentConnection
s with the non-null value as one of it's endpoints
container
- An instance of MappingsPanel
choice
- An Integer indicating which of the VisualComponentConnection
lists of container
should be searched.source
- The source TreeNodedest
- The destination TreeNodeVisualComponentConnection
components.
If no VisualComponentConnection
s were found returns an empty arraypublic static boolean connectionIsContained(MappingsPanel container, int choice, VisualComponentConnection connection)
true
if the specified connection
component is
contained in one of the VisualComponentConnection
lists of container
depending from choice
. Returns false
otherwise.container
- An instance of MappingsPanel
choice
- An Integer indicating which of the VisualComponentConnection
lists of container
should be checked.connection
- The VisualComponentConnection
componenttrue
if contained, false
otherwise