Documentation of 'jas2.util.JASWizardPage' Java class
JASWizardPage
jas2.util

Class JASWizardPage

  • All Implemented Interfaces:
    java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible


    public abstract class JASWizardPage
    extends javax.swing.JPanel
    implements java.awt.event.KeyListener
    Extend this class to create a page for the JASWizard. Implement the interface HasNextPages if you want there to be pages following this page, and implement the Finishable interface if you want this to be the final page. You may implement one or both, but implementing neither would be silly because then neither the "Next" nor "Finish" button will enable and your page will be a "dead end". Implement HasHelpPage if you want your page to link to a help topic. Override the methods getNextEnabled() and getFinishEnabled() to control how the "Next" and "Finish" buttons enable.

    This class is a KeyListener and has implemented the interface with non-final methods. If you do not override these methods, doEnable() will be called when a key is released on components registered as KeyListeners. This implementation is designed for when the buttons enable when text is added to them. For example, if you page had
    m_text = new JASTextField();
    text.addKeyListener(this);

    then the "Next" and "Finish" buttons would enable each time a key is released in the field text. You might define getNextEnabled() as follows:

     protected boolean getNextEnabled()
     {
                    final String s = m_text.getText();
                    return s != null && s.length() > 0;
     }
     
    See Also:
    JASWizard, HasNextPages, Finishable, HasHelpPage, Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.BaselineResizeBehavior
    • Field Summary

      • Fields inherited from class javax.swing.JComponent

        TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • Fields inherited from class java.awt.Component

        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 and Description
      JASWizardPage(java.awt.LayoutManager lm)
      Supply a layout manager for the panel to use.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void beforeShowing()
      This method is called just before the page is brought to the screen.
      void doBusy(java.lang.Runnable run) 
      void keyPressed(java.awt.event.KeyEvent e)
      Override this to provide your own behaviour for key events; does nothing by default.
      void keyReleased(java.awt.event.KeyEvent e)
      If you add this class as a KeyListener and don't override this method then the buttons will be enabled on every key event in the definition for this method.
      void keyTyped(java.awt.event.KeyEvent e)
      Override this to provide your own behaviour for key events; does nothing by default.
      void onCancel()
      This method is called if the user has canceled the wizard.
      java.lang.String toString()
      This method is public as an implementation side effect; do not call.
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, setUI, updateUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • JASWizardPage

        public JASWizardPage(java.awt.LayoutManager lm)
        Supply a layout manager for the panel to use. See Sun's notes on using layout managers. In the constructor of your subclass, add components to the page as you would add components to a regular container, using the add(..) methods. It is not a good idea to use AWT components here because those heavy-weight components do not mix well with swing's light-weight components. You should use only swing components. The jas.util package has a number of utility components that may be useful for these pages.
        Parameters:
        lm - the layout manager to use for this page.
        See Also:
        LayoutManager
    • Method Detail

      • toString

        public java.lang.String toString()
        This method is public as an implementation side effect; do not call.
        Overrides:
        toString in class java.awt.Component
      • onCancel

        public void onCancel()
        This method is called if the user has canceled the wizard. By default it does nothing, but you can override it to perform cleanup if necessary. The wizard follows a preorder tree traversal, so the onCancel() methods are called starting from the bottom and working up each branch separately to the root.
      • keyPressed

        public void keyPressed(java.awt.event.KeyEvent e)
        Override this to provide your own behaviour for key events; does nothing by default.
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
      • keyReleased

        public void keyReleased(java.awt.event.KeyEvent e)
        If you add this class as a KeyListener and don't override this method then the buttons will be enabled on every key event in the definition for this method.
        Specified by:
        keyReleased in interface java.awt.event.KeyListener
      • beforeShowing

        public void beforeShowing()
        This method is called just before the page is brought to the screen. By default, it does nothing but you can override it to do some last-minute setup on your page.
      • doBusy

        public void doBusy(java.lang.Runnable run)
      • keyTyped

        public void keyTyped(java.awt.event.KeyEvent e)
        Override this to provide your own behaviour for key events; does nothing by default.
        Specified by:
        keyTyped in interface java.awt.event.KeyListener

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.