org.argouml.uml.cognitive.critics
Class WizOperName

java.lang.Object
  extended byorg.argouml.cognitive.ui.Wizard
      extended byorg.argouml.uml.cognitive.critics.UMLWizard
          extended byorg.argouml.uml.cognitive.critics.WizMEName
              extended byorg.argouml.uml.cognitive.critics.WizOperName
All Implemented Interfaces:
Serializable

public class WizOperName
extends WizMEName

A wizard to help the user change the name of an operation to a better name. Same as WizMEName expect that it handles the special case where the operation instead should be made a constructor of the class. This is helpful in languages where constructors have names that do not agree with the convention for method names (i.e. Java).

Path looks like this for the case when it is not supposed to be a constructor:


  step0 -> step1

 
Path looks like this for the case when it is supposed to be a constructor:

  step0 -> step1 -> step2 (OK! in the case converted to constructor)
                 -> step2 (same as step1 in the scenario above)

 

See Also:
Serialized Form

Field Summary
private static Logger LOG
           
private  Object oldStereotype
           
private  boolean oldStereotypeIsSet
           
private  String option0
           
private  String option1
           
private  boolean possibleConstructor
           
private  WizStepChoice step1
           
private  WizStepCue step2
           
private  boolean stereotypePathChosen
           
 
Fields inherited from class org.argouml.uml.cognitive.critics.WizMEName
 
Fields inherited from class org.argouml.uml.cognitive.critics.UMLWizard
 
Fields inherited from class org.argouml.cognitive.ui.Wizard
 
Constructor Summary
WizOperName()
           
 
Method Summary
 void doAction(int oldStep)
          Take action at the completion of a step.
private static Object findNamespace(Object phantomNS, Object targetModel)
           
 int getNumSteps()
          Preset the number of steps to 1.
private  Vector getOptions()
           
 JPanel makePanel(int newStep)
          Create a new panel for the given step.
 void setPossibleConstructor(boolean b)
          Method to tell the Wizard what path it should work with.
 void undoAction(int origStep)
          There is a possibility that the next step forward takes another path in this wizard.
 
Methods inherited from class org.argouml.uml.cognitive.critics.WizMEName
canGoNext, getInstructions, setInstructions, setMustEdit, setSuggestion
 
Methods inherited from class org.argouml.uml.cognitive.critics.UMLWizard
getModelElement, getSuggestion, offerSuggestion
 
Methods inherited from class org.argouml.cognitive.ui.Wizard
back, canFinish, canGoBack, doAction, finish, getCurrentPanel, getPanel, getProgress, getStep, getToDoItem, isFinished, isStarted, next, removePanel, setToDoItem, undoAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG

possibleConstructor

private boolean possibleConstructor

stereotypePathChosen

private boolean stereotypePathChosen

option0

private String option0

option1

private String option1

step1

private WizStepChoice step1

step2

private WizStepCue step2

oldStereotype

private Object oldStereotype

oldStereotypeIsSet

private boolean oldStereotypeIsSet
Constructor Detail

WizOperName

public WizOperName()
Method Detail

getNumSteps

public int getNumSteps()
Description copied from class: UMLWizard
Preset the number of steps to 1. You need to override this method, in case your Wizard requires a different number of steps. This method is a convenience implementation.

Overrides:
getNumSteps in class UMLWizard
See Also:
Wizard.getNumSteps()

getOptions

private Vector getOptions()

setPossibleConstructor

public void setPossibleConstructor(boolean b)
Method to tell the Wizard what path it should work with.

Parameters:
b - setToConstructor is true if we shall take the path where the oper is converted to a constructor.

makePanel

public JPanel makePanel(int newStep)
Description copied from class: WizMEName
Create a new panel for the given step.

Overrides:
makePanel in class WizMEName
See Also:
Create a new panel for the given step.

undoAction

public void undoAction(int origStep)
There is a possibility that the next step forward takes another path in this wizard. To allow for this we must destroy the path already traveled by. TODO: I (Linus) would say that this is really a problem with the Wizard implementation since I believe it should be possible to explore a path in the wizard and then go back.

Overrides:
undoAction in class Wizard
Parameters:
origStep - the given step
See Also:
Wizard.undoAction(int)

doAction

public void doAction(int oldStep)
Take action at the completion of a step. For example, when the given step is 0, do nothing; and when the given step is 1, do the first action. Argo non-modal wizards should take action as they do along, as soon as possible, they should not wait until the final step.

Overrides:
doAction in class WizMEName
See Also:
Wizard.doAction(int)

findNamespace

private static Object findNamespace(Object phantomNS,
                                    Object targetModel)


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook