- 作业标题:COMP2396 - Assignment 4
- 课程名称:COMP2396 Object-oriented Programming and Java
- 完成周期:2天
- Deadline: 11:55pm, 22nd Nov, 2023.
Overview
This assignment tests your understanding of GUI and event-handling, and their
implementations in Java. You are going to design and implement a GUI for the Big Two card game you developed in assignment 3. In addition to the classes and interface provided in assignment 3, a CardGameUI interface is provided to model a user interface for a general card game. You may refer to their Javadoc for details of these classes and interfaces. You should NOT modify any of these provided classes and interfaces in completing yourassignment.
You will be reusing all the classes implemented in assignment 3. You are required to implement a BigTwoGUI class which builds a GUI for the game and handles all user actions. This class implements the CardGameUI interface and has several inner classes responsible for rendering the user interface and handling user actions. To make use of the BigTwoGUI class, you will need to modify your BigTwo class accordingly. You will need to replace the BigTwoUI object with a BigTwoGUI object. You are free to introduce new instance variables and methods to these classes. Besides, you are also free to design and introduce new classes in the inheritance trees as appropriate. With a proper OO design, you do not need to touch the rest of the classes in assignment 3. You are required to write Javadoc for all public classes and their public class members.
Specifications
Graphical user interface
You are free to design a GUI for your Big Two card game. As a minimum requirement, your GUI should
- Have a panel showing the cards of each player as well as the cards played on the table.
The cards should be shown in a partially overlapped manner (see Figure 1). - For each player, the panel should show his/her name and an avatar for him/her.
- For the active player, the panel should show the faces of his/her cards.
- For other players, the panel should show only the backs of their cards.
- For cards played on the table, the panel should show at least (the faces of) the last
hand of cards played on the table and the name of the player for this hand. - Allow the active player to select and deselect his/her cards by mouse clicks on the
cards. The selected cards should be drawn in a “raised” position with respect to the
rest of the cards (see Figure 1). - Have a “Play” button for the active player to play the selected cards. Nothing should
happen if the “Play” button is clicked with no card selected. - Have a “Pass” button for the active player to pass his/her turn to the next player.
- Have a text area to show the current game status as well as end of game messages.
- Have a text area showing the chat messages sent by the players.
- Have a text input field for the active player to send out chat messages.
- Have a “Restart” menu item under a “Game” menu for restarting the game.
- Have a “Quit” menu item under a “Game” menu for quitting the game.
- Your application window should support maximizing, minimizing, and resizing.
……