public interface IEdgeReconnectionPortCandidateProvider
IPortCandidate
s for a specific existing IEdge
.
As the name implies this is only used in the context of reconnecting existing edges. It is queried for existing edges to
find out about possible alternative port candidates that given edge could connect to. It is used during gestures where
an edge is reconnected to another port(candidate), i.e. when the source or target port handle of an edge is moved and
the source or target port properties of the edge get set to the new IPortCandidate
s.
Implementations of this interface can be queried using the ILookup.lookup(java.lang.Class)
method of an IEdge
implementation. This interface provides alternative candidates for the SourcePort
or TargetPort
of an edge.
Note that this interface is similar to the interface IPortCandidateProvider
in the sense that they will both
provide IPortCandidate
instances in a certain query context. They are used in different query contexts, though.
The two interfaces can come together in concrete implementations of IEdgeReconnectionPortCandidateProvider
: an
edge could potentially be connected to ports at any given IPortOwner
and thus the IPortCandidateProvider
interface can be queried from the respective IPortOwner
that the edge will be
reconnected to.
Modifier and Type | Field and Description |
---|---|
static IEdgeReconnectionPortCandidateProvider |
ALL_NODE_AND_EDGE_CANDIDATES
Creates an implementation of the
IEdgeReconnectionPortCandidateProvider interface that returns a union of all source port candidates
or
target port candidates ,
respectively, of nodse and edges in the graph. |
static IEdgeReconnectionPortCandidateProvider |
ALL_NODE_CANDIDATES
Creates an implementation of the
IEdgeReconnectionPortCandidateProvider interface that returns a union of all source port candidates
or
target port candidates ,
respectively, of nodes in the graph. |
Modifier and Type | Method and Description |
---|---|
static IEdgeReconnectionPortCandidateProvider |
fromSourceAndTarget(IEdge edge)
Creates an implementation of the
IEdgeReconnectionPortCandidateProvider interface that returns the candidates
provided by the source and target port's owner's IPortCandidateProvider
implementations or the existing edge's port, if no such provider is registered. |
Iterable<IPortCandidate> |
getSourcePortCandidates(IInputModeContext context)
Returns all source port candidates that may be used for the edge.
|
Iterable<IPortCandidate> |
getTargetPortCandidates(IInputModeContext context)
Returns all source port candidates that may be used for the edge.
|
static final IEdgeReconnectionPortCandidateProvider ALL_NODE_AND_EDGE_CANDIDATES
IEdgeReconnectionPortCandidateProvider
interface that returns a union of all source port candidates
or
target port candidates
,
respectively, of nodse and edges in the graph.
This implementation can be used to allow for relocating an edge's port
to any available source or target port in the graph.
static final IEdgeReconnectionPortCandidateProvider ALL_NODE_CANDIDATES
IEdgeReconnectionPortCandidateProvider
interface that returns a union of all source port candidates
or
target port candidates
,
respectively, of nodes in the graph.
This implementation can be used to allow for relocating an edge's port
to any available source or target port in the graph.
static IEdgeReconnectionPortCandidateProvider fromSourceAndTarget(IEdge edge)
IEdgeReconnectionPortCandidateProvider
interface that returns the candidates
provided by the source and target port's owner's IPortCandidateProvider
implementations or the existing edge's port, if no such provider is registered.
This instance uses the lookup mechanism of the nodes to query the providers.
Iterable<IPortCandidate> getSourcePortCandidates(IInputModeContext context)
The enumerable may both contain valid, invalid, and dynamic
port candidates.
context
- The context for which the candidates should be provided.Iterable<IPortCandidate> getTargetPortCandidates(IInputModeContext context)
The enumerable may both contain valid, invalid, and dynamic
port candidates.
context
- The context for which the candidates should be provided.