Package snap.view

Class EventDispatcher

java.lang.Object
snap.view.EventDispatcher

public class EventDispatcher extends Object
A class to help RootView dispatch events to Views.
  • Field Details

    • _mouseOvers

      protected List<View> _mouseOvers
    • _mouseOverView

      protected View _mouseOverView
  • Constructor Details

    • EventDispatcher

      public EventDispatcher(WindowView aWin)
      Creates a new EventDispatcher for given Window.
  • Method Details

    • isMouseDown

      public static boolean isMouseDown()
      Returns whether mouse is down.
    • isMouseDrag

      public static boolean isMouseDrag()
      Returns whether mouse is being dragged.
    • getLastMouseDown

      public static ViewEvent getLastMouseDown()
      Returns the last MouseDown event.
    • getMousePressView

      public View getMousePressView()
      Returns the last mouse pressed view.
    • getPopup

      public PopupWindow getPopup()
      Returns the popup window, if one was added to root view during last event.
    • setPopup

      protected void setPopup(PopupWindow aPopup)
      Sets the popup window, if one added to this root view during last event.
    • dispatchEvent

      public void dispatchEvent(ViewEvent anEvent)
      Dispatch event.
    • dispatchMouseEvent

      public void dispatchMouseEvent(ViewEvent anEvent)
      Dispatch Mouse event.
    • dispatchKeyEvent

      public void dispatchKeyEvent(ViewEvent anEvent)
      Dispatch key event.
    • dispatchActionEvent

      public void dispatchActionEvent(ViewEvent anEvent)
      Dispatch Action event.
    • dispatchDragSourceEvent

      public void dispatchDragSourceEvent(ViewEvent anEvent)
      Dispatch drag gesture event.
    • dispatchDragTargetEvent

      public void dispatchDragTargetEvent(ViewEvent anEvent)
      Dispatch drag target event.
    • dispatchMouseMoveOutsideWindow

      public void dispatchMouseMoveOutsideWindow()
      Dispatch MouseMove event to trigger exit.
    • isMouseOver

      public boolean isMouseOver(View aView)
      Returns whether given view is current under the mouse.
    • isMouseDown

      public boolean isMouseDown(View aView)
      Returns whether given view is currently in mouse press.