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
ConstructorsConstructorDescriptionHIDEventTracker(ViewPanel viewPanel) Construct new tracker for specified panel. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbeforeRender(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.voidkeyPressed(KeyEvent evt) voidkeyReleased(KeyEvent evt) voidvoidvoidmouseDragged(MouseEvent evt) voidvoidvoidvoidvoidmouseReleased(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
ViewRenderListenerwill be notified exactly once before every frame is rendered.ViewRenderListenercan 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:
beforeRenderin interfaceViewRenderListener- Returns:
trueif underlying view shall be re-rendered. If at least one of the view update listeners returnstrue, view is re-rendered.
-
keyPressed
- Specified by:
keyPressedin interfaceKeyListener
-
keyReleased
- Specified by:
keyReleasedin interfaceKeyListener
-
keyTyped
- Specified by:
keyTypedin interfaceKeyListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseWheelMoved
- Specified by:
mouseWheelMovedin interfaceMouseWheelListener
-