|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | 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
|
+--jsc.swt.mdi.MDIApplication
This is the base class for Multiple Document Interface (MDI) applications, and is used in conjunction with windows derived from the MDIWindow class. It provides a desktop, menubar with File, Edit, Window, Options and Help menus. A toolbar provides buttons for some of the more frequently used commands of the menus. The desktop, menubar, menus and toolbar can be accessed and modified using those objects' methods.
The File menu displays filer dialogues for opening and saving files.
The Edit menu provides the usual cut, copy, paste etc., which are implemented by overriding methods of the same name in the MDIWindow class.
The Window menu keeps a list of the current windows, and commands for activating, cascading and tiling them.
The Help menu provides a window for displaying HTML help pages, a calculator and an "About" box.
| Field Summary | |
static int |
CLOSE_CANCELLED
Indicates closing of MDI window cancelled. |
static int |
CLOSE_CONFIRMED
Indicates closing of MDI window confirmed. |
protected JDesktopPane |
desktop
The MDI application's desktop. |
protected JMenu |
editMenu
The MDI application's Edit menu. |
protected JMenu |
fileMenu
The MDI application's File menu. |
protected JMenu |
helpMenu
The MDI application's Help menu. |
protected JMenuBar |
menuBar
The MDI application's menu bar. |
static int |
NO_WINDOW
Indicates no MDI window exists. |
protected JMenu |
optionsMenu
The MDI application's Options menu. |
protected JFrame |
parent
Handle to the MDI application window. |
protected ToolBar |
toolBar
The MDI application's tool bar. |
protected JMenu |
windowMenu
The MDI application's Window menu. |
| 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 | |
MDIApplication(String title,
String appIconFilename,
String windowIconFilename,
String fileExt,
String initialHelpPage,
Object aboutMessage)
Create the MDI application. |
|
| Method Summary | |
void |
closeAllWindows()
Closes all windows. |
abstract MDIWindow |
createWindow(File f)
Given a file, creates a new window of a class derived from MDIWindow. |
void |
fileWriteErrorMessage(File f)
Display file write error massage. |
MDIWindow |
getActiveWindow()
Returns the active window, or returns null if no window is active. |
protected void |
processWindowEvent(WindowEvent e)
Detect application is closing and give user the opportunity to save changed windows, or cancel the closing. |
boolean |
save(boolean saveAs,
MDIWindow win)
Save the specified window to a file. |
protected int |
saveQuery()
Check whether windows have been changed and, if any have, give user the opportunity to save them. |
void |
setClearEnabled(boolean b)
Enable/disable Clear menu item. |
void |
setCopyEnabled(boolean b)
Enable/disable Copy menu item and toolbar button. |
void |
setCutEnabled(boolean b)
Enable/disable Cut menu item and toolbar button. |
void |
setEditEnabled(boolean b)
Enable/disable Copy, Clear & Cut menu items and toolbar buttons. |
void |
setPasteEnabled(boolean b)
Enable/disable Paste menu item and toolbar button. |
void |
setTitle(String filename)
Change title of application window to display file name after title. |
| Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
| Field Detail |
public static final int NO_WINDOW
public static final int CLOSE_CANCELLED
public static final int CLOSE_CONFIRMED
protected JMenuBar menuBar
protected JMenu fileMenu
protected JMenu editMenu
protected JMenu windowMenu
protected JMenu optionsMenu
protected JMenu helpMenu
protected ToolBar toolBar
protected JDesktopPane desktop
protected JFrame parent
| Constructor Detail |
public MDIApplication(String title,
String appIconFilename,
String windowIconFilename,
String fileExt,
String initialHelpPage,
Object aboutMessage)
title - the application's title.appIconFilename - the file path of the application's icon, or null.windowIconFilename - the file path of the windows' icon, or null.fileExt - the default file extension for files opened and saved by the
application: e.g. "txt".initialHelpPage - the pathname of the text file which is initially to
be displayed in the Help window: e.g. "c:\\myapp\\help.html",aboutMessage - the message that will be displayed in the About box.
Typically this will be a simple String object, but it could
be something much more complicated such as a panel containing several
graphical and textual components.| Method Detail |
public void closeAllWindows()
public abstract MDIWindow createWindow(File f)
f - the abstract representation of the file, or null.
public void fileWriteErrorMessage(File f)
f - the abstract representation of the file.public MDIWindow getActiveWindow()
protected void processWindowEvent(WindowEvent e)
processWindowEvent in class JFrame
public boolean save(boolean saveAs,
MDIWindow win)
saveAs - if true, display file chooser dialogue.win - the window to save.
protected int saveQuery()
public void setClearEnabled(boolean b)
b - if true (false), enable (disable) Clear menu item.public void setCopyEnabled(boolean b)
b - if true (false), enable (disable) Copy menu item.public void setCutEnabled(boolean b)
b - if true (false), enable (disable) Cut menu item.public void setEditEnabled(boolean b)
b - if true (false), enable (disable) Copy, Clear & Cut menu items.public void setPasteEnabled(boolean b)
b - if true (false), enable (disable) Paste menu item.public void setTitle(String filename)
setTitle in class Framefilename - new file name.
|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||