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 classSwingEvent.TimerEventA 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 voidconsume()Consume event.java.awt.AWTEventgetAWTEvent()Returns the AWT event.intgetClickCount()Returns the click count for a mouse event.java.awt.ColorgetColorValue()Returns the Color value encapsulated by the event widget.javax.swing.JComponentgetComponent()Returns the target component, if event target was component shape.java.awt.dnd.DropTargetDragEventgetDragDragEvent()Returns the drop event.java.awt.dnd.DropTargetDropEventgetDragDropEvent()Returns the drop event.SwingDraggergetDragger()Returns a Dragger for this event.java.awt.dnd.DragGestureEventgetDragGestureEvent()Returns the drop gesture event.java.util.List<java.io.File>getDropFiles()Returns the drop files, if drop files.java.lang.StringgetDropString()Returns the drop string, if drop event.java.util.EventObjectgetEvent()Returns the event as an EventObject.intgetEventID()Returns the event id.SwingHelpergetHelper()Returns the Ribs Helper for event widget.java.awt.event.InputEventgetInputEvent()Returns the input event.chargetKeyChar()Returns the event key char.intgetKeyCode()Returns the event keycode.java.awt.event.KeyEventgetKeyEvent()Returns the key event.java.awt.PointgetLocation()Returns the location for a mouse event or drop event.intgetMenuShortcutKeyMask()Returns the menu shortcut key mask.java.awt.event.MouseEventgetMouseEvent()Returns the mouse event.protected java.lang.StringgetPropertyChangePropertyName()Return PropertyChangeEvent property name.javax.swing.event.ListSelectionEventgetSelectionEvent()Returns the selection event.RMShapegetShape()Returns the target as shape, if shape.SwingTimergetTimer()Returns the timer.javax.swing.event.TreeSelectionEventgetTreeSelectionEvent()Returns the tree selection event.protected UIEvent.TypegetType(java.lang.Object anEvent)Computes the event type from EventObject.java.lang.ObjectgetValue()Override to provide value for DragDrop event.booleangetValueIsAdjusting()Returns whether event widget or internal event is currently in a continuous state of change.intgetX()Returns the mouse event x.intgetY()Returns the mouse event y.booleanisAltDown()Returns whether alt key is down.booleanisAWTEvent()Returns whether event is AWT event.booleanisCommandDown()Returns whether command menu shortcut key is down (command on Mac or control on other platforms).booleanisComponent()Returns whether target is a component.booleanisControlDown()Returns whether control key is down.booleanisDownArrow()Returns whether key is down arrow.booleanisDragDragEvent()Returns the drop event.booleanisEnterKey()Returns whether key is enter key.booleanisEscapeKey()Returns whether key is escape key.booleanisInputEvent()Returns whether event is input event.booleanisLeftArrow()Returns whether key is left arrow.booleanisMenuShortcutKeyPressed()Returns whether menu shortcut key is pressed.booleanisMetaDown()Returns whether "meta" key is down (the command key on Mac with no equivalent on Windows).booleanisRightArrow()Returns whether key is right arrow.booleanisShiftDown()Returns whether shift key is down.booleanisUpArrow()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:
getPropertyChangePropertyNamein 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.
-
-