kiwi.ui
Class WizardPanel

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

public abstract class WizardPanel
extends KPanel

This class represents a single user interface panel for a WizardView component. Subclassers should not construct the panel's user interface in the constructor, but rather, should provide an implementation for buildUI() that fills this purpose.

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.

See Also:
WizardView, WizardPanelSequence, Serialized Form

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
protected  Config config
          The configuration object for the WizardPanelSequence that owns this WizardPanel.
 
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
WizardPanel()
          Construct a new WizardPanel.
 
Method Summary
 void addChangeListener(ChangeListener listener)
          Add a ChangeListener to this object's list of listeners.
 void beginFocus()
          Begin focus in this component.
protected abstract  Component buildUI()
          Build the user interface for this WizardPanel.
protected  void fireChangeEvent()
          Fire a change event.
 void removeChangeListener(ChangeListener listener)
          Remove a ChangeListener from this object's list of listeners.
protected  void setTitle(String title)
          Set the title for this WizardPanel.
abstract  void updateUI()
          Update this WizardPanel's user interface.
 
Methods inherited from class kiwi.ui.KPanel
getComponentByName, paintComponent, setOpaque, setTexture
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString
 
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
 

Field Detail

config

protected Config config
The configuration object for the WizardPanelSequence that owns this WizardPanel.
Constructor Detail

WizardPanel

public WizardPanel()
Construct a new WizardPanel.
Method Detail

buildUI

protected abstract Component buildUI()
Build the user interface for this WizardPanel. This method must build and return the component that will be displayed in this WizardPanel. Typically the implementor will instantiate a container such as KPanel, add interface components to it, and then return that container.
Returns:
The component that will be displayed in this panel.

updateUI

public abstract void updateUI()
Update this WizardPanel's user interface. This method is called by the WizardView immediately before this panel is made visible to the user. This allows the implementor to update the state of the components that make up this panel's interface, perhaps based on the current values of the WizardPanelSequence's Config properties.
Overrides:
updateUI in class JPanel

setTitle

protected final void setTitle(String title)
Set the title for this WizardPanel. The title is displayed at the top of the panel.
Parameters:
title - The new title, or null if no title is needed.

beginFocus

public void beginFocus()
Begin focus in this component. This method is called by the WizardView immediately after this panel is made visible to the user. It allows the panel to give input focus to the appropriate component in its user interface. The default implementation requests focus for the panel's first child component.

addChangeListener

public void addChangeListener(ChangeListener listener)
Add a ChangeListener to this object's list of listeners.
Parameters:
listener - The listener to add.

removeChangeListener

public void removeChangeListener(ChangeListener listener)
Remove a ChangeListener from this object's list of listeners.
Parameters:
listener - The listener to remove.

fireChangeEvent

protected void fireChangeEvent()
Fire a change event. WizardPanels should fire ChangeEvents whenever a change in their internal state would affect the appearance of the WizardView. For example, the user may complete data entry in a panel, which should undim the WizardView's Next button to allow the user to proceed to the next panel.