Class WorldNavigationUserInputTracker

java.lang.Object
eu.svjatoslav.sixth.e3d.gui.humaninput.WorldNavigationUserInputTracker
All Implemented Interfaces:
KeyboardInputHandler, ViewRenderListener

public class WorldNavigationUserInputTracker extends Object implements KeyboardInputHandler, ViewRenderListener
  • Constructor Details

    • WorldNavigationUserInputTracker

      public WorldNavigationUserInputTracker()
  • Method Details

    • beforeRender

      public boolean beforeRender(ViewPanel viewPanel, int millisecondsSinceLastFrame)
      Description copied from interface: ViewRenderListener
      Notifies that it is about time (to keep constant framerate) to render next frame and allows listener to do any related processing that it needs to.

      Each ViewRenderListener will be notified exactly once before every frame is rendered.

      ViewRenderListener can determine if frame repaint is actually needed from its perspective. Frame will be rendered only if at least one listener says yes. This mechanism allows to save computing power and energy by skipping frame rendering when possible.

      Specified by:
      beforeRender in interface ViewRenderListener
      Returns:
      true if underlying view shall be re-rendered. If at least one of the view update listeners returns true, view is re-rendered.
    • focusLost

      public boolean focusLost(ViewPanel viewPanel)
      Specified by:
      focusLost in interface KeyboardInputHandler
      Returns:
      true if view needs to be re-rendered.
    • focusReceived

      public boolean focusReceived(ViewPanel viewPanel)
      Specified by:
      focusReceived in interface KeyboardInputHandler
      Returns:
      true if view needs to be re-rendered.
    • keyPressed

      public boolean keyPressed(KeyEvent event, ViewPanel viewContext)
      Specified by:
      keyPressed in interface KeyboardInputHandler
      Returns:
      true if view needs to be re-rendered.
    • keyReleased

      public boolean keyReleased(KeyEvent event, ViewPanel viewContext)
      Specified by:
      keyReleased in interface KeyboardInputHandler
      Returns:
      true if view needs to be re-rendered.