Progress + UML Update

Sunday, June 7, 2009 22:02
SOS UML Diagram v2

SOS UML Diagram v2

Throughout the week I have worked on my program on and off, the longest sitting being Friday night from around 8PM until 1AM when I finally went to bed.  I am tentatively done the classes GridBagConstraintsExt, MoveHistory, Move, Options, Player, Position, and UndoView.

The following is what I have modified in my UML diagram as I found the errors, or what I felt to be a better way of structuring/doing something:

  • changed two functions in UndoView to private
  • capitalized constructor in MoveHistory class
  • removed whoseTurn() from MoveHistory to OptionsView in replace of getSelection()
  • added statusChanged() to Player class
  • added advanceRow() and advanceColumn() to Position
  • added WinnerView Board Composiition
  • added newBoard function to Board, so can recreate the board when necessary.
  • added statusChanged() to Board so can notify observers.
  • added row & col to Board so can keep track of size of board since can change, for looping
  • added Choice class
  • complete restructuring of IntroView

The restructuring of IntroView was to give it a similar underlying structure as the other views.  I am still uncertain as to how I am going to get this view to work as I have conceived it in my mind.   Basically, what I am looking for is to have the IntroView JPanel (as the name alludes to) be the opening/greeting to my program which will display basic information about my game such as name, logo, and website address.

I have spent some of my Sunday playing around with this concept, and seem to have managed to get it to show an IntroView where it turns into the BoardView upon clicking the “Start Game” button, however it is not perfect.  The difficulty I am having now is that the initial view is smaller than the board size so when you switch panels most of the board isn’t viewable and you have to start resizing the window with the mouse, at which point it snaps to the size required to display the entire contents.  To me this isn’t all that user friendly, and thus I would like to figure out a way (if there is one) to auto re-size the window to display the full contents upon displaying the board.  Unfortunately just setting the panel to invisible and then visible doesn’t cut it.  This functionality will be required if I decide to go through with different difficulty options and especially if I do a custom board size option.  This also means that a new UML Diagram, that is program restructuring, is in order.

The Option class is structured as an enumeration, in which O is 0 and S is 1.  I chose to do this in hopes that checking for S-O-S sequences, making comparisons, etc. will be easier.

At the present moment I have some of my classes organized as follows:

Observers:
-BoardView
-ScoreCardView
-UndoView
-WinnerView
Observable:
-Board
-MoveHistory
-OptionsView
-Player
Singelton:
-MoveHistory
-Board
Enumeration:
-Choice
You can leave a response, or trackback from your own site.

Leave a Reply