All Packages Class Hierarchy This Package Previous Next Index
Class com.netobjects.nfx.wizard.WizardPageView
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.JPanel
|
+----com.netobjects.nfx.wizard.WizardPageView
- public class WizardPageView
- extends JPanel
This class is the view corrisponding to the wizard-page
class which is the model portion. The controller is replaced
by the java Observable/Observer mechanism. It takes care
of creation, display and layout of UI controls etc...
The purpose for the full model-view-controller approach
is not just that it is good design practice but that
we want the ability to load page objects into the
wizard without initially creating all the expensive
and numerous Swing UI controls. If the user gets
only a couple of pages into the wizard and hits
'finish', all subsequent view pages will never get
created.
- Version:
- 1.0
- Author:
- Scott Cinnamond
-
dmContentPanel
-
-
dmImagePanel
-
-
dmPagePanel
-
-
dmPagePanelLeftInset
-
-
dmTextCanvas
-
-
dmTextPanel
-
-
dmWizardPage
-
-
WizardPageView()
- Constructor.
-
WizardPageView(WizardPage)
- Constructor.
-
clipIndexOf(String, int, int, FontMetrics)
- Return the last index within the given string which
will fit within the given pixel width.
-
createComponents()
-
-
createControls()
- Create the UI controls.
-
createImagePanel()
-
-
createTextCanvas()
-
-
getContentPanel()
- Get the content panel for this view.
-
getExceptionHandler()
-
-
getModel()
- Get the wizard page-model associated with this view.
-
getWizard()
- Get the wizard associated with this view.
-
getWizardPage()
- Get the wizard page-model associated with this view.
-
isValid()
- Return true if data in controls is valid such
that we may proceed to the next panel.
-
layoutComponents()
-
-
setDirty(boolean)
- A comvienence method which flags the page/model as dirty.
-
setModel(WizardPage)
- Set the wizard page-model associated with this view.
-
toLines(String, int, int, FontMetrics)
- Return the last index within the given string which
will fit within the given pixel width.
-
validate()
- Validate the view.
dmWizardPage
private WizardPage dmWizardPage
dmImagePanel
private JPanel dmImagePanel
dmPagePanel
private JPanel dmPagePanel
dmTextPanel
private JPanel dmTextPanel
dmContentPanel
private JPanel dmContentPanel
dmTextCanvas
private WizardPageView. ImageCanvas dmTextCanvas
dmPagePanelLeftInset
private int dmPagePanelLeftInset
WizardPageView
public WizardPageView()
- Constructor.
WizardPageView
public WizardPageView(WizardPage page)
- Constructor.
- Parameters:
- page - the page model.
createComponents
protected void createComponents()
layoutComponents
protected void layoutComponents()
createControls
public void createControls()
- Create the UI controls.
createImagePanel
private void createImagePanel()
createTextCanvas
private void createTextCanvas()
validate
public void validate()
- Validate the view.
- Overrides:
- validate in class Container
getWizardPage
public WizardPage getWizardPage()
- Get the wizard page-model associated with this view.
- Returns:
- the model.
getModel
public WizardPage getModel()
- Get the wizard page-model associated with this view.
- Returns:
- the model.
setModel
public void setModel(WizardPage model)
- Set the wizard page-model associated with this view.
- Parameters:
- model - the wizard-page model.
getWizard
public Wizard getWizard()
- Get the wizard associated with this view.
- Returns:
- the wizard.
getExceptionHandler
public ExceptionHandler getExceptionHandler()
setDirty
public void setDirty(boolean set)
- A comvienence method which flags the page/model as dirty.
- Parameters:
- set - true/false.
getContentPanel
protected JPanel getContentPanel()
- Get the content panel for this view.
- Returns:
- the panel.
isValid
public boolean isValid()
- Return true if data in controls is valid such
that we may proceed to the next panel.
- Overrides:
- isValid in class Component
toLines
private Vector toLines(String s,
int width,
int maxLines,
FontMetrics fm)
- Return the last index within the given string which
will fit within the given pixel width. Tokenize
the string finding the total width after each token.
- Parameters:
- s - the string
- width - the width in pixels to clip the string to.
- maxLines - the maximum number of output lines desired.
- fm - the font metrics
- Returns:
- the clip index or -1 if the first token will not
fit within the given width.
clipIndexOf
private int clipIndexOf(String s,
int idx,
int width,
FontMetrics fm)
- Return the last index within the given string which
will fit within the given pixel width. Tokenize
the string finding the total width after each token.
- Parameters:
- s - the string
- idx - the start index
- width - the width in pixels to clip the string to.
- fm - the font metrics
- Returns:
- the clip index or -1 if the first token will not
fit within the given width.
All Packages Class Hierarchy This Package Previous Next Index