|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Frame | +--javax.swing.JFrame | +--sale.multiwindow.MultiWindow
A MultiWindow is a JFrame
capable of displaying contents in multiple frames.
Those frames can be displayed either as tabbed panels or as multiple internal frames on a
javax.swing.JDesktopPane
. The view mode can be chosen by client programs by calling the setViewMode(int)
method or by the user using the "Window" menu.
To add a frame, you have to get a MultiWindowHandle
(getNewHandle()
) and set its
FormSheet
and MenuSheet
. The display will be updated automatically.
Inner Class Summary | |
static class |
MultiWindow.MultiWindowAction
Special Actions are necessary for MultiWindow-MenuSheets in order for the serialization to work properly. |
Inner classes inherited from class javax.swing.JFrame |
JFrame.AccessibleJFrame |
Inner classes inherited from class java.awt.Frame |
Frame.AccessibleAWTFrame |
Inner classes inherited from class java.awt.Window |
Window.AccessibleAWTWindow |
Inner classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent |
Field Summary | |
static String |
CASCADE_TAG
Constant used as tag for the "Cascade" option. |
static int |
MULTIFRAME
Constant for the multiframe view mode. |
static String |
MULTIWINDOW_MENU_TAG
Constant used as tag for the MultiWindowMenu. |
static int |
OVERLAPPED
Constant for cascaded arrangement of the frames in multiframe view mode. |
static String[] |
s_asViewModeTexts
The texts describing the different view modes for purposes of the "Toggle View Mode" option. |
static String |
s_sToggleViewPrefix
The text that is used to create the "Toggle View Mode" option. |
static String |
SEPARATOR_TAG
Constant used as tag for the separator in the multi window menu. |
static int |
TABBED
Constant for the tabbed view mode. |
static String |
TILE_HORIZ_TAG
Constant used as tag for the "Tile horizontally" option. |
static String |
TILE_VERT_TAG
Constant used as tag for the "Tile vertically" option. |
static int |
TILED_HORIZONTALLY
Constant for horizontally tiled arrangement of the frames in multiframe view mode. |
static int |
TILED_VERTICALLY
Constant for vertically tiled arrangement of the frames in multiframe view mode. |
static String |
TOGGLE_VIEW_TAG
Constant used as tag for the "Toggle View Mode" menu option. |
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,
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 |
Constructor Summary | |
MultiWindow()
Create a new MultiWindow without title and with the view mode initially set to MULTIFRAME. |
|
MultiWindow(String sTitle)
Create a new MultiWindow with the given title and with the view mode initially set to MULTIFRAME. |
|
MultiWindow(String sTitle,
int nViewMode)
Create a new MultiWindow with the given title and view mode. |
Method Summary | |
void |
arrangeFrames(int nArrangement)
Set the arrangement of the frames in the MultiWindow. |
void |
closeDisplay(Display dWhich)
Closes the given display. |
MenuSheet |
getCurrentMenuSheet()
Get the current global MenuSheet. |
int |
getHandleCount()
Get the number of registered MultiWindowHandles. |
MenuSheet |
getMultiWindowMenuSheet()
Return the MultiWindow management MenuSheet for this MultiWindow. |
Display |
getNewHandle()
Returns a new Display and opens a new frame for it. |
Display |
getSelectedDisplay()
Get the currently selected display. |
int |
getViewMode()
Get the current view mode. |
int |
getVisibleHandleCount()
Count all currently visible displays. |
Iterator |
iterator()
Get all registered displays. |
void |
load(ObjectInputStream ois)
Load the state of this MultiWindow from a stream. |
void |
makeInVisible(Display d)
Remove the given display from the list of visible displays. |
void |
makeVisible(Display d)
Add the given display to the list of visible displays. |
void |
makeVisible(List lmwhHandles,
Display dSelected)
Make visible the specified displays if they are members of this MultiWindow. |
void |
propertyChange(PropertyChangeEvent e)
Implementation of the method in PropertyChangeListener . |
void |
save(ObjectOutputStream oos)
Save the current state of the MultiWindow. |
void |
setDefaultMenuSheet()
Sets the default MenuSheet. |
void |
setMenuSheet(MenuSheet msNewMenuSheet)
Sets the given MenuSheet as a global MenuSheet in the MultiWindow. |
void |
setSelectedDisplay(Display d)
Set the currently selected display. |
void |
setViewMode(int nViewMode)
Set a new view mode. |
void |
stateChanged(ChangeEvent evt)
Implementation of the method in ChangeListener . |
protected void |
transformToPane()
Transform the MultiWindow to multiframe view. |
protected void |
transformToTab()
Transforms the MultiWindow to tabbed view. |
Methods inherited from class javax.swing.JFrame |
addImpl,
createRootPane,
frameInit,
getAccessibleContext,
getContentPane,
getDefaultCloseOperation,
getGlassPane,
getJMenuBar,
getLayeredPane,
getRootPane,
isRootPaneCheckingEnabled,
paramString,
processKeyEvent,
processWindowEvent,
remove,
setContentPane,
setDefaultCloseOperation,
setGlassPane,
setJMenuBar,
setLayeredPane,
setLayout,
setRootPane,
setRootPaneCheckingEnabled,
update |
Methods inherited from class java.awt.Frame |
addNotify,
finalize,
getCursorType,
getFrames,
getIconImage,
getMenuBar,
getState,
getTitle,
isResizable,
remove,
removeNotify,
setCursor,
setIconImage,
setMenuBar,
setResizable,
setState,
setTitle |
Methods inherited from class java.awt.Window |
addWindowListener,
applyResourceBundle,
applyResourceBundle,
dispose,
getFocusOwner,
getGraphicsConfiguration,
getInputContext,
getListeners,
getLocale,
getOwnedWindows,
getOwner,
getToolkit,
getWarningString,
hide,
isShowing,
pack,
postEvent,
processEvent,
removeWindowListener,
setCursor,
show,
toBack,
toFront |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getInsets,
getLayout,
getMaximumSize,
getMinimumSize,
getPreferredSize,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paint,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
remove,
removeAll,
removeContainerListener,
setFont,
validate,
validateTree |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int MULTIFRAME
setViewMode(int)
and
for recognizing the return values of getViewMode()
.public static final int TABBED
setViewMode(int)
and
for recognizing the return values of getViewMode()
.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 String MULTIWINDOW_MENU_TAG
public static final String TOGGLE_VIEW_TAG
public static final String SEPARATOR_TAG
public static final String CASCADE_TAG
public static final String TILE_HORIZ_TAG
public static final String TILE_VERT_TAG
public static String s_sToggleViewPrefix
public static String[] s_asViewModeTexts
Constructor Detail |
public MultiWindow()
public MultiWindow(String sTitle)
sTitle
- the titlepublic MultiWindow(String sTitle, int nViewMode)
sTitle
- the titlenViewMode
- the view modeMethod Detail |
public void save(ObjectOutputStream oos) throws IOException
oos
- the stream into which to save the state.public void load(ObjectInputStream ois) throws IOException, ClassNotFoundException
ois
- the input stream to restore the state from.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 |
Toggle view (MULTIFRAME/TABBED) | TOGGLE_VIEW_TAG |
Toggle between multiframe and tabbed view. | The text in the parantheses will give the type of view, that will be set when the user selects
this item. You can define the three parts of this item's text in the following static attributes:
s_sToggleViewPrefix and s_asViewModeTexts . |
Separator | SEPARATOR_TAG |
None. | |
Cascade | CASCADE_TAG |
Cascade the internal frames. When in tabbed view mode, first change view mode. | |
Tile horizontally | TILE_HORIZ_TAG |
Tile internal frames horizontally. When in tabbed view mode, first change view mode. | |
Tile vertically | TILE_VERT_TAG |
Tile internal frames vertically. When in tabbed view mode, first change view mode. |
You will find this MenuSheet in your Shop's MenuSheet, with a caption of
"MultiWindow" and a tag of MULTIWINDOW_MENU_TAG
. Please note that the MultiWindow
will try to merge in the current display's MenuSheet before a MenuSheet with exactly this tag when in
the tabbed view mode. So, if you remove the MultiWindow menu, make sure there will be a
MenuSheetObject
in the Shop's menu with that tag, or the MenuSheets will be merged to the
end of the Shop's MenuSheet.
This method is used by setDefaultMenuSheet()
.
public void setDefaultMenuSheet()
This method uses getMultiWindowMenuSheet()
to get the MenuSheet to be set.
public void setMenuSheet(MenuSheet msNewMenuSheet)
msNewMenuSheet
- the MenuSheet to be setpublic MenuSheet getCurrentMenuSheet()
public int getViewMode()
TABBED
,
MULTIFRAME
public void setViewMode(int nViewMode)
nViewMode
- the view mode to be setTABBED
,
MULTIFRAME
,
arrangeFrames(int)
public void arrangeFrames(int nArrangement)
If the MultiWindow is in multiframe mode, the new arrangement will be brought to effect at once. Otherwise it will be carried out the next time the view mode is changed to multiframe.
nArrangement
- the new Arrangementpublic Display getNewHandle()
Display
and opens a new frame for it.
This Display is a MultiWindowHandle
and may be casted for extended
functionality. However, casting will break transparency and, thus, is usually not a good
idea.
A FormSheet and a MenuSheet should be set soon since the new frame is opened immediately and would otherwise remain empty.
The display returned is initially invisible and must be made visible explicitly by calling one of
the makeVisible()
methods.
makeVisible(sale.Display)
,
makeVisible(java.util.List, sale.Display)
public void makeVisible(List lmwhHandles, Display dSelected)
All displays that are currently visible will become invisible prior to making the new set of displays visible.
lmwhHandles
- the list of displays to be made visible.dSelected
- the Display that is to become the selected display. Must be contained in
lmwhHandles
.public void makeVisible(Display d)
d
- the display to become visible.public void makeInVisible(Display d)
d
- the display to become invisible.public Iterator iterator()
public int getHandleCount()
public int getVisibleHandleCount()
public Display getSelectedDisplay()
public void setSelectedDisplay(Display d)
d
- the display to become selected. Must be visible.protected void transformToPane()
Should not be called directly but rather via setViewMode(MULTIFRAME).
protected void transformToTab()
Should not be called directly but rather via setViewMode(TABBED).
public void stateChanged(ChangeEvent evt)
ChangeListener
.
ATTENTION: This method is public as an implementation detail and must not be called directly!
public void propertyChange(PropertyChangeEvent e)
PropertyChangeListener
.
ATTENTION: This method is public as an implementation detail and must not be called directly!
public void closeDisplay(Display dWhich)
Additionally, any FormSheet that is still open on the display will be forced to close.
dWhich
- the display to close
|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |