Class AWTInput

All Implemented Interfaces:
Direct Known Subclasses:
AWTKeyInput, AWTMouseInput

public class AWTInput extends Object implements Input
The implementation of the Input dedicated to AWT component.

This class is based on the JavaFX original code provided by Alexander Brui (see JME3-FX)

  • Field Details


      protected static final AWTTaskExecutor EXECUTOR
    • context

      protected final AWTContext context
      The context.
    • listener

      protected RawInputListener listener
      The raw listener.
    • component

      protected Component component
      The input node.
    • application

      protected Application application
      The JMonkey application that provide the context.
    • initialized

      protected boolean initialized
      Initializes is it.
  • Constructor Details

  • Method Details

    • bind

      public void bind(Component component)
    • unbind

      public void unbind()
    • initialize

      public void initialize()
      Description copied from interface: Input
      Initializes the native side to listen into events from the device.
      Specified by:
      initialize in interface Input
    • initializeImpl

      protected void initializeImpl()
    • update

      public void update()
      Description copied from interface: Input
      Queries the device for input. All events should be sent to the RawInputListener set with setInputListener.
      Specified by:
      update in interface Input
      See Also:
    • updateImpl

      protected void updateImpl()
    • destroy

      public void destroy()
      Description copied from interface: Input
      Ceases listening to events from the device.
      Specified by:
      destroy in interface Input
    • isInitialized

      public boolean isInitialized()
      Specified by:
      isInitialized in interface Input
      True if the device has been initialized and not destroyed.
      See Also:
    • setInputListener

      public void setInputListener(RawInputListener listener)
      Description copied from interface: Input
      Sets the input listener to receive events from this device. The appropriate events should be dispatched through the callbacks in RawInputListener.
      Specified by:
      setInputListener in interface Input
      listener - the desired listener
    • getInputTimeNanos

      public long getInputTimeNanos()
      Specified by:
      getInputTimeNanos in interface Input
      The current absolute time as nanoseconds. This time is expected to be relative to the time given in InputEvents time property.