org.salespointframework.desktop.multiwindow
Class MultiWindow

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by org.salespointframework.desktop.multiwindow.MultiWindow
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class MultiWindow
extends javax.swing.JFrame
implements javax.swing.event.ChangeListener

A MultiWindow is a JFrame capable managing all kinds of Displays.

There are three view modes:

FRAME: Displays are DisplayFrames, that is, every Display has its own window (JFrame)
TAB: Displays are TabbedFrames. The MultiWindow contains a row of tabs, each of which is a Display
DESKTOP: Displays are DesktopFrames. These are Windows that can be moved within the frame borders of the MultiWindow. (see JDesktopPane)

The view mode can be chosen by client programs by calling the setViewMode(int) method or by the user using the "MultiWindow" menu.

Displays can be added via the addSalesPointDisplay(SalesPoint) method and removed with removeSalesPointDisplay(SalesPoint). When a display is added it will be saved until it is explicitly closed.

The displays will be updated automatically when FormSheets or MenuSheets are set.

Since:
v2.0
Version:
4.0
Author:
Sven Matznick, Stephan Gambke, Andreas Bartho, Thomas Kissinger
See Also:
Serialized Form

Nested Class Summary
 class MultiWindow.DesktopFrame
          This class is actually used by MultiWindow to display SalesPoints in desktop view mode.
 class MultiWindow.DisplayFrame
          This class is actually used by MultiWindow to display SalesPoints in window view mode.
static class MultiWindow.MultiWindowAction
          Special Actions are necessary for MultiWindow-MenuSheets in order for the serialization to work properly.
 class MultiWindow.TabbedFrame
          This class is actually used by MultiWindow to display SalesPoints in tabbed view mode.
 
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
static java.lang.String CASCADE_MENU_TAG
          Constant used as tag for the "Cascade" option.
static java.lang.String DESKTOP_MENU_TAG
          Constant used as tag for the "Desktop" menu option.
static int DESKTOP_VIEW
          Constant for the desktop view mode.
protected  java.lang.String m_sMergeBefore
          Contains the tag of the MultiWindow's MenuSheet, in front of which the active SalesPoint's MenuSheet should be merged when in tabbed view mode.
static java.lang.String MULTIWINDOW_MENU_TAG
          Constant used as tag for the MultiWindowMenu.
static int OVERLAPPED
          Constant for cascaded arrangement of the frames in window or desktop view mode.
static java.lang.String SEPARATOR_TAG
          Constant used as tag for the separator in the multi window menu.
static java.lang.String TABBED_MENU_TAG
          Constant used as tag for the "Tabbed" menu option.
static int TABBED_VIEW
          Constant for the tabbed view mode.
static java.lang.String TILE_HORIZ_MENU_TAG
          Constant used as tag for the "Tile horizontally" option.
static java.lang.String TILE_VERT_MENU_TAG
          Constant used as tag for the "Tile vertically" option.
static int TILED_HORIZONTALLY
          Constant for horizontally tiled arrangement of the frames in window or desktop view mode.
static int TILED_VERTICALLY
          Constant for vertically tiled arrangement of the frames in window or desktop view mode.
static java.lang.String WINDOW_MENU_TAG
          Constant used as tag for the "Window" menu option.
static int WINDOW_VIEW
          Constant for the window view mode.
 
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
MultiWindow(Shop sShop, int nViewMode)
          Creates a new MultiWindow for the given Shop and initializes the viewmode.
 
Method Summary
protected  void addAllDisplays()
          Sets the displays of all open SalesPoints according to the current view mode.
 void addSalesPointDisplay(SalesPoint sp)
          Opens a display for a SalesPoint according to the current view mode.
 void arrangeFrames(int nArrangement)
          Sets the arrangement of the frames in the MultiWindow.
 void backupOffscreenBuffer(javax.swing.JComponent cmp, int surroundingX, int surroundingY)
          Backup the offscreenbuffer for preventing paintimmediately calls form corrupting paint operations, which are in progress
 void clearOffscreenBuffer(javax.swing.JComponent cmp, int surroundingX, int surroundingY)
          Clears the offscreen buffer
 void closeSalesPointDisplay(SalesPoint sp)
          Closes a SalesPoint's display as removeSalesPointDisplay(SalesPoint) does.
protected  javax.swing.JDesktopPane createDesktopPane()
          Creates and returns the JPanel which is used as content pane in DESKTOP_VIEW view mode.
protected  javax.swing.JPanel createFramePane()
          Creates and returns the JPanel which is used as content pane in WINDOW_VIEW view mode.
protected  IconTabbedPane createTabbedPane()
          Creates and returns the IconTabbedPane which is used as content pane in TABBED_VIEW view mode.
 MenuSheet getCurrentMenuSheet()
          Gets the current global MenuSheet.
protected  javax.swing.JDesktopPane getDesktopPane()
          Returns the JDesktopPane to be added to the content pane in DESKTOP_VIEW view mode.
 javax.swing.JPanel getDragLayer()
          get the drag layer of this frame
protected  javax.swing.JPanel getFramePane()
          Returns the JPanel to be added to the content pane in WINDOW_VIEW view mode.
 javax.swing.JPanel getModalLayer()
          get the modal layer of this frame
 MenuSheet getMultiWindowMenuSheet()
          Returns the MultiWindow management MenuSheet for this MultiWindow.
 Display getNewInternalFrame(SalesPoint sp)
          Creates and returns a new DesktopFrame for a SalesPoint.
 Display getNewTab(SalesPoint sp)
          Creates and returns a new TabbedFame for a SalesPoint.
 Display getNewWindow(SalesPoint sp)
          Creates and returns a new DisplayFrame for a SalesPoint.
 javax.swing.JPanel getPopupLayer()
          get the popup layer of this frame
protected  javax.swing.JPanel getStatusBar()
          create the status bar and register PersistenceStateListener
protected  IconTabbedPane getTabbedPane()
          Returns the IconTabbedPane to be added to the content pane in TABBED_VIEW view mode.
 int getViewMode()
          Gets the current view mode.
protected  void prepareNewContentPane(int viewMode)
          Prepares the MultiWindow's content pane for a new view mode.
protected  void removeAllDisplays()
          Closes the displays of all open SalesPoints.
 void restoreOffscreenBuffer(javax.swing.JComponent cmp)
          restore the offscreenbuffer which was backed up by backupOffscreenBuffer(JComponent, int, int)
protected  void setDefaultLayeredPane()
          We need to setup a Layoutmanager to layout our additional panes in z-order to take up the entire frame because of a weak implementation in RootLayout of JRootPane: "Note: This is laying out the children in the layeredPane, technically, these are not our children."
protected  void setDefaultLayers()
          prepare and set the frames popup layer
 void setDefaultMenuSheet()
          Sets the default MenuSheet.
 void setMenuSheet(MenuSheet msNewMenuSheet)
          Sets the given MenuSheet as a global MenuSheet in the MultiWindow.
protected  void setMergeBefore(java.lang.String sMergeBefore)
          Sets the value of m_sMergeBefore.
 void setSecondMenuSheet(MenuSheet ms)
          Merges the MultiWindow's MenuSheet with a second one.
 void setViewMode(int viewMode)
          Sets a new view mode.
 void stateChanged(javax.swing.event.ChangeEvent evt)
          Implementation of the method in ChangeListener.
 
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, dispose, 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, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, 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, 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 java.awt.MenuContainer
getFont, postEvent
 

Field Detail

m_sMergeBefore

protected java.lang.String m_sMergeBefore
Contains the tag of the MultiWindow's MenuSheet, in front of which the active SalesPoint's MenuSheet should be merged when in tabbed view mode.
The default implementation is null, so SalesPoint's menus appear behind all Shop's menus. It is also possible to use setMergeBefore(String) to change this variable's value.

See Also:
setSecondMenuSheet(org.salespointframework.core.MenuSheet)

WINDOW_VIEW

public static final int WINDOW_VIEW
Constant for the window view mode. Should be used as parameter for setViewMode(int) and for recognizing the return values of getViewMode().

See Also:
Constant Field Values

TABBED_VIEW

public static final int TABBED_VIEW
Constant for the tabbed view mode. Should be used as parameter for setViewMode(int) and for recognizing the return values of getViewMode().

See Also:
Constant Field Values

DESKTOP_VIEW

public static final int DESKTOP_VIEW
Constant for the desktop view mode. Should be used as parameter for setViewMode(int) and for recognizing the return values of getViewMode().

See Also:
Constant Field Values

OVERLAPPED

public static final int OVERLAPPED
Constant for cascaded arrangement of the frames in window or desktop view mode. Should be used as parameter for arrangeFrames(int).

See Also:
Constant Field Values

TILED_VERTICALLY

public static final int TILED_VERTICALLY
Constant for vertically tiled arrangement of the frames in window or desktop view mode. Should be used as parameter for arrangeFrames(int).

See Also:
Constant Field Values

TILED_HORIZONTALLY

public static final int TILED_HORIZONTALLY
Constant for horizontally tiled arrangement of the frames in window or desktop view mode. Should be used as parameter for arrangeFrames(int).

See Also:
Constant Field Values

MULTIWINDOW_MENU_TAG

public static final java.lang.String MULTIWINDOW_MENU_TAG
Constant used as tag for the MultiWindowMenu. Use this constant to gain access to the menu and manipulate it.

See Also:
Constant Field Values

WINDOW_MENU_TAG

public static final java.lang.String WINDOW_MENU_TAG
Constant used as tag for the "Window" menu option. Use this constant to gain access to the menu and manipulate it.

See Also:
Constant Field Values

TABBED_MENU_TAG

public static final java.lang.String TABBED_MENU_TAG
Constant used as tag for the "Tabbed" menu option. Use this constant to gain access to the menu and manipulate it.

See Also:
Constant Field Values

DESKTOP_MENU_TAG

public static final java.lang.String DESKTOP_MENU_TAG
Constant used as tag for the "Desktop" menu option. Use this constant to gain access to the menu and manipulate it.

See Also:
Constant Field Values

SEPARATOR_TAG

public static final java.lang.String SEPARATOR_TAG
Constant used as tag for the separator in the multi window menu. Use this constant to gain access to the menu and manipulate it.

See Also:
Constant Field Values

CASCADE_MENU_TAG

public static final java.lang.String CASCADE_MENU_TAG
Constant used as tag for the "Cascade" option. Use this constant to gain access to the menu and manipulate it.

See Also:
Constant Field Values

TILE_HORIZ_MENU_TAG

public static final java.lang.String TILE_HORIZ_MENU_TAG
Constant used as tag for the "Tile horizontally" option. Use this constant to gain access to the menu and manipulate it.

See Also:
Constant Field Values

TILE_VERT_MENU_TAG

public static final java.lang.String TILE_VERT_MENU_TAG
Constant used as tag for the "Tile vertically" option. Use this constant to gain access to the menu and manipulate it.

See Also:
Constant Field Values
Constructor Detail

MultiWindow

public MultiWindow(Shop sShop,
                   int nViewMode)
Creates a new MultiWindow for the given Shop and initializes the viewmode. The MultiWindow's caption will be the Shop's frame title.

Parameters:
sShop - the Shop for which the MultiWindow is created
nViewMode - the initial view mode
Method Detail

setDefaultLayeredPane

protected void setDefaultLayeredPane()
We need to setup a Layoutmanager to layout our additional panes in z-order to take up the entire frame because of a weak implementation in RootLayout of JRootPane: "Note: This is laying out the children in the layeredPane, technically, these are not our children." so we just need to layout our additional layers and let menubar and contentpane untouched


setDefaultLayers

protected void setDefaultLayers()
prepare and set the frames popup layer


getPopupLayer

public javax.swing.JPanel getPopupLayer()
get the popup layer of this frame

Returns:
a JPanel

getModalLayer

public javax.swing.JPanel getModalLayer()
get the modal layer of this frame

Returns:
a JPanel

getDragLayer

public javax.swing.JPanel getDragLayer()
get the drag layer of this frame

Returns:
a JPanel

getMultiWindowMenuSheet

public MenuSheet getMultiWindowMenuSheet()
Returns the MultiWindow management MenuSheet for this MultiWindow.

The MultiWindow management MenuSheet contains the following items for managing the look of the MultiWindow:

Item text Item tag Item action Comments
Window WINDOW_MENU_TAG Change to Window view. Executes WindowAction. All SalesPoints will have their displays converted to DisplayFrames, i.e. all SalesPoints are shown in a separate window.
Tabbed TABBED_MENU_TAG Change to Tab view. Executes TabAction. All SalesPoints will have their displays converted to TabbedFrames, i.e. the MultiFrame will contain a row of tabs each of which displays a SalesPoint. The SalesPoint's menus will be merged with the Shop's menu.
See also setSecondMenuSheet(org.salespointframework.core.MenuSheet)
Desktop DESKTOP_MENU_TAG Change to Desktop view. Executes DesktopAction. All SalesPoints will have their displays converted to DesktopFrames, i.e. all SalesPoints are shown in a separate window. But in contrast to Window view mode the SalesPoints cannot moved around the whole screen but only within the borders of the MultiWindow.
Separator SEPARATOR_TAG None.
Cascade CASCADE_MENU_TAG Cascade the Displays. Is ignored in tabbed view mode. Executes CascadeAction.
Tile horizontally TILE_HORIZ_MENU_TAG Tile internal frames horizontally. Is ignored in tabbed view mode. Executes TileHorizontallyAction.
Tile vertically TILE_VERT_MENU_TAG Tile internal frames vertically. Is ignored in tabbed view mode. Executes TileVerticallyAction.

This method is used by setDefaultMenuSheet().

Note: When adding new MenuSheetItems make sure the Actions are not implemented as anonymous inner classes as this causes problems on serialization. See MultiWindowAction for details.

Returns:
a MenuSheet representing the default MultiWindow menu

setDefaultMenuSheet

public void setDefaultMenuSheet()
Sets the default MenuSheet.

This method uses getMultiWindowMenuSheet() to get the MenuSheet to be set. The actual setting of the MenuSheet is performed by setMenuSheet(org.salespointframework.core.MenuSheet)


setMenuSheet

public void setMenuSheet(MenuSheet msNewMenuSheet)
Sets the given MenuSheet as a global MenuSheet in the MultiWindow.

Parameters:
msNewMenuSheet - the MenuSheet to be set

setSecondMenuSheet

public void setSecondMenuSheet(MenuSheet ms)
Merges the MultiWindow's MenuSheet with a second one.

The position of the inserted MenuSheet is determined from the m_sMergeBefore variable. The MultiWindow's very MenuSheet object will not be changed, only the MenuSheet's view is altered.

This method is used to insert SalesPoint's MenuSheets into the MultiFrame's MenuSheet when in tabbed view mode, because tabs cannot contain menus. The actual merging is done by MenuSheet.mergePeers(org.salespointframework.core.MenuSheet, java.lang.String).

Parameters:
ms - The MenuSheet to be added.
See Also:
setMergeBefore(java.lang.String)

setMergeBefore

protected void setMergeBefore(java.lang.String sMergeBefore)
Sets the value of m_sMergeBefore.

This variable contains a menu tag, in front of which a second MenuSheet will be added when executing setSecondMenuSheet(org.salespointframework.core.MenuSheet)

Parameters:
sMergeBefore - the menu's tag in front of which a second MenuSheet should be added

getCurrentMenuSheet

public MenuSheet getCurrentMenuSheet()
Gets the current global MenuSheet.


getViewMode

public int getViewMode()
Gets the current view mode.

Returns:
an int value representing the view mode
See Also:
WINDOW_VIEW, TABBED_VIEW, DESKTOP_VIEW

setViewMode

public void setViewMode(int viewMode)
Sets a new view mode.

When setting a new view mode, all open displays are closed, the MultiWindow's content pane is prepared for the new view mode and all displays that have been closed are converted and added according to the new view mode.

Parameters:
viewMode - the view mode to be set
See Also:
WINDOW_VIEW, TABBED_VIEW, DESKTOP_VIEW

prepareNewContentPane

protected void prepareNewContentPane(int viewMode)
Prepares the MultiWindow's content pane for a new view mode.

In fact, not the content pane directly is set. Instead an appropriate JComponent is added to the content pane.

View mode Set Component
WINDOW_VIEW Adds the JComponent that is returned by getFramePane(), by default an empty JPanel.
TABBED_VIEW Adds the JComponent that is returned by getTabbedPane(), by default a IconTabbedPane.
DESKTOP_VIEW Adds the JComponent that is returned by getDesktopPane(), by default a JDesktopPane.

Parameters:
viewMode - the view mode to be prepared

getStatusBar

protected javax.swing.JPanel getStatusBar()
create the status bar and register PersistenceStateListener

Returns:
statusbar panel

clearOffscreenBuffer

public void clearOffscreenBuffer(javax.swing.JComponent cmp,
                                 int surroundingX,
                                 int surroundingY)
Clears the offscreen buffer

Parameters:
cmp - only size is needed
surroundingX - x space
surroundingY - y space

backupOffscreenBuffer

public void backupOffscreenBuffer(javax.swing.JComponent cmp,
                                  int surroundingX,
                                  int surroundingY)
Backup the offscreenbuffer for preventing paintimmediately calls form corrupting paint operations, which are in progress

Parameters:
cmp - the component you wish to paintimmediately
surroundingX - additional space to backup
surroundingY - additional space to backup

restoreOffscreenBuffer

public void restoreOffscreenBuffer(javax.swing.JComponent cmp)
restore the offscreenbuffer which was backed up by backupOffscreenBuffer(JComponent, int, int)

Parameters:
cmp, - component which just called paintimmediately

getTabbedPane

protected IconTabbedPane getTabbedPane()
Returns the IconTabbedPane to be added to the content pane in TABBED_VIEW view mode.


createTabbedPane

protected IconTabbedPane createTabbedPane()
Creates and returns the IconTabbedPane which is used as content pane in TABBED_VIEW view mode.


getDesktopPane

protected javax.swing.JDesktopPane getDesktopPane()
Returns the JDesktopPane to be added to the content pane in DESKTOP_VIEW view mode.


createDesktopPane

protected javax.swing.JDesktopPane createDesktopPane()
Creates and returns the JPanel which is used as content pane in DESKTOP_VIEW view mode.


getFramePane

protected javax.swing.JPanel getFramePane()
Returns the JPanel to be added to the content pane in WINDOW_VIEW view mode.


createFramePane

protected javax.swing.JPanel createFramePane()
Creates and returns the JPanel which is used as content pane in WINDOW_VIEW view mode.


addAllDisplays

protected void addAllDisplays()
Sets the displays of all open SalesPoints according to the current view mode.

This method iterates over the list of active SalesPoints (see Shop.getSalesPoints()) and calls addSalesPointDisplay(org.salespointframework.core.SalesPoint) for each one.


removeAllDisplays

protected void removeAllDisplays()
Closes the displays of all open SalesPoints.

This method iterates over the list of active SalesPoints (see Shop.getSalesPoints()) and calls removeSalesPointDisplay(org.salespointframework.core.SalesPoint) for each one.


addSalesPointDisplay

public void addSalesPointDisplay(SalesPoint sp)
Opens a display for a SalesPoint according to the current view mode.

Depending on the view mode set, this method calls addSalesPoint_Window(org.salespointframework.core.SalesPoint), addSalesPoint_Tab(org.salespointframework.core.SalesPoint) or addSalesPoint_InternalFrame(org.salespointframework.core.SalesPoint).

Parameters:
sp - the SalesPoint for which to add a Display.

closeSalesPointDisplay

public void closeSalesPointDisplay(SalesPoint sp)
Closes a SalesPoint's display as removeSalesPointDisplay(SalesPoint) does. Additionally all displays that have been saved for this SalesPoint will be deleted.

Parameters:
sp - the SalesPoint for which to close the display.

arrangeFrames

public void arrangeFrames(int nArrangement)
Sets the arrangement of the frames in the MultiWindow.

If in window or desktop viewing mode, the frames will be rearranged. In tabbed mode nothing happens.

Parameters:
nArrangement - the new Arrangement
See Also:
OVERLAPPED, TILED_HORIZONTALLY, TILED_VERTICALLY

getNewTab

public Display getNewTab(SalesPoint sp)
Creates and returns a new TabbedFame for a SalesPoint.

Parameters:
sp - the SalesPoint for which to create the display
Returns:
the created display

getNewInternalFrame

public Display getNewInternalFrame(SalesPoint sp)
Creates and returns a new DesktopFrame for a SalesPoint.

Parameters:
sp - the SalesPoint for which to create the display
Returns:
the created display

getNewWindow

public Display getNewWindow(SalesPoint sp)
Creates and returns a new DisplayFrame for a SalesPoint.

Parameters:
sp - the SalesPoint for which to create the display
Returns:
the created display

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent evt)
Implementation of the method in ChangeListener.

This method is invoked when Tabs in tabbed mode are changed. This is to ensure that always the correct second MenuSheet is set.

ATTENTION: This method is public as an implementation detail and must not be called directly!

Specified by:
stateChanged in interface javax.swing.event.ChangeListener