This section describes the scenarios relating to the selection dialog.
There are the following components to this scenario:
- initialisation
- item selection
- OK_Button Pressed
- ADD_Button Pressed
- REMOVE_Button Pressed
- CANCEL_Button Pressed
See also: selection dialog object
model
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:
- Mouse Event - Add Button Pressed. The event created by JAVA to indicate that the add
button has been pressed.
- Selection Dialog. The selection dialogue containing the pressed button and receiving the
Add Button Pressed mouse event.
- Add dialogue - some generic interface to an add dialogue.
- Mouse Event - OK Button Pressed
- 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 |
|
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:
- Selection dialog - The selection dialogue containing the pressed button and receiving
the Add Button Pressed mouse event.
- 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 |
|
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:
- Selection dialog - The selection dialogue containing the pressed button and receiving
the Add Button Pressed mouse event.
- 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) |
|
This scenario describes the process undertaken when any driver is initialising the
selection dialogue.
Preconditions:
- none
Actors:
- Generic Driver Object the object setting up and configuring the selection dialogue.
- Selection Dialogue, the selection dialogue being created and operated.
- 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:
- item selection
- OK_Button Pressed
- ADD_Button Pressed
- REMOVE_Button Pressed
- 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 |
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:
- Selection dialogue - the selection dialogue containing the pressed button and the OK
button pressed event.
- Mouse Event - OK Button Pressed. The event created by JAVA to indicate that the OK
button was just pressed.
- Generic Driver Object - the object registered to hear general event as fired by the
Selection dialogue.
Postconditions:
- 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 |
|
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:
- Selection dialogue - the selection dialogue containing the pressed button and the REMOVE
button pressed event.
- Mouse Event - REMOVE Button Pressed. The event created by JAVA to indicate that the
REMOVE button was just pressed.
Postconditions:
- Item is remove 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.
Step |
1 |
Selection Dialog |
receives |
|
|
Mouse Event - REMOVE Button Pressed |
|
2 |
Selection Dialog |
removes |
|
old |
list item |
|
3 |
Selection Dialog |
select |
|
new |
list item |
|
|