public class WizardView extends KPanel
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".
ChangeEvent
,
WizardPanelSequence
,
Serialized FormModifier and Type | Class and Description |
---|---|
private class |
WizardView._ActionListener |
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
private WizardView._ActionListener |
actionListener |
private KButton |
b_cancel |
private KButton |
b_next |
private KButton |
b_prev |
private KPanel |
content |
private int |
count |
private WizardPanel |
curPanel |
private boolean |
finish |
private Icon |
i_next |
private KLabel |
iconLabel |
private ButtonPanel |
p_buttons |
private int |
pos |
private String |
s_back |
private String |
s_cancel |
private String |
s_finish |
private String |
s_next |
private WizardPanelSequence |
sequence |
private ActionSupport |
support |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
WizardView()
Construct a new
WizardView . |
WizardView(WizardPanelSequence sequence)
Construct a new
WizardView . |
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(ActionListener listener)
Add an
ActionListener to this component's list of listeners. |
void |
addButton(JButton button,
int pos)
Add a button to the
WizardView at the specified position. |
protected WizardPanelSequence |
buildSequence()
A method for constructing the wizard panel sequence.
|
JButton |
getCancelButton()
Get a reference to the Cancel button.
|
JButton |
getFinishButton()
Get a reference to the Finish button.
|
private void |
refresh() |
void |
removeActionListener(ActionListener listener)
Add an
ActionListener to this component's list of listeners. |
void |
removeButton(int pos)
Remove a button from the specified position in the
ButtonPanel . |
void |
reset()
Reset the
WizardView . |
void |
setIcon(Icon icon)
Set the component's icon.
|
private void |
showPanel(WizardPanel panel) |
getComponentByName, paintComponent, setFocusOrder, setTexture
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private WizardPanelSequence sequence
private WizardPanel curPanel
private int pos
private int count
private boolean finish
private ActionSupport support
private WizardView._ActionListener actionListener
private ButtonPanel p_buttons
public WizardView()
WizardView
. The buildSequence()
method will be called to construct the WizardPanel
sequence.public WizardView(WizardPanelSequence sequence)
WizardView
.sequence
- The WizardPanelSequence
that will provide
WizardPanel
s for the wizard.protected WizardPanelSequence buildSequence()
public JButton getCancelButton()
public JButton getFinishButton()
public void addButton(JButton button, int pos) throws IllegalArgumentException
WizardView
at the specified position.button
- The button to add.pos
- The position at which to add the button. The value 0 denotes
the first position, and -1 denotes the last position.IllegalArgumentException
- If the value of
pos
is invalid.public void removeButton(int pos) throws IllegalArgumentException
ButtonPanel
.pos
- The position of the button to remove, where 0 denotes the
first position.IllegalArgumentException
- If an attempt is made
to remove one of the predefined wizard buttons.public void setIcon(Icon icon)
WizardView
s.icon
- The new icon to use, or null
if no icon is
needed.private void showPanel(WizardPanel panel)
public void reset()
WizardView
. Resets the component so that the first
panel is displayed. This method also calls the
WizardPanelSequence
's reset()
method.WizardPanelSequence.reset()
private void refresh()
public void addActionListener(ActionListener listener)
ActionListener
to this component's list of listeners.listener
- The listener to add.public void removeActionListener(ActionListener listener)
ActionListener
to this component's list of listeners.listener
- The listener to add.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses