📄 imagegroup.java
字号:
package magic.graphics;
import java.applet.*;
// 提供创建和访问AnimationStrip对象的方法
public abstract class ImageGroup
{
// 一组AnimationStrip对象,它们从整体上创建了动画序列
protected AnimationStrip[] animations;
// 单个图像帧的宽和高
protected int frameWidth;
protected int frameHeight;
// 创建一个新的ImageGroup
protected ImageGroup()
{
animations = null;
}
// 使用传入的Applet引用对象初始化ImageGroup
public abstract void init(Applet a);
public final int getFrameWidth()
{
return frameWidth;
}
public final int getFrameHeight()
{
return frameHeight;
}
// 访问给定索引的AnimationStrip
public final AnimationStrip getAnimationStrip(int index)
{
if (animations != null) {
try {
return animations[index];
}
catch (ArrayIndexOutOfBoundsException e) {
// 给调试器或者标准输出发送错误...
}
}
return null;
}
} // ImageGroup
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -