Package adams.gui.wizard
Class AbstractWizardPage
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.wizard.AbstractWizardPage
-
- All Implemented Interfaces:
LoggingSupporter
,ImageObserver
,MenuContainer
,Serializable
,Accessible
- Direct Known Subclasses:
BranchSelectionPage
,FinalPage
,GenericObjectEditorPage
,ListPage
,ParameterPanelPage
,PropertySheetPanelPage
,SelectDirectoryPage
,SelectFilePage
,SelectMultipleDirectoriesPage
,SelectMultipleFilesPage
,StartPage
,TextAreaPage
,WekaPropertySheetPanelPage
,WekaSelectDatasetPage
,WekaSelectMultipleDatasetsPage
public abstract class AbstractWizardPage extends BasePanel implements LoggingSupporter
Ancestor for wizard pages.- 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 BaseButton
m_ButtonLoad
the load props button.protected BaseButton
m_ButtonSave
the save props button.protected BaseFileChooser
m_FileChooser
the filechooser for loading/saving properties.protected AbstractWizardPane
m_Owner
the wizard this page belongs to.protected PageCheck
m_PageCheck
the page check to perform.protected String
m_PageName
the name of the page.protected JPanel
m_PanelButtons
the panel for the buttons.protected ProceedAction
m_ProceedAction
the action to perform when proceeding.protected BaseScrollPane
m_ScrollPaneDescription
the scroll pane for the description.protected BaseTextPane
m_TextDescription
the description of the page.protected boolean
m_Valid
whether the page has valid input or not.-
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 AbstractWizardPage()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canProceed()
Returns whether we can proceed with the next page.String
getDescription()
Returns the description of the page.int
getDescriptionHeight()
Returns the preferred height of the description box.protected BaseFileChooser
getFileChooser()
Returns the file chooser to use for loading/saving of props files.Logger
getLogger()
Returns the logger in use.AbstractWizardPane
getOwner()
Returns the wizard this page belongs to.PageCheck
getPageCheck()
Returns the page check instance in use.String
getPageName()
Returns the page name.ProceedAction
getProceedAction()
Returns the proceed action instance in use.abstract Properties
getProperties()
Returns the content of the page (ie parameters) as properties.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.void
invalidate()
Invalidates the input on the page.boolean
isButtonPanelVisible()
Returns the visibility state of the buttons panel (load/save).boolean
isLoggingEnabled()
Returns whether logging is enabled.boolean
isValid()
Returns whether the input on the page is valid.protected void
loadProperties()
Loads properties from a file, prompts the user to select props file.protected void
saveProperties()
Saves properties to a file, prompts the user to select props file.void
setButtonPanelVisible(boolean value)
Sets the visibility state of the buttons panel (load/save).void
setDescription(String value)
Sets the description of the page.void
setDescription(String value, boolean isHtml)
Sets the description of the page.void
setDescriptionHeight(int value)
Sets the preferred height of the description box.void
setOwner(AbstractWizardPane value)
Sets the wizard this page belongs to.void
setPageCheck(PageCheck value)
Sets the page check instance to use.void
setPageName(String value)
Sets the page name.void
setProceedAction(ProceedAction value)
Sets the proceed action instance to use.abstract void
setProperties(Properties value)
Sets the content of the page (ie parameters) as properties.void
update()
Updates the page.void
updateButtons()
Updates the wizard's buttons.void
validate()
Marks the input on the page as valid.-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, finishInit, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, 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, 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, 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, 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_Owner
protected AbstractWizardPane m_Owner
the wizard this page belongs to.
-
m_PageName
protected String m_PageName
the name of the page.
-
m_TextDescription
protected BaseTextPane m_TextDescription
the description of the page.
-
m_ScrollPaneDescription
protected BaseScrollPane m_ScrollPaneDescription
the scroll pane for the description.
-
m_PageCheck
protected PageCheck m_PageCheck
the page check to perform.
-
m_ProceedAction
protected ProceedAction m_ProceedAction
the action to perform when proceeding.
-
m_PanelButtons
protected JPanel m_PanelButtons
the panel for the buttons.
-
m_ButtonLoad
protected BaseButton m_ButtonLoad
the load props button.
-
m_ButtonSave
protected BaseButton m_ButtonSave
the save props button.
-
m_FileChooser
protected BaseFileChooser m_FileChooser
the filechooser for loading/saving properties.
-
m_Valid
protected boolean m_Valid
whether the page has valid input or not.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classBasePanel
-
setOwner
public void setOwner(AbstractWizardPane value)
Sets the wizard this page belongs to.- Parameters:
value
- the owner
-
getOwner
public AbstractWizardPane getOwner()
Returns the wizard this page belongs to.- Returns:
- the owner, null if none set
-
setPageName
public void setPageName(String value)
Sets the page name.- Parameters:
value
- the name
-
getPageName
public String getPageName()
Returns the page name.- Returns:
- the name
-
setDescription
public void setDescription(String value)
Sets the description of the page. Checks for "html" tag to determine whether the content is HTML or plain-text.- Parameters:
value
- the description (plain-text or html)
-
setDescription
public void setDescription(String value, boolean isHtml)
Sets the description of the page.- Parameters:
value
- the descriptionisHtml
- if true then text is interpreted as HTML 3
-
getDescription
public String getDescription()
Returns the description of the page.- Returns:
- the description (may be html)
-
setDescriptionHeight
public void setDescriptionHeight(int value)
Sets the preferred height of the description box.- Parameters:
value
- the new height in pixel
-
getDescriptionHeight
public int getDescriptionHeight()
Returns the preferred height of the description box.- Returns:
- the height in pixel
-
setPageCheck
public void setPageCheck(PageCheck value)
Sets the page check instance to use.- Parameters:
value
- the check to use
-
getPageCheck
public PageCheck getPageCheck()
Returns the page check instance in use.- Returns:
- the check in use
-
setProceedAction
public void setProceedAction(ProceedAction value)
Sets the proceed action instance to use.- Parameters:
value
- the action to use
-
getProceedAction
public ProceedAction getProceedAction()
Returns the proceed action instance in use.- Returns:
- the action in use
-
canProceed
public boolean canProceed()
Returns whether we can proceed with the next page.- Returns:
- true if we can proceed
- See Also:
getPageCheck()
-
updateButtons
public void updateButtons()
Updates the wizard's buttons.
-
setButtonPanelVisible
public void setButtonPanelVisible(boolean value)
Sets the visibility state of the buttons panel (load/save).- Parameters:
value
- true if to show buttons
-
isButtonPanelVisible
public boolean isButtonPanelVisible()
Returns the visibility state of the buttons panel (load/save).- Returns:
- true if buttons displayed
-
getFileChooser
protected BaseFileChooser getFileChooser()
Returns the file chooser to use for loading/saving of props files.- Returns:
- the file chooser
-
loadProperties
protected void loadProperties()
Loads properties from a file, prompts the user to select props file.
-
saveProperties
protected void saveProperties()
Saves properties to a file, prompts the user to select props file.
-
setProperties
public abstract void setProperties(Properties value)
Sets the content of the page (ie parameters) as properties.- Parameters:
value
- the parameters as properties
-
getProperties
public abstract Properties getProperties()
Returns the content of the page (ie parameters) as properties.- Returns:
- the parameters as properties
-
getLogger
public Logger getLogger()
Returns the logger in use.- Specified by:
getLogger
in interfaceLoggingSupporter
- Returns:
- the logger
-
isLoggingEnabled
public boolean isLoggingEnabled()
Returns whether logging is enabled.- Specified by:
isLoggingEnabled
in interfaceLoggingSupporter
- Returns:
- true if at least
Level.INFO
-
update
public void update()
Updates the page.
Default implementation does nothing.
-
invalidate
public void invalidate()
Invalidates the input on the page.- Overrides:
invalidate
in classContainer
- See Also:
isValid()
,validate()
-
isValid
public boolean isValid()
Returns whether the input on the page is valid.- Overrides:
isValid
in classComponent
- Returns:
- true if valid
- See Also:
invalidate()
,validate()
-
validate
public void validate()
Marks the input on the page as valid.- Overrides:
validate
in classContainer
- See Also:
isValid()
,invalidate()
-
-