|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.bs.mdi.Application
The base class for all MDI applications.
| Field Summary | |
protected static Application |
application
|
protected static ClipboardManager |
clipboardManager
|
protected static DocumentWindow |
currentWindow
|
protected static ArrayList |
documents
|
protected static FileIOManager |
fileIOManager
|
protected static MainWindow |
mainWindow
|
protected static MessageDispatcher |
messageDispatcher
|
protected static Preferences |
preferences
|
protected static RecentFiles |
recentFiles
|
protected static CompositeResources |
resources
|
protected static boolean |
running
|
| Constructor Summary | |
Application()
Creates a new Application. |
|
| Method Summary | |
boolean |
close()
Exits the application by closing its main window. |
void |
closeDocument()
Tries to close the current document and all of its views and windows. |
void |
closeWindow()
Tries to close the current window. |
void |
copy()
Perform a copy operation on the current document. |
static int |
countDocuments()
Returns the number of currently opened documents. |
protected abstract ActionConverter[] |
createActionConverters()
Creates and returns all available Action converters (see ActionConverter).
|
protected abstract FileIOModule[] |
createFileIOModules()
Creates and returns all available File I/O extension modules (see FileIOModule)..
|
protected abstract MainWindow |
createMainWindow()
Creates and return an application-specific main window (see MainWindow).
|
protected abstract Resources |
createResources()
Creates and returns the applications resources. |
abstract RootData |
createRootData()
Creates and returns a new RootData instance. |
abstract RootView |
createRootView()
Creates and returns a new RootView instance. |
protected void |
currentWindowChanged(DocumentWindow newWindow)
Called when another document window is activated (receives the focus). |
void |
cut()
Perform a cut operation on the current document. |
void |
delete()
Perform a delete operation on the current document. |
void |
exit()
Closes the application the brute-force way. |
void |
exportDocument(FileExporter exporter)
Tries to export the current document. |
static ClipboardManager |
getClipboardManager()
Returns the ClipboardManager which provides clipboard access
and data transfer/conversion functions. |
static RootData |
getCurrentData()
Returns the data which belongs to the current window. |
static Document |
getCurrentDocument()
Returns the document which belongs to the current window. |
static RootView |
getCurrentView()
Returns the view which belongs to the current window. |
static DocumentWindow |
getCurrentWindow()
Returns the currently active window. |
static Document |
getDocument(int index)
Gets the document at the specified index. |
static Iterator |
getDocumentIterator()
Gets an iterator for all currently opened documents. |
static Document[] |
getDocuments()
Returns an array of currently opened documents. |
static FileIOManager |
getFileIOManager()
Returns the FileIOManager which manages modules for performing
file I/O (loading, saving, exporting). |
static Application |
getInstance()
Gets the current instance of the Application class. |
static MainWindow |
getMainWindow()
Returns the application's main window. |
static MessageDispatcher |
getMessageDispatcher()
Gets the MessageDispatcher object which is responsible for communication
between various parts of the framework. |
abstract String |
getName()
Get the name of the application. |
static Preferences |
getPreferences()
Gets the application's preferences. |
static RecentFiles |
getRecentFiles()
Gets the RecentFiles object which automatically maintains a list of recently opened filenames. |
static Resources |
getResources()
Returns the Resources object which handles internationalization
and icon loading. |
boolean |
isCopyPossible()
Returns true if information can be copied to the clipboard from the current document window. |
boolean |
isCutPossible()
Returns true if information can be cutted to the clipboard from the current document window. |
boolean |
isDeletePossible()
Returns true if information can be deleted from the current document window. |
boolean |
isPastePossible()
Returns true if information can be pasted from the clipboard to the current document window. |
boolean |
isRedoPossible()
Returns true if the last undo operation of the current document can be redone. |
static boolean |
isRunning()
Returns the running status of this application. |
boolean |
isUndoPossible()
Returns true if the last modification of the current document can be undone. |
Document |
newDocument()
Creates a new document and makes its view (window) visible. |
Document |
openDocument()
Displays a "Open File"-Dialog and tries to open the selected file. |
Document |
openDocument(String filename)
Tries to open the given file. |
void |
paste()
Perform a paste operation on the current document. |
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. |
void |
redo()
Perform a redo operation on the current document. |
void |
run(String[] args)
Starts and runs the application. |
void |
saveDocument()
Tries to save the current document. |
void |
saveDocumentAs()
Displays a "Save File"-Dialog and tries to save the current document using the selected filename. |
static void |
selectWindow(DocumentWindow window)
Activates a window programmatically. |
static void |
setBusy(boolean busy)
Gives the user the indication that the application is busy now. |
static boolean |
setCurrentDocumentLocked(boolean locked)
Prevents other documents from becoming active. |
static void |
setStatus(String status)
Sets the text to be displayed in the application's status bar. |
void |
showPrintPreview()
Shows a print preview dialog for the current document. |
void |
showPrintSetup()
Shows a dialog allowing the user to setup printing options such as paper size and orientation. |
static String |
tr(String key)
Returns a localized string for the specified key. |
void |
undo()
Perform an undo operation on the current document. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static ArrayList documents
protected static DocumentWindow currentWindow
protected static MainWindow mainWindow
protected static ClipboardManager clipboardManager
protected static CompositeResources resources
protected static FileIOManager fileIOManager
protected static Application application
protected static Preferences preferences
protected static RecentFiles recentFiles
protected static MessageDispatcher messageDispatcher
protected static boolean running
| Constructor Detail |
public Application()
getInstance().
| Method Detail |
public static Application getInstance()
Application class.
public static Preferences getPreferences()
Preferences object manages per-user preferences and settings for a particular application.
Preferences objectpublic static RecentFiles getRecentFiles()
RecentFiles object which automatically maintains a list of recently opened filenames.
public static MessageDispatcher getMessageDispatcher()
MessageDispatcher object which is responsible for communication
between various parts of the framework.
public abstract String getName()
Preferences object to create
the user-specific settings filename, so your application name should be unique
in order to avoid filename collisions.
public static boolean isRunning()
public static String tr(String key)
createResources()) for the specified key and returns its value.
This is the preferred way of providing internationalization support for
MDI applications.
key - the key which should be looked up in the resource bundle
public Document newDocument()
public Document openDocument()
public Document openDocument(String filename)
filename - the file to be opened
public void saveDocument()
public void saveDocumentAs()
public void exportDocument(FileExporter exporter)
exporter - the FileExporter to use.public void showPrintSetup()
public void showPrintPreview()
public void printDocument()
public void closeDocument()
public void closeWindow()
public static void setStatus(String status)
status - The status text to be displayedpublic static void setBusy(boolean busy)
busy - true if the busy indication should be enabled, false otherwisepublic boolean close()
public void exit()
public void undo()
public void redo()
public void cut()
public void copy()
public void paste()
public void delete()
public boolean isUndoPossible()
public boolean isRedoPossible()
public boolean isCutPossible()
public boolean isCopyPossible()
public boolean isPastePossible()
public boolean isDeletePossible()
public static Resources getResources()
Resources object which handles internationalization
and icon loading.
public static FileIOManager getFileIOManager()
FileIOManager which manages modules for performing
file I/O (loading, saving, exporting).
public static ClipboardManager getClipboardManager()
ClipboardManager which provides clipboard access
and data transfer/conversion functions.
public static MainWindow getMainWindow()
public static Document[] getDocuments()
public static int countDocuments()
public static Document getDocument(int index)
index -
public static Iterator getDocumentIterator()
public static DocumentWindow getCurrentWindow()
public static Document getCurrentDocument()
getCurrentWindow().getDocument()
(except for NullPointerException handling).
public static RootView getCurrentView()
getCurrentWindow().getView()
(except for NullPointerException handling).
public static RootData getCurrentData()
getCurrentWindow().getDocument().getData()
(except for NullPointerException handling).
public static void selectWindow(DocumentWindow window)
window - the window to be activatedpublic static boolean setCurrentDocumentLocked(boolean locked)
locked - true to activate the document lock, false to deactivate
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 void run(String[] args)
main method of the actual application.
It brings up the main window and loads the documents specified by the filenames
given as command line arguments.
args - the command line arguments passed to the applicationprotected void currentWindowChanged(DocumentWindow newWindow)
newWindow - the DocumentWindow that is now activeprotected abstract FileIOModule[] createFileIOModules()
FileIOModule)..
FileIOModules are required for opening, saving and exporting documents.
The framework is responsible for making these modules available to
the FileIOManager.
This is a factory method which is to be implemented by subclasses of
Application.
protected abstract ActionConverter[] createActionConverters()
ActionConverter).
ActionConverters are required for clipboard functionality (cut, copy, paste).
The framework is responsible for making these converters available to the
ClipboardManager.
This is a factory method which is to be implemented by subclasses of
Application.
protected abstract MainWindow createMainWindow()
MainWindow).
This is a factory method which is to be implemented by subclasses of
Application.
protected abstract Resources createResources()
CompositeResources.
This is a factory method which is to be implemented by subclasses of
Application.
public abstract RootData createRootData()
public abstract RootView createRootView()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||