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..
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SwingEvent.TimerEvent
A timer event.-
Nested classes/interfaces inherited from class com.inductiveautomation.snap.ui.UIEvent
UIEvent.Type
-
-
Constructor Summary
Constructors Constructor Description SwingEvent(java.util.EventObject anEvent, javax.swing.JComponent aComponent)
Creates a new SwingEvent.SwingEvent(java.util.EventObject anEvent, javax.swing.JComponent aComponent, UIEvent.Type aType)
Creates a new RibsEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
consume()
Consume event.java.awt.AWTEvent
getAWTEvent()
Returns the AWT event.int
getClickCount()
Returns the click count for a mouse event.java.awt.Color
getColorValue()
Returns the Color value encapsulated by the event widget.javax.swing.JComponent
getComponent()
Returns the target component, if event target was component shape.java.awt.dnd.DropTargetDragEvent
getDragDragEvent()
Returns the drop event.java.awt.dnd.DropTargetDropEvent
getDragDropEvent()
Returns the drop event.SwingDragger
getDragger()
Returns a Dragger for this event.java.awt.dnd.DragGestureEvent
getDragGestureEvent()
Returns the drop gesture event.java.util.List<java.io.File>
getDropFiles()
Returns the drop files, if drop files.java.lang.String
getDropString()
Returns the drop string, if drop event.java.util.EventObject
getEvent()
Returns the event as an EventObject.int
getEventID()
Returns the event id.SwingHelper
getHelper()
Returns the Ribs Helper for event widget.java.awt.event.InputEvent
getInputEvent()
Returns the input event.char
getKeyChar()
Returns the event key char.int
getKeyCode()
Returns the event keycode.java.awt.event.KeyEvent
getKeyEvent()
Returns the key event.java.awt.Point
getLocation()
Returns the location for a mouse event or drop event.int
getMenuShortcutKeyMask()
Returns the menu shortcut key mask.java.awt.event.MouseEvent
getMouseEvent()
Returns the mouse event.protected java.lang.String
getPropertyChangePropertyName()
Return PropertyChangeEvent property name.javax.swing.event.ListSelectionEvent
getSelectionEvent()
Returns the selection event.RMShape
getShape()
Returns the target as shape, if shape.SwingTimer
getTimer()
Returns the timer.javax.swing.event.TreeSelectionEvent
getTreeSelectionEvent()
Returns the tree selection event.protected UIEvent.Type
getType(java.lang.Object anEvent)
Computes the event type from EventObject.java.lang.Object
getValue()
Override to provide value for DragDrop event.boolean
getValueIsAdjusting()
Returns whether event widget or internal event is currently in a continuous state of change.int
getX()
Returns the mouse event x.int
getY()
Returns the mouse event y.boolean
isAltDown()
Returns whether alt key is down.boolean
isAWTEvent()
Returns whether event is AWT event.boolean
isCommandDown()
Returns whether command menu shortcut key is down (command on Mac or control on other platforms).boolean
isComponent()
Returns whether target is a component.boolean
isControlDown()
Returns whether control key is down.boolean
isDownArrow()
Returns whether key is down arrow.boolean
isDragDragEvent()
Returns the drop event.boolean
isEnterKey()
Returns whether key is enter key.boolean
isEscapeKey()
Returns whether key is escape key.boolean
isInputEvent()
Returns whether event is input event.boolean
isLeftArrow()
Returns whether key is left arrow.boolean
isMenuShortcutKeyPressed()
Returns whether menu shortcut key is pressed.boolean
isMetaDown()
Returns whether "meta" key is down (the command key on Mac with no equivalent on Windows).boolean
isRightArrow()
Returns whether key is right arrow.boolean
isShiftDown()
Returns whether shift key is down.boolean
isUpArrow()
Returns whether key is up arrow.-
Methods inherited from class com.inductiveautomation.snap.ui.UIEvent
equals, getBooleanValue, getBoolValue, getEvent, getFloatValue, getIntValue, getName, getPropertyName, getSelectedIndex, getSelectedItem, getSelectedItem, getStringValue, getTarget, getTarget, getText, getTriggersReset, getType, is, isActionEvent, isDragDropEvent, isDragEnter, isDragEvent, isDragExit, isDragGesture, isDragOver, isDragSourceEnd, isDragSourceEnter, isDragSourceExit, isFocusGained, isFocusLost, isKeyEvent, isKeyFinished, isKeyPressed, isKeyReleased, isKeyTyped, isMouseClicked, isMouseDragged, isMouseEntered, isMouseEvent, isMouseExited, isMouseFinished, isMouseMoved, isMousePressed, isMouseReleased, isPropertyChangeEvent, isSelectionEvent, isTimerEvent, isValueAdjusting, isValueChangeEvent, setEvent, setName, setTarget, setTriggersReset, setType, setValue, toString
-
-
-
-
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.
-
getType
protected UIEvent.Type getType(java.lang.Object anEvent)
Computes the event type from EventObject.
-
getPropertyChangePropertyName
protected java.lang.String getPropertyChangePropertyName()
Return PropertyChangeEvent property name.- Specified by:
getPropertyChangePropertyName
in classUIEvent
-
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.
-
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.
-
getHelper
public SwingHelper getHelper()
Returns the Ribs Helper for event widget.
-
-