diff options
author | Artur Signell <artur.signell@itmill.com> | 2010-06-21 08:23:39 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2010-06-21 08:23:39 +0000 |
commit | e9b730ddc0a44529a26520b8e0206ca2586a24d4 (patch) | |
tree | b55452f4f21e590468ab8981e3a9ce0a623a593f /src/com/vaadin/event | |
parent | 729bba0313ae90747e2670b7e0afe09114ab87b7 (diff) | |
download | vaadin-framework-e9b730ddc0a44529a26520b8e0206ca2586a24d4.tar.gz vaadin-framework-e9b730ddc0a44529a26520b8e0206ca2586a24d4.zip |
Merged and slightly modified fix for #4652 - MouseEventDetails and ClickEvent should provide coordinates relative to component
svn changeset:13800/svn branch:6.4
Diffstat (limited to 'src/com/vaadin/event')
-rw-r--r-- | src/com/vaadin/event/MouseEvents.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/com/vaadin/event/MouseEvents.java b/src/com/vaadin/event/MouseEvents.java index a7daf70714..547a56a9ea 100644 --- a/src/com/vaadin/event/MouseEvents.java +++ b/src/com/vaadin/event/MouseEvents.java @@ -80,6 +80,28 @@ public interface MouseEvents { } /** + * Returns the relative mouse position (x coordinate) when the click + * took place. The position is relative to the clicked component. + * + * @return The mouse cursor x position relative to the clicked layout + * component or -1 if no x coordinate available + */ + public int getRelativeX() { + return details.getRelativeX(); + } + + /** + * Returns the relative mouse position (y coordinate) when the click + * took place. The position is relative to the clicked component. + * + * @return The mouse cursor y position relative to the clicked layout + * component or -1 if no y coordinate available + */ + public int getRelativeY() { + return details.getRelativeY(); + } + + /** * Checks if the event is a double click event. * * @return true if the event is a double click event, false otherwise |