Package com.inductiveautomation.snap.ui
Class UIEvent
- java.lang.Object
-
- com.inductiveautomation.snap.ui.UIEvent
-
- Direct Known Subclasses:
SwingEvent
public abstract class UIEvent extends java.lang.Object
Represents a UI event sent to a UIOwner.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UIEvent.Type
Types for events.
-
Constructor Summary
Constructors Constructor Description UIEvent()
Creates a new UIEvent.UIEvent(java.lang.Object anEvent, java.lang.Object aTarget, UIEvent.Type aType)
Creates a new UIEvent with given event, event target and property name.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
consume()
Consumes the event.boolean
equals(java.lang.String aName)
Returns whether widget is equal to given name.java.lang.Boolean
getBooleanValue()
Returns the Boolean value encapsulated by the event widget.boolean
getBoolValue()
Returns the Boolean value encapsulated by the event widget.java.lang.Object
getEvent()
Returns the platform specific event, if available.<T> T
getEvent(java.lang.Class<T> aClass)
Returns the platform specific event as given class.java.lang.Float
getFloatValue()
Returns the Float value encapsulated by the event widget.abstract UIHelper
getHelper()
Returns the UI Helper for event target.java.lang.Integer
getIntValue()
Returns the Integer value encapsulated by the event widget.java.lang.String
getName()
Returns the name of the event (or the name of the Event Target).protected abstract java.lang.String
getPropertyChangePropertyName()
Returns whether event is property change.java.lang.String
getPropertyName()
Returns the property name.int
getSelectedIndex()
Returns the selected index for encapsulated widget.java.lang.Object
getSelectedItem()
Returns the selected item for encapsulated widget.<T> T
getSelectedItem(java.lang.Class<T> aClass)
Returns the selected item for encapsulated widget.java.lang.String
getStringValue()
Returns the String value encapsulated by the event widget.java.lang.Object
getTarget()
Returns the event target.<T> T
getTarget(java.lang.Class<T> aClass)
Returns the target of the event as given class.java.lang.String
getText()
Returns text for encapsulated widget.boolean
getTriggersReset()
Returns whether this event triggers a UI reset.UIEvent.Type
getType()
Returns the event type.protected abstract UIEvent.Type
getType(java.lang.Object anEvent)
Returns the UIEventType from given Event object.java.lang.Object
getValue()
Returns the value encapsulated by the event widget.boolean
is(java.lang.String aName)
Returns whether event represents component with given name.boolean
isActionEvent()
Returns whether event is action event.boolean
isDragDropEvent()
Returns whether event is drop event.boolean
isDragEnter()
Returns whether event is drag enter.boolean
isDragEvent()
Returns whether event is any drag event.boolean
isDragExit()
Returns whether event is drag exit.boolean
isDragGesture()
Returns whether event is DragGesture event.boolean
isDragOver()
Returns whether event is drag over.boolean
isDragSourceEnd()
Returns whether event is DragSourceEnd event.boolean
isDragSourceEnter()
Returns whether event is DragSourceEnter event.boolean
isDragSourceExit()
Returns whether event is DragSourceExit event.boolean
isFocusGained()
Returns whether event is FocusGained.boolean
isFocusLost()
Returns whether event is FocusLost.boolean
isKeyEvent()
Returns whether event is key event.boolean
isKeyFinished()
Returns whether event is key finished.boolean
isKeyPressed()
Returns whether event is key pressed.boolean
isKeyReleased()
Returns whether event is key released.boolean
isKeyTyped()
Returns whether event is key typed.boolean
isMouseClicked()
Returns whether event is mouse clicked.boolean
isMouseDragged()
Returns whether event is mouse dragged.boolean
isMouseEntered()
Returns whether event is mouse entered.boolean
isMouseEvent()
Returns whether event is mouse event.boolean
isMouseExited()
Returns whether event is mouse exited.boolean
isMouseFinished()
Returns whether event is mouse finished.boolean
isMouseMoved()
Returns whether event is mouse moved.boolean
isMousePressed()
Returns whether event is mouse pressed.boolean
isMouseReleased()
Returns whether event is mouse released.boolean
isPropertyChangeEvent()
Returns whether event is property change.boolean
isSelectionEvent()
Returns whether event is selection event.boolean
isTimerEvent()
Returns whether event is timer event.boolean
isValueAdjusting()
Returns whether event widget or internal event is currently in a continuous state of change.boolean
isValueChangeEvent()
Returns whether event is value change event.protected void
setEvent(java.lang.Object anEvent)
Sets the platform specific event, if available.void
setName(java.lang.String aName)
Returns the name of the event (or the name of the Event Target).protected void
setTarget(java.lang.Object aTarget)
Sets the event target.void
setTriggersReset(boolean aValue)
Sets whether this event triggers a UI reset.void
setType(UIEvent.Type aType)
Sets the event type.void
setValue(java.lang.Object aValue)
Sets the value encapsulated by the event widget.java.lang.String
toString()
Standard toString implementation.
-
-
-
Constructor Detail
-
UIEvent
public UIEvent()
Creates a new UIEvent.
-
UIEvent
public UIEvent(java.lang.Object anEvent, java.lang.Object aTarget, UIEvent.Type aType)
Creates a new UIEvent with given event, event target and property name.
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the event (or the name of the Event Target).
-
setName
public void setName(java.lang.String aName)
Returns the name of the event (or the name of the Event Target).
-
getEvent
public java.lang.Object getEvent()
Returns the platform specific event, if available.
-
setEvent
protected void setEvent(java.lang.Object anEvent)
Sets the platform specific event, if available.
-
getEvent
public <T> T getEvent(java.lang.Class<T> aClass)
Returns the platform specific event as given class.
-
getType
public UIEvent.Type getType()
Returns the event type.
-
setType
public void setType(UIEvent.Type aType)
Sets the event type.
-
getType
protected abstract UIEvent.Type getType(java.lang.Object anEvent)
Returns the UIEventType from given Event object.
-
getTarget
public java.lang.Object getTarget()
Returns the event target.
-
setTarget
protected void setTarget(java.lang.Object aTarget)
Sets the event target.
-
getTarget
public <T> T getTarget(java.lang.Class<T> aClass)
Returns the target of the event as given class.
-
isValueChangeEvent
public boolean isValueChangeEvent()
Returns whether event is value change event.
-
isPropertyChangeEvent
public boolean isPropertyChangeEvent()
Returns whether event is property change.
-
getPropertyChangePropertyName
protected abstract java.lang.String getPropertyChangePropertyName()
Returns whether event is property change.
-
getPropertyName
public java.lang.String getPropertyName()
Returns the property name.
-
isActionEvent
public boolean isActionEvent()
Returns whether event is action event.
-
isSelectionEvent
public boolean isSelectionEvent()
Returns whether event is selection event.
-
isTimerEvent
public boolean isTimerEvent()
Returns whether event is timer event.
-
isMouseEvent
public boolean isMouseEvent()
Returns whether event is mouse event.
-
isMousePressed
public boolean isMousePressed()
Returns whether event is mouse pressed.
-
isMouseDragged
public boolean isMouseDragged()
Returns whether event is mouse dragged.
-
isMouseReleased
public boolean isMouseReleased()
Returns whether event is mouse released.
-
isMouseClicked
public boolean isMouseClicked()
Returns whether event is mouse clicked.
-
isMouseFinished
public boolean isMouseFinished()
Returns whether event is mouse finished.
-
isMouseEntered
public boolean isMouseEntered()
Returns whether event is mouse entered.
-
isMouseMoved
public boolean isMouseMoved()
Returns whether event is mouse moved.
-
isMouseExited
public boolean isMouseExited()
Returns whether event is mouse exited.
-
isKeyEvent
public boolean isKeyEvent()
Returns whether event is key event.
-
isKeyPressed
public boolean isKeyPressed()
Returns whether event is key pressed.
-
isKeyReleased
public boolean isKeyReleased()
Returns whether event is key released.
-
isKeyTyped
public boolean isKeyTyped()
Returns whether event is key typed.
-
isKeyFinished
public boolean isKeyFinished()
Returns whether event is key finished.
-
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.
-
isDragDropEvent
public boolean isDragDropEvent()
Returns whether event is drop 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.
-
isFocusGained
public boolean isFocusGained()
Returns whether event is FocusGained.
-
isFocusLost
public boolean isFocusLost()
Returns whether event is FocusLost.
-
is
public boolean is(java.lang.String aName)
Returns whether event represents component with given name.
-
equals
public boolean equals(java.lang.String aName)
Returns whether widget is equal to given name.
-
getValue
public java.lang.Object getValue()
Returns the value encapsulated by the event widget.
-
setValue
public void setValue(java.lang.Object aValue)
Sets the value encapsulated by the event widget.
-
getStringValue
public java.lang.String getStringValue()
Returns the String value encapsulated by the event widget.
-
getBoolValue
public boolean getBoolValue()
Returns the Boolean value encapsulated by the event widget.
-
getBooleanValue
public java.lang.Boolean getBooleanValue()
Returns the Boolean value encapsulated by the event widget.
-
getIntValue
public java.lang.Integer getIntValue()
Returns the Integer value encapsulated by the event widget.
-
getFloatValue
public java.lang.Float getFloatValue()
Returns the Float value encapsulated by the event widget.
-
getText
public java.lang.String getText()
Returns text for encapsulated widget.
-
getSelectedIndex
public int getSelectedIndex()
Returns the selected index for encapsulated widget.
-
getSelectedItem
public java.lang.Object getSelectedItem()
Returns the selected item for encapsulated widget.
-
getSelectedItem
public <T> T getSelectedItem(java.lang.Class<T> aClass)
Returns the selected item for encapsulated widget.
-
getHelper
public abstract UIHelper getHelper()
Returns the UI Helper for event target.
-
isValueAdjusting
public boolean isValueAdjusting()
Returns whether event widget or internal event is currently in a continuous state of change.
-
getTriggersReset
public boolean getTriggersReset()
Returns whether this event triggers a UI reset.
-
setTriggersReset
public void setTriggersReset(boolean aValue)
Sets whether this event triggers a UI reset.
-
consume
public void consume()
Consumes the event.
-
toString
public java.lang.String toString()
Standard toString implementation.- Overrides:
toString
in classjava.lang.Object
-
-