kiwi.ui
Class WizardPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bykiwi.ui.KPanel
                      extended bykiwi.ui.WizardPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

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

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
protected  Config config
          The configuration object for the WizardPanelSequence that owns this WizardPanel.
private static java.awt.Font defaultFont
           
private  KLabel l_title
           
private  ChangeSupport support
           
 
Fields inherited from class kiwi.ui.KPanel
 
Fields inherited from class javax.swing.JPanel
 
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.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WizardPanel()
          Construct a new WizardPanel.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener listener)
          Add a ChangeListener to this object's list of listeners.
 void beginFocus()
          Begin focus in this component.
protected abstract  java.awt.Component buildUI()
          Build the user interface for this WizardPanel.
 boolean canMoveBackward()
          Determine if the user can move backward to the previous panel.
 boolean canMoveForward()
          Determine if the user can move forward to the next panel.
protected  void fireChangeEvent()
          Fire a change event.
 void removeChangeListener(javax.swing.event.ChangeListener listener)
          Remove a ChangeListener from this object's list of listeners.
(package private)  void setConfig(Config config)
           
protected  void setTitle(java.lang.String title)
          Set the title for this WizardPanel.
abstract  void syncData()
          Synchronize this WizardPanel's data.
abstract  void syncUI()
          Synchronize this WizardPanel's user interface.
 
Methods inherited from class kiwi.ui.KPanel
getComponentByName, paintComponent, setFocusOrder, setTexture
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

support

private ChangeSupport support

l_title

private KLabel l_title

config

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


defaultFont

private static java.awt.Font defaultFont
Constructor Detail

WizardPanel

public WizardPanel()
Construct a new WizardPanel.

Method Detail

buildUI

protected abstract java.awt.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.

syncUI

public abstract void syncUI()
Synchronize 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.


syncData

public abstract void syncData()
Synchronize this WizardPanel's data. This method is called by the WizardView immediately after this panel is made invisible (such as when the user moves to the next or previous panel). This allows the implementor to update the Config properties based on the values entered in the panel's user interface.


setTitle

protected final void setTitle(java.lang.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.

setConfig

final void setConfig(Config config)

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(javax.swing.event.ChangeListener listener)
Add a ChangeListener to this object's list of listeners.

Parameters:
listener - The listener to add.

removeChangeListener

public void removeChangeListener(javax.swing.event.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.


canMoveForward

public boolean canMoveForward()
Determine if the user can move forward to the next panel.

Returns:
true if the next panel can be shown, and false otherwise. The default implementation returns true.

canMoveBackward

public boolean canMoveBackward()
Determine if the user can move backward to the previous panel.

Returns:
true if the previous panel can be shown, and false otherwise. The default implementation returns true.