Analytical Perspectives in Game Design
Selection dialog scenario
Home ] Up ] Chain of command ] Construct scenario ] Displaying a game to join ] Instantiating new parts of the game ] loading a game ] [ Selection dialog scenario ] Starting a game ]


 

This section describes the scenarios relating to the selection dialog.

There are the following components to this scenario:

  1. initialisation
  2. item selection
  3. OK_Button Pressed
  4. ADD_Button Pressed
  5. REMOVE_Button Pressed
  6. CANCEL_Button Pressed

See also: selection dialog object model

ADD_Button Pressed

The user pressed the add button. This triggers another dialog to be created that guides the user through the adding process. This process updates the list (If the user so desires) and returns to the original selection dialog.

Preconditions:

The selection dialogue is the window on top and the user has just pressed the ADD button.

Actors:

  1. Mouse Event - Add Button Pressed. The event created by JAVA to indicate that the add button has been pressed.
  2. Selection Dialog. The selection dialogue containing the pressed button and receiving the Add Button Pressed mouse event.
  3. Add dialogue - some generic interface to an add dialogue.
  4. Mouse Event - OK Button Pressed
  5. Mouse Event - CANCEL Button Pressed

Postconditions:

If the user selected OK function from the add dialogue, the list is updates and the item selected is the default.

If the user selected the cancel function from the add dialogue, the list remains unchanged.

Step
1 Selection Dialog receives Mouse event - ADD Button Pressed
2 Selection Dialog fires ADD Button Pressed Event to Add Button Listeners
3 Add Dialog receives ADD Button Pressed Event
4a Add Dialog receives Mouse event - OK Button Pressed
4b Add Dialog validates user input
4c Add Dialog adds new input to Selection Dialog List
4d Add Dialog hides itself
5a Add Dialog receives Mouse event - CANCEL button pressed
5b Add Dialog hides itself

CANCEL_Button Pressed

The user presses the cancel button. All changes are discarded and the window closed.

Preconditions:

The selection dialog is on top and the user has just pressed the cancel button.

Actors:

  1. Selection dialog - The selection dialogue containing the pressed button and receiving the Add Button Pressed mouse event.
  2. Mouse Event - Cancel Button Pressed. The event created by JAVA to indicate that the add button has been pressed.

Postconditions:

None.

Step
1 Selection Dialog receives Mouse Event - Cancel Button Pressed
2 Selection Dialog hides itself

Item selection

The user selects an item. It is made the selected item and the details are shown in the properties sections of the window.

Preconditions:

The selection dialog is on top and the user has just clicked in the scrolling list.

Actors:

  1. Selection dialog - The selection dialogue containing the pressed button and receiving the Add Button Pressed mouse event.
  2. Mouse Event - List item selected.

Postconditions:

The new item in the list is selected, the properties shown in the grid section of the window are updated.

Step
1 Selection Dialog receives Mouse Event - List item selected
2 Selection Dialog saves current list item
3 Selection Dialog hilights new list item
4 Selection Dialog updates bound objects (Edit items)

Initialisation

This scenario describes the process undertaken when any driver is initialising the selection dialogue.

Preconditions:

  1. none

Actors:

  1. Generic Driver Object the object setting up and configuring the selection dialogue.
  2. Selection Dialogue, the selection dialogue being created and operated.
  3. Defaultable Vector Set is the object that contains the data in the list to be displayed.

Post conditions:

If the list contains one or no items, then the remove button is disabled.

The window has been initialised and the user can perform one of the following actions:

  1. item selection
  2. OK_Button Pressed
  3. ADD_Button Pressed
  4. REMOVE_Button Pressed
  5. CANCEL_Button Pressed
Step
1 Driver new Selection Dialog
2a Driver set OK_Button text on Selection Dialog
2b Driver set ADD_Button text on Selection Dialog
2c Driver set REMOVE_Button text on Selection Dialog
2d Driver set CANCEL_Button text on Selection Dialog
2e Driver set window title on Selection Dialog
2f1 Driver add edit items
2f2 Driver add edit item text fields
2f3 Driver add itteratively items to the list
2g1 Driver new Add Dialogue
2g2 Driver add Add Dialog as Listener Selection Dialog
3 Driver show Selection Dialog

OK_Button Pressed

The user presses the OK button. The system hides the selection dialogue and fires 2 general events. One is to ensure that the list is updated. The other is that the OK button has been pressed. It is the responsibility of the generic driver object to save the list and process the OK event.

Preconditions:

The selection dialogue is on top and the user has just pressed the OK button.

Actors:

  1. Selection dialogue - the selection dialogue containing the pressed button and the OK button pressed event.
  2. Mouse Event - OK Button Pressed. The event created by JAVA to indicate that the OK button was just pressed.
  3. Generic Driver Object - the object registered to hear general event as fired by the Selection dialogue.

Postconditions:

  1. The selection dialogue is hidden.
Step
1 Selection Dialog receives Mouse Event - OK Button Pressed
2 Selection Dialog hides itself
3 Selection Dialog fires a general event - save list to Listeners
3a Generic Driver Object receives and processes the general event - save list
4 Selection Dialog fires a general event - OK Button Pressed to Listeners
4a Generic Driver Object receives and processes the general event - OK Button Pressed

REMOVE_Button Pressed

The user presses the remove button. The current item is removed from the list. If the current item is not the top item, then the preceding item is made the current item. Otherwise the next item is made the current item. If the list only contains one item, the remove button is disabled.

Preconditions:

The selection dialogue is on top and the user has just pressed the Remove button.

Actors:

  1. Selection dialogue - the selection dialogue containing the pressed button and the REMOVE button pressed event.
  2. Mouse Event - REMOVE Button Pressed. The event created by JAVA to indicate that the REMOVE button was just pressed.

Postconditions:

  1. Item is remove from the list.
  2. If the current item is not the top item, then the preceding item is made the current item. Otherwise the next item is made the current item.
  3. If the list only contains one item, the remove button is disabled.
Step
1 Selection Dialog receives Mouse Event - REMOVE Button Pressed
2 Selection Dialog removes old list item
3 Selection Dialog select new list item
 

22/11/99

 


See also: [Role Playing Games] [Game Engine]
© 1998, 1999 Brian Yap. These pages are available under the GNU licence.