|
|||||||||||
| 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.bs.mdi.swing.SwingMainWindow
An implementation of a MainWindow using Swing technology.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JFrame |
JFrame.AccessibleJFrame |
| Nested classes inherited from class java.awt.Frame |
Frame.AccessibleAWTFrame |
| Nested classes inherited from class java.awt.Window |
Window.AccessibleAWTWindow |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
protected Application |
application
|
protected SwingDefaultCommands |
commands
|
protected JComponent |
desktop
|
protected DataPageable |
docPrinter
|
protected JMenu |
editMenu
|
protected JMenu |
fileExportMenu
|
protected JMenu |
fileMenu
|
protected JMenuBar |
menuBar
|
protected PrinterJob |
printerJob
|
protected SwingProgressMonitor |
progressMonitor
|
protected JMenu |
recentFilesMenu
|
protected SwingStatusBar |
statusBar
|
protected JToolBar |
toolBar
|
protected MDIWindowManager |
windowManager
|
protected JMenu |
windowMenu
|
| 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 org.bs.mdi.MainWindow |
ERROR, INFO, QUESTION, WARNING |
| 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 | |
SwingMainWindow()
Creates a new main window and adds a menu and a toolbar to it. |
|
SwingMainWindow(boolean addMenu,
boolean addStatusBar,
boolean addToolBar)
Creates a new main window. |
|
| Method Summary | |
protected void |
addSpecialWindowCommands(SwingCommand[] commands)
|
boolean |
close()
Tries to close the window. |
protected SwingDefaultCommands |
createCommands()
Creates a new set of commands to be used by the application. |
DocumentWindow |
createDocumentWindow()
Creates a new document window. |
protected void |
createEditMenu()
Creates the edit menu. |
protected void |
createFileMenu()
Creates the file menu. |
protected void |
createToolBar()
Creates the toolbar. |
SwingDefaultCommands |
getCommands()
Gets the current set of commands. |
JComponent |
getDesktop()
Returns the desktop component. |
List |
getDocumentWindows()
Gets a list of all currently opened document windows. |
JMenu |
getEditMenu()
Returns the edit menu. |
JMenu |
getFileMenu()
Returns the file menu. |
protected Icon |
getMessageIcon(int type)
|
ProgressMonitor |
getProgressMonitor()
Gets the default progress monitor for this main window. |
SwingStatusBar |
getStatusBar()
Gets the status bar. |
JToolBar |
getToolBar()
Returns the toolbar. |
MDIWindowManager |
getWindowManager()
Gets the current document window manager. |
JMenu |
getWindowMenu()
Returns the window menu. |
void |
printDocument()
Prints the current document. |
void |
processMessage(Object source,
int type,
Object argument)
Called from the MessageDispatcher to indicate that an event
has occurred which this object may be interested in. |
protected void |
removeAllSpecialWindowCommands()
|
void |
setBusy(boolean busy)
Sets the busy flag. |
protected void |
setDesktop(JComponent c)
Sets the desktop component. |
void |
setStatus(String status)
Sets the statusbar text. |
void |
setStatusBar(SwingStatusBar statusBar)
Sets the status bar. |
void |
setWindowManager(MDIWindowManager manager)
Sets another document window manager to be used. |
int |
showDialog(int type,
Window window,
String message,
String[] choices,
int defaultChoice)
Displays a dialog box. |
String |
showFileOpenDialog(FileFormat[] formats)
Shows a file open dialog for the given file formats. |
String |
showFileSaveDialog(FileFormat[] formats,
String initialName)
Shows a file save dialog for the given file formats. |
void |
showMessage(int type,
Window window,
String message)
Displays a message box. |
void |
showPrintPreview()
Shows a print preview dialog for the current document. |
void |
showPrintSetup()
Shows a print setup dialog. |
| 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, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.bs.mdi.Window |
getTitle, hide, repaint, setTitle, show |
| Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
| Field Detail |
protected Application application
protected PrinterJob printerJob
protected DataPageable docPrinter
protected SwingDefaultCommands commands
protected JMenuBar menuBar
protected JToolBar toolBar
protected JMenu recentFilesMenu
protected JMenu windowMenu
protected JMenu editMenu
protected JMenu fileMenu
protected JMenu fileExportMenu
protected SwingStatusBar statusBar
protected SwingProgressMonitor progressMonitor
protected MDIWindowManager windowManager
protected JComponent desktop
| Constructor Detail |
public SwingMainWindow()
SwingMainWindow(true, true).
public SwingMainWindow(boolean addMenu,
boolean addStatusBar,
boolean addToolBar)
addMenu - true if the main menu should be added to this windowaddStatusBar - true if a status bar should be added to the window| Method Detail |
public boolean close()
WindowNote that calling this method does not guarantee that the window is actually closed. The implementations of this interface can intercept close requests and decide if they are really carried out or not. For example, if you try to close a changed document,
close in interface Windowpublic void setStatus(String status)
MainWindow
setStatus in interface MainWindowstatus - the statusbar textpublic DocumentWindow createDocumentWindow()
MainWindow
createDocumentWindow in interface MainWindowpublic List getDocumentWindows()
MainWindow
getDocumentWindows in interface MainWindowpublic String showFileOpenDialog(FileFormat[] formats)
MainWindow
showFileOpenDialog in interface MainWindowformats - the file formats which are used to setup the file filters
public String showFileSaveDialog(FileFormat[] formats,
String initialName)
MainWindow
showFileSaveDialog in interface MainWindowformats - the file formats which are used to setup the file filtersinitialName - the initial file name
protected Icon getMessageIcon(int type)
public void showMessage(int type,
Window window,
String message)
MainWindow
showMessage in interface MainWindowtype - the type: QUESTION, INFO,
WARNING or ERROR,window - the window which this message concerns, or
null if it concerns the entire application.message - the message to be displayed (note: the message is
not automatically translated by passing it to
Application.tr(java.lang.String))
public int showDialog(int type,
Window window,
String message,
String[] choices,
int defaultChoice)
MainWindow
showDialog in interface MainWindowtype - the type: QUESTION, INFO,
WARNING or ERROR,window - the document window which this message concerns, or
null if it concerns the entire application.message - the message to be displayed (note: the message is
not automatically translated by passing it to
Application.tr(java.lang.String))choices - the choices to be presented to the user (note: the options
are - unlike the message - translated by passing it to Application.tr(java.lang.String))defaultChoice - the index of the default choice
public void showPrintSetup()
showPrintSetup in interface MainWindowpublic void showPrintPreview()
MainWindow
showPrintPreview in interface MainWindowpublic void printDocument()
MainWindow
printDocument in interface MainWindow
public void processMessage(Object source,
int type,
Object argument)
MessageProcessorMessageDispatcher to indicate that an event
has occurred which this object may be interested in.
processMessage in interface MessageProcessorsource - the source where this message originated fromtype - the message typeargument - an optional argumentpublic SwingDefaultCommands getCommands()
public JComponent getDesktop()
protected void setDesktop(JComponent c)
c - the desktop componentpublic MDIWindowManager getWindowManager()
public void setWindowManager(MDIWindowManager manager)
manager - the new window managerpublic JToolBar getToolBar()
public JMenu getFileMenu()
public JMenu getEditMenu()
public JMenu getWindowMenu()
public void setBusy(boolean busy)
MainWindow
setBusy in interface MainWindowbusy - true if the busy indication should be enabled, false otherwisepublic SwingStatusBar getStatusBar()
public void setStatusBar(SwingStatusBar statusBar)
statusBar - public ProgressMonitor getProgressMonitor()
MainWindow
getProgressMonitor in interface MainWindowprotected SwingDefaultCommands createCommands()
protected void createFileMenu()
protected void createEditMenu()
protected void createToolBar()
protected void addSpecialWindowCommands(SwingCommand[] commands)
protected void removeAllSpecialWindowCommands()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||