Class SwingEvent


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

      • SwingEvent

        public SwingEvent​(java.util.EventObject anEvent,
                          javax.swing.JComponent aComponent)
        Creates a new SwingEvent.
      • SwingEvent

        public SwingEvent​(java.util.EventObject anEvent,
                          javax.swing.JComponent aComponent,
                          UIEvent.Type aType)
        Creates a new RibsEvent.
    • Method Detail

      • getShape

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

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

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

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

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

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

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

        public java.awt.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 java.awt.event.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 java.awt.event.MouseEvent getMouseEvent()
        Returns the mouse event.
      • getClickCount

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

        public java.awt.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 java.awt.event.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 java.awt.dnd.DropTargetDragEvent getDragDragEvent()
        Returns the drop event.
      • getDragDropEvent

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

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

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

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

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

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

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

        public javax.swing.event.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 java.awt.Color getColorValue()
        Returns the Color value encapsulated by the event widget.
      • getTimer

        public SwingTimer getTimer()
        Returns the timer.
      • consume

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