Class SwingEvent

java.lang.Object
com.inductiveautomation.snap.ui.UIEvent
com.inductiveautomation.snap.swing.SwingEvent

public class SwingEvent extends UIEvent
This class encapsulates information for UI changes, like button clicks, text field entries, list selections, etc..
  • Constructor Details

  • Method Details

    • getShape

      public RMShape getShape()
      Returns the target as shape, if shape.
    • isComponent

      public boolean isComponent()
      Returns whether target is a component.
    • getComponent

      public JComponent getComponent()
      Returns the target component, if event target was component shape.
    • getEvent

      public EventObject getEvent()
      Returns the event as an EventObject.
      Overrides:
      getEvent in class UIEvent
    • getType

      protected UIEvent.Type getType(Object anEvent)
      Computes the event type from EventObject.
      Specified by:
      getType in class UIEvent
    • getPropertyChangePropertyName

      protected String getPropertyChangePropertyName()
      Return PropertyChangeEvent property name.
      Specified by:
      getPropertyChangePropertyName in class UIEvent
    • isAWTEvent

      public boolean isAWTEvent()
      Returns whether event is AWT event.
    • getAWTEvent

      public AWTEvent getAWTEvent()
      Returns the AWT event.
    • getEventID

      public int getEventID()
      Returns the event id.
    • isInputEvent

      public boolean isInputEvent()
      Returns whether event is input event.
    • getInputEvent

      public InputEvent getInputEvent()
      Returns the input event.
    • isShiftDown

      public boolean isShiftDown()
      Returns whether shift key is down.
    • isControlDown

      public boolean isControlDown()
      Returns whether control key is down.
    • isAltDown

      public boolean isAltDown()
      Returns whether alt key is down.
    • isMetaDown

      public boolean isMetaDown()
      Returns whether "meta" key is down (the command key on Mac with no equivalent on Windows).
    • isCommandDown

      public boolean isCommandDown()
      Returns whether command menu shortcut key is down (command on Mac or control on other platforms).
    • isMenuShortcutKeyPressed

      public boolean isMenuShortcutKeyPressed()
      Returns whether menu shortcut key is pressed.
    • getMenuShortcutKeyMask

      public int getMenuShortcutKeyMask()
      Returns the menu shortcut key mask.
    • getMouseEvent

      public MouseEvent getMouseEvent()
      Returns the mouse event.
    • getClickCount

      public int getClickCount()
      Returns the click count for a mouse event.
    • getLocation

      public Point getLocation()
      Returns the location for a mouse event or drop event.
    • getX

      public int getX()
      Returns the mouse event x.
    • getY

      public int getY()
      Returns the mouse event y.
    • getKeyEvent

      public KeyEvent getKeyEvent()
      Returns the key event.
    • getKeyCode

      public int getKeyCode()
      Returns the event keycode.
    • getKeyChar

      public char getKeyChar()
      Returns the event key char.
    • isLeftArrow

      public boolean isLeftArrow()
      Returns whether key is left arrow.
    • isRightArrow

      public boolean isRightArrow()
      Returns whether key is right arrow.
    • isUpArrow

      public boolean isUpArrow()
      Returns whether key is up arrow.
    • isDownArrow

      public boolean isDownArrow()
      Returns whether key is down arrow.
    • isEnterKey

      public boolean isEnterKey()
      Returns whether key is enter key.
    • isEscapeKey

      public boolean isEscapeKey()
      Returns whether key is escape key.
    • isDragDragEvent

      public boolean isDragDragEvent()
      Returns the drop event.
    • getDragDragEvent

      public DropTargetDragEvent getDragDragEvent()
      Returns the drop event.
    • getDragDropEvent

      public DropTargetDropEvent getDragDropEvent()
      Returns the drop event.
    • getDropString

      public String getDropString()
      Returns the drop string, if drop event.
    • getDropFiles

      public List<File> getDropFiles()
      Returns the drop files, if drop files.
    • getDragGestureEvent

      public DragGestureEvent getDragGestureEvent()
      Returns the drop gesture event.
    • getDragger

      public SwingDragger getDragger()
      Returns a Dragger for this event.
    • getValue

      public Object getValue()
      Override to provide value for DragDrop event.
      Overrides:
      getValue in class UIEvent
    • getSelectionEvent

      public ListSelectionEvent getSelectionEvent()
      Returns the selection event.
    • getTreeSelectionEvent

      public TreeSelectionEvent getTreeSelectionEvent()
      Returns the tree selection event.
    • getValueIsAdjusting

      public boolean getValueIsAdjusting()
      Returns whether event widget or internal event is currently in a continuous state of change.
    • getColorValue

      public Color getColorValue()
      Returns the Color value encapsulated by the event widget.
    • getTimer

      public SwingTimer getTimer()
      Returns the timer.
    • getHelper

      public SwingHelper getHelper()
      Returns the Ribs Helper for event widget.
      Specified by:
      getHelper in class UIEvent
    • consume

      public void consume()
      Consume event.
      Overrides:
      consume in class UIEvent