Package adams.gui.wizard
Class WizardPane
-
- All Implemented Interfaces:
LoggingSupporter
,ImageObserver
,MenuContainer
,Serializable
,Accessible
public class WizardPane extends AbstractWizardPane
Similar to aBaseTabbedPane
, but with the names of the pages listed in aBaseList
on the left-hand side.
AttachedActionListener
s received eitherAbstractWizardPane.ACTION_CANCEL
orAbstractWizardPane.ACTION_FINISH
as command.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseList
m_ListNames
the list for displaying the page names.protected DefaultListModel<String>
m_ModelNames
the model for displaying the page names.protected JPanel
m_PageComponent
for displaying the page component.protected List<String>
m_PageOrder
the page order.protected BaseScrollPane
m_ScrollPaneNames
the scrollpane for the names list.protected int
m_SelectedPage
the currently selected page.protected BaseSplitPane
m_SplitPane
the split pane.-
Fields inherited from class adams.gui.wizard.AbstractWizardPane
ACTION_CANCEL, ACTION_FINISH, m_ActionListeners, m_ButtonBack, m_ButtonCancelFinish, m_ButtonLoad, m_ButtonNext, m_ButtonSave, m_CustomFinishText, m_FileChooser, m_ID, m_Logger, m_PageLookup, m_PanelButtons, m_PanelButtonsProperties
-
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
Constructors Constructor Description WizardPane()
Initializes the wizard with no ID.WizardPane(String id)
Initializes the wizard.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPage(AbstractWizardPage page)
Adds the page under the given name.AbstractWizardPage
getPageAt(int index)
Returns the specified page.int
getPageCount()
Returns the current page count.int
getSelectedIndex()
Returns the currently active page index.AbstractWizardPage
getSelectedPage()
Returns the currently active page.BaseSplitPane
getSplitPane()
Returns the underlying split pane.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.static void
main(String[] args)
For testing only.protected void
nextPage()
Goes to the next page.protected void
previousPage()
Goes to the previous page.void
removeAllPages()
Removes all pages.void
removePageAt(int index)
Removes the page at the specified index.void
setSelectedPage(int index)
Sets the specified page as active one.void
updateButtons()
Updates the status of the buttons.-
Methods inherited from class adams.gui.wizard.AbstractWizardPane
addActionListener, cancelFinish, finishInit, getCustomFinishText, getFileChooser, getID, getLogger, getProperties, isLoggingEnabled, loadProperties, notifyActionListeners, removeActionListener, saveProperties, setCustomFinishText, setProperties, update
-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
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, paintComponent, 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, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
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
-
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, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
m_ModelNames
protected DefaultListModel<String> m_ModelNames
the model for displaying the page names.
-
m_ListNames
protected BaseList m_ListNames
the list for displaying the page names.
-
m_ScrollPaneNames
protected BaseScrollPane m_ScrollPaneNames
the scrollpane for the names list.
-
m_SplitPane
protected BaseSplitPane m_SplitPane
the split pane.
-
m_PageComponent
protected JPanel m_PageComponent
for displaying the page component.
-
m_SelectedPage
protected int m_SelectedPage
the currently selected page.
-
-
Constructor Detail
-
WizardPane
public WizardPane()
Initializes the wizard with no ID.
-
WizardPane
public WizardPane(String id)
Initializes the wizard.- Parameters:
id
- the ID of the wizard, used for logging purposes
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractWizardPane
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUI
in classAbstractWizardPane
-
previousPage
protected void previousPage()
Goes to the previous page.- Specified by:
previousPage
in classAbstractWizardPane
-
nextPage
protected void nextPage()
Goes to the next page.- Specified by:
nextPage
in classAbstractWizardPane
-
getSplitPane
public BaseSplitPane getSplitPane()
Returns the underlying split pane.- Returns:
- the split pane
-
removeAllPages
public void removeAllPages()
Removes all pages.- Overrides:
removeAllPages
in classAbstractWizardPane
-
addPage
public void addPage(AbstractWizardPage page)
Adds the page under the given name.- Overrides:
addPage
in classAbstractWizardPane
- Parameters:
page
- the page
-
removePageAt
public void removePageAt(int index)
Removes the page at the specified index.- Parameters:
index
- the index of the page to remove
-
getSelectedIndex
public int getSelectedIndex()
Returns the currently active page index.- Returns:
- the index, -1 if not available
-
getSelectedPage
public AbstractWizardPage getSelectedPage()
Returns the currently active page.- Specified by:
getSelectedPage
in classAbstractWizardPane
- Returns:
- the page, null if not available
-
setSelectedPage
public void setSelectedPage(int index)
Sets the specified page as active one.- Parameters:
index
- the index of the page to use as active page
-
getPageCount
public int getPageCount()
Returns the current page count.- Returns:
- the number of pages
-
getPageAt
public AbstractWizardPage getPageAt(int index)
Returns the specified page.- Parameters:
index
- the page index- Returns:
- the page
-
updateButtons
public void updateButtons()
Updates the status of the buttons.- Specified by:
updateButtons
in classAbstractWizardPane
-
main
public static void main(String[] args)
For testing only.- Parameters:
args
- ignored
-
-