Package com.storedobject.vaadin
Class EnhancedClickEvent<C extends com.vaadin.flow.component.Component>
java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<C>
com.vaadin.flow.component.ClickEvent<C>
com.storedobject.vaadin.EnhancedClickEvent<C>
- Type Parameters:
C- Component type.
- All Implemented Interfaces:
Serializable
public class EnhancedClickEvent<C extends com.vaadin.flow.component.Component>
extends com.vaadin.flow.component.ClickEvent<C>
Enhanced version of Vaadin's
ClickEvent class. This class has additionally 2 attributes -
componentX and componentY to provide (X, Y) position of the point on the component being clicked (relative to component's
top-left corner). This event class instance is available when you use Clickable.- Author:
- Syam
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionEnhancedClickEvent(com.vaadin.flow.component.Component source, boolean fromClient, int screenX, int screenY, int clientX, int clientY, int componentX, int componentY, int clickCount, int button, boolean ctrlKey, boolean shiftKey, boolean altKey, boolean metaKey) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintGet the X coordinate of the component.intGet the Y coordinate of the component.Methods inherited from class com.vaadin.flow.component.ClickEvent
getButton, getClickCount, getClientX, getClientY, getScreenX, getScreenY, isAltKey, isCtrlKey, isMetaKey, isShiftKeyMethods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListenerMethods inherited from class java.util.EventObject
toString
-
Constructor Details
-
EnhancedClickEvent
public EnhancedClickEvent(com.vaadin.flow.component.Component source, boolean fromClient, int screenX, int screenY, int clientX, int clientY, int componentX, int componentY, int clickCount, int button, boolean ctrlKey, boolean shiftKey, boolean altKey, boolean metaKey) Constructor.- Parameters:
source- Source of the component.fromClient- Happened from the client side or not.screenX- X coordinate of the screen.screenY- Y coordinate of the screen.clientX- X coordinate of the client.clientY- Y coordinate of the client.componentX- X coordinate of the component.componentY- Y coordinate of the component.clickCount- Number of clicks.button- The button that was clicked.ctrlKey- Whether "Ctrl" key was pressed or not.shiftKey- Whether "Shift" key was pressed or not.altKey- Whether "Alt" key was pressed or not.metaKey- Whether "Meta" key was pressed or not.
-
-
Method Details
-
getComponentX
public int getComponentX()Get the X coordinate of the component.- Returns:
- X coordinate.
-
getComponentY
public int getComponentY()Get the Y coordinate of the component.- Returns:
- Y coordinate.
-