Class HIDEventTracker
java.lang.Object
eu.svjatoslav.sixth.e3d.gui.humaninput.HIDEventTracker
- All Implemented Interfaces:
ViewRenderListener
,KeyListener
,MouseListener
,MouseMotionListener
,MouseWheelListener
,EventListener
public class HIDEventTracker
extends Object
implements MouseMotionListener, KeyListener, MouseListener, MouseWheelListener, ViewRenderListener
This class is responsible for tracking human input devices (keyboard, mouse, etc.) and
forwarding those inputs to subsequent virtual components.
-
Constructor Summary
ConstructorDescriptionHIDEventTracker
(ViewPanel viewPanel) Construct new tracker for specified panel. -
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.void
keyPressed
(KeyEvent evt) void
keyReleased
(KeyEvent evt) void
void
void
mouseDragged
(MouseEvent evt) void
void
void
void
void
mouseReleased
(MouseEvent evt) void
-
Constructor Details
-
HIDEventTracker
Construct new tracker for specified panel.
-
-
Method Details
-
beforeRender
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.
-
keyPressed
- Specified by:
keyPressed
in interfaceKeyListener
-
keyReleased
- Specified by:
keyReleased
in interfaceKeyListener
-
keyTyped
- Specified by:
keyTyped
in interfaceKeyListener
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
mousePressed
- Specified by:
mousePressed
in interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseWheelMoved
- Specified by:
mouseWheelMoved
in interfaceMouseWheelListener
-