001 package org.gwtbootstrap3.extras.animate.client.ui.constants;
002
003 /*
004 * #%L
005 * GwtBootstrap3
006 * %%
007 * Copyright (C) 2013 - 2014 GwtBootstrap3
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 *
013 * http://www.apache.org/licenses/LICENSE-2.0
014 *
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023 import com.google.gwt.dom.client.Style;
024 import org.gwtbootstrap3.client.ui.base.helper.EnumHelper;
025
026 /**
027 * Enumeration of CSS animations from Animate.css project.
028 * See: http://daneden.github.io/animate.css/
029 *
030 * @author Pavel Zlámal
031 */
032 public enum Animation implements Style.HasCssName {
033
034 BOUNCE("animated bounce"),
035 BOUNCE_IN("animated bounceIn"),
036 BOUNCE_IN_DOWN("animated bounceInDown"),
037 BOUNCE_IN_LEFT("animated bounceInLeft"),
038 BOUNCE_IN_RIGHT("animated bounceInRight"),
039 BOUNCE_IN_UP("animated bounceInUp"),
040 BOUNCE_OUT("animated bounceOut"),
041 BOUNCE_OUT_DOWN("animated bounceOutDown"),
042 BOUNCE_OUT_LEFT("animated bounceOutLeft"),
043 BOUNCE_OUT_RIGHT("animated bounceOutRight"),
044 BOUNCE_OUT_UP("animated bounceOutUp"),
045 FADE_IN("animated fadeIn"),
046 FADE_IN_DOWN("animated fadeInDown"),
047 FADE_IN_DOWN_BIG("animated fadeInDownBig"),
048 FADE_IN_LEFT("animated fadeInLeft"),
049 FADE_IN_LEFT_BIG("animated fadeInLeftBig"),
050 FADE_IN_RIGHT("animated fadeInRight"),
051 FADE_IN_RIGHT_BIG("animated fadeInRightBig"),
052 FADE_IN_UP("animated fadeInUp"),
053 FADE_IN_UP_BIG("animated fadeInUpBig"),
054 FADE_OUT("animated fadeOut"),
055 FADE_OUT_DOWN("animated fadeOutDown"),
056 FADE_OUT_DOWN_BIG("animated fadeOutDownBig"),
057 FADE_OUT_LEFT("animated fadeOutLeft"),
058 FADE_OUT_LEFT_BIG("animated fadeOutLeftBig"),
059 FADE_OUT_RIGHT("animated fadeOutRight"),
060 FADE_OUT_RIGHT_BIG("animated fadeOutRightBig"),
061 FADE_OUT_UP("animated fadeOutUp"),
062 FADE_OUT_UP_BIG("animated fadeOutUpBig"),
063 FLASH("animated flash"),
064 FLIP("animated flip"),
065 FLIP_IN_X("animated flipInX"),
066 FLIP_IN_Y("animated flipInY"),
067 FLIP_OUT_X("animated flipOutX"),
068 FLIP_OUT_Y("animated flipOutY"),
069 HINGE("animated hinge"),
070 LIGHTSPEED_IN("animated lightSpeedIn"),
071 LIGHTSPEED_OUT("animated lightSpeedOut"),
072 NO_ANIMATION(""),
073 PULSE("animated pulse"),
074 ROLL_IN("animated rollIn"),
075 ROLL_OUT("animated rollOut"),
076 ROTATE_IN("animated rotateIn"),
077 ROTATE_IN_DOWN_LEFT("animated rotateInDownLeft"),
078 ROTATE_IN_DOWN_RIGHT("animated rotateInDownRight"),
079 ROTATE_IN_UP_LEFT("animated rotateInUpLeft"),
080 ROTATE_IN_UP_RIGHT("animated rotateInUpRight"),
081 ROTATE_OUT("animated rotateOut"),
082 ROTATE_OUT_DOWN_LEFT("animated rotateOutDownLeft"),
083 ROTATE_OUT_DOWN_RIGHT("animated rotateOutDownRight"),
084 ROTATE_OUT_UP_LEFT("animated rotateOutUpLeft"),
085 ROTATE_OUT_UP_RIGHT("animated rotateOutUpRight"),
086 RUBBER_BAND("animated rubberBand"),
087 SHAKE("animated shake"),
088 SWING("animated swing"),
089 TADA("animated tada"),
090 WOBBLE("animated wobble"),
091 ZOOM_IN("animated zoomIn"),
092 ZOOM_IN_DOWN("animated zoomInDown"),
093 ZOOM_IN_LEFT("animated zoomInLeft"),
094 ZOOM_IN_RIGHT("animated zoomInRight"),
095 ZOOM_IN_UP("animated zoomInUp"),
096 ZOOM_OUT("animated zoomOut"),
097 ZOOM_OUT_DOWN("animated zoomOutDown"),
098 ZOOM_OUT_LEFT("animated zoomOutLeft"),
099 ZOOM_OUT_RIGHT("animated zoomOutRight"),
100 ZOOM_OUT_UP("animated zoomOutUp");
101
102 private final String cssClass;
103
104 private Animation(final String cssClass) {
105 this.cssClass = cssClass;
106 }
107
108 @Override
109 public String getCssName() {
110 return cssClass;
111 }
112
113 public static Animation fromStyleName(final String styleName) {
114 return EnumHelper.fromStyleName(styleName, Animation.class, NO_ANIMATION);
115 }
116
117 }