com.bws42.wizard
Class Wizard

java.lang.Object
  extended bycom.bws42.wizard.Wizard
All Implemented Interfaces:
ActionListener, EventListener

public class Wizard
extends Object
implements ActionListener

Central class of the Wizard. It is responsible for displaying and changing the panels that are visible to the user by listening for clicks on the next and previous buttons. It defaults to a 400x400 frame unless specified otherwise.

Version:
1.0, October 4, 2006
Author:
William P. Roberts, IV

Field Summary
static int DEFAULT_HEIGHT
          Holds the default wizard height.
static int DEFAULT_WIDTH
          Holds the default wizard width.
 
Constructor Summary
Wizard(Locale language)
          Creates a new Wizard in the given language if available.
 
Method Summary
 void actionPerformed(ActionEvent evt)
          Listens for clicks on the next/previous buttons and acts accordingly.
 void displayWizard()
          Creates and displays the wizard.
 void displayWizard(WizardObject obj)
          Creates and displays the wizard using the info stored in the WizardObject.
 JFrame getFrame()
          Returns a pointer to the JFrame of the wizard.
 JButton getNextButton()
          Returns a pointer to the next button.
 JButton getPrevButton()
          Returns a pointer to the previous button.
 void setLanguage(Locale locale)
          Changes the language of the Wizard to the language of the given locale if available.
 void setWizardFactory(WizardFactory factory)
          Sets the WizardFactory for the Wizard.
 void setWizardSize(int width, int height)
          Sets the size of the wizard window.
 void setWizardTitle(String title)
          Sets the title of the wizard window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WIDTH

public static final int DEFAULT_WIDTH
Holds the default wizard width.

See Also:
Constant Field Values

DEFAULT_HEIGHT

public static final int DEFAULT_HEIGHT
Holds the default wizard height.

See Also:
Constant Field Values
Constructor Detail

Wizard

public Wizard(Locale language)
Creates a new Wizard in the given language if available.

Parameters:
language - the locale for the desired language.
Method Detail

setWizardTitle

public final void setWizardTitle(String title)
Sets the title of the wizard window.

Parameters:
title - the title of the wizard window

setWizardSize

public final void setWizardSize(int width,
                                int height)
Sets the size of the wizard window.

Parameters:
width - the desired width
height - the desired height

setWizardFactory

public final void setWizardFactory(WizardFactory factory)
Sets the WizardFactory for the Wizard.

Parameters:
factory - the WizardFactory for this wizard

getNextButton

public final JButton getNextButton()
Returns a pointer to the next button.

Returns:
a pointer to the next button.

getPrevButton

public final JButton getPrevButton()
Returns a pointer to the previous button.

Returns:
a pointer to the previous button.

getFrame

public final JFrame getFrame()
Returns a pointer to the JFrame of the wizard.

Returns:
a pointer to the JFrame of the wizard.

displayWizard

public final void displayWizard()
Creates and displays the wizard.


displayWizard

public final void displayWizard(WizardObject obj)
                         throws WizardException
Creates and displays the wizard using the info stored in the WizardObject.

Parameters:
obj - the WizardObject with the information needed to create the Wizard.
Throws:
WizardException - if the information is not satisfactory.

setLanguage

public final void setLanguage(Locale locale)
Changes the language of the Wizard to the language of the given locale if available.

Parameters:
locale - the new locale

actionPerformed

public final void actionPerformed(ActionEvent evt)
Listens for clicks on the next/previous buttons and acts accordingly.

Specified by:
actionPerformed in interface ActionListener
Parameters:
evt - the action event