📄 chesspoint.java
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package 中国象棋打谱系统;/** * * @author Administrator */public class ChessPoint{ int x,y; boolean 有棋子; ChessPiece piece=null; ChessBoard board=null; public ChessPoint(int x,int y,boolean boo) { this.x=x; this.y=y; 有棋子=boo; } public boolean isPiece() { return 有棋子; } public void set有棋子(boolean boo) { 有棋子=boo; } public int getX() { return x; } public int getY() { return y; } public void setPiece(ChessPiece piece,ChessBoard board) { this.board=board; this.piece=piece; board.add(piece); int w=(board.unitWidth); int h=(board.unitHeight); piece.setBounds(x-w/2,y-h/2,w,h); 有棋子=true; board.validate(); } public ChessPiece getPiece() { return piece; } public void reMovePiece(ChessPiece piece,ChessBoard board) { this.board=board; this.piece=piece; board.remove(piece); board.validate(); 有棋子=false; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -