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 BaseButtonm_ButtonLoadthe load props button.protected BaseButtonm_ButtonSavethe save props button.protected BaseFileChooserm_FileChooserthe filechooser for loading/saving properties.protected AbstractWizardPanem_Ownerthe wizard this page belongs to.protected PageCheckm_PageCheckthe page check to perform.protected Stringm_PageNamethe name of the page.protected JPanelm_PanelButtonsthe panel for the buttons.protected ProceedActionm_ProceedActionthe action to perform when proceeding.protected BaseScrollPanem_ScrollPaneDescriptionthe scroll pane for the description.protected BaseTextPanem_TextDescriptionthe description of the page.protected booleanm_Validwhether 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 booleancanProceed()Returns whether we can proceed with the next page.StringgetDescription()Returns the description of the page.intgetDescriptionHeight()Returns the preferred height of the description box.protected BaseFileChoosergetFileChooser()Returns the file chooser to use for loading/saving of props files.LoggergetLogger()Returns the logger in use.AbstractWizardPanegetOwner()Returns the wizard this page belongs to.PageCheckgetPageCheck()Returns the page check instance in use.StringgetPageName()Returns the page name.ProceedActiongetProceedAction()Returns the proceed action instance in use.abstract PropertiesgetProperties()Returns the content of the page (ie parameters) as properties.protected voidinitGUI()Initializes the widgets.protected voidinitialize()Initializes the members.voidinvalidate()Invalidates the input on the page.booleanisButtonPanelVisible()Returns the visibility state of the buttons panel (load/save).booleanisLoggingEnabled()Returns whether logging is enabled.booleanisValid()Returns whether the input on the page is valid.protected voidloadProperties()Loads properties from a file, prompts the user to select props file.protected voidsaveProperties()Saves properties to a file, prompts the user to select props file.voidsetButtonPanelVisible(boolean value)Sets the visibility state of the buttons panel (load/save).voidsetDescription(String value)Sets the description of the page.voidsetDescription(String value, boolean isHtml)Sets the description of the page.voidsetDescriptionHeight(int value)Sets the preferred height of the description box.voidsetOwner(AbstractWizardPane value)Sets the wizard this page belongs to.voidsetPageCheck(PageCheck value)Sets the page check instance to use.voidsetPageName(String value)Sets the page name.voidsetProceedAction(ProceedAction value)Sets the proceed action instance to use.abstract voidsetProperties(Properties value)Sets the content of the page (ie parameters) as properties.voidupdate()Updates the page.voidupdateButtons()Updates the wizard's buttons.voidvalidate()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:
initializein 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:
getLoggerin interfaceLoggingSupporter- Returns:
- the logger
-
isLoggingEnabled
public boolean isLoggingEnabled()
Returns whether logging is enabled.- Specified by:
isLoggingEnabledin 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:
invalidatein classContainer- See Also:
isValid(),validate()
-
isValid
public boolean isValid()
Returns whether the input on the page is valid.- Overrides:
isValidin classComponent- Returns:
- true if valid
- See Also:
invalidate(),validate()
-
validate
public void validate()
Marks the input on the page as valid.- Overrides:
validatein classContainer- See Also:
isValid(),invalidate()
-
-