|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
org.salespointframework.core.JDisplayDialog
public class JDisplayDialog
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JDialog |
---|
javax.swing.JDialog.AccessibleJDialog |
Nested classes/interfaces inherited from class java.awt.Dialog |
---|
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected javax.swing.event.EventListenerList |
m_ellListeners
The list of listeners. |
private FormSheet |
m_fsCurrent
The current FormSheet. |
private javax.swing.JComponent |
m_jcmpComponent
The currently displaying component. |
private javax.swing.JPanel |
m_jpButtonBar
The currently displaying button bar panel. |
private MenuSheet |
m_msCurrent
The current MenuSheet. |
private java.lang.Object |
m_oWaiter
Object used to block setFormSheet(org.salespointframework.core.FormSheet) when the FormSheet demands it. |
Fields inherited from class javax.swing.JDialog |
---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Dialog |
---|
DEFAULT_MODALITY_TYPE |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JDisplayDialog()
Create a new JDisplayDialog. |
|
JDisplayDialog(java.awt.Window 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. |
FormSheet |
getFormSheet()
Return the FormSheet that is currently attached to the display. |
MenuSheet |
getMenuSheet()
Return the MenuSheet that is currently attached to the display. |
private java.lang.Object |
getWaiter()
Return the object used to block setFormSheet(org.salespointframework.core.FormSheet) when the FormSheet demands it. |
boolean |
isUseableDisplay()
Return true to indicate this is a useable display. |
void |
load(java.io.ObjectInputStream ois)
Restores the display from a stream. |
static void |
main(java.lang.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 |
onFormSheetButtonbarPositionChanged(FormSheet fs,
int position)
Notification event informing about a change of the Buttonbar's position |
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,
java.lang.String sNewCaption)
Notification event informing about a change of a FormSheet's caption. |
void |
onFormSheetComponentChanged(FormSheet fs,
javax.swing.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 |
popUpFormSheet(FormSheet fsParent,
FormSheet fsToSet)
Opens a fresh JDisplayDialog which is assigned to a FormSheet and displays
another FormSheet in it. |
void |
removeFormSheetListener(FormSheetListener fsl)
Remove a listener to receive notification on the JDisplayDialog's FormSheet. |
void |
save(java.io.ObjectOutputStream oos)
Writes the display to a stream. |
void |
setButtonbarPosition(int position)
Called to update the Buttonbar position |
void |
setFormSheet(FormSheet fs)
Set and display a FormSheet. |
void |
setMenuSheet(MenuSheet ms)
Remove any old MenuSheet and display the new one. |
void |
setVisible(boolean value)
|
Methods inherited from class javax.swing.JDialog |
---|
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.awt.Dialog |
---|
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, show, toBack |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.salespointframework.core.Display |
---|
getBounds, setBounds, toFront |
Field Detail |
---|
private transient java.lang.Object m_oWaiter
setFormSheet(org.salespointframework.core.FormSheet)
when the FormSheet demands it.
private transient javax.swing.JComponent m_jcmpComponent
private transient javax.swing.JPanel m_jpButtonBar
private transient FormSheet m_fsCurrent
private transient MenuSheet m_msCurrent
protected transient javax.swing.event.EventListenerList m_ellListeners
Constructor Detail |
---|
public JDisplayDialog()
public JDisplayDialog(java.awt.Window jfOwner)
jfOwner
- the JFrame owning the display dialog.Method Detail |
---|
private java.lang.Object getWaiter()
setFormSheet(org.salespointframework.core.FormSheet)
when the FormSheet demands it.
public void setVisible(boolean value)
setVisible
in class java.awt.Dialog
public void closeFormSheet(FormSheet fs)
If a FormSheet is closed, by default, the JDisplayDialog containing it is also closed. You can,
however, alter this behavior by overriding formSheetClosed()
.
closeFormSheet
in interface FormSheetContainer
fs
- the FormSheet to be closed.protected void formSheetClosed()
public void dispose()
dispose
in class java.awt.Window
public void onFormSheetCaptionChanged(FormSheet fs, java.lang.String sNewCaption)
onFormSheetCaptionChanged
in interface FormSheetContainer
fs
- the FormSheet whose caption changed.sNewCaption
- the new caption of the FormSheet.public void onFormSheetComponentChanged(FormSheet fs, javax.swing.JComponent jcmpNew)
onFormSheetComponentChanged
in interface FormSheetContainer
fs
- the FormSheet whose component changed.jcmpNew
- the new component of the FormSheet.public void onFormSheetButtonAdded(FormSheet fs, FormSheet.FormButton fb)
onFormSheetButtonAdded
in interface FormSheetContainer
fs
- the FormSheet whose button bar changed.fb
- the button that was added to the FormSheet.public void onFormSheetButtonRemoved(FormSheet fs, FormSheet.FormButton fb)
onFormSheetButtonRemoved
in interface FormSheetContainer
fs
- the FormSheet whose button bar changed.fb
- the button that was removed from the FormSheet.public void onFormSheetButtonsCleared(FormSheet fs)
onFormSheetButtonsCleared
in interface FormSheetContainer
fs
- the FormSheet whose button bar was cleared.public void setFormSheet(FormSheet fs) throws java.lang.InterruptedException
If fs.waitResponse()
returns true,
setFormSheet()
blocks, until the FormSheet is closed by a matching
call to closeFormSheet(org.salespointframework.core.FormSheet)
.
setFormSheet
in interface Display
fs
- the FormSheet to be displayed.
java.lang.InterruptedException
- if an interrupt occurs while waiting for the
FormSheet to be closed.public FormSheet getFormSheet()
FormSheet
that is currently attached to the display.
getFormSheet
in interface Display
public void closeFormSheet()
closeFormSheet
in interface Display
public void popUpFormSheet(FormSheet fs) throws java.lang.InterruptedException
JDisplayDialog
and display the FormSheet in it.
popUpFormSheet
in interface Display
fs
- the FormSheet to be displayed.
java.lang.InterruptedException
- if an interrupt occured while waiting for the
FormSheet to be closed.public void popUpFormSheet(FormSheet fsParent, FormSheet fsToSet) throws java.lang.InterruptedException
JDisplayDialog
which is assigned to a FormSheet and displays
another FormSheet in it.
fsParent
- the FormSheet to which the JDisplayDialog is assigned.fsToSet
- the FormSheet which is displayed by the JDisplayDialog.
java.lang.InterruptedException
- if an interrupt occured while waiting for the
FormSheet to be closed.public void setMenuSheet(MenuSheet ms)
setMenuSheet
in interface Display
ms
- the MenuSheet to be displayed.public MenuSheet getMenuSheet()
MenuSheet
that is currently attached to the display.
getMenuSheet
in interface Display
public boolean isUseableDisplay()
isUseableDisplay
in interface Display
public void addFormSheetListener(FormSheetListener fsl)
addFormSheetListener
in interface Display
fsl
- the FormSheetListener to be registered.public void removeFormSheetListener(FormSheetListener fsl)
removeFormSheetListener
in interface Display
fsl
- the FormSheetListener to be unregistered.protected void fireFormSheetSet(FormSheet fs)
FormSheetListeners
indicating that
a FormSheet
was set on this display. As FormSheet setting is always explicit, no
extra parameter is necessary.
fs
- the FormSheet that was setprotected void fireFormSheetRemoved(FormSheet fs, boolean fExplicit)
FormSheetListeners
indicating that
a FormSheet
was removed from this display.
fs
- the FormSheet that was setfExplicit
- true, if the FormSheet was closed explicitly, i.e. either by a call to one of
the closeFormSheet
methods or by setFormSheet (null)
.closeFormSheet()
,
closeFormSheet(FormSheet)
,
setFormSheet(org.salespointframework.core.FormSheet)
public static void main(java.lang.String[] args)
public void load(java.io.ObjectInputStream ois) throws java.io.IOException, java.lang.ClassNotFoundException
Display
As displays should not be serialized when making the Shop persistent, they cannot be normally
deserialized. Instead they should individually read the attributes they previously saved
.
The attributes must be read in the same order they have previously been writtn.
Attention: The current class that has been written by the save()
method
must not be read here!
FormSheet fsCurrent = (FormSheet)ois.readObject(); MenuSheet msCurrent = (MenuSheet)ois.readObject(); ...
load
in interface Display
ois
- the stream to read attributes from
java.io.IOException
java.lang.ClassNotFoundException
public void save(java.io.ObjectOutputStream oos) throws java.io.IOException
Display
Displays should not be serialized as a whole. Instead use this method to individually write all attributes of the display to the stream.
Attention: The very first attribute to be written must be the display's class!
Example:oos.writeObject(getClass()); oos.writeObject(fsCurrent); //current FormSheet oos.writeObject(msCurrent); //current MenuSheet ...
save
in interface Display
oos
- the stream to write attributes to
java.io.IOException
public void setButtonbarPosition(int position)
Display
setButtonbarPosition
in interface Display
public void onFormSheetButtonbarPositionChanged(FormSheet fs, int position)
FormSheetContainer
onFormSheetButtonbarPositionChanged
in interface FormSheetContainer
fs
- the Formsheet whose Buttonbar position changedposition
- the new buttonbar position
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |