public interface IFoldingEdgeFactory
IFoldingEdgeConverter
's IFoldingEdgeConverter.addFoldingEdge(IFoldingEdgeFactory, IFoldingView, IEdge, INode, boolean, INode, boolean)
method.
Implementors of the IFoldingEdgeConverter
need to use this interface to tell the calling IFoldingView
implementation how to add the folding edge to the given view. They need to call exactly one of the following methods for
each factory:
addAsSeparateEdge(IPort, IPort)
– Call this to add a separate folding edge for the given master edge to the view. Pass the return value of that method to
the caller.
addToExistingFoldingEdge(IEdge)
– Call this to reuse a folding edge that is already part of the view as a representative for the master edge. Pass the
return value of that method to the caller.
excludeFoldingEdge()
– Call this in order not to add a folding edge for the master edge to the view at all. Pass null
to the caller.IEdge addAsSeparateEdge(IPort sourcePort, IPort targetPort)
IFoldingView
implementation to add the edge provided to the IFoldingEdgeConverter.addFoldingEdge(IFoldingEdgeFactory, com.yworks.yfiles.graph.IFoldingView, IEdge, com.yworks.yfiles.graph.INode, boolean, com.yworks.yfiles.graph.INode, boolean)
method as a separate folding edge to the view at the given ports.
This tells the view that there is currently no existing folding edge
in the
view to which the master edge should be added to. Instead the view should add a separate folding edge that represents
the master edge. Use the result of this method call as the return value for the IFoldingEdgeConverter.addFoldingEdge(IFoldingEdgeFactory, com.yworks.yfiles.graph.IFoldingView, IEdge, com.yworks.yfiles.graph.INode, boolean, com.yworks.yfiles.graph.INode, boolean)
call. Note that the returned folding edge should not be modified by this code, instead the IFoldingEdgeConverter.initializeFoldingEdgeState(com.yworks.yfiles.graph.FoldingEdgeState, com.yworks.yfiles.graph.IFoldingView, IEdge, java.util.List)
and IFoldingEdgeConverter.updateFoldingEdgeState(com.yworks.yfiles.graph.FoldingEdgeState, com.yworks.yfiles.graph.IFoldingView, IEdge, java.util.List)
callbacks need to be used to change the appearance of the folding edge. Existing ports at the provided source and target
nodes may be specified to further influence the folding edge creation.
sourcePort
- The source port at the source node in the view to use or null
if an extra folding state
port should be added for the edge to connect to at the source.targetPort
- The target port at the target node in the view to use or null
if an extra folding state
port should be added for the edge to connect to at the target.IFoldingEdgeConverter
,
IFoldingView.getViewItem(com.yworks.yfiles.graph.IModelItem)
IEdge addToExistingFoldingEdge(IEdge foldingEdge)
IFoldingView
implementation to logically add the edge provided to the IFoldingEdgeConverter.addFoldingEdge(IFoldingEdgeFactory, com.yworks.yfiles.graph.IFoldingView, IEdge, com.yworks.yfiles.graph.INode, boolean, com.yworks.yfiles.graph.INode, boolean)
method to a folding edge that already exists in the view.
This tells the view that there is already an existing folding edge
in the view
to which the master edge should be added logically added to. The given foldingEdge
will have the master edge
added to its collection of master edges
. Note that
the returned folding edge should not be modified by this code, instead the IFoldingEdgeConverter.updateFoldingEdgeState(com.yworks.yfiles.graph.FoldingEdgeState, com.yworks.yfiles.graph.IFoldingView, IEdge, java.util.List)
callback needs to be used to change the appearance of the folding edge. Implementations can use the getExistingFoldingEdges(boolean)
method to retrieve the current set of existing folding edges that interconnect the same source and target nodes. The
range of valid parameters is constrained to this collection.
foldingEdge
- One of the existing folding edges
from the view which has been chosen to
represent the master edge in this view.foldingEdge
parameter. Don't
change the properties of the edge directly.IFoldingEdgeConverter
,
getExistingFoldingEdges(boolean)
IEdge excludeFoldingEdge()
IFoldingView
implementation not to add a folding edge for the edge provided to
the IFoldingEdgeConverter.addFoldingEdge(IFoldingEdgeFactory, com.yworks.yfiles.graph.IFoldingView, IEdge, com.yworks.yfiles.graph.INode, boolean, com.yworks.yfiles.graph.INode, boolean)
method in this view.
This tells the view that there should not be a representation of the master edge in this view. If this method is called,
null
should be returned as the result of a IFoldingEdgeConverter.addFoldingEdge(IFoldingEdgeFactory, com.yworks.yfiles.graph.IFoldingView, IEdge, com.yworks.yfiles.graph.INode, boolean, com.yworks.yfiles.graph.INode, boolean)
call, which is the same as the return value of this method. So it is possible to just pass the return value on to the
caller.
null
. This is for symmetry reasons to be easily exchangeable with the other methods.IFoldingEdgeConverter
IEnumerable<IEdge> getExistingFoldingEdges(boolean ignoreDirection)
IFoldingEdgeConverter.addFoldingEdge(IFoldingEdgeFactory, com.yworks.yfiles.graph.IFoldingView, IEdge, com.yworks.yfiles.graph.INode, boolean, com.yworks.yfiles.graph.INode, boolean)
method to determine the folding edges that are currently part of the view and interconnect the same nodes as the folding
edge would, if it was included in the view.
This method will yield all folding edges
that interconnect the same source and target node as that the folding edge would, if it was included in this view. One
of the items in the returned collection can be passed to the addToExistingFoldingEdge(IEdge)
method.
ignoreDirection
- Whether the direction of the edges should be ignored so that reverse edges are included in the enumeration, too.