// XAAL toolkit // Copyright (C) 2009 Ville Karavirta // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . package xaal.objects.animation.timing; public class Timing { private int delay; private String delayType = FRAMES_TYPE; private int duration; private String durationType = FRAMES_TYPE; public static final String MS_TYPE = "ms"; public static final String S_TYPE = "s"; public static final String FRAMES_TYPE = "frames"; public Timing() { super(); } public void setDelay(int delay, String type) { if (type.equalsIgnoreCase(MS_TYPE) || type.equalsIgnoreCase(S_TYPE) || type.equalsIgnoreCase(FRAMES_TYPE)) { this.delay = delay; this.delayType = type.toLowerCase(); } else { // TODO common error reporting } } public void setDuration(int dur, String type) { if (type.equalsIgnoreCase(MS_TYPE) || type.equalsIgnoreCase(S_TYPE) || type.equalsIgnoreCase(FRAMES_TYPE)) { this.duration = dur; this.durationType = type.toLowerCase(); } else { // TODO common error reporting } } public int getDelay() { return delay; } public String getDelayType() { return delayType; } public int getDuration() { return duration; } public String getDurationType() { return durationType; } }