001package 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
023import com.google.gwt.dom.client.Style;
024import 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 */
032public 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    JELLO("animated jello"),
071    LIGHTSPEED_IN("animated lightSpeedIn"),
072    LIGHTSPEED_OUT("animated lightSpeedOut"),
073    NO_ANIMATION(""),
074    PULSE("animated pulse"),
075    ROLL_IN("animated rollIn"),
076    ROLL_OUT("animated rollOut"),
077    ROTATE_IN("animated rotateIn"),
078    ROTATE_IN_DOWN_LEFT("animated rotateInDownLeft"),
079    ROTATE_IN_DOWN_RIGHT("animated rotateInDownRight"),
080    ROTATE_IN_UP_LEFT("animated rotateInUpLeft"),
081    ROTATE_IN_UP_RIGHT("animated rotateInUpRight"),
082    ROTATE_OUT("animated rotateOut"),
083    ROTATE_OUT_DOWN_LEFT("animated rotateOutDownLeft"),
084    ROTATE_OUT_DOWN_RIGHT("animated rotateOutDownRight"),
085    ROTATE_OUT_UP_LEFT("animated rotateOutUpLeft"),
086    ROTATE_OUT_UP_RIGHT("animated rotateOutUpRight"),
087    RUBBER_BAND("animated rubberBand"),
088    SHAKE("animated shake"),
089    SLIDE_IN_UP("animated slideInUp"),
090    SLIDE_IN_DOWN("animated slideInDown"),
091    SLIDE_IN_LEFT("animated slideInLeft"),
092    SLIDE_IN_RIGHT("animated slideInRight"),
093    SLIDE_OUT_UP("animated slideOutUp"),
094    SLIDE_OUT_DOWN("animated slideOutDown"),
095    SLIDE_OUT_LEFT("animated slideOutLeft"),
096    SLIDE_OUT_RIGHT("animated slideOutRight"),
097    SWING("animated swing"),
098    TADA("animated tada"),
099    WOBBLE("animated wobble"),
100    ZOOM_IN("animated zoomIn"),
101    ZOOM_IN_DOWN("animated zoomInDown"),
102    ZOOM_IN_LEFT("animated zoomInLeft"),
103    ZOOM_IN_RIGHT("animated zoomInRight"),
104    ZOOM_IN_UP("animated zoomInUp"),
105    ZOOM_OUT("animated zoomOut"),
106    ZOOM_OUT_DOWN("animated zoomOutDown"),
107    ZOOM_OUT_LEFT("animated zoomOutLeft"),
108    ZOOM_OUT_RIGHT("animated zoomOutRight"),
109    ZOOM_OUT_UP("animated zoomOutUp");
110
111    private final String cssClass;
112
113    private Animation(final String cssClass) {
114        this.cssClass = cssClass;
115    }
116
117    @Override
118    public String getCssName() {
119        return cssClass;
120    }
121
122    public static Animation fromStyleName(final String styleName) {
123        return EnumHelper.fromStyleName(styleName, Animation.class, NO_ANIMATION);
124    }
125
126}