Package snap.view
Class ViewEvent
java.lang.Object
snap.view.ViewEvent
- All Implemented Interfaces:
Cloneable
Represents node UI events sent to a Views for input events.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called to indicate that drop is accepted.clone()
Copy event.void
consume()
Consume event.copyForClickCount
(int aClickCount) Returns a ViewEvent at new click count.copyForPoint
(double aX, double aY) Returns a ViewEvent at new point.copyForView
(View aView) Returns a ViewEvent at new point.copyForViewPoint
(View aView, double aX, double aY, int aClickCount) Returns a ViewEvent at new point.static ViewEvent
createEvent
(View aView, Object anEvent, ViewEvent.Type aType, String aName) Creates an Event.void
Called to indicate that drop is complete.boolean
Returns whether widget is equal to given object.boolean
Returns whether widget is equal to given name.Returns the Boolean value encapsulated by the event widget.boolean
Returns the Boolean value encapsulated by the event widget.int
Returns the click count for a mouse event.Returns the Drag Clipboard for this event, if appropriate.getEvent()
Returns the platform specific event, if available.<T> T
Returns the platform specific event as given class.Returns the Float value encapsulated by the event widget.Returns the Integer value encapsulated by the event widget.char
Returns the event key char.int
Returns the event keycode.Returns the key combo.Returns the event key char.getName()
Returns the name of the event (or the name of the Event Target).Sets the event that precipitated this event (optional).getPoint()
Returns the event location.Returns the event location in coords of given view.protected Point
Returns the event location.Sets the event that precipitated this event (optional).double
Returns the scroll amount X.double
Returns the scroll amount Y.int
Returns the selected index for encapsulated widget.Returns the selected item for encapsulated widget.Returns the shared action, if set.Returns the String value encapsulated by the event widget.getText()
Returns text for encapsulated widget.getType()
Returns the event type.protected abstract ViewEvent.Type
Returns the event type.getValue()
Returns the value encapsulated by the event widget.getView()
Returns the node associated with this event.<T> T
Returns the event node as given class.long
getWhen()
Returns the time the event was sent.double
getX()
Returns the mouse event x.double
getY()
Returns the mouse event y.boolean
Returns whether event represents component with given name.boolean
Returns whether event is action event.boolean
Returns whether alt key is down.boolean
Returns whether key is delete key.boolean
Returns whether event is mouse event in mouse click range (within half second of downboolean
Returns whether event was consumed.boolean
Returns whether key is ISO control character.boolean
Returns whether control key is down.boolean
Returns whether key is delete key.boolean
Returns whether key is down arrow.boolean
Returns whether event is drop event.boolean
Returns whether event is drop event.boolean
Returns whether event is drag enter.boolean
Returns whether event is any drag event.boolean
Returns whether event is drag exit.boolean
Returns whether event is DragGesture event.boolean
Returns whether event is drag over.boolean
Returns whether event is DragSourceEnd event.boolean
Returns whether event is DragSourceEnter event.boolean
Returns whether event is drag source event.boolean
Returns whether event is DragSourceExit event.boolean
Returns whether key is enter key.boolean
Returns whether key is escape key.boolean
isEventWithinTimeAndDist
(int timeMillis, double aDist) Returns whether event is mouse clicked.boolean
Returns whether event is key event.boolean
Returns whether event is key pressed.boolean
Returns whether event is key released.boolean
Returns whether event is key typed.boolean
Returns whether key is left arrow.boolean
Returns whether "meta" key is down (the command key on Mac with no equivalent on Windows).boolean
Returns whether event is mouse clicked.boolean
Returns whether event is mouse dragged.boolean
Returns whether event is mouse entered.boolean
Returns whether event is mouse event.boolean
Returns whether event is mouse exited.boolean
Returns whether event is mouse moved.boolean
Returns whether event is mouse pressed.boolean
Returns whether event is mouse released.boolean
Returns whether popup trigger is down.boolean
Returns whether key is right arrow.boolean
isScroll()
Returns whether event is scroll.boolean
Returns whether shift key is down.boolean
Returns whether shortcut key is pressed.boolean
Returns whether key is escape key.boolean
isTabKey()
Returns whether key is tab key.boolean
Returns whether key is up arrow.boolean
Returns whether event is WinClosing.boolean
Returns whether event is WinOpened.void
setClickCount
(int aValue) Sets the click count for a mouse event.void
Sets the platform specific event, if available.void
Returns the name of the event (or the name of the Event Target).protected void
setParentEvent
(ViewEvent anEvent) Sets the event that precipitated this event (optional).protected void
setSharedAction
(SharedAction sharedAction) Sets the shared action, if set.void
setType
(ViewEvent.Type aType) Sets the event type.void
Sets the value encapsulated by the event widget.void
Returns the node associated with this event.protected void
setXY
(double aX, double aY) Sets the x/y.toString()
Standard toString implementation.
-
Field Details
-
_type
-
-
Constructor Details
-
ViewEvent
public ViewEvent()
-
-
Method Details
-
getView
Returns the node associated with this event. -
getView
Returns the event node as given class. -
setView
Returns the node associated with this event. -
getEvent
Returns the platform specific event, if available. -
setEvent
Sets the platform specific event, if available. -
getEvent
Returns the platform specific event as given class. -
getName
Returns the name of the event (or the name of the Event Target). -
setName
Returns the name of the event (or the name of the Event Target). -
getType
Returns the event type. -
getTypeImpl
Returns the event type. -
setType
Sets the event type. -
getParentEvent
Sets the event that precipitated this event (optional). -
setParentEvent
Sets the event that precipitated this event (optional). -
getRootEvent
Sets the event that precipitated this event (optional). -
getWhen
public long getWhen()Returns the time the event was sent. -
isActionEvent
public boolean isActionEvent()Returns whether event is action event. -
isMouseEvent
public boolean isMouseEvent()Returns whether event is mouse event. -
isMousePress
public boolean isMousePress()Returns whether event is mouse pressed. -
isMouseDrag
public boolean isMouseDrag()Returns whether event is mouse dragged. -
isMouseRelease
public boolean isMouseRelease()Returns whether event is mouse released. -
isMouseClick
public boolean isMouseClick()Returns whether event is mouse clicked. -
isEventWithinTimeAndDist
public boolean isEventWithinTimeAndDist(int timeMillis, double aDist) Returns whether event is mouse clicked. -
isClickCandidate
public boolean isClickCandidate()Returns whether event is mouse event in mouse click range (within half second of down -
isMouseEnter
public boolean isMouseEnter()Returns whether event is mouse entered. -
isMouseMove
public boolean isMouseMove()Returns whether event is mouse moved. -
isMouseExit
public boolean isMouseExit()Returns whether event is mouse exited. -
isKeyEvent
public boolean isKeyEvent()Returns whether event is key event. -
isKeyPress
public boolean isKeyPress()Returns whether event is key pressed. -
isKeyRelease
public boolean isKeyRelease()Returns whether event is key released. -
isKeyType
public boolean isKeyType()Returns whether event is key typed. -
isScroll
public boolean isScroll()Returns whether event is scroll. -
isDragEvent
public boolean isDragEvent()Returns whether event is any drag event. -
isDragEnter
public boolean isDragEnter()Returns whether event is drag enter. -
isDragOver
public boolean isDragOver()Returns whether event is drag over. -
isDragExit
public boolean isDragExit()Returns whether event is drag exit. -
isDragDrop
public boolean isDragDrop()Returns whether event is drop event. -
isDragDropEvent
public boolean isDragDropEvent()Returns whether event is drop event. -
isDragSourceEvent
public boolean isDragSourceEvent()Returns whether event is drag source event. -
isDragGesture
public boolean isDragGesture()Returns whether event is DragGesture event. -
isDragSourceEnter
public boolean isDragSourceEnter()Returns whether event is DragSourceEnter event. -
isDragSourceExit
public boolean isDragSourceExit()Returns whether event is DragSourceExit event. -
isDragSourceEnd
public boolean isDragSourceEnd()Returns whether event is DragSourceEnd event. -
isWinOpen
public boolean isWinOpen()Returns whether event is WinOpened. -
isWinClose
public boolean isWinClose()Returns whether event is WinClosing. -
getValue
Returns the value encapsulated by the event widget. -
setValue
Sets the value encapsulated by the event widget. -
getStringValue
Returns the String value encapsulated by the event widget. -
getBoolValue
public boolean getBoolValue()Returns the Boolean value encapsulated by the event widget. -
getBooleanValue
Returns the Boolean value encapsulated by the event widget. -
getIntValue
Returns the Integer value encapsulated by the event widget. -
getFloatValue
Returns the Float value encapsulated by the event widget. -
getText
Returns text for encapsulated widget. -
getSelIndex
public int getSelIndex()Returns the selected index for encapsulated widget. -
getSelItem
Returns the selected item for encapsulated widget. -
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). -
isShortcutDown
public boolean isShortcutDown()Returns whether shortcut key is pressed. -
getKeyCombo
Returns the key combo. -
isPopupTrigger
public boolean isPopupTrigger()Returns whether popup trigger is down. -
getClickCount
public int getClickCount()Returns the click count for a mouse event. -
setClickCount
public void setClickCount(int aValue) Sets the click count for a mouse event. -
getX
public double getX()Returns the mouse event x. -
getY
public double getY()Returns the mouse event y. -
setXY
protected void setXY(double aX, double aY) Sets the x/y. -
getPoint
Returns the event location. -
getPointImpl
Returns the event location. -
getPoint
Returns the event location in coords of given view. -
getScrollX
public double getScrollX()Returns the scroll amount X. -
getScrollY
public double getScrollY()Returns the scroll amount Y. -
getKeyCode
public int getKeyCode()Returns the event keycode. -
getKeyChar
public char getKeyChar()Returns the event key char. -
getKeyString
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. -
isBackSpaceKey
public boolean isBackSpaceKey()Returns whether key is delete key. -
isDeleteKey
public boolean isDeleteKey()Returns whether key is delete key. -
isEnterKey
public boolean isEnterKey()Returns whether key is enter key. -
isTabKey
public boolean isTabKey()Returns whether key is tab key. -
isEscapeKey
public boolean isEscapeKey()Returns whether key is escape key. -
isSpaceKey
public boolean isSpaceKey()Returns whether key is escape key. -
isControlChar
public boolean isControlChar()Returns whether key is ISO control character. -
getClipboard
Returns the Drag Clipboard for this event, if appropriate. -
acceptDrag
public void acceptDrag()Called to indicate that drop is accepted. -
dropComplete
public void dropComplete()Called to indicate that drop is complete. -
isConsumed
public boolean isConsumed()Returns whether event was consumed. -
consume
public void consume()Consume event. -
copyForView
Returns a ViewEvent at new point. -
copyForPoint
Returns a ViewEvent at new point. -
copyForClickCount
Returns a ViewEvent at new click count. -
copyForViewPoint
Returns a ViewEvent at new point. -
clone
Copy event. -
is
Returns whether event represents component with given name. -
equals
Returns whether widget is equal to given name. -
equals
Returns whether widget is equal to given object. -
toString
Standard toString implementation. -
createEvent
Creates an Event.
-