Class SwtGameWindowMouseListener
- java.lang.Object
-
- be.yildizgames.module.window.input.GameWindowMouseListener
-
- be.yildizgames.module.window.swt.input.SwtGameWindowMouseListener
-
- All Implemented Interfaces:
EventListener,org.eclipse.swt.events.MouseListener,org.eclipse.swt.events.MouseMoveListener,org.eclipse.swt.events.MouseWheelListener,org.eclipse.swt.internal.SWTEventListener
public final class SwtGameWindowMouseListener extends be.yildizgames.module.window.input.GameWindowMouseListener implements org.eclipse.swt.events.MouseListener, org.eclipse.swt.events.MouseMoveListener, org.eclipse.swt.events.MouseWheelListenerClass for the mouse management. All event are catch here from SWT and then sent to the observer.- Author:
- Grégory Van den Borre
-
-
Constructor Summary
Constructors Constructor Description SwtGameWindowMouseListener(org.eclipse.swt.widgets.Control c, be.yildizgames.module.window.input.WindowInputListener dispatcher)Full constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmouseDoubleClick(org.eclipse.swt.events.MouseEvent e)voidmouseDown(org.eclipse.swt.events.MouseEvent e)Mouse button press actions: If the left button is pressed: camera ray selection is called.voidmouseMove(org.eclipse.swt.events.MouseEvent e)Moving mouse actions: check if a button is pressed or not and call appropriate logic.voidmouseScrolled(org.eclipse.swt.events.MouseEvent e)voidmouseUp(org.eclipse.swt.events.MouseEvent e)Notify that mouse button is up.
-
-
-
Constructor Detail
-
SwtGameWindowMouseListener
public SwtGameWindowMouseListener(org.eclipse.swt.widgets.Control c, be.yildizgames.module.window.input.WindowInputListener dispatcher)Full constructor.- Parameters:
c- SWT control element, it can be any widget with mouse interaction capability.dispatcher- Input listener
-
-
Method Detail
-
mouseUp
public void mouseUp(org.eclipse.swt.events.MouseEvent e)
Notify that mouse button is up.- Specified by:
mouseUpin interfaceorg.eclipse.swt.events.MouseListener- Parameters:
e- Event retrieved from the listener.
-
mouseDown
public void mouseDown(org.eclipse.swt.events.MouseEvent e)
Mouse button press actions: If the left button is pressed: camera ray selection is called. If the right button is pressed, the camera will rotate or make an action for a unit.- Specified by:
mouseDownin interfaceorg.eclipse.swt.events.MouseListener- Parameters:
e- Event retrieved from the listener.
-
mouseDoubleClick
public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
- Specified by:
mouseDoubleClickin interfaceorg.eclipse.swt.events.MouseListener
-
mouseMove
public void mouseMove(org.eclipse.swt.events.MouseEvent e)
Moving mouse actions: check if a button is pressed or not and call appropriate logic.- Specified by:
mouseMovein interfaceorg.eclipse.swt.events.MouseMoveListener- Parameters:
e- Event retrieved from the listener.
-
mouseScrolled
public void mouseScrolled(org.eclipse.swt.events.MouseEvent e)
- Specified by:
mouseScrolledin interfaceorg.eclipse.swt.events.MouseWheelListener
-
-