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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
beforeRender
(ViewPanel viewPanel, int millisecondsSinceLastFrame) 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.boolean
boolean
focusReceived
(ViewPanel viewPanel) boolean
keyPressed
(KeyEvent event, ViewPanel viewContext) boolean
keyReleased
(KeyEvent event, ViewPanel viewContext)
-
Constructor Details
-
WorldNavigationUserInputTracker
public WorldNavigationUserInputTracker()
-
-
Method Details
-
beforeRender
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 interfaceViewRenderListener
- Returns:
true
if underlying view shall be re-rendered. If at least one of the view update listeners returnstrue
, view is re-rendered.
-
focusLost
- Specified by:
focusLost
in interfaceKeyboardInputHandler
- Returns:
true
if view needs to be re-rendered.
-
focusReceived
- Specified by:
focusReceived
in interfaceKeyboardInputHandler
- Returns:
true
if view needs to be re-rendered.
-
keyPressed
- Specified by:
keyPressed
in interfaceKeyboardInputHandler
- Returns:
true
if view needs to be re-rendered.
-
keyReleased
- Specified by:
keyReleased
in interfaceKeyboardInputHandler
- Returns:
true
if view needs to be re-rendered.
-