|
Side of Software Wizard Library 1.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.plaf.ComponentUI | +--sos.wizard.WizardUI | +--sos.wizard.BasicWizardUI
A basic implementation of the wizard look and feel.
This look and feel tries to follow the guidelines set forth in Java (TM) Look and Feel Design Guidelines: Advanced Topics. It installs a layout manager that lays out the panels as follows (assuming a left-to-right orientation and an English locale):
+----------------+-------------------------------------+ | Steps | Page Title | | ------------ | -------------------------------- | | 1 | | | 2 | | | 3 | | | 4 | Right | | | Pane | | Left | | | Pane | | | | | +----------------+-------------------------------------+ | | | < Back Next > Cancel | | | +------------------------------------------------------+The preferred size of a
JWizard
component inside a dialog
is 660 x 400, subject to the maximum and minimum sizes of
the component.This class provides a number of protected method to allow subclasses to customize the behavior.
Property | UIManager Key | Default Value |
---|---|---|
Amount of space side panel should occupy, as a percentage of the total width | ACCESSORY_PERCENTAGE_KEY | 0.25 |
Mapping of keyboard events to action names | ANCESTOR_INPUT_MAP_KEY | Escape key maps to the "escape" action |
Wizard's background color | BACKGROUND_KEY | Same as "Panel.background" |
Preferred height of a wizard in a dialog | DIALOG_PREFERRED_HEIGHT_KEY | 400 |
Preferred width of a wizard in a dialog | DIALOG_PREFERRED_WIDTH_KEY | 660 |
Wizard's foreground (i.e. text) color | FOREGROUND_KEY | Same as "TextArea.foreground" |
Wizard's font for ordinary text | FONT_KEY | Same as "TextArea.font" |
Background color of a default side panel that lists the wizard steps | STEPS_BACKGROUND_KEY | Same as "TextPane.background" |
Wizard's font for its titles | TITLE_FONT_KEY | Same as "TextArea.font" but bolded and 20% larger |
WizardUI
,
JWizard
Field Summary | |
static java.lang.Object |
ACCESSORY_PERCENTAGE_KEY
The look-and-feel key for the ideal percentage the accessory component should be in relation to the entire wizard component. |
static java.lang.Object |
ANCESTOR_INPUT_MAP_KEY
The look-and-feel key for the ancestor input map. |
static java.lang.Object |
BACKGROUND_KEY
The look-and-feel key for the background color. |
static java.lang.Object |
DIALOG_PREFERRED_HEIGHT_KEY
The look-and-feel key for the preferred wizard dialog height. |
static java.lang.Object |
DIALOG_PREFERRED_WIDTH_KEY
The look-and-feel key for the preferred wizard dialog width. |
static java.lang.Object |
FONT_KEY
The look-and-feel key for the font. |
static java.lang.Object |
FOREGROUND_KEY
The look-and-feel key for the foreground color. |
static java.lang.Object |
STEPS_BACKGROUND_KEY
The look-and-feel key for the background color of the accessory panel that shows the list of wizard steps. |
static java.lang.Object |
TITLE_FONT_KEY
The look-and-feel key for the title font. |
Constructor Summary | |
BasicWizardUI()
|
Method Summary | |
protected javax.swing.Action |
createBackAction()
Creates and returns an action for the Back button. |
protected javax.swing.Action |
createCancelAction()
Creates and returns an action for the Cacnel button. |
protected javax.swing.Action |
createCloseAction()
Creates and returns an action for the Close button. |
protected javax.swing.Action |
createFinishAction()
Creates and returns an action for the Finish button. |
protected javax.swing.Action |
createHelpAction()
Creates and returns an action for the Help button. |
protected javax.swing.Action |
createLastAction()
Creates and returns an action for the Last button. |
protected javax.swing.Action |
createNextAction()
Creates and returns an action for the Next button. |
protected java.beans.PropertyChangeListener |
createPropertyChangeListener()
Creates and returns the property change listener that will respond to changes in the JWizard . |
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c)
Returns an instance of the UI delegate for the specified component. |
protected javax.swing.Icon |
getBackButtonIcon()
Returns the icon to use for the button that returns the wizard to the previous step. |
protected int |
getBackButtonMnemonic()
Returns the mnemonic to use for the button that returns the wizard to the previous step. |
protected java.lang.String |
getBackButtonText()
Returns the string to display on the button that returns the wizard to the previous step. |
protected java.lang.String |
getBackButtonToolTipText()
Returns the tool tip to use for the button that returns the wizard to the previous step. |
protected java.lang.String |
getCancelButtonText()
Returns the string to display on the button that cancels the wizard. |
protected java.lang.String |
getCancelButtonToolTipText()
Returns the tool tip to use for the button that cancels the wizard. |
protected int |
getCloseButtonMnemonic()
Returns the mnemonic to use for the button that closes the wizard after it has finished. |
protected java.lang.String |
getCloseButtonText()
Returns the string to display on the button that closes the wizard after it has finished. |
protected java.lang.String |
getCloseButtonToolTipText()
Returns the tool tip to use for the button that closes the wizard after it has finished. |
protected int |
getFinishButtonMnemonic()
Returns the mnemonic to use for the button that finishes the wizard. |
protected java.lang.String |
getFinishButtonText()
Returns the string to display on the button that finishes the wizard. |
protected java.lang.String |
getFinishButtonToolTipText()
Returns the tool tip to use for the button that finishes the wizard. |
protected int |
getHelpButtonMnemonic()
Returns the mnemonic to use for the button that provides the user with additional help. |
protected java.lang.String |
getHelpButtonText()
Returns the string to display on the button that provides the user with additional help. |
protected java.lang.String |
getHelpButtonToolTipText()
Returns the tool tip to use for the button that provides the user with additional help. |
protected int |
getLastButtonMnemonic()
Returns the mnemonic to use for the button that skips to the final page of the wizard. |
protected java.lang.String |
getLastButtonText()
Returns the string to display on the button that skips to the final page of the wizard. |
protected java.lang.String |
getLastButtonToolTipText()
Returns the tool tip to use for the button that skips to the final page of the wizard. |
protected javax.swing.Icon |
getNextButtonIcon()
Returns the icon to use for the button that advances the wizard to the next step. |
protected int |
getNextButtonMnemonic()
Returns the mnemonic to use for the button that advances the wizard to the next step. |
protected java.lang.String |
getNextButtonText()
Returns the string to display on the button that advances the wizard to the next step. |
protected java.lang.String |
getNextButtonToolTipText()
Returns the tool tip to use for the button that advances the wizard to the next step. |
java.awt.Dimension |
getPreferredDialogSize(JWizard wizard)
Returns the preferred size of the specified wizard when displayed as a dialog . |
protected java.lang.String |
getStepsTitle()
Returns the string to display as the title of the list of wizard steps. |
JWizard |
getWizard()
Returns the JWizard component that this UI delegate is overseeing. |
protected void |
installComponents()
Installs the child components in the wizard component. |
protected void |
installDefaults()
Installs the default colors of the wizard component. |
protected void |
installListeners()
Installs the look and feel's listeners into the wizard component. |
void |
installUI(javax.swing.JComponent c)
Configures the specified component appropriate for the look and feel. |
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
Paints the specified component appropriate for the look and feel. |
protected void |
uninstallComponents()
Uninstalls the components installed by installComponents . |
protected void |
uninstallDefaults()
Uninstalls the defaults installed by installDefaults . |
protected void |
uninstallListeners()
Uninstalls the listeners installed by this look and feel object. |
void |
uninstallUI(javax.swing.JComponent c)
Reverses configuration which was done on the specified component during installUI . |
Methods inherited from class javax.swing.plaf.ComponentUI |
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.Object ACCESSORY_PERCENTAGE_KEY
UIManager.put( BasicWizardUI.ACCESSORY_PERCENTAGE, new Double( 0.33 ));
public static final java.lang.Object ANCESTOR_INPUT_MAP_KEY
public static final java.lang.Object BACKGROUND_KEY
UIManager.put( BasicWizardUI.BACKGROUND_KEY, Color.blue );
public static final java.lang.Object DIALOG_PREFERRED_HEIGHT_KEY
UIManager.put( BasicWizardUI.DIALOG_PREFERRED_HEIGHT_KEY, new Integer( 300 ));
public static final java.lang.Object DIALOG_PREFERRED_WIDTH_KEY
UIManager.put( BasicWizardUI.DIALOG_PREFERRED_WIDTH_KEY, new Integer( 500 ));
public static final java.lang.Object FOREGROUND_KEY
UIManager.put( BasicWizardUI.FOREGROUND_KEY, Color.blue );
public static final java.lang.Object FONT_KEY
Font customFont = ... UIManager.put( BasicWizardUI.FONT_KEY, customFont );
public static final java.lang.Object STEPS_BACKGROUND_KEY
UIManager.put( BasicWizardUI.STEPS_BACKGROUND_KEY, Color.blue );
public static final java.lang.Object TITLE_FONT_KEY
Font customFont = ... UIManager.put( BasicWizardUI.TITLE_FONT_KEY, customFont );
Constructor Detail |
public BasicWizardUI()
Method Detail |
protected javax.swing.Action createBackAction()
JWizard.doBack()
protected javax.swing.Action createCancelAction()
JWizard.doCancel()
protected javax.swing.Action createCloseAction()
JWizard.doClose()
protected javax.swing.Action createFinishAction()
JWizard.doFinish()
protected javax.swing.Action createHelpAction()
JWizard.doHelp()
protected javax.swing.Action createLastAction()
JWizard.doLast()
protected javax.swing.Action createNextAction()
JWizard.doNext()
protected java.beans.PropertyChangeListener createPropertyChangeListener()
JWizard
.
protected javax.swing.Icon getBackButtonIcon()
protected java.lang.String getBackButtonText()
protected java.lang.String getBackButtonToolTipText()
protected int getBackButtonMnemonic()
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
protected java.lang.String getCancelButtonText()
protected java.lang.String getCancelButtonToolTipText()
protected java.lang.String getCloseButtonText()
protected java.lang.String getCloseButtonToolTipText()
protected int getCloseButtonMnemonic()
protected java.lang.String getFinishButtonText()
protected java.lang.String getFinishButtonToolTipText()
protected int getFinishButtonMnemonic()
protected java.lang.String getHelpButtonText()
protected java.lang.String getHelpButtonToolTipText()
protected int getHelpButtonMnemonic()
protected java.lang.String getLastButtonText()
protected java.lang.String getLastButtonToolTipText()
protected int getLastButtonMnemonic()
protected javax.swing.Icon getNextButtonIcon()
protected java.lang.String getNextButtonText()
protected java.lang.String getNextButtonToolTipText()
protected int getNextButtonMnemonic()
public java.awt.Dimension getPreferredDialogSize(JWizard wizard)
WizardUI
getPreferredDialogSize
in class WizardUI
wizard
- component for which the preferred dialog size is requested
protected java.lang.String getStepsTitle()
public JWizard getWizard()
JWizard
component that this UI delegate is overseeing.
JWizard
component that this UI delegate is overseeing.protected void installComponents()
protected void installDefaults()
uninstallDefaults()
protected void installListeners()
public void installUI(javax.swing.JComponent c)
installUI
in class javax.swing.plaf.ComponentUI
uninstallUI(javax.swing.JComponent)
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
ComponentUI.update
method when
the specified component is being painted. Subclasses should override
this method and use the specified Graphics
object to
render the content of the component.
paint
in class javax.swing.plaf.ComponentUI
g
- the Graphics
context in which to paintc
- the component being painted;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple componentsComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
protected void uninstallComponents()
installComponents
.
installComponents()
protected void uninstallDefaults()
installDefaults
.
installDefaults()
protected void uninstallListeners()
installListeners()
public void uninstallUI(javax.swing.JComponent c)
installUI
.
uninstallUI
in class javax.swing.plaf.ComponentUI
installUI(javax.swing.JComponent)
|
Side of Software Wizard Library 1.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |