What is Tabula Chess?

Tabula Chess is a Java library which provides a convenient chess board Swing component. Tabula does not handle any chess rules or algorithms in order to provide reuse for any application which requires a chessboard. The client using Tabula is notified when a piece is moved and is given a chance to veto the move if it violates any rules of the chess variant being played.

License

Tabula Chess is released under the open source MIT license.

Features

Example

The Tabula Chess libary is meant to be easy to use. Clients of this library create a new instance of a ChessBoardContext, configure it, then retrieve a JComponent to embed in a Swing GUI. Through the MoveListener interface, the client is given a record of moves played on the board as well as the opportunity to veto any illegal moves.

	     1 final ChessBoardContext context = new ChessBoardContext();
	     2 context.setMoveListener(new MoveListener() {
	     3     @Override
	     4     public boolean acceptMove(Chessman piece, Coordinate source, Coordinate destination) {
	     5         System.out.printf("Moving %s %s from %s to %s %n",
	     6                             piece.getColor(), piece.getPieceType(), source, destination);
	     7         return true;
	     8     }
	     9 })
	    10     .setPositionFEN("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1")
	    11     .setColors(Color.BLACK, Color.WHITE)
	    12     .setPieceImageSet(PieceSets.ARIAL);
	  

Feature Backlog

Download

https://sourceforge.net/projects/tabula-chess/

Contribute

We would especially like someone with a graphics background to contribute some nice looking piece sets and square background images. Anyone interested in development of the library are also welcome. Contact us if you are interested -- we'd love to hear from you.

Screenshots

image of Tabula chess board swing component image of Tabula chess board swing component image of Tabula chess board swing component image of Tabula chess board swing component