org.qdwizard

Class Wizard

Implemented Interfaces:
ActionListener, Observer, WindowListener

public abstract class Wizard
extends java.lang.Object
implements ActionListener, WindowListener, Observer

A Wizard dialog displaying one to many screens
Author:
Bertrand Florat

Field Summary

protected static int
DEFAULT_H_LAYOUT_PADDING
protected static int
DEFAULT_H_SIZE
Default Wizard size
protected static int
DEFAULT_V_LAYOUT_PADDING
protected static int
DEFAULT_V_SIZE
static HashMap
Object>data
Wizard data

Constructor Summary

Wizard(String sName, Class initial, ImageIcon icon, Frame parentWindow)
Wizard constructor (uses default locale)
Wizard(String sName, Class initial, ImageIcon icon, Frame parentWindow, Locale locale)
Wizard constructor
Wizard(String sName, Class initial, ImageIcon icon, Image backgroundImage, Frame parentWindow)
Wizard constructor (uses default locale)
Wizard(String sName, Class initial, ImageIcon icon, Image backgroundImage, Frame parentWindow, Locale locale)
Wizard constructor

Method Summary

void
actionPerformed(ActionEvent ae)
void
clearScreens()
Clear screens history
abstract void
finish()
Finish action.
Class
getCurrentScreen()
Get curent screen
JDialog
getDialog()
access to the jdialog of the wizard, in case we need it (for instance to set a glasspane when waiting)
abstract Class
getNextScreen(Class screen)
abstract Class
getPreviousScreen(Class screen)
boolean
onCancel()
Called when user clicks on "cancel".
void
setActionsBackgroundColor(Color color)
Set the background color of the ActionPanel
void
setHeaderImage(Image img)
Set the header image
void
setProblemBackgroundColor(Color color)
Set the background color of the ActionPanel's Problem notification area
void
show()
void
update(Observable o, Object arg)
@Deprecated
void cancel()
Empty cancel action.
boolean
wasCancelled()
void
windowActivated(WindowEvent windowEvent)
Called when the wizard dialog is activated.
void
windowClosed(WindowEvent windowEvent)
Called when the wizard dialog is closed.
void
windowClosing(WindowEvent windowEvent)
void
windowDeactivated(WindowEvent windowEvent)
Called when the wizard dialog is deactivated.
void
windowDeiconified(WindowEvent windowEvent)
Called when the wizard dialog is deiconified.
void
windowIconified(WindowEvent windowEvent)
Called when the wizard dialog is iconified.
void
windowOpened(WindowEvent windowEvent)
Called when the wizard dialog opens.

Field Details

DEFAULT_H_LAYOUT_PADDING

protected static final int DEFAULT_H_LAYOUT_PADDING
Field Value:
5

DEFAULT_H_SIZE

protected static final int DEFAULT_H_SIZE
Default Wizard size
Field Value:
700

DEFAULT_V_LAYOUT_PADDING

protected static final int DEFAULT_V_LAYOUT_PADDING
Field Value:
5

DEFAULT_V_SIZE

protected static final int DEFAULT_V_SIZE
Field Value:
500

Object>data

public static HashMapdata
Wizard data

Constructor Details

Wizard

public Wizard(String sName,
              Class initial,
              ImageIcon icon,
              Frame parentWindow)
Wizard constructor (uses default locale)
Parameters:
sName - Wizard name displayed in dialog title
initial - Initial screen class
icon - Wizard icon (null if no icon)
parentWindow - wizard parent window

Wizard

public Wizard(String sName,
              Class initial,
              ImageIcon icon,
              Frame parentWindow,
              Locale locale)
Wizard constructor
Parameters:
sName - Wizard name displayed in dialog title
initial - Initial screen class
icon - Wizard icon (null if no icon)
parentWindow - wizard parent window
locale - Wizard locale

Wizard

public Wizard(String sName,
              Class initial,
              ImageIcon icon,
              Image backgroundImage,
              Frame parentWindow)
Wizard constructor (uses default locale)
Parameters:
sName - Wizard name displayed in dialog title
initial - Initial screen class
icon - Wizard icon (null if no icon)
backgroundImage - Wizard header background (null if no image)
parentWindow - wizard parent window

Wizard

public Wizard(String sName,
              Class initial,
              ImageIcon icon,
              Image backgroundImage,
              Frame parentWindow,
              Locale locale)
Wizard constructor
Parameters:
sName - Wizard name displayed in dialog title
initial - Initial screen class
icon - Wizard icon (null if no icon)
backgroundImage - Wizard header background (null if no image)
parentWindow - wizard parent window
locale - Wizard locale

Method Details

actionPerformed

public void actionPerformed(ActionEvent ae)

clearScreens

public void clearScreens()
Clear screens history

finish

public abstract void finish()
Finish action. Called when user clicks on "finish"

getCurrentScreen

public Class getCurrentScreen()
Get curent screen
Returns:
current screen class

getDialog

public JDialog getDialog()
access to the jdialog of the wizard, in case we need it (for instance to set a glasspane when waiting)
Returns:
the wizard dialog

getNextScreen

public abstract Class getNextScreen(Class screen)
Returns:
next screen class

getPreviousScreen

public abstract Class getPreviousScreen(Class screen)
Returns:
previous screen class

onCancel

public boolean onCancel()
Called when user clicks on "cancel". Override it if you want to do something in cancel such as display a confirmation dialog.

Returns:
return true if the Wizard should contine to close

setActionsBackgroundColor

public void setActionsBackgroundColor(Color color)
Set the background color of the ActionPanel
Parameters:
color -

setHeaderImage

public void setHeaderImage(Image img)
Set the header image
Parameters:
img -

setProblemBackgroundColor

public void setProblemBackgroundColor(Color color)
Set the background color of the ActionPanel's Problem notification area
Parameters:
color -

show

public void show()

update

public void update(Observable o,
                   Object arg)

void cancel

public @Deprecated void cancel()
Empty cancel action. Called when user clicks on "cancel". Override it if you want to do something in cancel. Deprecated: use onCancel()

wasCancelled

public boolean wasCancelled()

windowActivated

public void windowActivated(WindowEvent windowEvent)
Called when the wizard dialog is activated. Override it if you want notification of this event.

windowClosed

public void windowClosed(WindowEvent windowEvent)
Called when the wizard dialog is closed. Override it if you want notification of this event.

caution: You must always call super.windowClosed(windowEvent) within the override function to ensure that the Wizard closes completely.


windowClosing

public void windowClosing(WindowEvent windowEvent)

windowDeactivated

public void windowDeactivated(WindowEvent windowEvent)
Called when the wizard dialog is deactivated. Override it if you want notification of this event.

windowDeiconified

public void windowDeiconified(WindowEvent windowEvent)
Called when the wizard dialog is deiconified. Override it if you want notification of this event.

windowIconified

public void windowIconified(WindowEvent windowEvent)
Called when the wizard dialog is iconified. Override it if you want notification of this event.

windowOpened

public void windowOpened(WindowEvent windowEvent)
Called when the wizard dialog opens. Override it if you want notification of this event.