|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.argouml.kernel.Wizard
org.argouml.uml.cognitive.critics.WizAssocComposite
A non-modal wizard to assist the user in changing aggregation of an association.
Earlier version always imposed composite aggregation. This version allows the user to choose.
Note. This only applies to binary associations. A separate wizard is needed for 3-way (or more) associations.
Field Summary | |
private java.lang.String |
_instructions
The initial instructions on the Step 1 screen. |
private WizStepChoice |
_step1Choice
Contains the WizStepChoice that is used to get the user's
desired options. |
private java.lang.Object |
_triggerAsc
The MAssociation WizStepChoice that triggered the
critic. |
protected static org.apache.log4j.Logger |
cat
Deprecated. by Linus Tolke as of 0.15.4. Use your own logger in your class. This will be removed. |
Fields inherited from class org.argouml.kernel.Wizard |
_finished, _item, _panels, _started, _step |
Constructor Summary | |
WizAssocComposite()
Constructor for the wizard. |
Method Summary | |
private java.util.Vector |
_buildOptions()
Returns a vector of options to be used in creating a WizStepChoice that will exercise the options. |
private java.lang.Object |
_getTriggerAsc()
Tries to identify the MAssociation that
triggered the critic. |
boolean |
canFinish()
Determine if we have sufficient information to finish. |
void |
doAction(int oldStep)
Take action at the completion of a step. |
int |
getNumSteps()
Returns the number of steps in this wizard. |
javax.swing.JPanel |
makePanel(int newStep)
Create a JPanel for the given step. |
void |
setInstructions(java.lang.String s)
Set the initial instruction string for the choice. |
Methods inherited from class org.argouml.kernel.Wizard |
back, canGoBack, canGoNext, doAction, finish, getCurrentPanel, getPanel, getProgress, getToDoItem, isFinished, isStarted, next, setToDoItem, undoAction, undoAction |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.apache.log4j.Logger cat
private java.lang.String _instructions
setInstructions(java.lang.String)
method.
private WizStepChoice _step1Choice
WizStepChoice
that is used to get the user's
desired options. Not created until we get to that step.
private java.lang.Object _triggerAsc
MAssociation
WizStepChoice
that triggered the
critic. Null until set when it is first needed.
Constructor Detail |
public WizAssocComposite()
Method Detail |
public int getNumSteps()
getNumSteps
in class Wizard
Wizard
private java.lang.Object _getTriggerAsc()
MAssociation
that
triggered the critic.
The first time it is called, it will initialise the trigger
from the ToDoItem. If there, it is assumed to be the first
trigger of the ToDoItem and to be an association. If found, the
value is stored in the private field _triggerAsc
.
On all subsequent calls, if a non-null value is found in _triggerAsc
that is returned.
MAssociation
that triggered the critic, or null
if there was none.private java.util.Vector _buildOptions()
WizStepChoice
that will exercise the options.We provide five options, shared aggregation in each direction, composite aggregation in each direction and no aggregation at all.
It is possible that a very malicious user could delete the triggering association just before we get to this point. For now we don't bother to trap this. It will raise an exception, and then everything will carry on happily.
Vector
of the options or null
if the
association that triggered the critic is no longer there.public void setInstructions(java.lang.String s)
public javax.swing.JPanel makePanel(int newStep)
JPanel
for the given step.
We use a WizStepChoice
to handle the choice selection
for the user. We only create the panel once, saving it in a
private field (_step1Choice
) for subsequent
use.
Note. If the association has been deleted, then we may not be able to create a vector of options. Under these circumstances we also return null.
makePanel
in class Wizard
newStep
- The index of the step for which a panel is needed.
JPanel
or null
if no
options were available.Wizard
public void doAction(int oldStep)
The guideline for ArgoUML non-modal wizards is to act immediately, not wait for the finish. This method may also be invoked when finish is triggered for any steps whose panels didn't get created.
The observation is that this seems to be trigged when there is any change on the panel (e.g choosing an option), not just when "next" is pressed. Coded accordingly
We allow for the association that caused the problem having by now been deleted, and hence an exception may be raised. We catch this politely.
doAction
in class Wizard
oldStep
- The index of the step just completed (0 for the first
information panel)Wizard
public boolean canFinish()
We can't finish if our parent Wizard
can't finish.
We can finish if we're on step 0.
We can finish if we're on step 1 and have made a choice.
canFinish
in class Wizard
true
if we can finish, otherwise
false
.Wizard
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20040316) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |