com.tensegrity.gui.document
Interface MDIComponent

All Superinterfaces:
Evaluable, Observable
All Known Subinterfaces:
SwingMDIComponent, SwtMDIComponent
All Known Implementing Classes:
DockMDIComponent, FramedMDIComponent, MDIDelegate, PanelMDIComponent, SwtTabbedMDIComponent, TabbedMDIComponent, WindowMDIComponent

public interface MDIComponent
extends Observable, Evaluable

This interface specifies the functionality of an MDI (Multiple Document Interface) holder. This specialized aggregate manages Document instances and displays them with a certain graphical style. Despite the word "Component" in the interface name and the behavioral aspect of containing documents, this interface represents neither a BasicComponent nor a Container as specified in the API. The interface name predates the API overhaul and is maintained for historical reasons.

The Document metaphor is used to describe single data views that can be loaded and saved separately. In a typical MDI windows application, a Document is shown in an internal frame of the application window (and cannot extend beyond it). This is a typical style of an MDIComponent. This interface, therefore, specifies the general functionality that all MDI components must have.

A particular implementation of this interface might display a Document as a window in an internal frame, while another might choose to display it as a page in a tabbed dialog. Common MDI styles include:

Version:
$Id: MDIComponent.java,v 1.23 2005/10/21 11:54:17 KevinCVS Exp $
Author:
Stepan Rutz

Method Summary
 void addDocument(Document document)
          Adds the given Document to the container.
 void addDocumentListener(DocumentListener documentlistener)
          Adds a document listener.
 void fireDocumentDataChanged(Document document)
          Fires the document data changed event from the outside world.
 Document getActiveDocument()
          Returns the active document.
 int getDocumentCount()
          Returns the number of currently open documents.
 java.util.List getDocuments()
          Returns a List containing all active documents.
 Observable getObservable()
          Returns the Observable instance.
 void indicateModifiedDocument(Document document)
          The mdi component shall indicate visually that the given document was modified.
 void indicateUnmodifiedDocument(Document document)
          The mdi component shall indicate visually that the given document was not modified.
 void postValidate()
          Invoked by the framework after the MDIComponent was shown on the screen.
 void removeActiveDocument()
          Closes the active document.
 void removeDocument(Document document)
          Closes the given document and removes it from the mdi container.
 void removeDocumentListener(DocumentListener documentlistener)
          Removes a document listener.
 void renameDocument(Document document, java.lang.String name)
          Renames a document.
 void setActiveDocument(Document document)
          Sets the active document.
 void setDocumentListener(DocumentListener documentlistener)
          Sets a single document listener.
 void setObservable(Observable observable)
          Sets an observable.
 
Methods inherited from interface com.tensegrity.generic.util.Observable
addObserver, clearChanged, deleteObserver, deleteObservers, getObservers, notifyObservers, notifyObservers, setChanged
 
Methods inherited from interface com.tensegrity.gui.Evaluable
applyEvList, installEvList
 

Method Detail

setDocumentListener

public void setDocumentListener(DocumentListener documentlistener)
Sets a single document listener. Use with caution.

Parameters:
documentlistener - the documentlistener to set.

addDocumentListener

public void addDocumentListener(DocumentListener documentlistener)
Adds a document listener.

Parameters:
documentlistener - the documentlistener to add.

removeDocumentListener

public void removeDocumentListener(DocumentListener documentlistener)
Removes a document listener.

Parameters:
documentlistener - the documentlistener to remove.

getDocumentCount

public int getDocumentCount()
Returns the number of currently open documents.

Returns:
the number of currently open documents.

getDocuments

public java.util.List getDocuments()
Returns a List containing all active documents.

Returns:
the list of currently active documents.

Find more information in the class documentation


addDocument

public void addDocument(Document document)
Adds the given Document to the container.

Parameters:
document - the document to add to the container.

Find more information in the class documentation


removeDocument

public void removeDocument(Document document)
Closes the given document and removes it from the mdi container.

Parameters:
document - the document to close and remove.

Find more information in the class documentation


getActiveDocument

public Document getActiveDocument()
Returns the active document.

Returns:
the active document.

Find more information in the class documentation


setActiveDocument

public void setActiveDocument(Document document)
Sets the active document. The given document must be in the container.

Parameters:
document - the document to activate.

Find more information in the class documentation


removeActiveDocument

public void removeActiveDocument()
Closes the active document.


renameDocument

public void renameDocument(Document document,
                           java.lang.String name)
Renames a document.

Parameters:
document - the document to rename.
name - the new name for the document.

indicateModifiedDocument

public void indicateModifiedDocument(Document document)
The mdi component shall indicate visually that the given document was modified. This is needed by application that likes to visually point out that a document was modified and thus may require saving before the application is exited.

Parameters:
document - the modified document.

indicateUnmodifiedDocument

public void indicateUnmodifiedDocument(Document document)
The mdi component shall indicate visually that the given document was not modified.

Parameters:
document - the unmodified document.

postValidate

public void postValidate()
Invoked by the framework after the MDIComponent was shown on the screen. This is a callback and the application that uses the MDIComponent is responsible for invoking this method at the specified moments in time.


getObservable

public Observable getObservable()
Returns the Observable instance. Useful if current MDIComponent gives away responsibility for them.

Returns:
the observable of this mdi component.

setObservable

public void setObservable(Observable observable)
Sets an observable. Useful during switch of MDIComponents.

Parameters:
observable - the observable to set for the mdi component.

fireDocumentDataChanged

public void fireDocumentDataChanged(Document document)
Fires the document data changed event from the outside world.

Parameters:
document - the document whose data has changed.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.