1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.googlecode.mgwt.dom.client.recognizer.swipe;
17
18 import com.google.gwt.event.shared.GwtEvent;
19 import com.googlecode.mgwt.dom.client.event.touch.Touch;
20
21
22
23
24
25
26
27
28 public class SwipeMoveEvent extends SwipeEvent<SwipeMoveHandler> {
29
30 private final static GwtEvent.Type<SwipeMoveHandler> TYPE = new Type<SwipeMoveHandler>();
31 private final boolean distanceReached;
32 private final int distance;
33 private final Touch touch;
34
35 public static GwtEvent.Type<SwipeMoveHandler> getType() {
36 return TYPE;
37 }
38
39
40
41
42
43
44
45
46
47
48 public SwipeMoveEvent(Touch touch, boolean distanceReached, int distance, SwipeEvent.DIRECTION direction) {
49 super(direction);
50 this.touch = touch;
51 this.distanceReached = distanceReached;
52 this.distance = distance;
53 }
54
55
56
57
58
59 @Override
60 public com.google.gwt.event.shared.GwtEvent.Type<SwipeMoveHandler> getAssociatedType() {
61 return TYPE;
62 }
63
64
65
66
67
68 @Override
69 protected void dispatch(SwipeMoveHandler handler) {
70 handler.onSwipeMove(this);
71
72 }
73
74
75
76
77
78
79 public int getDistance() {
80 return distance;
81 }
82
83
84
85
86
87
88 public boolean isDistanceReached() {
89 return distanceReached;
90 }
91
92 public Touch getTouch() {
93 return touch;
94 }
95
96 }