kiwi.ui
Class WizardView

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--kiwi.ui.KPanel
                                |
                                +--kiwi.ui.WizardView

public class WizardView
extends KPanel
implements ActionListener

A wizard-style component. WizardView essentially displays a sequence of panels (or "cards") to the user; each panel typically contains messages and/or input elements. A WizardPanelSequence object functions as the source of these panels, and determines the order in which the panels are presented to the user, and the conditions under which forward and backward movement is allowed between consecutive panels.

This component is arranged as follows. The leftmost portion of the component is used to display an image (which for best results should be transparent). Animated GIFs are acceptable. The bottom portion of the component displays the Back, Next, and Cancel buttons. The remaining space is occupied by the current WizardPanel provided by the WizardPanelSequence object.

The WizardPanelSequence determines when the user may move to the next or previous panel. Whenever these conditions change, the WizardPanelSequence fires a ChangeEvent to notify the WizardView, which responds by dimming or undimming the Next and Back buttons, as appropriate. When the final panel in the sequence is reached, the Next button changes to a Finish button.

If the Cancel button is pressed, an ActionEvent is fired with an action command of "cancel". If the Finish button is pressed, an ActionEvent is fired with an action command of "finish".

The goal of the Wizard family of classes was to provide a framework for creating wizards that was as flexible as possible, without creating a large amount of classes and interfaces to achieve that goal. Therefore the APIs for these classes may at first appear counterintuitive or inelegant. If they are found to be too cumbersome, they will be changed in a future release of Kiwi.


An example WizardView.

Version:
1.0 (11/98)
Author:
Mark Lindner, PING Software Group
See Also:
ChangeEvent, WizardPanelSequence, Serialized Form

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
WizardView(WizardPanelSequence sequence)
          Construct a new WizardView.
 
Method Summary
 void actionPerformed(ActionEvent evt)
          Handle events.
 void addActionListener(ActionListener listener)
          Add an ActionListener to this component's list of listeners.
 JButton getCancelButton()
          Get a reference to the Cancel button.
 JButton getFinishButton()
          Get a reference to the Finish button.
 void removeActionListener(ActionListener listener)
          Add an ActionListener to this component's list of listeners.
 void reset()
          Reset the WizardView.
 void setIcon(Icon icon)
          Set the component's icon.
 
Methods inherited from class kiwi.ui.KPanel
getComponentByName, paintComponent, setOpaque, setTexture
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WizardView

public WizardView(WizardPanelSequence sequence)
Construct a new WizardView.
Parameters:
sequence - The WizardPanelSequence that will provide WizardPanels for the wizard.
Method Detail

getCancelButton

public JButton getCancelButton()
Get a reference to the Cancel button.
Returns:
The Cancel button.

getFinishButton

public JButton getFinishButton()
Get a reference to the Finish button.
Returns:
The Finish button.

setIcon

public void setIcon(Icon icon)
Set the component's icon. Animated and/or transparent GIF images add a professional touch when used with WizardViews.
Parameters:
icon - The new icon to use, or null if no icon is needed.

actionPerformed

public void actionPerformed(ActionEvent evt)
Handle events. This method is public as an implementation side-effect.
Specified by:
actionPerformed in interface ActionListener

reset

public void reset()
Reset the WizardView. Resets the component so that the first panel is displayed. This method also calls the WizardPanelSequence's reset() method.
See Also:
WizardPanelSequence.reset()

addActionListener

public void addActionListener(ActionListener listener)
Add an ActionListener to this component's list of listeners.
Parameters:
listener - The listener to add.

removeActionListener

public void removeActionListener(ActionListener listener)
Add an ActionListener to this component's list of listeners.
Parameters:
listener - The listener to add.