public interface IInputModeContext extends ICanvasContext
IInputMode instances during IInputMode.install(IInputModeContext, ConcurrencyController)
and IInputMode.uninstall(IInputModeContext) and IDragHandler implementations like IPositionHandler
and IHandle to provide additional context for the implementations.
Implementations of this interface can carry additional information through their ILookup.lookup(java.lang.Class)
method.
ILookup,
IInputMode| Modifier and Type | Field and Description |
|---|---|
static IInputModeContext |
EMPTY
An empty context where both the inputmode and the canvas is
null. |
DEFAULT| Modifier and Type | Method and Description |
|---|---|
static IInputModeContext |
create(CanvasControl canvas)
Factory method that creates an
IInputModeContext that uses the provided values. |
static IInputModeContext |
create(CanvasControl canvas,
IInputMode parent)
Factory method that creates an
IInputModeContext that uses the provided values. |
static IInputModeContext |
create(CanvasControl canvas,
IInputMode parent,
ILookup lookup)
Factory method that creates an
IInputModeContext that uses the provided values. |
static IInputModeContext |
create(IInputMode parent)
Factory method that creates an
IInputModeContext that uses the provided parent mode and lookup decoration. |
static IInputModeContext |
create(IInputMode parent,
IContextLookup lookupCallback)
Factory method that creates an
IInputModeContext that uses the provided parent mode and lookup decoration. |
static IInputModeContext |
create(IInputMode parent,
IInputModeContext parentContext,
IContextLookup lookupCallback)
Factory method that creates an
IInputModeContext that uses the provided parent mode, parent context, and lookup
decoration. |
static IInputModeContext |
create(IInputMode parent,
IInputModeContext parentContext,
ILookup lookup)
Factory method that creates an
IInputModeContext that uses the provided parent mode, parent context, and lookup
decoration. |
static IInputModeContext |
create(IInputMode parent,
ILookup lookup)
Factory method that creates an
IInputModeContext that uses the provided parent mode and lookup decoration. |
default IFoldingView |
getFoldingView()
Tries to retrieve an
IFoldingView instance from the IInputModeContext. |
default IGraph |
getGraph()
Tries to retrieve an
IGraph instance from the IInputModeContext. |
default IGraphSelection |
getGraphSelection()
Tries to retrieve an
IGraphSelection instance from the IInputModeContext. |
IInputMode |
getParentInputMode()
Yields the
IInputMode which issued the context object. |
default void |
invalidateDisplays()
|
create, create, getCanvasControl, getHitTestRadius, getZoomcreateDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, lookup, safeLookupstatic final IInputModeContext EMPTY
null.
The lookup always yields null, also.
static IInputModeContext create(CanvasControl canvas)
IInputModeContext that uses the provided values.create in interface ICanvasContextcanvas - The CanvasControl to use, may not be null.static IInputModeContext create(CanvasControl canvas, IInputMode parent)
IInputModeContext that uses the provided values.canvas - The CanvasControl to use, may not be null.parent - The mode to set as the parent. This may be null for the canvas' context.static IInputModeContext create(CanvasControl canvas, IInputMode parent, ILookup lookup)
IInputModeContext that uses the provided values.canvas - The CanvasControl to use, may not be null.parent - The mode to set as the parent. This may be null for the canvas' context.lookup - The lookup to use.static IInputModeContext create(IInputMode parent)
IInputModeContext that uses the provided parent mode and lookup decoration.static IInputModeContext create(IInputMode parent, IContextLookup lookupCallback)
IInputModeContext that uses the provided parent mode and lookup decoration.static IInputModeContext create(IInputMode parent, IInputModeContext parentContext, IContextLookup lookupCallback)
IInputModeContext that uses the provided parent mode, parent context, and lookup
decoration.static IInputModeContext create(IInputMode parent, IInputModeContext parentContext, ILookup lookup)
IInputModeContext that uses the provided parent mode, parent context, and lookup
decoration.static IInputModeContext create(IInputMode parent, ILookup lookup)
IInputModeContext that uses the provided parent mode and lookup decoration.default IFoldingView getFoldingView()
IFoldingView instance from the IInputModeContext.
This will use the ILookup of the context or if nothing is found the lookup of the
graph in the context.
null.default IGraph getGraph()
IGraph instance from the IInputModeContext.
This will use the ILookup and if this yields nothing, it will use the ILookup of the CanvasControl
or finally test if it is a GraphControl to obtain the graph from.
null.default IGraphSelection getGraphSelection()
IGraphSelection instance from the IInputModeContext.
This will use the ILookup and if this yields nothing, it will use the ILookup of the CanvasControl
or finally test if it is a GraphControl to obtain the selection from.
null.IInputMode getParentInputMode()
IInputMode which issued the context object.
This can be null if this context is used outside the context of an IInputMode.
default void invalidateDisplays()
IGraph.invalidateDisplays() on the graph from the IInputModeContext.
If the graph instance cannot be found, CanvasControl.invalidate() will be called instead.