ChessForge Part 2: GUI
Due on October 4th at 11:59 PM.
This is an individual assignment. You are to complete this assignment on your own, although you may discuss the lab concepts with your classmates. Remember the Academic Integrity Policy: do not show your work to anyone outside of the course staff and do not look at anyone else’s work for this lab. If you need help, please post on the Piazza forum or contact the instructor. Note that no exception is made for your group members; collaboration with your group members is a violation of the Academic Integrity Policy as much as collaboration with other members of the class. If you have any doubts about what is okay and what is not, it’s much safer to ask than to risk violating the Academic Integrity Policy.
Overview
In this assignment, you will write a graphical user interface (GUI) for ChessForge. This GUI comprises the view and controller parts of the MVC design pattern.
Implementation
Your GUI implementation should be developed in the same repository in which you developed your model. Although you may wish to refer to that assignment for a refresher on the rules of the game, the fundamental purpose of this application is to give a human user the ability to interact with a ChessForge model.
You will need to write several classes to complete this implementation. You are strongly encouraged to place your code in a different package than the one you used for the first part of this assignment. Your GUI code will communicate with the ChessForge model via the provided interfaces; you will not name any model classes directly.
To develop your JavaFX application, you’ll need to write a subclass of the Application
class as we discussed in class. You’ll also want a main class with a main
method that looks something like this:
public static void main(String[] arg) {
Application.launch(MyChessForgeGUI.class, arg);
}
In writing your program, you may wish to refer to the JavaFX Guide for the course. That link also leads to a number of other resources, such as the JavaFX tutorials published by Oracle.
You should feel free to use the reference implementation of the ChessForge model during this assignment. You may use your own model, but you are not required to do so; this way, you don’t have to worry about debugging anything wrong with your model implementation while you work on your GUI.
Requirements
Your GUI must have the following properties:
- It must be written using JavaFX.
-
You may use the name of a ChessForge model class only to construct the model object. You must not refer to a ChessForge model class when declaring a variable or to cast. Doing so defeats much of the purpose of MVC design and will be met with a significant deduction. Here are some examples:
ChessForgeModel model = new ChessForgeModelImpl(); // good ChessForgeModel myModel = new MyChessForgeModel(); // also good ChessForgeModelImpl model = new ChessForgeModelImpl(); // bad MyChessForgeModel model = new MyChessForgeModel(); // equally bad ((ChessForgeModelImpl)model).getLegalMoves(); // very bad ((MyChessForgeModel)myModel).someCustomMethod(); // extremely bad
Furthermore, it must be possible for the model class in question to be replaced with any other implementation of
ChessForgeModel
. This is nearly guaranteed if you simply interact with the object through theChessForgeModel
interface. - Your GUI should be visually appealing. Up to 25% of your grade depends upon the quality of the user interface experience. While you are not expected to include a more comfortable experience than the reference implementation, you should avoid poorly placed visual components, awkwardly wrapped text, and large sections of wasted space. Your board must be represented visually; at least some graphical aspect must be used to represent each tile’s symbol and hit count.
- Your GUI must display the error messages that the model generates. This output may not be routed to the terminal.
- Your GUI must not generate any exception stack traces on the terminal as your program is running.
Finally, your GUI code is expected to conform to the same style requirements as the previous assignment.
Images
You may (but are not required to) use the images in the tile-images
subdirectory for this project. If you wish to do so, make sure to add that directory as a “resources root” in IntelliJ and refer to the images as Java resources in your code (instead of opening them as File
s).
Submitting Your Work
As with the previous assignment, you will add to your previous README.md
file in the root of your repository. This document should identify the main class for your GUI application. Once you have done so, you may submit your assignment simply by pushing to the Swarthmore GitHub.
Extra Credit
There is also the opportunity for extra credit in this assignment as well. If your GUI goes significantly beyond the above requirements, you may receive some extra points for your efforts. Examples of extra credit-worthy features include:
- A resizable window
- Use of images beyond the board tiles
- A “new game” menu item or button
- Sound
- User interface customization features
Make sure to include mention of the features you implemented in your README.md
. The amount of extra credit will depend upon the effect your decision has upon the user interface.