In this homework you will practice:
You have a bunch of PGN games and want to display them easily.
Write a GUI program in a file named ChessGui.java
that displays the metadata of ChessGame
s, one per line, of each game in ChessDb
in a TableView. In the bottom of the main screen should be two buttons: “View” and “Dismiss”.
“View” should be disabled if no game is selected in the table. If a game is selected, “View” should be enabled and, when clicked, should show a dialog box with the metadata and moves of the selected game. This dialog may be as simple as you wish.
“Dismiss” should exit the program.
Your main screen should look something like this:
Once you figure out how to hook up the domain objects that we give you (ChessGame
and ChessDb
) to the TableView, this assignment is very easy.
Add a search feature to your GUI that allows the user to search for games by a specific player, or games that Black won, or any other useful thing you can think of.
Add a field for Opening to ChessGame
that is automatically calculated from the moves of the game. In addition to any games you add in the step below, recognize the following openings: Giuoco Piano, Ruy Lopez, Sicilian Defence, Queen’s Gambit, Indian Defence, and Philidor Defence
Re-use or re-write your PGN reader from hw1 and incorporate it into your GUI so that, in addition to the games in ChessDb
, all the games in PGN files in the same directory as your ChessGui
are also displayed in the table.
Checkstyle deduction will be capped at 50 points for this homework. Use the -a flag when running checkstyle! JavaDocs will be counted for this homework.
Submit code that compiles!!!
Non compiling code will receive an automatic zero.
Submit each of your Java source files necessary for all the files in your chess game database to compile on T-Square as separate attachments. When you’re ready, double-check that you have submitted and not just saved a draft. Download each file and compile them to assure that nothing went wrong with the submission process.
Practice safe submission! Verify that your HW files were truly submitted correctly, the upload was successful, and that your program runs with no syntax or runtime errors. It is solely your responsibility to turn in your homework and practice this safe submission safeguard.
This procedure helps guard against a few things.