|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.argouml.cognitive.ui.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 not 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 the 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, values 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 | |
private boolean |
finished
True when the wizard has done everything it can. |
private WizardItem |
item
|
private Vector |
panels
User interface panels displayed so far. |
private boolean |
started
|
private 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()
Step back. |
boolean |
canFinish()
|
boolean |
canGoBack()
|
boolean |
canGoNext()
Return true iff the "Next>" button should be enabled. |
void |
doAction()
Do the action of this wizard. |
abstract void |
doAction(int oldStep)
Take action at the completion of a step. |
void |
finish()
Finish the wizard. |
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. |
protected int |
getStep()
|
WizardItem |
getToDoItem()
|
boolean |
isFinished()
|
boolean |
isStarted()
|
abstract JPanel |
makePanel(int newStep)
Create a new panel for the given step. |
void |
next()
The next step of the wizard. |
protected void |
removePanel(int s)
|
void |
setToDoItem(WizardItem i)
Setter for the todoitem. |
void |
undoAction()
Undo the action. |
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 |
private Vector panels
private int step
private boolean finished
private boolean started
private WizardItem item
Constructor Detail |
public Wizard()
Method Detail |
protected void removePanel(int s)
s
- the step number of the panel to be removedpublic void setToDoItem(WizardItem i)
i
- the todoitempublic WizardItem getToDoItem()
public int getProgress()
public abstract int getNumSteps()
public JPanel getCurrentPanel()
public JPanel getPanel(int s)
s
- the step
public boolean canGoNext()
true
iff the "Next>" button should be enabled.public void next()
public boolean canGoBack()
public void back()
public boolean canFinish()
public boolean isStarted()
public boolean isFinished()
public void finish()
public abstract JPanel makePanel(int newStep)
TODO: 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 efficiently presented by reusing a single panel with a single JTextArea.
newStep
- the number of the step to make a panel for.
public abstract void doAction(int oldStep)
oldStep
- the given steppublic void doAction()
public void undoAction(int oldStep)
oldStep
- the given steppublic void undoAction()
protected int getStep()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |