Pre-release fixes & UML Diagram

Wednesday, July 8, 2009 20:42
SOS UML Diagram v. 6

SOS UML Diagram v. 6

The following is a summary of the glitches I found and thus fixed along with a little background on how I enhanced the look and feel of the GUI.

Pre 1.0 release testing Fixes:

  • WinnerView was not clearing the winner of previous game when new game was created

Board:

  • added variable boardSize, which stores SMALL, MEDIUM, or LARGE passed from menu when board size is changed, used to determine the dimensions to set the JFrame to in order to incorporate the new board that has been drawn (allows me to use more exact measures giving a cleaner look)
  • added method getBoardSize

MenuBar:

  • added constants SMALL,MEDIUM, and LARGE and are public so that I can access them directly (since they are final I cannot change them) in order to do a comparison and avoid typos

I also enhanced the GUI a bit to get rid of the bland grey default background and organized my components.  In the case of the background I changed the background
color for all components (Including the instructions, which are contained in a JOptionPane) to white using the following code in my main function:

UIManager.put("OptionPane.background", Color.WHITE);
UIManager.put("Panel.background", Color.WHITE);

I then, in one case, over-ride the white background by using the setBackground() function to set the color to something else.

I used borders to separate the components board, controls, and score card.  In the case of the last two, I also used the boarder to label the components allowing me to update my instructions to easily refer to sections and in my opinion make the GUI look cleaner.  Since I am just using the three board sizes I figured out the exact dimensions the JFrame (PlayerView) had to be in order to encompass all of its components nicely and hard-coded them in.  I know the width and height values by passing/using one of the constants I added to MenuBar (see above).

You can leave a response, or trackback from your own site.

Leave a Reply