allensoft.gui
Class Wizard

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--allensoft.gui.EscapeDialog
                                      |
                                      +--allensoft.gui.Wizard
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
Direct Known Subclasses:
BugReportWizard

public class Wizard
extends EscapeDialog

A Wizard is a dialog that guides the user through a series of steps they must perform to accomplish a task. Each step is represented by a page. When the user has finished with a page they can use the "Next" button to advance to the next page. Once all pages have been completed they can click on the finish button to complete the wizard process.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Inner classes inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Wizard(java.awt.Frame owner)
           
Wizard(java.awt.Frame owner, boolean modal)
           
Wizard(java.awt.Frame owner, java.lang.String title)
           
Wizard(java.awt.Frame owner, java.lang.String title, boolean modal)
          Creates a new wizard dialog with no pages.
Wizard(java.lang.String title)
           
 
Method Summary
 void addPage(WizardPage page)
          Adds a new page to the end of this wizard.
 void addPage(WizardPage page, int index)
          Inserts a new page at the specified position in this wizard.
 void addPages(WizardPage[] pages, int index)
           
 void cancel()
           
protected  javax.swing.JPanel createButtonPanel()
          Creates the panel of buttons that appear at the bottom of the wizard.
protected  javax.swing.JButton createCancelButton()
           
protected  javax.swing.JButton createFinishButton()
           
protected  javax.swing.JButton createNextButton()
           
protected  javax.swing.JButton createPreviousButton()
           
 void finish()
          Finishes this wizard.
 java.lang.String getCancelText(java.lang.String s)
          Gets the text displayed in the cancel button.
 WizardPage getCurrentPage()
          Gets the currently displayed page in this wizard.
 int getCurrentPageIndex()
          Gets the index of the currently displayed page in this wizard.
 java.lang.String getFinishText()
          Gets the text displayed in the finish button.
 javax.swing.Icon getImage()
          Gets the image that is displayed to the left of the wizard.
 java.lang.String getNextText()
          Gets the text displayed in the next button.
 WizardPage getPage(int index)
          Gets the page specified by the supplied index for this wizard.
 int getPageCount()
          Gets the number of pages in this wizard.
 java.lang.String getPreviousText()
          Gets the text displayed in the previous button.
static javax.swing.Icon getWizardImage()
           
 boolean nextPage()
          Advances to the next page.
protected  boolean onFinish()
           
 void previousPage()
          Goes back to the previous page.
 void setCancelText(java.lang.String s)
          Sets the text displayed in the cancel button.
 void setFinishText(java.lang.String s)
          Sets the text displayed in the finish button.
 void setImage(javax.swing.Icon image)
          Sets the image that is displayed to the left of the wizard.
 void setNextText(java.lang.String s)
          Sets the text displayed in the next button.
 void setPreviousText(java.lang.String s)
          Sets the text displayed in the previous button.
 boolean wasFinished()
          Checks if the dialog finished successfully or if the user canceled.
 
Methods inherited from class allensoft.gui.EscapeDialog
createRootPane, escapePressed
 
Methods inherited from class javax.swing.JDialog
addImpl, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle, show
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, removeWindowListener, setCursor, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Wizard

public Wizard(java.awt.Frame owner,
              java.lang.String title,
              boolean modal)
Creates a new wizard dialog with no pages.

Wizard

public Wizard(java.awt.Frame owner,
              java.lang.String title)

Wizard

public Wizard(java.awt.Frame owner,
              boolean modal)

Wizard

public Wizard(java.lang.String title)

Wizard

public Wizard(java.awt.Frame owner)
Method Detail

wasFinished

public boolean wasFinished()
Checks if the dialog finished successfully or if the user canceled.
Returns:
true if the user clicked the finish button or false if they clicked the cancel button.

getFinishText

public java.lang.String getFinishText()
Gets the text displayed in the finish button.

setFinishText

public void setFinishText(java.lang.String s)
Sets the text displayed in the finish button.

getNextText

public java.lang.String getNextText()
Gets the text displayed in the next button.

setNextText

public void setNextText(java.lang.String s)
Sets the text displayed in the next button.

getPreviousText

public java.lang.String getPreviousText()
Gets the text displayed in the previous button.

setPreviousText

public void setPreviousText(java.lang.String s)
Sets the text displayed in the previous button.

getCancelText

public java.lang.String getCancelText(java.lang.String s)
Gets the text displayed in the cancel button.

setCancelText

public void setCancelText(java.lang.String s)
Sets the text displayed in the cancel button.

getImage

public javax.swing.Icon getImage()
Gets the image that is displayed to the left of the wizard.

setImage

public void setImage(javax.swing.Icon image)
Sets the image that is displayed to the left of the wizard.

getPageCount

public int getPageCount()
Gets the number of pages in this wizard.

getPage

public WizardPage getPage(int index)
Gets the page specified by the supplied index for this wizard.

addPage

public void addPage(WizardPage page)
Adds a new page to the end of this wizard.

addPage

public void addPage(WizardPage page,
                    int index)
Inserts a new page at the specified position in this wizard.

addPages

public void addPages(WizardPage[] pages,
                     int index)

getCurrentPage

public WizardPage getCurrentPage()
Gets the currently displayed page in this wizard.

getCurrentPageIndex

public int getCurrentPageIndex()
Gets the index of the currently displayed page in this wizard.

nextPage

public boolean nextPage()
Advances to the next page.

previousPage

public void previousPage()
Goes back to the previous page.

cancel

public void cancel()

finish

public void finish()
Finishes this wizard. The current page is checked for validity and then the wizard is hidden.

onFinish

protected boolean onFinish()

getWizardImage

public static javax.swing.Icon getWizardImage()

createButtonPanel

protected javax.swing.JPanel createButtonPanel()
Creates the panel of buttons that appear at the bottom of the wizard.

createNextButton

protected javax.swing.JButton createNextButton()

createPreviousButton

protected javax.swing.JButton createPreviousButton()

createFinishButton

protected javax.swing.JButton createFinishButton()

createCancelButton

protected javax.swing.JButton createCancelButton()