SalesPoint Framework v3.0

sale
Class JDisplayDialog

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--sale.JDisplayDialog

public class JDisplayDialog
extends JDialog
implements Display, FormSheetContainer

A JDialog that can display Form- and MenuSheets.

You can use this frame to pop up messages and dialogs in extra windows, while maintaining consistency with the rest of the GUI by using the familiar FormSheet look'n'feel.

The frame will display one FormSheet, and, by default, will close when the FormSheet is closed. Closing the frame using the systems menu or any other OS dependent gesture will result in a call to FormSheet.cancel() on the FormSheet.

Also, the frame may display a MenuSheet. It can therefore be used wherever a Display can be used.

Attention: This class is not meant to be serialized.

Since:
v2.0
Version:
2.0 25/05/1999
Author:
Steffen Zschaler
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
 
Inner classes inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog
 
Inner classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
Component.AccessibleAWTComponent
 
Field Summary
protected  EventListenerList m_ellListeners
          The list of listeners.
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
JDisplayDialog()
          Create a new JDisplayDialog.
JDisplayDialog(JFrame jfOwner)
          Create a new JDisplayDialog with the given owner.
 
Method Summary
 void addFormSheetListener(FormSheetListener fsl)
          Add a listener to receive notification on the JDisplayDialog's FormSheet.
 void closeFormSheet()
          Close the current FormSheet.
 void closeFormSheet(FormSheet fs)
          Close a FormSheet.
 void dispose()
          In addition to disposing of the peer resources, remove the FormSheet and the MenuSheet.
protected  void fireFormSheetRemoved(FormSheet fs, boolean fExplicit)
          Fire an event to all FormSheetListeners indicating that a FormSheet was removed from this display.
protected  void fireFormSheetSet(FormSheet fs)
          Fire an event to all FormSheetListeners indicating that a FormSheet was set on this display.
protected  void formSheetClosed()
          Hook method called when the FormSheet was closed.
 boolean isUseableDisplay()
          Return true to indicate this is a useable display.
static void main(String[] args)
          JDisplayDialog test suite.
 void onFormSheetButtonAdded(FormSheet fs, FormSheet.FormButton fb)
          Notification event informing that a button was added to the FormSheet's button bar.
 void onFormSheetButtonRemoved(FormSheet fs, FormSheet.FormButton fb)
          Notification event informing that a button was removed from the FormSheet's button bar.
 void onFormSheetButtonsCleared(FormSheet fs)
          Notification event informing that all buttons were removed from a FormSheet's button bar.
 void onFormSheetCaptionChanged(FormSheet fs, String sNewCaption)
          Notification event informing about a change of a FormSheet's caption.
 void onFormSheetComponentChanged(FormSheet fs, JComponent jcmpNew)
          Notification event informing about a change of a FormSheet's component.
 void popUpFormSheet(FormSheet fs)
          Open a fresh JDisplayDialog and display the FormSheet in it.
 void removeFormSheetListener(FormSheetListener fsl)
          Remove a listener to receive notification on the JDisplayDialog's FormSheet.
 void setFormSheet(FormSheet fs)
          Set and display a FormSheet.
 void setMenuSheet(MenuSheet ms)
          Remove any old MenuSheet and display the new one.
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle, show
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, removeWindowListener, setCursor, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_ellListeners

protected transient EventListenerList m_ellListeners
The list of listeners.
Constructor Detail

JDisplayDialog

public JDisplayDialog()
Create a new JDisplayDialog.

JDisplayDialog

public JDisplayDialog(JFrame jfOwner)
Create a new JDisplayDialog with the given owner.
Parameters:
jfOwner - the JFrame owning the display dialog.
Method Detail

closeFormSheet

public void closeFormSheet(FormSheet fs)
Close a FormSheet.

If a FormSheet is closed, by default, the JDisplayDialog containing it is also closed. You can, however, alter this behavior by overriding formSheetClosed().

Override:
Never.
Instead override formSheetClosed().
Specified by:
closeFormSheet in interface FormSheetContainer
Parameters:
fs - the FormSheet to be closed.

formSheetClosed

protected void formSheetClosed()
Hook method called when the FormSheet was closed.
Override:
Sometimes.
The default implementation closes the JDisplayDialog.

dispose

public void dispose()
In addition to disposing of the peer resources, remove the FormSheet and the MenuSheet.
Override:
Never.
Overrides:
dispose in class Dialog

onFormSheetCaptionChanged

public void onFormSheetCaptionChanged(FormSheet fs,
                                      String sNewCaption)
Notification event informing about a change of a FormSheet's caption.
Override:
Never.
Specified by:
onFormSheetCaptionChanged in interface FormSheetContainer
Parameters:
fs - the FormSheet whose caption changed.
sNewCaption - the new caption of the FormSheet.

onFormSheetComponentChanged

public void onFormSheetComponentChanged(FormSheet fs,
                                        JComponent jcmpNew)
Notification event informing about a change of a FormSheet's component.
Override:
Never.
Specified by:
onFormSheetComponentChanged in interface FormSheetContainer
Parameters:
fs - the FormSheet whose component changed.
jcmpNew - the new component of the FormSheet.

onFormSheetButtonAdded

public void onFormSheetButtonAdded(FormSheet fs,
                                   FormSheet.FormButton fb)
Notification event informing that a button was added to the FormSheet's button bar.
Override:
Never.
Specified by:
onFormSheetButtonAdded in interface FormSheetContainer
Parameters:
fs - the FormSheet whose button bar changed.
fb - the button that was added to the FormSheet.

onFormSheetButtonRemoved

public void onFormSheetButtonRemoved(FormSheet fs,
                                     FormSheet.FormButton fb)
Notification event informing that a button was removed from the FormSheet's button bar.
Override:
Never.
Specified by:
onFormSheetButtonRemoved in interface FormSheetContainer
Parameters:
fs - the FormSheet whose button bar changed.
fb - the button that was removed from the FormSheet.

onFormSheetButtonsCleared

public void onFormSheetButtonsCleared(FormSheet fs)
Notification event informing that all buttons were removed from a FormSheet's button bar.
Override:
Never.
Specified by:
onFormSheetButtonsCleared in interface FormSheetContainer
Parameters:
fs - the FormSheet whose button bar was cleared.

setFormSheet

public void setFormSheet(FormSheet fs)
                  throws InterruptedException
Set and display a FormSheet.

If fs.waitResponse() returns true, setFormSheet() blocks, until the FormSheet is closed by a matching call to closeFormSheet(sale.FormSheet).

Override:
Never.
Specified by:
setFormSheet in interface Display
Parameters:
fs - the FormSheet to be displayed.
Throws:
InterruptedException - if an interrupt occurs while waiting for the FormSheet to be closed.

closeFormSheet

public void closeFormSheet()
Close the current FormSheet.
Override:
Never.
Specified by:
closeFormSheet in interface Display

popUpFormSheet

public void popUpFormSheet(FormSheet fs)
                    throws InterruptedException
Open a fresh JDisplayDialog and display the FormSheet in it.
Override:
Never.
Specified by:
popUpFormSheet in interface Display
Throws:
InterruptedException - if an interrupt occured while waiting for the FormSheet to be closed.

setMenuSheet

public void setMenuSheet(MenuSheet ms)
Remove any old MenuSheet and display the new one.
Override:
Never.
Specified by:
setMenuSheet in interface Display
Parameters:
ms - the MenuSheet to be displayed.

isUseableDisplay

public boolean isUseableDisplay()
Return true to indicate this is a useable display.
Override:
Never.
Specified by:
isUseableDisplay in interface Display

addFormSheetListener

public void addFormSheetListener(FormSheetListener fsl)
Add a listener to receive notification on the JDisplayDialog's FormSheet.
Override:
Never.
Specified by:
addFormSheetListener in interface Display

removeFormSheetListener

public void removeFormSheetListener(FormSheetListener fsl)
Remove a listener to receive notification on the JDisplayDialog's FormSheet.
Override:
Never.
Specified by:
removeFormSheetListener in interface Display

fireFormSheetSet

protected void fireFormSheetSet(FormSheet fs)
Fire an event to all FormSheetListeners indicating that a FormSheet was set on this display. As FormSheet setting is always explicit, no extra parameter is necessary.
Override:
Never.
Parameters:
fs - the FormSheet that was set

fireFormSheetRemoved

protected void fireFormSheetRemoved(FormSheet fs,
                                    boolean fExplicit)
Fire an event to all FormSheetListeners indicating that a FormSheet was removed from this display.
Override:
Never.
Parameters:
fs - the FormSheet that was set
fExplicit - true, if the FormSheet was closed explicitly, i.e. either by a call to one of the closeFormSheet methods or by setFormSheet (null).
See Also:
closeFormSheet(), closeFormSheet(FormSheet), setFormSheet(sale.FormSheet)

main

public static void main(String[] args)
JDisplayDialog test suite.

SalesPoint Framework v3.0