1
2
3
4
5
6
7
8
9
10
11
12
13
14 package com.googlecode.mgwt.dom.client.event.mouse;
15
16 import com.google.gwt.event.dom.client.MouseUpEvent;
17 import com.google.gwt.event.dom.client.MouseUpHandler;
18 import com.googlecode.mgwt.dom.client.event.touch.TouchEndHandler;
19
20
21
22
23
24
25
26 public class TouchEndToMouseUpHandler implements MouseUpHandler {
27 private final TouchEndHandler handler;
28
29
30
31
32
33
34
35
36 public TouchEndToMouseUpHandler(TouchEndHandler handler) {
37 this.handler = handler;
38 }
39
40
41 @Override
42 public void onMouseUp(MouseUpEvent event) {
43 if (event.isAltKeyDown() || MultiTouchMouseEmulator.isHasValues()) {
44 MultiTouchMouseEmulator.reset();
45
46 SimulatedTouchEndEvent simulatedTouchEndEvent = new SimulatedTouchEndEvent(event, true);
47 handler.onTouchEnd(simulatedTouchEndEvent);
48 }
49
50 SimulatedTouchEndEvent simulatedTouchEndEvent = new SimulatedTouchEndEvent(event, false);
51 handler.onTouchEnd(simulatedTouchEndEvent);
52
53 }
54 }