001/*
002 * #%L
003 * GwtMaterial
004 * %%
005 * Copyright (C) 2015 - 2017 GwtMaterialDesign
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 * 
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 * 
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package gwt.material.design.client.base;
021
022import com.google.gwt.dom.client.Element;
023
024/**
025 * Css3 Transition property to be set {@link MaterialWidget#setTransition(TransitionConfig)}.
026 *
027 * @author kebzlou7979
028 */
029public class TransitionConfig {
030
031    private Element target;
032    private int duration;
033    private int delay;
034    private String property = "";
035    private String timingFunction = "";
036
037    public TransitionConfig() {}
038
039    public TransitionConfig(Element target, int duration, int delay, String property, String timingFunction) {
040        this.target = target;
041        this.duration = duration;
042        this.delay = delay;
043        this.property = property;
044        this.timingFunction = timingFunction;
045    }
046
047    public TransitionConfig(int duration, String property) {
048        this.duration = duration;
049        this.property = property;
050    }
051
052    public TransitionConfig(Element target, int duration, String property) {
053        this.target = target;
054        this.duration = duration;
055        this.property = property;
056    }
057
058    public Element getTarget() {
059        return target;
060    }
061
062    /**
063     * Specifies the target element to apply the transition.
064     */
065    public void setTarget(Element target) {
066        this.target = target;
067    }
068
069    public int getDuration() {
070        return duration;
071    }
072
073    /**
074     * Specifies how many seconds or milliseconds a transition effect takes to complete (In milliseconds)
075     */
076    public void setDuration(int duration) {
077        this.duration = duration;
078    }
079
080    public int getDelay() {
081        return delay;
082    }
083
084    /**
085     * Specifies a delay (in seconds) for the transition effect
086     */
087    public void setDelay(int delay) {
088        this.delay = delay;
089    }
090
091    public String getProperty() {
092        return property;
093    }
094
095    /**
096     * Specifies the name of the CSS property the transition effect is for.
097     */
098    public void setProperty(String property) {
099        this.property = property;
100    }
101
102    public String getTimingFunction() {
103        return timingFunction;
104    }
105
106    /**
107     * Specifies the speed curve of the transition effect (In milliseconds)
108     */
109    public void setTimingFunction(String timingFunction) {
110        this.timingFunction = timingFunction;
111    }
112}