public class FoldingEdgeStateId extends Object
folding
edge that
connects to nodes inside a collapsed group or to other folder nodes in a IFoldingView
.
Instances of this type are passed to the various methods in FoldingManager
to identify different possible states
of an edge inside IFoldingView
s. A folding edge is identified through the master edge, which is an edge in the MasterGraph
and a source and target node. Also whether those source and target nodes are currently folder
nodes needs to be taken into account. The source and target nodes need to be either the true owners
of the adjacent edge's SourcePort
and TargetPort
respectively, or ancestor
group nodes in the
MasterGraph
. In the latter case these folding edges are used to describe the
state of the folding edges that are present in the views of the corresponding group nodes are in collapsed
state, so that the true source and target nodes are not currently visible in the view. As such the CurrentMasterSource
and CurrentMasterTarget
nodes represent the masters
of the nearest ancestors in the MasterGraph
that are visible in the folding view
graph.
Constructor and Description |
---|
FoldingEdgeStateId(IEdge masterEdge,
INode currentMasterSource,
boolean sourceCollapsed,
INode currentMasterTarget,
boolean targetCollapsed)
Initializes an id for a folding edge in a
view that represent a master edge and connects a specific
pair of nodes. |
FoldingEdgeStateId(IFoldingView foldingView,
IEdge foldingEdge)
Initializes an id for a folding edge that is currently part of the given view.
|
Modifier and Type | Method and Description |
---|---|
INode |
getCurrentMasterSource()
The source node of the edge or an ancestor (both in the
MasterGraph ). |
INode |
getCurrentMasterTarget()
The target node of the edge or an ancestor (both in the
MasterGraph ). |
IEdge |
getMasterEdge()
The edge instance in the
MasterGraph that is represented
by the folding edge in a view. |
boolean |
isSourceCollapsed()
Specifies whether the
CurrentMasterSource node
is in folder state . |
boolean |
isTargetCollapsed()
Specifies whether the
CurrentMasterTarget node
is in folder state . |
public FoldingEdgeStateId(IEdge masterEdge, INode currentMasterSource, boolean sourceCollapsed, INode currentMasterTarget, boolean targetCollapsed)
view
that represent a master edge and connects a specific
pair of nodes.
All of the arguments need to be entities of the
master graph
.
masterEdge
- An edge in the MasterGraph
that is represented by the
folding edge.currentMasterSource
- The source node of the edge or one of its ancestors to which the folding edge connects in the view, if the actual parent
is currently collapsed in an ancestor node
.sourceCollapsed
- true
if the currentMasterSource
is the true source of the masterEdge
, but is in its collapsed/dummy
state.targetCollapsed
- true
if the currentMasterTarget
is the true target of the masterEdge
, but is in its collapsed/dummy
state.currentMasterTarget
- The target node of the edge or one of its ancestors to which the folding edge connects in the view, if the actual parent
is currently collapsed in an ancestor node
.public FoldingEdgeStateId(IFoldingView foldingView, IEdge foldingEdge)
foldingView
- The view the folding edge is part of.foldingEdge
- The instance that is part of the folding view graph
.public final INode getCurrentMasterSource()
MasterGraph
).
This may be an ancestor of the true source node if this ancestor is collapsed
. More
specific it is the source node of the MasterEdge
if the source node is represented in the view
and otherwise the first ancestor of the source node which is represented in the view.
public final INode getCurrentMasterTarget()
MasterGraph
).
This may be an ancestor of the true target node if this ancestor is collapsed
. More
precisely it is the target node of the MasterEdge
if the target node is represented in the view
and otherwise the first ancestor of the target node which is represented in the view.
public final IEdge getMasterEdge()
MasterGraph
that is represented
by the folding edge in a view.public final boolean isSourceCollapsed()
CurrentMasterSource
node
is in folder state
.
Since an edge will be converted to a folding edge if the adjacent node itself will be collapsed
to a folder node, this property determines which state the source node is in for this folding edge.
public final boolean isTargetCollapsed()
CurrentMasterTarget
node
is in folder state
.
Since an edge will be converted to a folding edge if the adjacent node itself will be collapsed
to a folder node, this property determines which state the source node is in for this folding edge.