?? chesspoint.java
字號:
package vo;
import javax.swing.JLabel;
import java.awt.Point;
import javax.swing.ImageIcon;
/**
* 棋子類,繼承自JLabel類
*
* @author B.Lee
*
*/
public class ChessPoint extends JLabel {
private Enums.chessState state = Enums.chessState.NONE;// 當前子的狀態
private Point point = new Point(0, 0);// 當前子的坐標
private float score; // 當前子的分數,電腦以此為依據下棋
/**
* 構造函數
*
* @param argState
* 初始化新棋的狀態
* @param argPoint
* 初始化新棋的坐標
*/
public ChessPoint(Enums.chessState argState, Point argPoint) {
state = argState;
point = argPoint;
setIcon(new ImageIcon("icon/none.gif"));
}
public Point getPoint() {
return point;
}
public void setPoint(Point point) {
this.point = point;
}
public float getScore() {
return score;
}
public void setScore(float score) {
this.score = score;
}
public Enums.chessState getState() {
return state;
}
public void setState(Enums.chessState state) {
this.state = state;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -