litesoft
Diff Revisions
151
vs
948
for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/nonpublic/external/DragEvent.java
|
@@ -27,8 +27,7 @@ |
27 |
27 |
|
* example, a slider will process both mouse down and mouse drag (but not mouse |
28 |
28 |
|
* move). |
29 |
29 |
|
*/ |
30 |
|
- |
public class DragEvent extends MouseEvent |
31 |
|
- |
{ |
|
30 |
+ |
public class DragEvent extends MouseEvent { |
32 |
31 |
|
private static final long serialVersionUID = -60876731058183754L; |
33 |
32 |
|
|
34 |
33 |
|
private final int m_deltaX, m_deltaY; |
|
@@ -39,12 +38,10 @@ |
39 |
38 |
|
* @param mouseEvent a <code>mousedown</code>, <code>mousemove</code> or <code>mouseup</code> event |
40 |
39 |
|
* @param previousEvent |
41 |
40 |
|
*/ |
42 |
|
- |
public DragEvent( MouseEvent mouseMove, MouseEvent mouseDown, MouseEvent previousEvent ) |
43 |
|
- |
{ |
|
41 |
+ |
public DragEvent( MouseEvent mouseMove, MouseEvent mouseDown, MouseEvent previousEvent ) { |
44 |
42 |
|
super( mouseMove ); |
45 |
43 |
|
|
46 |
|
- |
if ( previousEvent != null ) |
47 |
|
- |
{ |
|
44 |
+ |
if ( previousEvent != null ) { |
48 |
45 |
|
/* |
49 |
46 |
|
* Calculate the delta relative to the last event, adjusting for a |
50 |
47 |
|
* possibly moving coordinate space |
|
@@ -53,9 +50,7 @@ |
53 |
50 |
|
m_deltaY = mouseMove.getWidgetTop() - previousEvent.getWidgetTop() + mouseMove.getWidgetY() - previousEvent.getWidgetY(); |
54 |
51 |
|
m_cumulativeX = mouseMove.getWidgetX() - mouseDown.getWidgetX(); |
55 |
52 |
|
m_cumulativeY = mouseMove.getWidgetY() - mouseDown.getWidgetY(); |
56 |
|
- |
} |
57 |
|
- |
else |
58 |
|
- |
{ |
|
53 |
+ |
} else { |
59 |
54 |
|
m_deltaX = m_deltaY = 0; |
60 |
55 |
|
m_cumulativeX = m_cumulativeY = 0; |
61 |
56 |
|
} |
|
@@ -66,8 +61,7 @@ |
66 |
61 |
|
* a useful value even if the document is scrolled or the widget has moved |
67 |
62 |
|
* since the last event. |
68 |
63 |
|
*/ |
69 |
|
- |
public int getDeltaX() |
70 |
|
- |
{ |
|
64 |
+ |
public int getDeltaX() { |
71 |
65 |
|
return m_deltaX; |
72 |
66 |
|
} |
73 |
67 |
|
|
|
@@ -76,18 +70,15 @@ |
76 |
70 |
|
* a useful value even if the document is scrolled or the widget has moved |
77 |
71 |
|
* since the last event. |
78 |
72 |
|
*/ |
79 |
|
- |
public int getDeltaY() |
80 |
|
- |
{ |
|
73 |
+ |
public int getDeltaY() { |
81 |
74 |
|
return m_deltaY; |
82 |
75 |
|
} |
83 |
76 |
|
|
84 |
|
- |
public int getCumulativeX() |
85 |
|
- |
{ |
|
77 |
+ |
public int getCumulativeX() { |
86 |
78 |
|
return m_cumulativeX; |
87 |
79 |
|
} |
88 |
80 |
|
|
89 |
|
- |
public int getCumulativeY() |
90 |
|
- |
{ |
|
81 |
+ |
public int getCumulativeY() { |
91 |
82 |
|
return m_cumulativeY; |
92 |
83 |
|
} |
93 |
84 |
|
} |