?? animatedcanvaselement.java
字號:
package inline.ui.ce;
import inline.ui.*;
import java.util.*;
import javax.microedition.lcdui.*;
public class AnimatedCanvasElement extends CanvasElement
{
final private static int TAG_ANIM_CLOCK = 0xE8219901;
private int interval;
private boolean animated;
private Timer ticker;
public AnimatedCanvasElement(HostCanvas prnt, int x, int y, int w, int h)
{
super(prnt, x, y, w,h);
}
public AnimatedCanvasElement(HostCanvas prnt)
{
this(prnt, 0,0,0,0);
}
public void showNotify()
{
super.showNotify();
if (animated)
{
ticker = getParent().newFixedRateTimer(ticker, TAG_ANIM_CLOCK,
interval, interval, this);
onAnimate();
}
}
public void hideNotify()
{
super.hideNotify();
ticker = getParent().killTimer(ticker);
}
public void onTimer(int tag, long delay)
{
if (tag == TAG_ANIM_CLOCK)
{
onAnimate();
}
else
{
super.onTimer(tag, delay);
}
}
protected void onAnimate() // override this
{
}
public void setInterval(int iinterval)
{
interval = iinterval;
}
public void setAnimated(boolean aanimated)
{
animated = aanimated;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -