com.japisoft.framework.wizard
Class JWizard

java.lang.Object
  extended bycom.japisoft.framework.wizard.JWizard

public class JWizard
extends java.lang.Object

Main component managing a wizard. All wizard step are stored inside the WizardStepModel. Each step implements the WizardStep interface for controlling the wizard part behavior and look.

UIManager properties : - com.japisoft.jwizard.labelbg : Background color for the label steps - com.japisoft.jwizard.image : Image for the label steps

Key for the JWizard.properties resource bundle : - STEPS : Steps title - STEP : Step title - PREVIOUS : Previous button title - NEXT : Next button title - OK : Ok button title - CANCEL : Cancel button title

Author:
(c) 2005 JAPISOFT - http://www.japisoft.com

Field Summary
static int CANCEL_ACTION
           
static int OK_ACTION
           
 
Constructor Summary
JWizard()
           
 
Method Summary
 void addWizardListener(WizardListener listener)
          Add a listener for the start / stop wizard step
 void dispose()
          Free all inner resource, it must be called for helping the garbage collector to do the best job.
 javax.swing.Icon getImage()
           
protected  java.lang.String getLabel(java.lang.String name, java.lang.String defaultValue)
           
 java.awt.Dimension getLabelsPreferredSize()
           
 java.awt.Color getStepLabelsBackground()
           
 WizardView getView()
           
 java.awt.Dimension getViewPreferredSize()
           
 WizardStepContext getWizardContext()
          This method is useful to get all the sharedData from each Wizard step
 WizardStepModel getWizardStepModel()
           
 boolean isNumberedStep()
           
 boolean isWizardStepTitle()
           
 void removeWizardListener(WizardListener listener)
          Remove a listener for the start / stop wizard step
 void setImage(javax.swing.Icon image)
          Set a background image for the wizard steps
 void setLabelsPreferredSize(java.awt.Dimension dim)
          Set the preferred size for the left labels with the current wizard step
 void setNumberedStep(boolean numberedStep)
           
 void setStepLabelsBackground(java.awt.Color color)
           
 void setView(WizardView view)
          Reset the default WizardView by this one
 void setViewPreferredSize(java.awt.Dimension dim)
          Force a default dimension for the wizard step view
 void setWizardStepModel(WizardStepModel model)
          Reset the model containing a set of wizard step
 void setWizardStepTitle(boolean wizardStepLabel)
          Show a title for the wizard step.
 int show(java.awt.Dialog owner, java.lang.String title)
          A new dialog will be created including the wizard
 int show(java.awt.Frame owner, java.lang.String title)
          A new dialog will be created including the wizard
 int show(javax.swing.JDialog dialog, boolean preparedDialog)
          No new dialog will be created.
 int show(java.lang.String title)
          A new dialog will be created including the wizard
protected  void startWizard(WizardStep step)
          Start a particular wizard step, this is called by default for the first one
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK_ACTION

public static int OK_ACTION

CANCEL_ACTION

public static int CANCEL_ACTION
Constructor Detail

JWizard

public JWizard()
Method Detail

setWizardStepModel

public void setWizardStepModel(WizardStepModel model)
Reset the model containing a set of wizard step


getWizardStepModel

public WizardStepModel getWizardStepModel()
Returns:
a model containing a set of wizard step. This method will never return null

setView

public void setView(WizardView view)
Reset the default WizardView by this one


getView

public WizardView getView()
Returns:
the user interface part. This method will never return null

setImage

public void setImage(javax.swing.Icon image)
Set a background image for the wizard steps


getImage

public javax.swing.Icon getImage()
Returns:
a background image for the wizard steps

isNumberedStep

public boolean isNumberedStep()
Returns:
true if each step is numbered. By default true

setNumberedStep

public void setNumberedStep(boolean numberedStep)
Parameters:
numberedStep - Decide to show a number for each wizard step

setWizardStepTitle

public void setWizardStepTitle(boolean wizardStepLabel)
Show a title for the wizard step. By default true


isWizardStepTitle

public boolean isWizardStepTitle()
Returns:
true if the wizard step has a major title

getLabel

protected java.lang.String getLabel(java.lang.String name,
                                    java.lang.String defaultValue)
Returns:
a label for the view part. It used a resource bundle called Bundle.properties in the same package

startWizard

protected void startWizard(WizardStep step)
Start a particular wizard step, this is called by default for the first one


show

public int show(java.awt.Frame owner,
                java.lang.String title)
A new dialog will be created including the wizard

Parameters:
owner - The dialog parent owner
title - Title of the dialog
Returns:
The state of the wizard OK_ACTION or CANCEL_ACTION

show

public int show(java.awt.Dialog owner,
                java.lang.String title)
A new dialog will be created including the wizard

Parameters:
owner - The dialog parent owner
title - Title of the dialog
Returns:
The state of the wizard OK_ACTION or CANCEL_ACTION

show

public int show(java.lang.String title)
A new dialog will be created including the wizard

Parameters:
title - Title of the dialog
Returns:
The state of the wizard OK_ACTION or CANCEL_ACTION

show

public int show(javax.swing.JDialog dialog,
                boolean preparedDialog)
No new dialog will be created. This is the dialog from the first parameter that will be shown

Parameters:
dialog - A dialog that will contain the Wizard
preparedDialog - Decide to include the wizard view automatically
Returns:
The state of the wizard OK_ACTION or CANCEL_ACTION

setViewPreferredSize

public void setViewPreferredSize(java.awt.Dimension dim)
Force a default dimension for the wizard step view


getViewPreferredSize

public java.awt.Dimension getViewPreferredSize()
Returns:
a default dimension for the wizard step view

setLabelsPreferredSize

public void setLabelsPreferredSize(java.awt.Dimension dim)
Set the preferred size for the left labels with the current wizard step


getLabelsPreferredSize

public java.awt.Dimension getLabelsPreferredSize()
Returns:
the preferredSize for the left labels

getStepLabelsBackground

public java.awt.Color getStepLabelsBackground()
Returns:
the color background for the left labels

setStepLabelsBackground

public void setStepLabelsBackground(java.awt.Color color)
Returns:
a color background for the left labels. By default WHITE

getWizardContext

public WizardStepContext getWizardContext()
This method is useful to get all the sharedData from each Wizard step

Returns:
the current wizard context

dispose

public void dispose()
Free all inner resource, it must be called for helping the garbage collector to do the best job. Note that you mustn't reuse your wizard instance after calling this method !


addWizardListener

public void addWizardListener(WizardListener listener)
Add a listener for the start / stop wizard step


removeWizardListener

public void removeWizardListener(WizardListener listener)
Remove a listener for the start / stop wizard step