C
- The source component type@DomEvent(value="click") public class ClickEvent<C extends Component> extends ComponentEvent<C>
source
Constructor and Description |
---|
ClickEvent(Component source)
Creates a new server-side click event with no additional information.
|
ClickEvent(Component source,
boolean fromClient,
int screenX,
int screenY,
int clientX,
int clientY,
int clickCount,
int button,
boolean ctrlKey,
boolean shiftKey,
boolean altKey,
boolean metaKey)
Creates a new click event.
|
Modifier and Type | Method and Description |
---|---|
int |
getButton()
Gets the id of the pressed mouse button.
|
int |
getClickCount()
Gets the number of consecutive clicks recently recorded.
|
int |
getClientX()
Gets the x coordinate of the click event, relative to the upper left
corner of the browser viewport.
|
int |
getClientY()
Gets the y coordinate of the click event, relative to the upper left
corner of the browser viewport.
|
int |
getScreenX()
Gets the x coordinate of the click event, relative to the upper left
corner of the screen.
|
int |
getScreenY()
Gets the y coordinate of the click event, relative to the upper left
corner of the screen.
|
boolean |
isAltKey()
Checks whether the alt key was was down when the event was fired.
|
boolean |
isCtrlKey()
Checks whether the ctrl key was was down when the event was fired.
|
boolean |
isMetaKey()
Checks whether the meta key was was down when the event was fired.
|
boolean |
isShiftKey()
Checks whether the shift key was was down when the event was fired.
|
getSource, isFromClient, unregisterListener
toString
public ClickEvent(Component source, boolean fromClient, @EventData(value="event.screenX") int screenX, @EventData(value="event.screenY") int screenY, @EventData(value="event.clientX") int clientX, @EventData(value="event.clientY") int clientY, @EventData(value="event.detail") int clickCount, @EventData(value="event.button") int button, @EventData(value="event.ctrlKey") boolean ctrlKey, @EventData(value="event.shiftKey") boolean shiftKey, @EventData(value="event.altKey") boolean altKey, @EventData(value="event.metaKey") boolean metaKey)
source
- the component that fired the eventfromClient
- true
if the event was originally fired on the
client, false
if the event originates from
server-side logicscreenX
- the x coordinate of the click event, relative to the upper
left corner of the screen, -1 if unknownscreenY
- the y coordinate of the click event, relative to the upper
left corner of the screen, -i if unknownclientX
- the x coordinate of the click event, relative to the upper
left corner of the browser viewport, -1 if unknownclientY
- the y coordinate of the click event, relative to the upper
left corner of the browser viewport, -1 if unknownclickCount
- the number of consecutive clicks recently recordedbutton
- the id of the pressed mouse buttonctrlKey
- true
if the control key was down when the event
was fired, false
otherwiseshiftKey
- true
if the shift key was down when the event was
fired, false
otherwisealtKey
- true
if the alt key was down when the event was
fired, false
otherwisemetaKey
- true
if the meta key was down when the event was
fired, false
otherwisepublic ClickEvent(Component source)
source
- the component that fired the eventpublic int getClientX()
public int getClientY()
public int getScreenX()
public int getScreenY()
public int getClickCount()
public int getButton()
public boolean isCtrlKey()
true
if the ctrl key was down when the event was
fired, false
otherwisepublic boolean isAltKey()
true
if the alt key was down when the event was
fired, false
otherwisepublic boolean isMetaKey()
true
if the meta key was down when the event was
fired, false
otherwisepublic boolean isShiftKey()
true
if the shift key was down when the event was
fired, false
otherwiseCopyright © 2022. All rights reserved.