View Javadoc
1   package com.google.gwt.user.client.impl;
2   
3   import com.google.gwt.user.client.Element;
4   
5   public class DOMImplMozillaWithTransistions extends DOMImplMozilla{
6   
7   	/**
8   	 * <p>Constructor for DOMImplSafariWithTransistion.</p>
9   	 */
10  	public DOMImplMozillaWithTransistions() {
11  
12  	}
13  
14  	
15  	
16  	
17  	
18  	
19  	protected native int eventGetTypeInt0(String eventType)/*-{
20  		switch (eventType) {
21  		//added dom transistionend event
22  		case "transitionend": return 0x8000000;
23  		//added dom transistionend event
24  		case "animationend": return 0x10000000;
25  		default: return -1;
26  		}
27  	}-*/;
28  
29  	/** {@inheritDoc} */
30  	@Override
31  	public int eventGetTypeInt(String eventType) {
32  		int type = super.eventGetTypeInt(eventType);
33  		if (type != -1)
34  			return type;
35  		return eventGetTypeInt0(eventType);
36  
37  	}
38  
39  	/** {@inheritDoc} */
40  	protected void sinkEventsImpl(Element elem, int bits) {
41  		sinkEventsImpl0(elem, bits);
42  	}
43  
44  	protected  native void sinkEventsImpl0(Element elem, int bits) /*-{
45  		var chMask = (elem.__eventBits || 0) ^ bits;
46  	    elem.__eventBits = bits;
47  	    if (!chMask) return;
48  	   
49  	    if (chMask & 0x00001) elem.onclick       = (bits & 0x00001) ?
50  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
51  	    if (chMask & 0x00002) elem.ondblclick    = (bits & 0x00002) ?
52  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
53  	    if (chMask & 0x00004) elem.onmousedown   = (bits & 0x00004) ?
54  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
55  	    if (chMask & 0x00008) elem.onmouseup     = (bits & 0x00008) ?
56  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
57  	    if (chMask & 0x00010) elem.onmouseover   = (bits & 0x00010) ?
58  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
59  	    if (chMask & 0x00020) elem.onmouseout    = (bits & 0x00020) ?
60  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
61  	    if (chMask & 0x00040) elem.onmousemove   = (bits & 0x00040) ?
62  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
63  	    if (chMask & 0x00080) elem.onkeydown     = (bits & 0x00080) ?
64  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
65  	    if (chMask & 0x00100) elem.onkeypress    = (bits & 0x00100) ?
66  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
67  	    if (chMask & 0x00200) elem.onkeyup       = (bits & 0x00200) ?
68  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
69  	    if (chMask & 0x00400) elem.onchange      = (bits & 0x00400) ?
70  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
71  	    if (chMask & 0x00800) elem.onfocus       = (bits & 0x00800) ?
72  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
73  	    if (chMask & 0x01000) elem.onblur        = (bits & 0x01000) ?
74  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
75  	    if (chMask & 0x02000) elem.onlosecapture = (bits & 0x02000) ?
76  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
77  	    if (chMask & 0x04000) elem.onscroll      = (bits & 0x04000) ?
78  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
79  	    if (chMask & 0x08000) elem.onload        = (bits & 0x08000) ?
80  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchUnhandledEvent : null;
81  	    if (chMask & 0x10000) elem.onerror       = (bits & 0x10000) ?
82  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
83  	    if (chMask & 0x20000) elem.onmousewheel  = (bits & 0x20000) ? 
84  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
85  	    if (chMask & 0x40000) elem.oncontextmenu = (bits & 0x40000) ? 
86  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
87  	    if (chMask & 0x80000) elem.onpaste       = (bits & 0x80000) ? 
88  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
89  	    if (chMask & 0x100000) elem.ontouchstart = (bits & 0x100000) ? 
90  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
91  	    if (chMask & 0x200000) elem.ontouchmove  = (bits & 0x200000) ? 
92  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
93  	    if (chMask & 0x400000) elem.ontouchend   = (bits & 0x400000) ? 
94  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
95  	    if (chMask & 0x800000) elem.ontouchcancel= (bits & 0x800000) ? 
96  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
97  	    if (chMask & 0x1000000) elem.ongesturestart  =(bits & 0x1000000) ? 
98  	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
99  	    if (chMask & 0x2000000) elem.ongesturechange =(bits & 0x2000000) ? 
100 	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
101 	    if (chMask & 0x4000000) elem.ongestureend    = (bits & 0x4000000) ? 
102 	        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
103         
104 		//transistion end
105 		if (chMask & 0x8000000) {
106 		if(bits & 0x8000000){
107 		elem.addEventListener('transitionend', @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent, false);
108 		}
109 		}
110 	
111 	
112 		//animation end
113 		if (chMask & 0x10000000) {
114 		if(bits & 0x10000000){
115 		elem.addEventListener('animationend', @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent, false);
116 		}
117 		}
118 	}-*/;
119 		
120 	
121 	
122 }