Pluggable chess graphism ======================== This project aims to give you a chess component, will all gesture managed. All you have to do is to configure the appearance by choosing from some sets, and above all, use your favorite chess engine to fill the move validation callbacks, and the chess engine update callback : *) make an InteractionManager subclass (InteractionClickAndClick, InteractionClassicDragAndDrop or InteractionClickMoveClick). *) call setMoveCallBacks in your InteractionManager, and fill => tryToValidate, returning true if the move is to validate, and false otherwise => updateMoveInEngine, to update the chess engine you have chosen with the validated move *) set the InteractionManager instance to your BoardJPanel instance. When you include the BoardJPanel component in your swing application, it will already have a given size (so you can just call pack() if you want instead of setSize) and a set of pieces and cells images is already choosen. Also you can choose cells size (with constructor or with setCellsSize(int) method), and you can change cells images set (setCellsSet), pieces images set (setPiecesSet) with the help of CellsSet and PiecesSet constants. Starting from version 1.22, the class TableHistoryPanel gives you a support for the history : the user click on a positon, and the board given at the constructor is updated with the wanted position. But this only work if you remember to provide the move SAN and the position FEN to the addMove(String, String) method of the interface HistoryPrinter, which TableHistoryPanel implements. Of course, don't forget to call TableHistoryPanel#addMove(String, String) each time a move is commited. Another advice, you should use a BoardJPanel to let the user play, and use another one to let the user navigate into the history. And finally, notice that to set the start position in the history board, you can click on a cell of the first column (move number). Starting from version 1.38, there is a position builder frame (in swing package) in order to define a custom position and to get its fen value : typically, you add a window listener to it in order to listen to its WindowDesactivated method, and in this method, you test the isLastClosingValidation() method and call getFenValue() method if its succeed. Please, also note that by default, the last move cells are highlighted, but you can easily change this behavior : calling setMovesHighlighted(boolean). Feature only available starting from version 1_02. Also, see the history file if you want to follow modifications.
PluggableChessGraphism Files
Take the chess graphism, and use it with a chess engine.
Brought to you by:
laurentdu64