?? layer.java
字號(hào):
package src;
import javax.microedition.lcdui.Graphics;
public abstract class Layer {
protected int x;
protected int y;
protected int width;
protected int height;
protected boolean visible;
protected Layer(int width, int height) {
visible = true;
setWidthImpl(width);
setHeightImpl(height);
}
public void setPosition(int x, int y) {
this.x = x;
this.y = y;
}
public void move(int dx, int dy) {
x += dx;
y += dy;
}
public final int getWidth() {
return width;
}
public final int getHeight() {
return height;
}
public abstract void paint(Graphics g);
void setWidthImpl(int width) {
if (width < 0) {
throw new IllegalArgumentException();
} else {
this.width = width;
}
}
void setHeightImpl(int height) {
if (height < 0) {
throw new IllegalArgumentException();
} else {
this.height = height;
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -