Class 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.MouseWheelListener
    Class 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
      void mouseDoubleClick​(org.eclipse.swt.events.MouseEvent e)  
      void mouseDown​(org.eclipse.swt.events.MouseEvent e)
      Mouse button press actions: If the left button is pressed: camera ray selection is called.
      void mouseMove​(org.eclipse.swt.events.MouseEvent e)
      Moving mouse actions: check if a button is pressed or not and call appropriate logic.
      void mouseScrolled​(org.eclipse.swt.events.MouseEvent e)  
      void mouseUp​(org.eclipse.swt.events.MouseEvent e)
      Notify that mouse button is up.
      • Methods inherited from class be.yildizgames.module.window.input.GameWindowMouseListener

        mouseLeftDouble, mouseLeftPressed, mouseLeftReleased, mouseMove, mouseRightPressed, mouseRightReleased, mouseScrolled, mouseWheelPressed, mouseWheelReleased
    • 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:
        mouseUp in interface org.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:
        mouseDown in interface org.eclipse.swt.events.MouseListener
        Parameters:
        e - Event retrieved from the listener.
      • mouseDoubleClick

        public void mouseDoubleClick​(org.eclipse.swt.events.MouseEvent e)
        Specified by:
        mouseDoubleClick in interface org.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:
        mouseMove in interface org.eclipse.swt.events.MouseMoveListener
        Parameters:
        e - Event retrieved from the listener.
      • mouseScrolled

        public void mouseScrolled​(org.eclipse.swt.events.MouseEvent e)
        Specified by:
        mouseScrolled in interface org.eclipse.swt.events.MouseWheelListener