summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/event
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2010-06-21 08:23:39 +0000
committerArtur Signell <artur.signell@itmill.com>2010-06-21 08:23:39 +0000
commite9b730ddc0a44529a26520b8e0206ca2586a24d4 (patch)
treeb55452f4f21e590468ab8981e3a9ce0a623a593f /src/com/vaadin/event
parent729bba0313ae90747e2670b7e0afe09114ab87b7 (diff)
downloadvaadin-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.java22
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