public class PortsHandleProvider extends Object implements IHandleProvider
IHandleProvider
that returns all handles in the lookup of the ports owned by the
given owner.
Using this class to display port handles will result in exceptions if the underlying port instances are removed from the
graph while the handles are displayed. This can happen, for example, through Undo
or if ports are removed
programmatically with
IGraph.remove(com.yworks.yfiles.graph.IModelItem)
. In that case, you need to query
the handles again before interacting with the graph, for example by temporarily unselecting and reselecting the
port-owning nodes.
Modifier and Type | Field and Description |
---|---|
protected IPortOwner |
portOwner
The owner of the ports.
|
Constructor and Description |
---|
PortsHandleProvider(IPortOwner owner)
Creates an instance using the given owner as the provider for the ports.
|
Modifier and Type | Method and Description |
---|---|
protected IHandle |
getHandle(IPort port)
Retrieves the handle implementation from the port's lookup.
|
Iterable<IHandle> |
getHandles(IInputModeContext context)
Returns a collection of zero or more
IHandle implementations that are associated with the ports of this
context. |
protected final IPortOwner portOwner
public PortsHandleProvider(IPortOwner owner)
protected IHandle getHandle(IPort port)
public final Iterable<IHandle> getHandles(IInputModeContext context)
IHandle
implementations that are associated with the ports of this
context.getHandles
in interface IHandleProvider