org.salespointframework.desktop.multiwindow
Class JInternalDisplay

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JInternalFrame
                  extended by org.salespointframework.desktop.multiwindow.JInternalDisplay
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, Display
Direct Known Subclasses:
MultiWindow.DesktopFrame

public class JInternalDisplay
extends javax.swing.JInternalFrame
implements Display

A JInternalFrame that can display Form- and MenuSheets.

This display allows SalesPoints to be displayed on a JDesktopPane.

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.

Since:
v3.1
Version:
3.1 2003-10-05
Author:
Andreas Bartho
See Also:
Serialized Form

Nested Class Summary
private static class JInternalDisplay.JIDFormSheetContainer
          The FormSheetContainer for this display.
 
Nested classes/interfaces inherited from class javax.swing.JInternalFrame
javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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  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  JInternalDisplay.JIDFormSheetContainer m_jidfscContainer
          The display's FormSheetContainer
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
          The display's main title, by default the SalesPoint's name.
private  java.lang.String m_sSecondaryTitle
          The display's secondary title, by default the FormSheet's name.
 
Fields inherited from class javax.swing.JInternalFrame
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
JInternalDisplay()
          Creates a new JInternalDisplay.
 
Method Summary
 void addFormSheetListener(FormSheetListener fsl)
          Adds a listener to receive notification on the JInternalDisplay's FormSheet.
 void closeFormSheet()
          Closes the current FormSheet.
 void closeFormSheet(FormSheet fs)
          Closes a FormSheet.
 void dispose()
          In addition to disposing of the peer resources, removes the FormSheet and the MenuSheet.
protected  void exitForm()
          Hook method called when the display is about to be closed.
protected  void fireFormSheetRemoved(FormSheet fs, boolean fExplicit)
          Fires an event to all FormSheetListeners indicating that a FormSheet was removed from this display.
protected  void fireFormSheetSet(FormSheet fs)
          Fires 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()
          Returns the FormSheet that is currently attached to the display.
 MenuSheet getMenuSheet()
          Returns the MenuSheet that is currently attached to the display.
 java.lang.String getPrimaryTitle()
          Returns the display's primary title.
 java.lang.String getSecondaryTitle()
          Returns the display's secondary title.
private  java.lang.Object getWaiter()
          Returns the object used to block setFormSheet(org.salespointframework.core.FormSheet) when the FormSheet demands it.
 boolean isUseableDisplay()
          Returns true to indicate this is a useable display.
 void load(java.io.ObjectInputStream ois)
          Restores the display from a stream.
protected  void onDisplayFocusGained()
          Executed when the JInternalDisplay receives the focus, i.e. is being activated.
 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)
          Opens a fresh JDisplayDialog and displays the FormSheet in it.
 void removeFormSheetListener(FormSheetListener fsl)
          Removse a listener to receive notification on the JInternalDisplay'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 setDisplayTitle()
          Sets the display's title.
 void setFormSheet(FormSheet fs)
          Sets and displays a FormSheet.
 void setMenuSheet(MenuSheet ms)
          Sets and displays a MenuSheet.
 void setPrimaryTitle(java.lang.String sPrimaryTitle)
          Sets the display's primary title.
 void setSecondaryTitle(java.lang.String sSecondaryTitle)
          Sets the display's secondary title.
 void toFront()
          Gives the display the focus, i.e. brings it to front and activates it.
 
Methods inherited from class javax.swing.JInternalFrame
addImpl, addInternalFrameListener, createRootPane, doDefaultCloseAction, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getFrameIcon, getGlassPane, getInternalFrameListeners, getJMenuBar, getLastCursor, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setCursor, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setTitle, setUI, show, toBack, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, 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
 

Field Detail

m_sPrimaryTitle

private java.lang.String m_sPrimaryTitle
The display's main title, by default the SalesPoint's name.


m_sSecondaryTitle

private java.lang.String m_sSecondaryTitle
The display's secondary title, by default the FormSheet's name.


m_fsCurrent

private FormSheet m_fsCurrent
The current FormSheet.


m_msCurrent

private MenuSheet m_msCurrent
The current MenuSheet.


m_fHadFormSheet

private boolean m_fHadFormSheet
If true, a Formsheet has been displayed on this display at least once.


m_lhListeners

protected ListenerHelper m_lhListeners
The list of listeners.


m_jidfscContainer

private JInternalDisplay.JIDFormSheetContainer m_jidfscContainer
The display's FormSheetContainer


m_oWaiter

private transient java.lang.Object m_oWaiter
Object used to block setFormSheet(org.salespointframework.core.FormSheet) when the FormSheet demands it.


m_jcmpComponent

private transient javax.swing.JComponent m_jcmpComponent
The currently displaying component.


m_jpButtonBar

private transient javax.swing.JPanel m_jpButtonBar
The currently displaying button bar panel.

Constructor Detail

JInternalDisplay

public JInternalDisplay()
Creates a new JInternalDisplay. Its default close operation will be set to DO_NOTHING_ON_CLOSE. Instead an InternalFrameListener will be added that executes exitForm() when the JInternalDisplay is closed and onDisplayFocusGained() when it is activated.

Method Detail

getWaiter

private java.lang.Object getWaiter()
Returns the object used to block setFormSheet(org.salespointframework.core.FormSheet) when the FormSheet demands it.


onDisplayFocusGained

protected void onDisplayFocusGained()
Executed when the JInternalDisplay receives the focus, i.e. is being activated. Does nothing by default.


setPrimaryTitle

public void setPrimaryTitle(java.lang.String sPrimaryTitle)
Sets the display's primary title. The title will be displayed in the title bar.

The whole title will be displayed as follows: primaryTitle - secondaryTitle

Parameters:
sPrimaryTitle - the primary title to be set.

getPrimaryTitle

public java.lang.String getPrimaryTitle()
Returns the display's primary title.


setSecondaryTitle

public void setSecondaryTitle(java.lang.String sSecondaryTitle)
Sets the display's secondary title. The title will be displayed in the title bar.

The whole title will be displayed as follows: primaryTitle - secondaryTitle

Parameters:
sSecondaryTitle - the secondary title to be set.

getSecondaryTitle

public java.lang.String getSecondaryTitle()
Returns the display's secondary title.


setDisplayTitle

public void setDisplayTitle()
Sets the display's title. It computes the whole title string from the primary and secondary title and assigns it to the actual JInternalFrame.


exitForm

protected void exitForm()
Hook method called when the display is about to be closed.

By default cancels any FormSheet being currently displayed and closes the frame.


setFormSheet

public void setFormSheet(FormSheet fs)
                  throws java.lang.InterruptedException
Sets and displays a FormSheet.

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.

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

getFormSheet

public FormSheet getFormSheet()
Returns the FormSheet that is currently attached to the display.

Specified by:
getFormSheet in interface Display

closeFormSheet

public void closeFormSheet()
Closes the current FormSheet. It is up to the display whether the FormSheet will be cancelled or just closed normally.

Specified by:
closeFormSheet in interface Display

popUpFormSheet

public void popUpFormSheet(FormSheet fs)
                    throws java.lang.InterruptedException
Opens a fresh JDisplayDialog and displays the FormSheet in it.

Specified by:
popUpFormSheet in interface Display
Parameters:
fs - the FormSheet to be displayed.
Throws:
java.lang.InterruptedException - if an interrupt occured while waiting for the FormSheet to be closed.

setMenuSheet

public void setMenuSheet(MenuSheet ms)
Sets and displays a MenuSheet.

If a MenuSheet is already being displayed, setMenuSheet() should remove this MenuSheet prior to setting the new MenuSheet.

Specified by:
setMenuSheet in interface Display
Parameters:
ms - the MenuSheet to be displayed. null is a valid value and should result in the current MenuSheet being closed.

getMenuSheet

public MenuSheet getMenuSheet()
Returns the MenuSheet that is currently attached to the display.

Specified by:
getMenuSheet in interface Display

isUseableDisplay

public boolean isUseableDisplay()
Returns true to indicate this is a useable display.

Specified by:
isUseableDisplay in interface Display

toFront

public void toFront()
Gives the display the focus, i.e. brings it to front and activates it.

Specified by:
toFront in interface Display
Overrides:
toFront in class javax.swing.JInternalFrame

addFormSheetListener

public void addFormSheetListener(FormSheetListener fsl)
Adds a listener to receive notification on the JInternalDisplay's FormSheet.

Specified by:
addFormSheetListener in interface Display
Parameters:
fsl - the FormSheetListener to be registered.

removeFormSheetListener

public void removeFormSheetListener(FormSheetListener fsl)
Removse a listener to receive notification on the JInternalDisplay's FormSheet.

Specified by:
removeFormSheetListener in interface Display
Parameters:
fsl - the FormSheetListener to be unregistered.

fireFormSheetSet

protected void fireFormSheetSet(FormSheet fs)
Fires 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.

Parameters:
fs - the FormSheet that was set

fireFormSheetRemoved

protected void fireFormSheetRemoved(FormSheet fs,
                                    boolean fExplicit)
Fires an event to all FormSheetListeners indicating that a FormSheet was removed from this display.

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(org.salespointframework.core.FormSheet)

closeFormSheet

public void closeFormSheet(FormSheet fs)
Closes 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().

Parameters:
fs - the FormSheet to be closed.

formSheetClosed

protected void formSheetClosed()
Hook method called when the FormSheet was closed.


dispose

public void dispose()
In addition to disposing of the peer resources, removes the FormSheet and the MenuSheet.

Overrides:
dispose in class javax.swing.JInternalFrame

onFormSheetCaptionChanged

public void onFormSheetCaptionChanged(FormSheet fs,
                                      java.lang.String sNewCaption)
Notification event informing about a change of a FormSheet's caption.

Parameters:
fs - the FormSheet whose caption changed.
sNewCaption - the new caption of the FormSheet.

onFormSheetComponentChanged

public void onFormSheetComponentChanged(FormSheet fs,
                                        javax.swing.JComponent jcmpNew)
Notification event informing about a change of a FormSheet's component.

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.

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.

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.

Parameters:
fs - the FormSheet whose button bar was cleared.

setButtonbarPosition

public void setButtonbarPosition(int position)
Description copied from interface: Display
Called to update the Buttonbar position

Specified by:
setButtonbarPosition in interface Display

load

public void load(java.io.ObjectInputStream ois)
          throws java.io.IOException,
                 java.lang.ClassNotFoundException
Description copied from interface: Display
Restores the display from a stream.

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!

Example:
 FormSheet fsCurrent = (FormSheet)ois.readObject();
 MenuSheet msCurrent = (MenuSheet)ois.readObject();
 ...
 

Specified by:
load in interface Display
Parameters:
ois - the stream to read attributes from
Throws:
java.io.IOException
java.lang.ClassNotFoundException

save

public void save(java.io.ObjectOutputStream oos)
          throws java.io.IOException
Description copied from interface: Display
Writes the display to a stream.

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
 ...
 

Specified by:
save in interface Display
Parameters:
oos - the stream to write attributes to
Throws:
java.io.IOException