Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

allensoft.gui
Class Wizard  view Wizard download Wizard.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
                  extended byjavax.swing.JDialog
                      extended byallensoft.gui.EscapeDialog
                          extended byallensoft.gui.Wizard
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

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.


Nested Class Summary
 
Nested classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Nested classes inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private static java.util.ResourceBundle g_Resources
           
private static javax.swing.Icon g_WizardImage
           
private  boolean m_bFinished
           
private  javax.swing.JButton m_CancelButton
           
private  WizardPage m_CurrentPage
           
private  javax.swing.JButton m_FinishButton
           
private  javax.swing.JLabel m_ImageLabel
           
private  CardPanel m_MainPanel
           
private  javax.swing.JButton m_NextButton
           
private  javax.swing.JButton m_PreviousButton
           
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
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, EXIT_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.
private  boolean setCurrentPage(int index, boolean bValidate)
           
private  boolean setCurrentPage(WizardPage page, boolean bValidate)
          Sets the currently displayed page for this wizard.
 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.
private  void updateButtons()
          Updates the status of the buttons.
 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, getPreferredSize, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getGraphicsConfiguration, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_MainPanel

private CardPanel m_MainPanel

m_ImageLabel

private javax.swing.JLabel m_ImageLabel

m_CurrentPage

private WizardPage m_CurrentPage

m_NextButton

private javax.swing.JButton m_NextButton

m_PreviousButton

private javax.swing.JButton m_PreviousButton

m_FinishButton

private javax.swing.JButton m_FinishButton

m_CancelButton

private javax.swing.JButton m_CancelButton

m_bFinished

private boolean m_bFinished

g_Resources

private static java.util.ResourceBundle g_Resources

g_WizardImage

private static javax.swing.Icon g_WizardImage
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.


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.


setCurrentPage

private boolean setCurrentPage(WizardPage page,
                               boolean bValidate)
Sets the currently displayed page for this wizard.


setCurrentPage

private boolean setCurrentPage(int index,
                               boolean bValidate)

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()

updateButtons

private void updateButtons()
Updates the status of the buttons.