|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--com.zfqjava.swing.JWizardPane
JWizardPane provides a wizard component.
For the better Look and Feel with the JWizardPane,
the side image preferred size is 164x314, the banner image preferred
size is 495x62, the logo icon preferred size is 54x54.
In order to provides the better control for wizard, should attach a WizardListener.
The methods showDialog(Component) and showFrame()
is easy to use, all window close event has dispathed to cancel()
method, that means you can veto dialog or frame close by throws one
ActionVetoException in WizardListener.beforeCancel(com.zfqjava.swing.event.WizardEvent) methods.
Client Property:
| Name | Value | Default Value |
|---|---|---|
| JWizardPane.interiorPageStyle |
|
BannerTip |
| Inner Class Summary | |
protected class |
JWizardPane.AccessibleJWizardPane
This class implements accessibility support for the JWizardPane class. |
protected class |
JWizardPane.ModelListener
We pass ModelChanged events along to the listeners with
the wizardpane (instead of the model itself) as the event source. |
| Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
| Field Summary | |
static int |
BACK_CONTROL
Type used for back button on the wizard. |
static int |
CANCEL_CONTROL
Type used for cancel button on the wizard. |
static int |
FINISH_CONTROL
Type used for finish button on the wizard. |
static int |
HELP_CONTROL
Type used for help button on the wizard. |
static int |
NEXT_CONTROL
Type used for next button on the wizard. |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, 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 |
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 | |
JWizardPane()
Constructs a JWizardPane. |
|
| Method Summary | |
void |
addChangeListener(javax.swing.event.ChangeListener l)
Adds a ChangeListener to this wizardpane. |
protected void |
addImpl(java.awt.Component comp,
java.lang.Object constraints,
int index)
|
void |
addPage(java.awt.Component comp)
Adds a page component, appends to end page. |
void |
addPage(java.lang.String header,
java.lang.String description,
java.awt.Component comp)
Adds a page component with header and description, appends to end page. |
void |
addPageAt(java.lang.String header,
java.lang.String description,
java.awt.Component comp,
int index)
Adds a page component with header and description and specify index. |
void |
addWizardListener(WizardListener l)
Adds a listener for WizardEvent events. |
void |
back()
Called by JWizardPane when the user hits the Back button. |
void |
cancel()
Called by JWizardPane when the user hits the Cancel button. |
protected javax.swing.event.ChangeListener |
createChangeListener()
Subclasses that want to handle ChangeEvents differently
can override this to return a subclass of ModelListener or
another ChangeListener implementation. |
protected javax.swing.JDialog |
createDialog(java.awt.Component parent,
java.lang.String title)
Creates a dialog for the JWizardPane. |
protected javax.swing.JFrame |
createFrame(java.lang.String title)
Creates a frame for the JWizardPane. |
void |
finish()
Called by JWizardPane when the user hits the Finish button. |
protected void |
fireAfterBack()
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireAfterCancel()
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireAfterFinish()
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireAfterHelp()
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireAfterNext()
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireBeforeBack()
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireBeforeCancel()
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireBeforeFinish()
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireBeforeHelp()
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireBeforeNext()
Notifies all listeners that have registered interest for notification on this event type. |
protected void |
fireStateChanged()
Sends a ChangeEvent, whose source is this wizardpane,
to each listener. |
javax.accessibility.AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this JWizardPane. |
java.awt.Image |
getBannerImage()
Returns the banner image used in top side of wizard pane. |
javax.swing.ImageIcon |
getBannerImageIcon()
Returns the banner image used in top side of wizard pane. |
javax.swing.event.ChangeListener[] |
getChangeListeners()
Returns an array of all the ChangeListeners added
to this JWizardPane with addChangeListener. |
java.awt.Component |
getComponentAt(int index)
Gets the component at the specified page index. |
javax.swing.JButton |
getControlButton(int controlType)
Gets the control button of the type. |
java.lang.String |
getDescriptionAt(int index)
Gets the long description at the speficied page. |
java.lang.String |
getHeaderAt(int index)
Gets the short description at the specified page. |
javax.swing.Icon |
getLogoIcon()
Returns the logo icon for this wizard. |
java.lang.String |
getLogoText()
Returns the logo text for this wizard. |
int |
getPageCount()
Returns the page count. |
java.awt.Component |
getSelectedComponent()
Returns the currently selected component for this wizard pane. |
int |
getSelectedIndex()
Returns the page's selection. |
javax.swing.SingleSelectionModel |
getSelectionModel()
Returns the selection model associated with this wizardpane. |
java.awt.Image |
getSideImage()
Returns the side image used in left side of wizard pane. |
javax.swing.ImageIcon |
getSideImageIcon()
Returns the side image used in left side of wizard pane. |
WizardPaneUI |
getUI()
Returns the UI object which implements the L&F for this component. |
java.lang.String |
getUIClassID()
Returns the name of the UI class that implements the L&F for this component. |
WizardListener[] |
getWizardListeners()
Returns an array of all the WizardListeners
added to this JWizardPane with
addWizardListener(). |
void |
help()
Called by JWizardPane when the user hits the Help button. |
int |
indexOfComponent(java.awt.Component comp)
Gets the index of that component. |
int |
indexOfDescription(java.lang.String desc)
Gets the first index with a given desc,
or -1 if no page has this description. |
int |
indexOfHeader(java.lang.String header)
Gets the first index with a given header,
or -1 if no page has this header. |
void |
next()
Called by JWizardPane when the user hits the Next button. |
protected java.lang.String |
paramString()
Returns a string representation of this JWizardPane. |
void |
removeAllPage()
Removes all page component at JWizardPane. |
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Removes a ChangeListener from this wizardpane. |
void |
removePage(java.awt.Component page)
Removes the page component at JWizardPane. |
void |
removePageAt(int index)
Removes the page component at the specify index. |
void |
removeWizardListener(WizardListener l)
Removes a listener for WizardEvent events. |
void |
setBannerImage(java.awt.Image bannerImage)
Sets the banner image used in top side of wizard pane. |
void |
setBannerImageIcon(javax.swing.ImageIcon bannerImageIcon)
Sets the banner image used in top side of wizard pane. |
void |
setComponentAt(int index,
java.awt.Component comp)
Sets the component at the specified page index. |
void |
setDescriptionAt(int index,
java.lang.String description)
Sets the page description text at the specified page index. |
void |
setHeaderAt(int index,
java.lang.String header)
Sets the page header text at the specified page index. |
void |
setLogoIcon(javax.swing.Icon logoIcon)
Sets the logo icon for this wizard. |
void |
setLogoText(java.lang.String logoText)
Sets the logo text for this wizard. |
void |
setSelectedComponent(java.awt.Component c)
Sets the selected component for this wizardpane. |
void |
setSelectedIndex(int index)
Sets the page's selected index to index. |
void |
setSelectionModel(javax.swing.SingleSelectionModel model)
Sets the selection model to be used with this wizardpane. |
void |
setSideImage(java.awt.Image sideImage)
Sets the side image used in left side of wizard pane. |
void |
setSideImageIcon(javax.swing.ImageIcon sideImageIcon)
Sets the side image used in left side of wizard pane. |
void |
setUI(WizardPaneUI ui)
Sets the UI object which implements the L&F for this component. |
void |
showDialog(java.awt.Component parent)
Pops up a dialog contains the JWizardPane and
parented to parent with the dialog having a default
title. |
void |
showDialog(java.awt.Component parent,
java.lang.String title)
Pops up a dialog contains the JWizardPane and
parented to parent with the dialog having a
title title. |
void |
showFrame()
Pops up a frame contains the JWizardPane with the
frame having a default title. |
void |
showFrame(java.lang.String title)
Pops up a frame contains the JWizardPane and with
the frame having a title title. |
void |
updateUI()
Resets the UI property to a value from the current look and feel. |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int BACK_CONTROL
public static final int NEXT_CONTROL
public static final int CANCEL_CONTROL
public static final int FINISH_CONTROL
public static final int HELP_CONTROL
| Constructor Detail |
public JWizardPane()
JWizardPane.| Method Detail |
public WizardPaneUI getUI()
WizardPaneUI objectsetUI(com.zfqjava.swing.plaf.WizardPaneUI)public void setUI(WizardPaneUI ui)
ui - the new UI objectUIDefaults.getUI(javax.swing.JComponent)public void updateUI()
updateUI in class javax.swing.JComponentJComponent.updateUI()public java.lang.String getUIClassID()
getUIClassID in class javax.swing.JComponentJComponent.getUIClassID(),
UIDefaults.getUI(javax.swing.JComponent)public javax.swing.SingleSelectionModel getSelectionModel()
setSelectionModel(javax.swing.SingleSelectionModel)public void setSelectionModel(javax.swing.SingleSelectionModel model)
model - the selection model to be usedgetSelectionModel()public int getSelectedIndex()
setSelectedIndex(int)public void setSelectedIndex(int index)
an - int specifying the page selectiongetSelectedIndex(),
addChangeListener(javax.swing.event.ChangeListener)public java.awt.Component getSelectedComponent()
null if there is no currently selected page.setSelectedComponent(java.awt.Component)public void setSelectedComponent(java.awt.Component c)
selectedIndex to the index
corresponding to the specified component.java.lang.IllegalArgumentException - if component not found in wizard
panegetSelectedComponent()public void setLogoText(java.lang.String logoText)
logoText - the logo textgetLogoText()public java.lang.String getLogoText()
setLogoText(java.lang.String)public void setLogoIcon(javax.swing.Icon logoIcon)
logoIcon - the logo icongetLogoIcon()public javax.swing.Icon getLogoIcon()
setLogoIcon(javax.swing.Icon)public void setSideImage(java.awt.Image sideImage)
sideIcon - the left side imagegetSideImage()public java.awt.Image getSideImage()
setSideImage(java.awt.Image)public void setSideImageIcon(javax.swing.ImageIcon sideImageIcon)
sideIcon - the left side imagegetSideImageIcon()public javax.swing.ImageIcon getSideImageIcon()
setSideImageIcon(javax.swing.ImageIcon)public void setBannerImage(java.awt.Image bannerImage)
bannerImage - the banner image to usegetBannerImage()public java.awt.Image getBannerImage()
setBannerImage(java.awt.Image)public void setBannerImageIcon(javax.swing.ImageIcon bannerImageIcon)
bannerImageIcon - the banner image to usegetBannerImageIcon()public javax.swing.ImageIcon getBannerImageIcon()
setBannerImageIcon(javax.swing.ImageIcon)public void showDialog(java.awt.Component parent)
JWizardPane and
parented to parent with the dialog having a default
title.parent - the parent of the dialogshowDialog(Component,String),
showFrame(),
showFrame(String)
public void showDialog(java.awt.Component parent,
java.lang.String title)
JWizardPane and
parented to parent with the dialog having a
title title.parent - the parent of the dialogtitle - the title of the dialogshowDialog(Component),
showFrame(),
showFrame(String)
protected javax.swing.JDialog createDialog(java.awt.Component parent,
java.lang.String title)
JWizardPane.parent - the parent of the dialogtitle - the title of the dialogshowDialog(Component,String),
showDialog(Component)public void showFrame()
JWizardPane with the
frame having a default title.showDialog(Component),
showDialog(Component,String),
showFrame(String)public void showFrame(java.lang.String title)
JWizardPane and with
the frame having a title title.title - the title of the frameshowDialog(Component),
showDialog(Component,String),
showFrame()protected javax.swing.JFrame createFrame(java.lang.String title)
JWizardPane.title - the title of the frameshowFrame(),
showFrame(String)public void addPage(java.awt.Component comp)
comp - the page component to addaddPage(String,String,Component),
addPageAt(String,String,Component,int)
public void addPage(java.lang.String header,
java.lang.String description,
java.awt.Component comp)
header - the page headerdescription - the page descriptioncomp - the page component to addaddPage(Component),
addPageAt(String,String,Component,int)
public void addPageAt(java.lang.String header,
java.lang.String description,
java.awt.Component comp,
int index)
header - the page headerdescription - the page descriptioncomp - the page component to addindex - the page indexjava.lang.IndexOutOfBoundsException - if index is out of range
(index < 0 || index > page count)addPage(Component),
addPage(String,String,Component)public void removePageAt(int index)
index - the page indexremovePage(Component),
removeAllPage()public void removePage(java.awt.Component page)
JWizardPane.page - the page component to removeremovePageAt(int),
removeAllPage()public void removeAllPage()
JWizardPane.page - the page component to removeremovePage(Component),
removePageAt(int)
protected void addImpl(java.awt.Component comp,
java.lang.Object constraints,
int index)
addImpl in class java.awt.Containerpublic int getPageCount()
public int indexOfComponent(java.awt.Component comp)
page - the componentpublic int indexOfHeader(java.lang.String header)
header,
or -1 if no page has this header.header - the header for the pageheader,
or -1 if no page has this headerpublic int indexOfDescription(java.lang.String desc)
desc,
or -1 if no page has this description.header - the description for the pagedesc,
or -1 if no page has this descriptionpublic java.awt.Component getComponentAt(int index)
index - the specified page indexjava.lang.IndexOutOfBoundsException - if index is out of range
(index < 0 || index >= page count)setComponentAt(int, java.awt.Component)
public void setComponentAt(int index,
java.awt.Component comp)
index - the specified page indexpage - the component at that indexjava.lang.IndexOutOfBoundsException - if index is out of range
(index < 0 || index >= page count)getComponentAt(int)public java.lang.String getHeaderAt(int index)
index - the page indexjava.lang.IndexOutOfBoundsException - if index is out of range
(index < 0 || index >= page count)setHeaderAt(int, java.lang.String)
public void setHeaderAt(int index,
java.lang.String header)
index - the specified page indexpage - the header text at that indexjava.lang.IndexOutOfBoundsException - if index is out of range
(index < 0 || index >= page count)getHeaderAt(int)public java.lang.String getDescriptionAt(int index)
index - the page indexjava.lang.IndexOutOfBoundsException - if index is out of range
(index < 0 || index >= page count)setDescriptionAt(int, java.lang.String)
public void setDescriptionAt(int index,
java.lang.String description)
index - the specified page indexpage - the description text at that indexjava.lang.IndexOutOfBoundsException - if index is out of range
(index < 0 || index >= page count)getDescriptionAt(int)public javax.swing.JButton getControlButton(int controlType)
controlType - the type of the button to be selected:
public void next()
JWizardPane when the user hits the Next button.
This can also be called by the programmer.
This method causes a wizard event to fire.public void back()
JWizardPane when the user hits the Back button.
This can also be called by the programmer.
This method causes a wizard event to fire.public void cancel()
JWizardPane when the user hits the Cancel button.
This can also be called by the programmer.
This method causes a wizard event to fire.public void finish()
JWizardPane when the user hits the Finish button.
This can also be called by the programmer.
This method causes a wizard event to fire.public void help()
JWizardPane when the user hits the Help button.
This can also be called by the programmer.
This method causes a wizard event to fire.protected void fireAfterNext()
EventListenerListprotected void fireAfterBack()
EventListenerList
protected void fireBeforeNext()
throws ActionVetoException
EventListenerList
protected void fireBeforeBack()
throws ActionVetoException
EventListenerList
protected void fireBeforeCancel()
throws ActionVetoException
EventListenerListprotected void fireAfterCancel()
EventListenerList
protected void fireBeforeFinish()
throws ActionVetoException
EventListenerListprotected void fireAfterFinish()
EventListenerList
protected void fireBeforeHelp()
throws ActionVetoException
EventListenerListprotected void fireAfterHelp()
EventListenerListpublic void addWizardListener(WizardListener l)
WizardEvent events.
param l a WizardListener that will be
notified when the wizard event fired.public void removeWizardListener(WizardListener l)
WizardEvent events.l - the WizardListener to removepublic WizardListener[] getWizardListeners()
WizardListeners
added to this JWizardPane with
addWizardListener().protected javax.swing.event.ChangeListener createChangeListener()
ChangeEvents differently
can override this to return a subclass of ModelListener or
another ChangeListener implementation.fireStateChanged()public void addChangeListener(javax.swing.event.ChangeListener l)
ChangeListener to this wizardpane.l - the ChangeListener to addfireStateChanged(),
removeChangeListener(javax.swing.event.ChangeListener)public void removeChangeListener(javax.swing.event.ChangeListener l)
ChangeListener from this wizardpane.l - the ChangeListener to removefireStateChanged(),
addChangeListener(javax.swing.event.ChangeListener)public javax.swing.event.ChangeListener[] getChangeListeners()
ChangeListeners added
to this JWizardPane with addChangeListener.ChangeListeners added or an empty
array if no listeners have been addedprotected void fireStateChanged()
ChangeEvent, whose source is this wizardpane,
to each listener. This method method is called each time
a ChangeEvent is received from the model.addChangeListener(javax.swing.event.ChangeListener),
EventListenerListprotected java.lang.String paramString()
null.paramString in class javax.swing.JComponentpublic javax.accessibility.AccessibleContext getAccessibleContext()
getAccessibleContext in interface javax.accessibility.AccessiblegetAccessibleContext in class javax.swing.JComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||