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

📄 animation.java

📁 wap浏览器 日程安排 Rss 棋牌游戏
💻 JAVA
字号:
/* * Fire (Flexible Interface Rendering Engine) is a set of graphics widgets for creating GUIs for j2me applications.  * Copyright (C) 2006-2008 Bluevibe (www.bluevibe.net) * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. *  * This library 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 * Lesser General Public License for more details. *  * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA *  */package gr.fire.core;import javax.microedition.lcdui.Graphics;import javax.microedition.lcdui.Image;/** *  * Animation are either used as transitions effects (used when the state of a Container changes)  * or as Animations inside a component. * <br/>  * A transition effect can be displayed for example when a component is added or  * removed from the Container or when the container is made visible or disabled etc. * The transition effect will be triggered if there is a  * Animation instance associated with the transition the container is going through. * <br/> * An animation inside a Component can be for example the movement of the dials of an AnalogClock component. * This type of animation is continious (i.e. it will not complete). * <br/> * An animation is confined inside its owner. It is not allowed to paint outside the  * clipping rectangle defined by owner.x,owner.y,owner.width,owner.height. *  * @author padeler * */public abstract class Animation{	private static Image offscreen;	protected Image getOffscreen()	{		if(offscreen==null)		{			FireScreen screen = FireScreen.getScreen();			System.out.println("Creating animation offscreen "+screen.getWidth()+"/"+screen.getHeight());			offscreen = Image.createImage(screen.getWidth(),screen.getHeight());					}		return offscreen;	}	/**	 * 	 * An animation is running when it has not yet reached its final state.	 * This function should not alter the state of the animation and should return fast.	 * 	 * @return true, if this Animation is running. 	 * 	 * @see  Animation#step()	 */	public abstract boolean isRunning();		/**	 * Setups this animation for the given owner,triger and properties.	 * @param owner	 * @param trigger	 * @param properties	 * @throws IllegalArgumentException if owner or trigger are null.	 */	public abstract void setup(Component owner, Component trigger, Object properties);		/**	 * Causes this animation to move to its next frame. 	 * This method should return as fast as possible.	 *  	 * @return true, if the animation needs to be re-drawn on the screen. false otherwise.	 */	public abstract boolean step();			/**	 * Moves the animation to its last state. 	 * Subsequent calls to getCurrentFrame() should return the final frame of the animation. 	 */	public abstract void stop();		/**	 * 	 * @return an image containing the current frame of this effect. 	 */	public abstract void paint(Graphics g);				public abstract Component getOwner();	public abstract Component getTrigger();	public abstract Object getProperties();	}

⌨️ 快捷键说明

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