|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Dialog javax.swing.JDialog sale.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 |
---|
JDialog.AccessibleJDialog |
Nested classes/interfaces inherited from class java.awt.Dialog |
---|
Dialog.AccessibleAWTDialog |
Nested classes/interfaces inherited from class java.awt.Window |
---|
Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
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 |
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(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. |
FormSheet |
getFormSheet()
Return the FormSheet that is currently attached to the display. |
MenuSheet |
getMenuSheet()
Return the MenuSheet that is currently attached to the display. |
boolean |
isUseableDisplay()
Return true to indicate this is a useable display. |
void |
load(ObjectInputStream ois)
Restores the display from a stream. |
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 |
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(ObjectOutputStream oos)
Writes the display to a stream. |
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 java.awt.Dialog |
---|
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface sale.Display |
---|
getBounds, setBounds, toFront |
Field Detail |
---|
protected transient EventListenerList m_ellListeners
Constructor Detail |
---|
public JDisplayDialog()
public JDisplayDialog(JFrame jfOwner)
jfOwner
- the JFrame owning the display dialog.Method Detail |
---|
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.formSheetClosed()
.protected void formSheetClosed()
public void dispose()
dispose
in class Window
public void onFormSheetCaptionChanged(FormSheet fs, String sNewCaption)
onFormSheetCaptionChanged
in interface FormSheetContainer
fs
- the FormSheet whose caption changed.sNewCaption
- the new caption of the FormSheet.public void onFormSheetComponentChanged(FormSheet fs, 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 InterruptedException
If fs.waitResponse()
returns true,
setFormSheet()
blocks, until the FormSheet is closed by a matching
call to closeFormSheet(sale.FormSheet)
.
setFormSheet
in interface Display
fs
- the FormSheet to be displayed.
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 InterruptedException
JDisplayDialog
and display the FormSheet in it.
popUpFormSheet
in interface Display
fs
- the FormSheet to be displayed.
InterruptedException
- if an interrupt occured while waiting for the
FormSheet to be closed.public void popUpFormSheet(FormSheet fsParent, FormSheet fsToSet) throws 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.
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(sale.FormSheet)
public static void main(String[] args)
public void load(ObjectInputStream ois) throws IOException, 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
IOException
ClassNotFoundException
public void save(ObjectOutputStream oos) throws 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
IOException
|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |