|
||||||||||
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.Frame
javax.swing.JFrame
org.salespointframework.core.JDisplayFrame
public class JDisplayFrame
A JFrame 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
. 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. See load()
and store()
for details.
Nested Class Summary | |
---|---|
private static class |
JDisplayFrame.DFFormSheetContainer
|
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
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 | |
---|---|
private JDisplayFrame.DFFormSheetContainer |
m_dffscContainer
|
private boolean |
m_fHadFormSheet
If true, a Formsheet has been displayed on this display at least once. |
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. |
protected ListenerHelper |
m_lhListeners
The list of listeners. |
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. |
private java.lang.String |
m_sPrimaryTitle
|
private java.lang.String |
m_sSecondaryTitle
|
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
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, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JDisplayFrame()
Create a new JDisplayFrame. |
Method Summary | |
---|---|
void |
addFormSheetListener(FormSheetListener fsl)
Add a listener to receive notification on the JDisplayFrame's FormSheet. |
void |
closeFormSheet()
Close the current FormSheet. |
void |
closeFormSheet(FormSheet fs)
Closes a FormSheet. |
void |
dispose()
In addition to disposing of the peer resources, remove the FormSheet and the MenuSheet. |
protected void |
exitForm()
Hook method called when the frame is about to be closed. |
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. |
java.lang.String |
getPrimaryTitle()
|
java.lang.String |
getSecondaryTitle()
|
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. |
protected void |
onDisplayFocusGained()
|
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,
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 |
removeFormSheetListener(FormSheetListener fsl)
Remove a listener to receive notification on the JDisplayFrame's FormSheet. |
void |
save(java.io.ObjectOutputStream oos)
Writes the display to a stream. |
void |
setBounds(java.awt.Rectangle r)
Sets size an position of the display. |
void |
setButtonbarPosition(int position)
Called to update the Buttonbar position |
void |
setDisplayTitle()
|
void |
setFormSheet(FormSheet fs)
Set and display a FormSheet. |
void |
setMenuSheet(MenuSheet ms)
Set and display a MenuSheet. |
void |
setPrimaryTitle(java.lang.String sPrimaryTitle)
|
void |
setSecondaryTitle(java.lang.String sSecondaryTitle)
|
Methods inherited from class javax.swing.JFrame |
---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
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, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, 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, 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, toFront |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
private java.lang.String m_sPrimaryTitle
private java.lang.String m_sSecondaryTitle
private FormSheet m_fsCurrent
private MenuSheet m_msCurrent
protected ListenerHelper m_lhListeners
private JDisplayFrame.DFFormSheetContainer m_dffscContainer
private boolean m_fHadFormSheet
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
Constructor Detail |
---|
public JDisplayFrame()
Method Detail |
---|
private java.lang.Object getWaiter()
setFormSheet(org.salespointframework.core.FormSheet)
when the FormSheet demands it.
protected void onDisplayFocusGained()
public void setPrimaryTitle(java.lang.String sPrimaryTitle)
public java.lang.String getPrimaryTitle()
public void setSecondaryTitle(java.lang.String sSecondaryTitle)
public java.lang.String getSecondaryTitle()
public void setDisplayTitle()
protected void exitForm()
By default cancels any FormSheet being currently displayed and closes the frame.
public void setFormSheet(FormSheet fs) throws java.lang.InterruptedException
This method should attach a FormSheetContainer as the FormSheet's display,
get the FormSheet's caption, component and button bar and render them. The entire
peer creation should be synchronized using FormSheet.getComponentLock()
and FormSheet.getButtonsLock()
, so as not to loose any events.
If fs.waitResponse()
returns true,
setFormSheet()
should block, until the FormSheet is closed by a matching
call to a closeFormSheet()
method.
If a FormSheet is already being displayed, setFormSheet()
should cancel this
FormSheet prior to setting the new FormSheet.
setFormSheet
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 setBounds(java.awt.Rectangle r)
Display
setBounds
in interface Display
setBounds
in class java.awt.Window
r
- the Rectangle that contains the size and position information.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 setMenuSheet(MenuSheet ms)
If a MenuSheet is already being displayed, setMenuSheet()
should remove this
MenuSheet prior to setting the new MenuSheet.
setMenuSheet
in interface Display
ms
- the MenuSheet to be displayed. null
is a valid value and should result in the
current MenuSheet being closed.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 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()
.
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)
fs
- the FormSheet whose caption changed.sNewCaption
- the new caption of the FormSheet.public void onFormSheetComponentChanged(FormSheet fs, javax.swing.JComponent jcmpNew)
fs
- the FormSheet whose component changed.jcmpNew
- the new component of the FormSheet.public void onFormSheetButtonAdded(FormSheet fs, FormSheet.FormButton fb)
fs
- the FormSheet whose button bar changed.fb
- the button that was added to the FormSheet.public void onFormSheetButtonRemoved(FormSheet fs, FormSheet.FormButton fb)
fs
- the FormSheet whose button bar changed.fb
- the button that was removed from the FormSheet.public void onFormSheetButtonsCleared(FormSheet fs)
fs
- the FormSheet whose button bar was cleared.public void setButtonbarPosition(int position)
Display
setButtonbarPosition
in interface Display
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |