⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 animation.java

📁 一个基于J2ME的动画引擎框架
💻 JAVA
字号:
package sjg.animation;import java.util.*;/** * A list of {@link Frame frames}. * * The Animation may be looped or not looped. Animations are created * by {@link Cropper Cropper} . * * @author Christian Hvid */public class Animation {    private String name;    private Vector frames = new Vector();    private boolean looped;    public int size() {        return frames.size();    }    public Frame getFrame(int index) {        if (looped == true)            return (Frame) frames.elementAt(index % frames.size());        else {            if (index >= frames.size())                return (Frame) frames.elementAt(frames.size() - 1);            else                return (Frame) frames.elementAt(index % frames.size());        }    }    public String getName() {        return name;    }    protected void addFrame(Frame frame) {        frames.addElement(frame);    }    public Animation(String name, boolean looped) {        this.name = name;        this.looped = looped;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -