|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--uci.argo.kernel.Wizard
"Abstract" base class for non-modal wizards. Each subclass should define its own makeNextPanel methods. Because most wizards will not be run to completion, the panels are constructed only as needed. This implies that Wizards should no initialize many instance variables in their constructors.
By convention step 0 is the problem description of the ToDoItem, step 1 is the first panel displayed after the user presses "Next>", and so on. The problem description panel is not stored in this wizard, only the panels that are specific to the wizard are stored. If the user presses "Back>" enough times to get back to the problem description, backPanel should return null. A null panel indicates that problem description should be shown.
Several of the comments in this class refer to "context". Context is the data about this execution of this wizard, for example, valus that the user enters in step 1 is part of the context of later steps, and the ToDoItem with its offenders Set is always context. Most context should be stored in instance variables of Wizard subclasses.
| Field Summary | |
protected boolean |
_finished
True when the wizard has done everything it can. |
protected ToDoItem |
_item
|
protected Vector |
_panels
User interface panels displayed so far. |
protected boolean |
_started
|
protected int |
_step
The current step that the Wizard is on. |
| Constructor Summary | |
Wizard()
Construct a new wizard to help the user repair a design flaw. |
|
| Method Summary | |
void |
back()
|
boolean |
canFinish()
|
boolean |
canGoBack()
|
boolean |
canGoNext()
Return true iff the "Next>" button should be enabled. |
void |
doAction()
|
abstract void |
doAction(int oldStep)
Take action at the completion of a step. |
void |
finish()
|
JPanel |
getCurrentPanel()
Get the panel that should be displayed now. |
abstract int |
getNumSteps()
Get the number of steps in this wizard. |
JPanel |
getPanel(int s)
Get the exising panel at step s. |
int |
getProgress()
An integer between 0 and 100, shows percent done. |
ToDoItem |
getToDoItem()
|
boolean |
isFinsished()
|
boolean |
isStarted()
|
abstract JPanel |
makePanel(int newStep)
Create a new panel for the given step. |
void |
next()
|
void |
redoAction()
|
void |
redoAction(int oldStep)
Redo the action at the completion of a step. |
void |
setToDoItem(ToDoItem item)
|
void |
undoAction()
|
void |
undoAction(int oldStep)
Undo the action done after the given step. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected Vector _panels
protected int _step
protected boolean _finished
protected boolean _started
protected ToDoItem _item
| Constructor Detail |
public Wizard()
| Method Detail |
public void setToDoItem(ToDoItem item)
public ToDoItem getToDoItem()
public int getProgress()
public abstract int getNumSteps()
public JPanel getCurrentPanel()
public JPanel getPanel(int s)
public boolean canGoNext()
public void next()
public boolean canGoBack()
public void back()
public boolean canFinish()
public boolean isStarted()
public boolean isFinsished()
public void finish()
public abstract JPanel makePanel(int newStep)
Needs-More-Work: It might be convient to make a reusable subclass of Wizard that shows all textual steps to guide the user without any automation. Such a Wizard could be easily authored, stored in an XML file, and effiecntly presented by reusing a single panel with a single JTextArea.
public abstract void doAction(int oldStep)
public void doAction()
public void undoAction(int oldStep)
public void undoAction()
public void redoAction(int oldStep)
public void redoAction()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||