Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

diva.gui
Interface Application

All Known Implementing Classes:
AbstractApplication

public interface Application

Application is an interface that captures the notion of a graphical application. An application is associated with an ApplicationFrame, and contains a set of Documents. All applications will need to create an implementation of this interface.

Version:
$Id: Application.java,v 1.12 2005年07月08日 19:55:10 cxh Exp $
Author:
John Reekie
Accepted Rating:
Red

Method Summary
java.util.Iterator actions()
Get an iterator over the names of the actions that are contained by this application.
void addAction(javax.swing.Action action)
Add an action to the table of actions.
void addDocument(Document d)
Add a document to the application and notify document listeners.
void addDocumentListener(javax.swing.event.ListDataListener listener)
Add a document listener to this application.
void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this application.
void addView(View d)
Add a view to the application and notify view listeners.
void addViewListener(javax.swing.event.ListDataListener listener)
Add a view listener to this application.
boolean closeDocument(Document d)
Try to close the given document, respecting the storage policy.
boolean closeView(View v)
Try to close the given view, respecting the storage policy.
View createView(Document d)
Create a view to display the given document.
java.util.List documentList()
Get an iterator over all documents
javax.swing.Action getAction(java.lang.String name)
Get an action by name.
AppContext getAppContext()
Get the context that this application draws itself in.
java.awt.datatransfer.Clipboard getClipboard()
Return the clipboard used by this application.
View getCurrentView()
Get the current view.
DocumentFactory getDocumentFactory()
Get the factory that this application uses to create document objects.
StoragePolicy getStoragePolicy()
Get the storage policy of this application.
java.lang.String getTitle()
Get the title of this application
boolean isVisible()
Test whether the application frame is visible.
void removeDocument(Document d)
This method should only be called by storage policies.
void removeDocumentListener(javax.swing.event.ListDataListener listener)
Remove a document list listener from this application.
void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this application.
void removeView(View v)
This method should only be called by storage policies.
void removeViewListener(javax.swing.event.ListDataListener listener)
Remove a view list listener from this application.
void setCurrentView(View v)
Set the given view to be the current view.
void setVisible(boolean visible)
Set the visibility of the application's frame
void showError(java.lang.String op, java.lang.Exception e)
Report that an exception occurred to the user.
java.util.List viewList()
Get an iterator over all views

Method Detail

actions

public java.util.Iterator actions()
Get an iterator over the names of the actions that are contained by this application.


addAction

public void addAction(javax.swing.Action action)
Add an action to the table of actions. Every action known by the application should be added to this list so it can be retrieved and invoked later. The action name must be unique in this application.


addDocument

public void addDocument(Document d)
Add a document to the application and notify document listeners. Throw an exception if the document is already in the list of documents.


addDocumentListener

public void addDocumentListener(javax.swing.event.ListDataListener listener)
Add a document listener to this application. The document listener is in fact a ListDataListener, which will be notified with intervalAdded() and intervalRemoved() events when documents are added or removed, and with a contentsChanged() event when the current document is changed.


addView

public void addView(View d)
Add a view to the application and notify view listeners. Throw an exception if the view is already in the list of views.


addViewListener

public void addViewListener(javax.swing.event.ListDataListener listener)
Add a view listener to this application. The view listener is in fact a ListDataListener, which will be notified with intervalAdded() and intervalRemoved() events when views are added or removed, and with a contentsChanged() event when the current view is changed.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this application. Changes to certain elements of the state of the application require that registered property change listeners be notified of the change.


closeDocument

public boolean closeDocument(Document d)
Try to close the given document, respecting the storage policy. Return whether or not the operation was successful.


closeView

public boolean closeView(View v)
Try to close the given view, respecting the storage policy. Return whether or not the operation was successful.


createView

public View createView(Document d)
Create a view to display the given document. The document should already be added to the application. After calling this method, most callers should set this view to be the current view.


documentList

public java.util.List documentList()
Get an iterator over all documents


viewList

public java.util.List viewList()
Get an iterator over all views


getAction

public javax.swing.Action getAction(java.lang.String name)
Get an action by name.


getCurrentView

public View getCurrentView()
Get the current view. Generally, this will be the one that is displayed in the window that is top-most in the display. Return null if there is no current document.


getClipboard

public java.awt.datatransfer.Clipboard getClipboard()
Return the clipboard used by this application.


getDocumentFactory

public DocumentFactory getDocumentFactory()
Get the factory that this application uses to create document objects.


getAppContext

public AppContext getAppContext()
Get the context that this application draws itself in. Some applications may have more one than one frame, in which case they probably want to designate one as the "main frame" (heh heh).


getStoragePolicy

public StoragePolicy getStoragePolicy()
Get the storage policy of this application.


getTitle

public java.lang.String getTitle()
Get the title of this application


isVisible

public boolean isVisible()
Test whether the application frame is visible. Return false if the application has no frame or if the frame is not visible.


removeDocument

public void removeDocument(Document d)
This method should only be called by storage policies. It removes a document from the list of documents currently known by this application, and remove all of the views associated with this document. Fire a list data event to registered document listeners. Throw an exception if the document is not known.


removeView

public void removeView(View v)
This method should only be called by storage policies. It removes a view from the list of views currently known by this application. Fire a list data event to registered view listeners. If the removed view is the current view it is up to the application to decide which view to display next. Throw an exception if the view is not known.


removeDocumentListener

public void removeDocumentListener(javax.swing.event.ListDataListener listener)
Remove a document list listener from this application.


removeViewListener

public void removeViewListener(javax.swing.event.ListDataListener listener)
Remove a view list listener from this application.


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this application.


setCurrentView

public void setCurrentView(View v)
Set the given view to be the current view. Fire a contentsChanged() event to registered view listeners. Throw an exception of the view is not known.


setVisible

public void setVisible(boolean visible)
Set the visibility of the application's frame


showError

public void showError(java.lang.String op,
 java.lang.Exception e)
Report that an exception occurred to the user.


Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

AltStyle によって変換されたページ (->オリジナル) /