Class BindingInputStrategy

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bind​(Input input, Input targetInput)
      Binds the given input to other input.
      void bind​(Input input, ActionModel targetAction)
      Binds the given input to an action.
      boolean input​(Input input)
      Processes input, returning whether the input was consumed.
      boolean isBound​(Input input)
      Indicates whether the given input is bound.
      void unbind​(Input input)
      Unbinds the given input from any other input or action.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BindingInputStrategy

        public BindingInputStrategy()
        Default constructor with no parent.
      • BindingInputStrategy

        public BindingInputStrategy​(InputStrategy parent)
        Parent constructor.
        Parameters:
        parent - The parent input strategy, or null if there is no parent input strategy.
    • Method Detail

      • isBound

        public boolean isBound​(Input input)
        Indicates whether the given input is bound.
        Parameters:
        input - The input that may be bound, such as KeystrokeInput or CommandInput.
        Returns:
        true if a binding exists for the given input, else false.
      • bind

        public void bind​(Input input,
                         Input targetInput)
        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 as KeystrokeInput.
        targetInput - The target input, such as CommandInput.
      • bind

        public void bind​(Input input,
                         ActionModel targetAction)
        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 as CommandInput.
        targetAction - The target action that should be performed.
      • unbind

        public void unbind​(Input input)
        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

        public boolean input​(Input 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 interface InputStrategy
        Overrides:
        input in class AbstractInputStrategy
        Parameters:
        input - The input to process.
        Returns:
        true if the input was consumed and should not be processed further.