Package adams.gui.wizard
Class WizardPaneWithBranches
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.wizard.AbstractWizardPane
-
- adams.gui.wizard.WizardPaneWithBranches
-
- All Implemented Interfaces:
LoggingSupporter
,ImageObserver
,MenuContainer
,Serializable
,Accessible
public class WizardPaneWithBranches extends AbstractWizardPane
Similar toWizardPane
but allows branching.- 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 Set<AbstractWizardPage>
m_FinalPages
the final pages.protected AbstractWizardPage
m_LastPageAdded
the last page added.protected JPanel
m_PageComponent
for displaying the page component.protected DefaultMutableTreeNode
m_Pages
the page layout.protected AbstractWizardPage
m_SelectedPage
the currently selected page.-
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 WizardPaneWithBranches()
Initializes the wizard with no ID.WizardPaneWithBranches(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.void
addPage(AbstractWizardPage parent, AbstractWizardPage page)
Adds the page under the given name.protected DefaultMutableTreeNode
findNode(AbstractWizardPage page)
Finds the node associated with the specified page.AbstractWizardPage[]
getChildPages(AbstractWizardPage page)
Returns all the child pages for the specified page.AbstractWizardPage
getSelectedPage()
Returns the currently active page.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.static void
main(String[] args)
For testing only.void
markFinalPage(AbstractWizardPage page)
Marks the page as a final one (for the finish button to be displayed).protected void
nextPage()
Goes to the next page.protected void
previousPage()
Goes to the previous page.void
removeAllPages()
Removes all pages.void
removePage(AbstractWizardPage page)
Removes the page (and all its subsequent pages).void
setSelectedPage(AbstractWizardPage page)
Sets the specified page as active one.void
unmarkFinalPage(AbstractWizardPage page)
Unmarks the page as a final one (for the finish button to be displayed).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_PageComponent
protected JPanel m_PageComponent
for displaying the page component.
-
m_Pages
protected DefaultMutableTreeNode m_Pages
the page layout.
-
m_LastPageAdded
protected AbstractWizardPage m_LastPageAdded
the last page added.
-
m_SelectedPage
protected AbstractWizardPage m_SelectedPage
the currently selected page.
-
m_FinalPages
protected Set<AbstractWizardPage> m_FinalPages
the final pages.
-
-
Constructor Detail
-
WizardPaneWithBranches
public WizardPaneWithBranches()
Initializes the wizard with no ID.
-
WizardPaneWithBranches
public WizardPaneWithBranches(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
-
removeAllPages
public void removeAllPages()
Removes all pages.- Overrides:
removeAllPages
in classAbstractWizardPane
-
addPage
public void addPage(AbstractWizardPage page)
Adds the page under the given name. Uses the last page as parent.- Overrides:
addPage
in classAbstractWizardPane
- Parameters:
page
- the page
-
findNode
protected DefaultMutableTreeNode findNode(AbstractWizardPage page)
Finds the node associated with the specified page.- Parameters:
page
- the page to get the node for- Returns:
- the node, null if failed to locate
-
addPage
public void addPage(AbstractWizardPage parent, AbstractWizardPage page)
Adds the page under the given name. Uses the specified parent.- Parameters:
parent
- the parent, null for rootpage
- the page
-
removePage
public void removePage(AbstractWizardPage page)
Removes the page (and all its subsequent pages).- Parameters:
page
- the page to remove
-
markFinalPage
public void markFinalPage(AbstractWizardPage page)
Marks the page as a final one (for the finish button to be displayed).- Parameters:
page
- the page
-
unmarkFinalPage
public void unmarkFinalPage(AbstractWizardPage page)
Unmarks the page as a final one (for the finish button to be displayed).- Parameters:
page
- the page
-
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(AbstractWizardPage page)
Sets the specified page as active one.- Parameters:
page
- the page to use as active page
-
getChildPages
public AbstractWizardPage[] getChildPages(AbstractWizardPage page)
Returns all the child pages for the specified page.- Parameters:
page
- the page to get the children for- Returns:
- the children
-
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
-
-