|
@@ -1,71 +1,76 @@ |
1 |
1 |
|
/* |
2 |
2 |
|
* Copyright 2010 Daniel Kurka |
3 |
3 |
|
* |
4 |
|
- |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
5 |
|
- |
* use this file except in compliance with the License. You may obtain a copy of |
6 |
|
- |
* the License at |
|
4 |
+ |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
|
5 |
+ |
* in compliance with the License. You may obtain a copy of the License at |
7 |
6 |
|
* |
8 |
7 |
|
* http://www.apache.org/licenses/LICENSE-2.0 |
9 |
8 |
|
* |
10 |
|
- |
* Unless required by applicable law or agreed to in writing, software |
11 |
|
- |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
12 |
|
- |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
13 |
|
- |
* License for the specific language governing permissions and limitations under |
|
9 |
+ |
* Unless required by applicable law or agreed to in writing, software distributed under the License |
|
10 |
+ |
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
|
11 |
+ |
* or implied. See the License for the specific language governing permissions and limitations under |
14 |
12 |
|
* the License. |
15 |
13 |
|
*/ |
16 |
14 |
|
package com.googlecode.mgwt.dom.client.event.animation; |
17 |
15 |
|
|
18 |
|
- |
import com.google.gwt.core.client.GWT; |
19 |
16 |
|
import com.google.gwt.event.dom.client.DomEvent; |
20 |
|
- |
import com.googlecode.mgwt.dom.client.event.EventTypes; |
|
17 |
+ |
import com.googlecode.mgwt.dom.client.event.EventTypesHolder; |
21 |
18 |
|
|
22 |
19 |
|
/** |
23 |
|
- |
* |
|
20 |
+ |
* |
24 |
21 |
|
* Represent a native animation end event |
25 |
|
- |
* |
|
22 |
+ |
* |
26 |
23 |
|
* @author Daniel Kurka |
27 |
24 |
|
* @version $Id: $ |
28 |
25 |
|
*/ |
29 |
26 |
|
public class AnimationEndEvent extends DomEvent<AnimationEndHandler> { |
30 |
|
- |
|
31 |
|
- |
private static final EventTypes EVENT_TYPES = GWT.create(EventTypes.class); |
32 |
|
- |
/** |
33 |
|
- |
* Event type for animation end events. |
34 |
|
- |
*/ |
35 |
|
- |
private static final Type<AnimationEndHandler> TYPE = new Type<AnimationEndHandler>(EVENT_TYPES.getAnimationEnd(), new AnimationEndEvent()); |
36 |
|
- |
|
37 |
|
- |
/** |
38 |
|
- |
* <p>getType</p> |
39 |
|
- |
* |
40 |
|
- |
* @return a Type object. |
41 |
|
- |
*/ |
42 |
|
- |
public static Type<AnimationEndHandler> getType() { |
43 |
|
- |
return TYPE; |
44 |
|
- |
} |
45 |
|
- |
|
46 |
|
- |
/** |
47 |
|
- |
* {@inheritDoc} |
48 |
|
- |
* |
49 |
|
- |
* Gets the event type associated with animation end events. |
50 |
|
- |
*/ |
51 |
|
- |
@Override |
52 |
|
- |
public com.google.gwt.event.dom.client.DomEvent.Type<AnimationEndHandler> getAssociatedType() { |
53 |
|
- |
return TYPE; |
54 |
|
- |
} |
55 |
|
- |
|
56 |
|
- |
/** |
57 |
|
- |
* Protected constructor, use |
58 |
|
- |
* {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)} |
59 |
|
- |
* to fire animation end events. |
60 |
|
- |
*/ |
61 |
|
- |
protected AnimationEndEvent() { |
62 |
|
- |
|
63 |
|
- |
} |
64 |
|
- |
|
65 |
|
- |
/** {@inheritDoc} */ |
66 |
|
- |
@Override |
67 |
|
- |
protected void dispatch(AnimationEndHandler handler) { |
68 |
|
- |
handler.onAnimationEnd(this); |
69 |
27 |
|
|
70 |
|
- |
} |
|
28 |
+ |
/** |
|
29 |
+ |
* Event type for animation end events. |
|
30 |
+ |
*/ |
|
31 |
+ |
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "MS_PKGPROTECT", justification = "we need this for testing") |
|
32 |
+ |
protected static Type<AnimationEndHandler> TYPE; |
|
33 |
+ |
|
|
34 |
+ |
/** |
|
35 |
+ |
* <p> |
|
36 |
+ |
* getType |
|
37 |
+ |
* </p> |
|
38 |
+ |
* |
|
39 |
+ |
* @return a Type object. |
|
40 |
+ |
*/ |
|
41 |
+ |
public static Type<AnimationEndHandler> getType() { |
|
42 |
+ |
if (TYPE == null) { |
|
43 |
+ |
TYPE = new Type<AnimationEndHandler>(EventTypesHolder.EVENT_TYPES.getAnimationEnd(), new AnimationEndEvent()); |
|
44 |
+ |
} |
|
45 |
+ |
return TYPE; |
|
46 |
+ |
} |
|
47 |
+ |
|
|
48 |
+ |
/** |
|
49 |
+ |
* {@inheritDoc} |
|
50 |
+ |
* |
|
51 |
+ |
* Gets the event type associated with animation end events. |
|
52 |
+ |
*/ |
|
53 |
+ |
@Override |
|
54 |
+ |
public com.google.gwt.event.dom.client.DomEvent.Type<AnimationEndHandler> getAssociatedType() { |
|
55 |
+ |
if (TYPE == null) { |
|
56 |
+ |
TYPE = new Type<AnimationEndHandler>(EventTypesHolder.EVENT_TYPES.getAnimationEnd(), new AnimationEndEvent()); |
|
57 |
+ |
} |
|
58 |
+ |
return TYPE; |
|
59 |
+ |
} |
|
60 |
+ |
|
|
61 |
+ |
/** |
|
62 |
+ |
* Protected constructor, use |
|
63 |
+ |
* {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)} |
|
64 |
+ |
* to fire animation end events. |
|
65 |
+ |
*/ |
|
66 |
+ |
protected AnimationEndEvent() { |
|
67 |
+ |
|
|
68 |
+ |
} |
|
69 |
+ |
|
|
70 |
+ |
/** {@inheritDoc} */ |
|
71 |
+ |
@Override |
|
72 |
+ |
protected void dispatch(AnimationEndHandler handler) { |
|
73 |
+ |
handler.onAnimationEnd(this); |
|
74 |
+ |
|
|
75 |
+ |
} |
71 |
76 |
|
} |