|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.sciss.app.AbstractDocumentHandler
public abstract class AbstractDocumentHandler
A basic implementation of the DocumentHandler
interface.
Field Summary | |
---|---|
protected java.lang.Object |
sync
|
Constructor Summary | |
---|---|
protected |
AbstractDocumentHandler(boolean isMDA)
|
Method Summary | |
---|---|
void |
addDocument(java.lang.Object source,
Document doc)
Adds a new document to the list of open documents. |
void |
addDocumentListener(DocumentListener l)
Registeres a listener which will be informed about document handler actions such as adding or removing a document. |
Document |
getActiveDocument()
Determines the currently active document. |
Document |
getDocument(int idx)
Returns one of the open documents. |
int |
getDocumentCount()
Returns the number of open documents |
boolean |
isMultiDocumentApplication()
Determines whether the underlying application handles more than a single open document or not. |
void |
processEvent(BasicEvent e)
This is called by the EventManager if new events are to be processed. |
void |
removeDocument(java.lang.Object source,
Document doc)
Removes a document from the list of open documents. |
void |
removeDocumentListener(DocumentListener l)
Unregisteres a listener who wishes to not be notified any more about document handler actions such as adding or removing a document. |
void |
setActiveDocument(java.lang.Object source,
Document doc)
Makes a document the active one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.lang.Object sync
Constructor Detail |
---|
protected AbstractDocumentHandler(boolean isMDA)
Method Detail |
---|
public boolean isMultiDocumentApplication()
DocumentHandler
isMultiDocumentApplication
in interface DocumentHandler
true
if the application
allows more than one document to be opened
at a time. false
for a
single-document-application.public int getDocumentCount()
DocumentHandler
getDocumentCount
in interface DocumentHandler
public Document getDocument(int idx)
DocumentHandler
getDocument
in interface DocumentHandler
idx
- the index of the document, ranging
from 0
to getDocumentCount() - 1
.
public void addDocument(java.lang.Object source, Document doc)
DocumentHandler
DocumentEvent
is generated and dispatched to all
registered listeners. The caller is responsible for calling
setActiveDocument
separately, if desired.
addDocument
in interface DocumentHandler
source
- the source of the dispatched DocumentEvent
,
or null
to not dispatch an event.doc
- the document to add.DocumentHandler.isMultiDocumentApplication()
public void removeDocument(java.lang.Object source, Document doc)
DocumentHandler
DocumentEvent
is generated and dispatched to all
registered listeners. This method will first call
setActiveDocument( null )
if the removed document
was the active document. After removing the document, this method
will call doc.dispose()
to free resources occupied
by the document.
removeDocument
in interface DocumentHandler
source
- the source of the dispatched DocumentEvent
,
or null
to not dispatch an event.doc
- the document to remove.public void setActiveDocument(java.lang.Object source, Document doc)
DocumentHandler
DocumentEvent
is generated and dispatched to all
registered listeners.
setActiveDocument
in interface DocumentHandler
source
- the source of the dispatched DocumentEvent
,
or null
to not dispatch an event.doc
- the document to make the active one, or null
to indicate that no document is active.DocumentHandler.getActiveDocument()
public Document getActiveDocument()
DocumentHandler
getActiveDocument
in interface DocumentHandler
null
, if there is none
(this is the case when all documents have been removed)DocumentHandler.setActiveDocument( Object, Document )
public void addDocumentListener(DocumentListener l)
DocumentHandler
addDocumentListener
in interface DocumentHandler
l
- the listener to addDocumentHandler.removeDocumentListener( DocumentListener )
public void removeDocumentListener(DocumentListener l)
DocumentHandler
removeDocumentListener
in interface DocumentHandler
l
- the listener to removeDocumentHandler.addDocumentListener( DocumentListener )
public void processEvent(BasicEvent e)
processEvent
in interface EventManager.Processor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |