|
||||||||||
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.desktop.multiwindow.MultiWindow
public class MultiWindow
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.
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 | |
---|---|
private static javax.swing.ImageIcon |
CASCADE_ICON
Icon MenuItem "Cascade". |
static java.lang.String |
CASCADE_MENU_TAG
Constant used as tag for the "Cascade" option. |
private java.awt.image.BufferedImage |
currentWindowBackground
Currently used background image |
private java.awt.image.BufferedImage |
currentWindowImage
Currently used foreground image |
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. |
private static javax.swing.ImageIcon |
HORIZONTAL_ICON
Icon MenuItem "Tile horizontally". |
private javax.swing.JPanel |
m_dragLayer
the popup layer |
private javax.swing.JComponent |
m_jcShopComponent
The main Component for this MultiWindow. |
private javax.swing.JDesktopPane |
m_jdpDesktopPane
The main Component for this MultiWindow in DESKTOP view mode, i.e. |
private javax.swing.JPanel |
m_jpFramePane
The main Component for this MultiWindow in FRAME view mode, i.e. |
private IconTabbedPane |
m_jtpTabPane
The main Component for this MultiWindow in TAB view mode, i.e. |
private java.util.LinkedList<MultiWindow.MultiWindowAction> |
m_lActions
The MultiWindowActions registered with this MultiWindow. |
private javax.swing.JPanel |
m_modalLayer
the modal layer |
private java.util.HashMap<java.lang.Integer,JDisplayFrame> |
m_mpjdfDisplayFrames
The map of currently open DisplayFrames. |
private java.util.HashMap<java.lang.Integer,JInternalDisplay> |
m_mpjidInternalDisplays
The map of currently open DesktopFrames. |
private java.util.HashMap<java.lang.Integer,JTabDisplay> |
m_mpjtdTabDisplays
The map of currently open TabbedFrames. |
private MenuSheet |
m_msCurrentMenuSheet
The currently set global MenuSheet. |
private int |
m_nArrangement
Current frame arrangement. |
private java.lang.Integer |
m_nSelectedFrame
The ID of the currently selected frame. |
private int |
m_nViewMode
Current view mode. |
private javax.swing.JPanel |
m_popupLayer
The popup layer |
private Shop |
m_shShop
Reference to the Shop for which the MultiWindow was created. |
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. |
private javax.swing.JPanel |
m_statusBar
The statusbar in the bottom |
private java.lang.Object |
menusheetLock
menusheet lock |
static java.lang.String |
MULTIWINDOW_MENU_TAG
Constant used as tag for the MultiWindowMenu. |
private static int |
NONE
No view mode yet. |
private java.awt.image.BufferedImage |
offscreenBufferBackup
Backup of the in memory offscreen buffer. used for paintimmediately issues |
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. |
private static javax.swing.ImageIcon |
VERTICAL_ICON
Icon MenuItem "Tile vertically". |
private java.awt.image.BufferedImage |
volatileOffscreenBufferBackup
backup of the in vram offscreen buffer. used fpr paintimmediately issues |
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. |
private void |
addSalesPoint_InternalFrame(SalesPoint sp)
Opens a DesktopFrame for a SalesPoint. |
private void |
addSalesPoint_Tab(SalesPoint sp)
Opens a TabbedFrame for a SalesPoint. |
private void |
addSalesPoint_Window(SalesPoint sp)
Opens a DisplayFrame for a SalesPoint. |
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. |
private Display |
getInternalFrame(SalesPoint sp)
Tries to retrieve a DesktopFrame for a given SalesPoint. |
private java.lang.Object |
getMenusheetLock()
get the menusheet lock |
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 |
private Display |
getTab(SalesPoint sp)
Tries to retrieve a TabbedFrame for a given SalesPoint. |
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. |
private Display |
getWindow(SalesPoint sp)
Tries to retrieve a DisplayFrame for a given SalesPoint. |
private void |
paintWindowBackground(java.awt.Graphics graphics,
javax.swing.JComponent c)
Paint the main window background |
protected void |
prepareNewContentPane(int viewMode)
Prepares the MultiWindow's content pane for a new view mode. |
(package private) void |
registerAction(MultiWindow.MultiWindowAction mwa)
Internal communications method: Register a MultiWindowAction so that it can be properly serialized. |
protected void |
removeAllDisplays()
Closes the displays of all open SalesPoints. |
private void |
removeSalesPoint_InternalFrame(SalesPoint sp)
Closes the DeskopFrame of a SalesPoint. |
private void |
removeSalesPoint_Tab(SalesPoint sp)
Closes the TabbedFrame of a SalesPoint. |
private void |
removeSalesPoint_Window(SalesPoint sp)
Closes the MultiWindow.DisplayFrame of a SalesPoint. |
private void |
removeSalesPointDisplay(SalesPoint sp)
Closes a display for a SalesPoint. |
void |
restoreOffscreenBuffer(javax.swing.JComponent cmp)
restore the offscreenbuffer which was backed up by backupOffscreenBuffer(JComponent, int, int) |
private void |
runAndWait(java.lang.Thread t)
As Swing is not threadsafe, removing a tab or an internal frame might cause an ArrayIndexOutOfBoundsException. |
private void |
setAppropriateDisplay(SalesPoint sp,
int mode)
Prepares the SalesPoint's display according to a view mode. |
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 . |
private void |
updateMenuBar(java.awt.Component cmpTab)
|
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, 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, 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 java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
private java.awt.image.BufferedImage currentWindowBackground
private java.awt.image.BufferedImage currentWindowImage
private javax.swing.JComponent m_jcShopComponent
private javax.swing.JPanel m_jpFramePane
private IconTabbedPane m_jtpTabPane
private javax.swing.JDesktopPane m_jdpDesktopPane
private javax.swing.JPanel m_popupLayer
private javax.swing.JPanel m_modalLayer
private javax.swing.JPanel m_dragLayer
private javax.swing.JPanel m_statusBar
private int m_nViewMode
private int m_nArrangement
private java.util.HashMap<java.lang.Integer,JDisplayFrame> m_mpjdfDisplayFrames
private java.util.HashMap<java.lang.Integer,JTabDisplay> m_mpjtdTabDisplays
private java.util.HashMap<java.lang.Integer,JInternalDisplay> m_mpjidInternalDisplays
private MenuSheet m_msCurrentMenuSheet
private java.lang.Integer m_nSelectedFrame
arrangeFrames(int)
private java.util.LinkedList<MultiWindow.MultiWindowAction> m_lActions
private java.awt.image.BufferedImage offscreenBufferBackup
private java.awt.image.BufferedImage volatileOffscreenBufferBackup
private java.lang.Object menusheetLock
protected java.lang.String m_sMergeBefore
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.
setSecondMenuSheet(org.salespointframework.core.MenuSheet)
private Shop m_shShop
public static final int WINDOW_VIEW
setViewMode(int)
and
for recognizing the return values of getViewMode()
.
public static final int TABBED_VIEW
setViewMode(int)
and
for recognizing the return values of getViewMode()
.
public static final int DESKTOP_VIEW
setViewMode(int)
and
for recognizing the return values of getViewMode()
.
private static final int NONE
public static final int OVERLAPPED
arrangeFrames(int)
.
public static final int TILED_VERTICALLY
arrangeFrames(int)
.
public static final int TILED_HORIZONTALLY
arrangeFrames(int)
.
public static final java.lang.String MULTIWINDOW_MENU_TAG
public static final java.lang.String WINDOW_MENU_TAG
public static final java.lang.String TABBED_MENU_TAG
public static final java.lang.String DESKTOP_MENU_TAG
public static final java.lang.String SEPARATOR_TAG
public static final java.lang.String CASCADE_MENU_TAG
public static final java.lang.String TILE_HORIZ_MENU_TAG
public static final java.lang.String TILE_VERT_MENU_TAG
private static final javax.swing.ImageIcon HORIZONTAL_ICON
private static final javax.swing.ImageIcon VERTICAL_ICON
private static final javax.swing.ImageIcon CASCADE_ICON
Constructor Detail |
---|
public MultiWindow(Shop sShop, int nViewMode)
Shop's frame title
.
sShop
- the Shop for which the MultiWindow is creatednViewMode
- the initial view modeMethod Detail |
---|
void registerAction(MultiWindow.MultiWindowAction mwa)
mwa
- the action to be registeredprotected void setDefaultLayeredPane()
protected void setDefaultLayers()
public javax.swing.JPanel getPopupLayer()
public javax.swing.JPanel getModalLayer()
public javax.swing.JPanel getDragLayer()
public MenuSheet getMultiWindowMenuSheet()
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()
.
Actions
are
not implemented as anonymous inner classes as this causes problems on serialization.
See MultiWindowAction
for details.
private java.lang.Object getMenusheetLock()
public void setDefaultMenuSheet()
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)
public void setMenuSheet(MenuSheet msNewMenuSheet)
msNewMenuSheet
- the MenuSheet to be setpublic void setSecondMenuSheet(MenuSheet ms)
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)
.
ms
- The MenuSheet to be added.setMergeBefore(java.lang.String)
protected void setMergeBefore(java.lang.String sMergeBefore)
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)
sMergeBefore
- the menu's tag in front of which a second MenuSheet should be addedpublic MenuSheet getCurrentMenuSheet()
public int getViewMode()
WINDOW_VIEW
,
TABBED_VIEW
,
DESKTOP_VIEW
public void setViewMode(int viewMode)
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.
viewMode
- the view mode to be setWINDOW_VIEW
,
TABBED_VIEW
,
DESKTOP_VIEW
protected void prepareNewContentPane(int viewMode)
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 . |
viewMode
- the view mode to be preparedprotected javax.swing.JPanel getStatusBar()
PersistenceStateListener
public void clearOffscreenBuffer(javax.swing.JComponent cmp, int surroundingX, int surroundingY)
cmp
- only size is neededsurroundingX
- x spacesurroundingY
- y spacepublic void backupOffscreenBuffer(javax.swing.JComponent cmp, int surroundingX, int surroundingY)
cmp
- the component you wish to paintimmediatelysurroundingX
- additional space to backupsurroundingY
- additional space to backuppublic void restoreOffscreenBuffer(javax.swing.JComponent cmp)
backupOffscreenBuffer(JComponent, int, int)
cmp,
- component which just called paintimmediatelyprivate void paintWindowBackground(java.awt.Graphics graphics, javax.swing.JComponent c)
graphics
- c
- protected IconTabbedPane getTabbedPane()
protected IconTabbedPane createTabbedPane()
protected javax.swing.JDesktopPane getDesktopPane()
protected javax.swing.JDesktopPane createDesktopPane()
protected javax.swing.JPanel getFramePane()
protected javax.swing.JPanel createFramePane()
protected void addAllDisplays()
This method iterates over the list of active SalesPoints (see Shop.getSalesPoints()
) and calls
addSalesPointDisplay(org.salespointframework.core.SalesPoint)
for each one.
protected void removeAllDisplays()
This method iterates over the list of active SalesPoints (see Shop.getSalesPoints()
) and calls
removeSalesPointDisplay(org.salespointframework.core.SalesPoint)
for each one.
public void addSalesPointDisplay(SalesPoint sp)
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)
.
sp
- the SalesPoint for which to add a Display.private void removeSalesPointDisplay(SalesPoint sp)
Depending on the view mode set, this method calls addSalesPoint_Window(SalesPoint)
,
addSalesPoint_Tab(SalesPoint)
or addSalesPoint_InternalFrame(SalesPoint)
.
This method assumes, that only displays that match the current view mode are set, e.g. no
JDisplayFrame
must be set if the view mode is tabbed view and TabbedFrame
s
are expected.
sp
- the SalesPoint for which to add a Display.public void closeSalesPointDisplay(SalesPoint sp)
removeSalesPointDisplay(SalesPoint)
does. Additionally
all displays that have been saved for this SalesPoint will be deleted.
sp
- the SalesPoint for which to close the display.private void addSalesPoint_Window(SalesPoint sp)
DisplayFrame
for a SalesPoint.
This includes converting the Display
that is currently
assigned to the SalesPoint and making it visible.
sp
- the SalesPoint for which to open a Display.private void removeSalesPoint_Window(SalesPoint sp)
MultiWindow.DisplayFrame
of a SalesPoint.
sp
- the SalesPoint for which to close the display.private void addSalesPoint_Tab(SalesPoint sp)
TabbedFrame
for a SalesPoint.
This includes converting the Display
that is currently
assigned to the SalesPoint, making it visible and attaching it to the MultiWindow which
must be able to display tabs.
sp
- the SalesPoint for which to open a Display.private void removeSalesPoint_Tab(SalesPoint sp)
TabbedFrame
of a SalesPoint.
sp
- the SalesPoint for which to close the display.private void addSalesPoint_InternalFrame(SalesPoint sp)
DesktopFrame
for a SalesPoint.
This includes converting the Display
that is currently
assigned to the SalesPoint, making it visible and attaching it to the MultiWindow which
must be able to display JInternalFrames
.
sp
- the SalesPoint for which to open a Display.private void removeSalesPoint_InternalFrame(SalesPoint sp)
DeskopFrame
of a SalesPoint.
sp
- the SalesPoint for which to close the display.private void setAppropriateDisplay(SalesPoint sp, int mode) throws java.lang.InterruptedException
Depending on the desired view mode, a DisplayFrame
,
TabbedFrame
or DesktopFrame
for the SalesPoint is retrieved
or created. Then the FormSheet
, the MenuSheet
and the bounds are copied from the
old to the new display. Finally the new display is attached
to the SalesPoint.
sp
- the SalesPoint for which to change the display typemode
- the view mode to be prepared
java.lang.InterruptedException
public void arrangeFrames(int nArrangement)
If in window or desktop viewing mode, the frames will be rearranged. In tabbed mode nothing happens.
nArrangement
- the new ArrangementOVERLAPPED
,
TILED_HORIZONTALLY
,
TILED_VERTICALLY
public Display getNewTab(SalesPoint sp)
TabbedFame
for a SalesPoint.
sp
- the SalesPoint for which to create the display
private Display getTab(SalesPoint sp)
TabbedFrame
for a given SalesPoint. If no such display
exists a new one is created using getNewTab(SalesPoint)
.
sp
- the SalesPoint for which to retrieve the display
public Display getNewInternalFrame(SalesPoint sp)
DesktopFrame
for a SalesPoint.
sp
- the SalesPoint for which to create the display
private Display getInternalFrame(SalesPoint sp)
DesktopFrame
for a given SalesPoint. If no such
display exists a new one is created using getNewInternalFrame(SalesPoint)
.
sp
- the SalesPoint for which to retrieve the display
public Display getNewWindow(SalesPoint sp)
DisplayFrame
for a SalesPoint.
sp
- the SalesPoint for which to create the display
private Display getWindow(SalesPoint sp)
DisplayFrame
for a given SalesPoint.
If no such display exists a new one is created using getNewWindow(SalesPoint)
.
sp
- the SalesPoint for which to retrieve the display
public void stateChanged(javax.swing.event.ChangeEvent evt)
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!
stateChanged
in interface javax.swing.event.ChangeListener
private void updateMenuBar(java.awt.Component cmpTab)
private void runAndWait(java.lang.Thread t)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |