org.qdwizard
Class Wizard
- ActionListener, Observer, WindowListener
public abstract class Wizard
extends java.lang.Object
implements ActionListener, WindowListener, Observer
A Wizard dialog displaying one to many screens
- Create a class that extends Wizard. You have to implement getPreviousScreen(), getNextScreen() and finish() abstract methods
- Displaying the wizard:
MyWizard wizard = new MyWizard(String sName,Class initial,
ImageIcon icon,Frame parentWindow,
Locale locale,int iHSize,int iVSize);
wizard.show();
finish() method implements actions to be done at the end of the wizardgetPreviousScreen() and getNextScreen() have to return previous or next screen class. Example:
public Class getNextScreen(Class screen) {
if (ActionSelectionPanel.class.equals(getCurrentScreen())){
String sAction = (String)data.get(KEY_ACTION);
if (ActionSelectionPanel.ACTION_CREATION.equals(sAction)){
return TypeSelectionPanel.class;
}
else if (ActionSelectionPanel.ACTION_DELETE.equals(sAction)){
return RemovePanel.class;
}
}
}
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
|
DEFAULT_H_LAYOUT_PADDING
protected static final int DEFAULT_H_LAYOUT_PADDING
DEFAULT_H_SIZE
protected static final int DEFAULT_H_SIZE
Default Wizard size
DEFAULT_V_LAYOUT_PADDING
protected static final int DEFAULT_V_LAYOUT_PADDING
DEFAULT_V_SIZE
protected static final int DEFAULT_V_SIZE
Object>data
public static HashMapdata
Wizard data
Wizard
public Wizard(String sName,
Class initial,
ImageIcon icon,
Frame parentWindow)
Wizard constructor (uses default locale)
sName
- Wizard name displayed in dialog titleinitial
- Initial screen classicon
- 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
sName
- Wizard name displayed in dialog titleinitial
- Initial screen classicon
- Wizard icon (null if no icon)parentWindow
- wizard parent windowlocale
- Wizard locale
Wizard
public Wizard(String sName,
Class initial,
ImageIcon icon,
Image backgroundImage,
Frame parentWindow)
Wizard constructor (uses default locale)
sName
- Wizard name displayed in dialog titleinitial
- Initial screen classicon
- 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
sName
- Wizard name displayed in dialog titleinitial
- Initial screen classicon
- Wizard icon (null if no icon)backgroundImage
- Wizard header background (null if no image)parentWindow
- wizard parent windowlocale
- Wizard locale
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
getDialog
public JDialog getDialog()
access to the jdialog of the wizard, in case we need it (for instance to
set a glasspane when waiting)
getNextScreen
public abstract Class getNextScreen(Class screen)
getPreviousScreen
public abstract Class getPreviousScreen(Class screen)
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.
- return true if the Wizard should contine to close
setActionsBackgroundColor
public void setActionsBackgroundColor(Color color)
Set the background color of the ActionPanel
setHeaderImage
public void setHeaderImage(Image img)
Set the header image
setProblemBackgroundColor
public void setProblemBackgroundColor(Color color)
Set the background color of the ActionPanel's Problem notification area
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.