Package io.guise.framework.input
Class BindingInputStrategy
java.lang.Object
io.guise.framework.input.AbstractInputStrategy
io.guise.framework.input.BindingInputStrategy
- All Implemented Interfaces:
InputStrategy
An input strategy based upon input bindings between input and other input or actions. Typical uses include binding
CommandInput
to
KeystrokeInput
, or binding an ActionModel
to CommandInput
. There must be a GuiseSession
in effect when this
input(Input)
is called for this input strategy.- Author:
- Garret Wilson
-
Constructor Summary
ConstructorDescriptionDefault constructor with no parent.BindingInputStrategy
(InputStrategy parent) Parent constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Binds the given input to other input.void
bind
(Input input, ActionModel targetAction) Binds the given input to an action.boolean
Processes input, returning whether the input was consumed.boolean
Indicates whether the given input is bound.void
Unbinds the given input from any other input or action.Methods inherited from class io.guise.framework.input.AbstractInputStrategy
getParent
-
Constructor Details
-
BindingInputStrategy
public BindingInputStrategy()Default constructor with no parent. -
BindingInputStrategy
Parent constructor.- Parameters:
parent
- The parent input strategy, ornull
if there is no parent input strategy.
-
-
Method Details
-
isBound
Indicates whether the given input is bound.- Parameters:
input
- The input that may be bound, such asKeystrokeInput
orCommandInput
.- Returns:
true
if a binding exists for the given input, elsefalse
.
-
bind
Binds the given input to other input. If the given input is already bound, the old binding will be replaced.- Parameters:
input
- The input to be bound, such asKeystrokeInput
.targetInput
- The target input, such asCommandInput
.
-
bind
Binds the given input to an action. If the given input is already bound, the old binding will be replaced.- Parameters:
input
- The input to be bound, such asCommandInput
.targetAction
- The target action that should be performed.
-
unbind
Unbinds the given input from any other input or action. If there is no binding with the given input, no action is taken.- Parameters:
input
- The input to be unbound.
-
input
Description copied from class:AbstractInputStrategy
Processes input, returning whether the input was consumed. If the input is not consumed by this input strategy, it is sent to the parent input strategy, if any, for processing.This version does nothing besides delegate to the parent input strategy.
- Specified by:
input
in interfaceInputStrategy
- Overrides:
input
in classAbstractInputStrategy
- Parameters:
input
- The input to process.- Returns:
true
if the input was consumed and should not be processed further.
-