public interface IFoldingEdgeConverter
FoldingManager
and IFoldingView
which is responsible for managing edges between folder
nodes.
Since FoldingManager.createFoldingView(INode, java.util.function.Predicate)
creates views that can potentially
contain edges that connect to nodes which have a different set of attributes, these edges might need to have a separate
set of attributes, too. Implementations of this interface are being called by the
IFoldingView
s to configure these kind of folding edges.
Modifier and Type | Method and Description |
---|---|
IEdge |
addFoldingEdge(IFoldingEdgeFactory factory,
IFoldingView foldingView,
IEdge masterEdge,
INode source,
boolean sourceIsCollapsed,
INode target,
boolean targetIsCollapsed)
This method gets called by the
IFoldingView implementation to determine whether a given edge in the MasterGraph
should be represented by a folding edge in the given view. |
void |
initializeFoldingEdgeState(FoldingEdgeState state,
IFoldingView foldingView,
IEdge foldingEdge,
List<IEdge> masterEdges)
Callback that is triggered by the
view to initially create the appearance of a folding edge. |
void |
updateFoldingEdgeState(FoldingEdgeState state,
IFoldingView foldingView,
IEdge foldingEdge,
List<IEdge> masterEdges)
Callback that is triggered by the
view to adjust the appearance of a folding edge. |
IEdge addFoldingEdge(IFoldingEdgeFactory factory, IFoldingView foldingView, IEdge masterEdge, INode source, boolean sourceIsCollapsed, INode target, boolean targetIsCollapsed)
IFoldingView
implementation to determine whether a given edge in the MasterGraph
should be represented by a folding edge in the given view.
The implementation will be passed in a factory
object that implements the IFoldingEdgeFactory
interface,
which needs to be used by the implementation to communicate the result of the query. The implementation needs to either
call IFoldingEdgeFactory.addAsSeparateEdge(com.yworks.yfiles.graph.IPort, com.yworks.yfiles.graph.IPort)
,
IFoldingEdgeFactory.addToExistingFoldingEdge(IEdge)
, or IFoldingEdgeFactory.excludeFoldingEdge()
and
return the values that these implementation yields to the caller. The implementation can optionally query the existing folding edges
between the source and target node and decide whether to add the edge
to the existing folding edge
.
factory
- The IFoldingEdgeFactory
implementation that needs to be called in order to communicate the results of this
query.foldingView
- The instance into which the folding edge is going to be inserted.masterEdge
- The edge from the MasterGraph
that needs to be
represented by a folding edge. Note that you may not return this instance.source
- The source node that belongs to the IFoldingView
graph that will act as the local view node of the actual source
node.sourceIsCollapsed
- Determines whether the source
is currently a folder node.target
- The target node that belongs to the IFoldingView
graph that will act as the local view node of the actual target
node.targetIsCollapsed
- Determines whether the target
is currently a folder node.IFoldingEdgeFactory.addAsSeparateEdge(com.yworks.yfiles.graph.IPort, com.yworks.yfiles.graph.IPort)
, or
IFoldingEdgeFactory.addToExistingFoldingEdge(IEdge)
, or null
if the edge will be excluded
from the view.void initializeFoldingEdgeState(FoldingEdgeState state, IFoldingView foldingView, IEdge foldingEdge, List<IEdge> masterEdges)
view
to initially create the appearance of a folding edge.
Implementations may not use the IFoldingView
's Graph
instance to modify the
foldingEdge
, because this would create and enqueue undo events. Rather the properties provided by the state
implementation must be set.
state
- The FoldingEdgeState
of the edge to change.foldingView
- The graph to which the folding edge belongs.foldingEdge
- The folding edge for which the appearance shall be determined.masterEdges
- The list of master edges
, that the folding edge initially represents.updateFoldingEdgeState(FoldingEdgeState, IFoldingView, IEdge, List)
void updateFoldingEdgeState(FoldingEdgeState state, IFoldingView foldingView, IEdge foldingEdge, List<IEdge> masterEdges)
view
to adjust the appearance of a folding edge.
For instance, it can be used to reflect a state change in the master edges
that make up that folding edge.
Implementations may not use the IFoldingView
's Graph
instance to modify the
foldingEdge
, because this would create and enqueue undo events. Rather the properties provided by the state
implementation must be set.
state
- The FoldingEdgeState
of the edge to change.foldingView
- The graph to which the folding edge belongs.foldingEdge
- The folding edge for which the appearance might need an update.masterEdges
- The list of master edges
, that the folding edge currently represents.initializeFoldingEdgeState(FoldingEdgeState, IFoldingView, IEdge, List)