Package snap.swing
Class SwingEvent
java.lang.Object
snap.view.ViewEvent
snap.swing.SwingEvent
- All Implemented Interfaces:
Cloneable
An ViewEvent implementation for Swing.
-
Nested Class Summary
Nested classes/interfaces inherited from class snap.view.ViewEvent
ViewEvent.Type
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called to indicate that drop is accepted.void
consume()
Consume event.void
Called to indicate that drop is complete.Returns the drag Clipboard for this event.char
Returns the event key char.int
Returns the event keycode.protected Point
Returns the location for a mouse event or drop event.double
Returns the scroll amount X.double
Returns the scroll amount X.protected ViewEvent.Type
Computes the event type from EventObject.boolean
Returns whether alt key is down.boolean
Returns whether control key is down.boolean
Returns whether "meta" key is down (the command key on Mac with no equivalent on Windows).boolean
Returns whether popup trigger is down.boolean
Returns whether shift key is down.boolean
Returns whether shortcut key is pressed.Methods inherited from class snap.view.ViewEvent
clone, copyForClickCount, copyForPoint, copyForView, copyForViewPoint, createEvent, equals, equals, getBooleanValue, getBoolValue, getClickCount, getEvent, getEvent, getFloatValue, getIntValue, getKeyCombo, getKeyString, getName, getParentEvent, getPoint, getPoint, getRootEvent, getSelIndex, getSelItem, getStringValue, getText, getType, getValue, getView, getView, getWhen, getX, getY, is, isActionEvent, isBackSpaceKey, isClickCandidate, isConsumed, isControlChar, isDeleteKey, isDownArrow, isDragDrop, isDragDropEvent, isDragEnter, isDragEvent, isDragExit, isDragGesture, isDragOver, isDragSourceEnd, isDragSourceEnter, isDragSourceEvent, isDragSourceExit, isEnterKey, isEscapeKey, isEventWithinTimeAndDist, isKeyEvent, isKeyPress, isKeyRelease, isKeyType, isLeftArrow, isMouseClick, isMouseDrag, isMouseEnter, isMouseEvent, isMouseExit, isMouseMove, isMousePress, isMouseRelease, isRightArrow, isScroll, isSpaceKey, isTabKey, isUpArrow, isWinClose, isWinOpen, setClickCount, setEvent, setName, setParentEvent, setType, setValue, setView, setXY, toString
-
Constructor Details
-
SwingEvent
public SwingEvent()
-
-
Method Details
-
isAltDown
public boolean isAltDown()Returns whether alt key is down. -
isControlDown
public boolean isControlDown()Returns whether control key is down.- Overrides:
isControlDown
in classViewEvent
-
isMetaDown
public boolean isMetaDown()Returns whether "meta" key is down (the command key on Mac with no equivalent on Windows).- Overrides:
isMetaDown
in classViewEvent
-
isShiftDown
public boolean isShiftDown()Returns whether shift key is down.- Overrides:
isShiftDown
in classViewEvent
-
isShortcutDown
public boolean isShortcutDown()Returns whether shortcut key is pressed.- Overrides:
isShortcutDown
in classViewEvent
-
isPopupTrigger
public boolean isPopupTrigger()Returns whether popup trigger is down.- Overrides:
isPopupTrigger
in classViewEvent
-
getPointImpl
Returns the location for a mouse event or drop event.- Overrides:
getPointImpl
in classViewEvent
-
getScrollY
public double getScrollY()Returns the scroll amount X.- Overrides:
getScrollY
in classViewEvent
-
getScrollX
public double getScrollX()Returns the scroll amount X.- Overrides:
getScrollX
in classViewEvent
-
getKeyCode
public int getKeyCode()Returns the event keycode.- Overrides:
getKeyCode
in classViewEvent
-
getKeyChar
public char getKeyChar()Returns the event key char.- Overrides:
getKeyChar
in classViewEvent
-
acceptDrag
public void acceptDrag()Called to indicate that drop is accepted.- Overrides:
acceptDrag
in classViewEvent
-
dropComplete
public void dropComplete()Called to indicate that drop is complete.- Overrides:
dropComplete
in classViewEvent
-
getClipboard
Returns the drag Clipboard for this event.- Overrides:
getClipboard
in classViewEvent
-
consume
public void consume()Consume event. -
getTypeImpl
Computes the event type from EventObject.- Specified by:
getTypeImpl
in classViewEvent
-