|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.cke.CreekDocumentGroup
This class manages all of the CreekDocument objects in the program. Use this class when you want to perform operations on a document, rather than calling the document directly. For the less common operations, the user can easily get at the current document and communicate with it.
This is a singleton class, which means there's only one instance of this class in the system. To get a reference to that single instance, use the instanceOf() method.
Field Summary | |
protected int |
curDocument
Index into documents to the current document. |
protected java.lang.String |
defaultExtensionDoc
Default filename extension for new documents. |
protected java.lang.String |
defaultExtensionKM
Default filename extension for new documents. |
protected java.util.Hashtable |
docTypes
Table of the supported document types, keyed by the filename extension. |
protected java.util.Vector |
documents
List of documents held under this document group. |
protected static CreekDocumentGroup |
instance
Reference to the single instance of this class. |
protected KnowledgeModel |
km
Reference to the Knowledge Model |
protected boolean |
kmEditable
|
protected java.util.Hashtable |
kmTypes
Table of the supported document types, keyed by the filename extension. |
protected java.awt.print.PageFormat |
pf
Default page format for Printing the Documents |
protected java.beans.PropertyChangeSupport |
propSupport
Makes supporting property change listeners trivial. |
protected UndoHandler |
undoHandler
Undo handler that handles everything to do with undo. |
protected java.util.Hashtable |
viewDocs
Table of the documents, keyed by the associated views. |
Constructor Summary | |
protected |
CreekDocumentGroup()
No-arg constructor for our class. |
Method Summary | |
protected void |
addDocument(CreekDocument doc)
Add the given Creek document object to group and set it as the current document. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a property change listener to this document group. |
void |
addPropertyChangeListener(java.lang.String name,
java.beans.PropertyChangeListener l)
Add a property change listener to this document group. |
boolean |
closeDocument()
Closes the current document. |
boolean |
closeModel()
|
boolean |
deleteContext(CreekDocument selDoc)
|
protected void |
fireDirtyChange(CreekDocument doc)
Let all the property change listeners know that the current document has become dirty or become clean. |
protected void |
fireDocAdded(CreekDocument oldDoc)
|
protected void |
fireDocChange(CreekDocument oldDoc,
CreekDocument newDoc)
Let all the property change listeners know that the current document has been switched with another document, making that other document the new current document. |
protected void |
fireDocRemoved(CreekDocument oldDoc)
Let all the property change listeners know that the current document has been switched with another document, making that other document the new current document. |
protected void |
fireKMEditChange(boolean newEdit)
Let all the property change listeners know that the knowledge model editable status has changed. |
protected void |
fireModelClosed(KnowledgeModel oldKM)
Let all the property change listeners know that the current knowledge model has been closed |
protected void |
fireModelOpened(KnowledgeModel newKM)
Let all the property change listeners know that the current knowledge model has been opened |
protected void |
fireSelectionChange(CreekDocument oldDoc)
Let all the property change listeners know that the current knowledge model has been opened |
Context[] |
getContexts()
|
CreekDocument |
getCurrentDocument()
Returns the reference to the current document in the group. |
protected java.awt.print.PageFormat |
getDefaultPageFormat()
|
CreekDocument |
getDocument(ConceptView view)
Retrieve the document object associated with the given view. |
CreekDocument |
getDocument(int index)
Returns the reference to the requested document in the group. |
CreekDocument[] |
getDocuments()
Returns an array of the current documents in the group. |
java.util.Hashtable |
getDocumentTypes()
Retrieve a list of all the registered document types. |
KnowledgeModel |
getKM()
Retrieve the KnowledgeModel. |
java.util.Hashtable |
getKMTypes()
|
boolean |
getKnowledgeModelEditable()
|
java.awt.print.PageFormat |
getPageFormat()
|
static CreekDocumentGroup |
instanceOf()
Returns the reference to the single instance of this class. |
boolean |
isActive(CreekDocument doc)
|
boolean |
isDirty()
|
void |
markDocumentDirty(CreekDocument doc)
Sends out notification to any listeners if this document is the current document. |
void |
markSelection(CreekDocument doc)
Sends out notification to any listeners if this document is the current document. |
boolean |
newDocument(ConceptView view)
Creates a new document object, as well as the needed UI and adds it to the group. |
void |
newKM(KnowledgeModel km)
|
boolean |
openDocument(ConceptView view,
CreekDocument doc)
Add the given Document as a Creek document, creating the needed UI and the document object. |
void |
openKM(java.io.File f)
|
void |
openTestKM()
Opens a Test KnowledgeModel as Creek document, creating the needed UI and the document object. |
void |
registerDocument(java.lang.String ext,
java.lang.Class doc)
Registers a filename extension with a given document class. |
void |
registerkm(java.lang.String ext,
java.lang.Class doc)
Registers a filename extension with a given document class. |
protected void |
removeDocument(CreekDocument doc)
Remove the Creek document from the document group. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a property change listener from this document group. |
void |
removePropertyChangeListener(java.lang.String name,
java.beans.PropertyChangeListener l)
Remove a property change listener from this document group. |
boolean |
revertDocument()
Reverts the current document from disk. |
void |
saveAsKM(java.lang.String file,
java.lang.String dir)
Saves the KnowledgeModel under a new name and possibly a new file format. |
void |
saveKM()
Saves the current KnowledgeModel to disk. |
void |
setCurrentDocument(CreekDocument newDoc)
Sets the given document to be the current one. |
void |
setKM(KnowledgeModel km)
|
void |
setKnowledgeModelEditable(boolean editable)
|
void |
setPageFormat(java.awt.print.PageFormat pf)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected KnowledgeModel km
protected static CreekDocumentGroup instance
protected int curDocument
protected java.util.Vector documents
protected java.util.Hashtable viewDocs
protected java.util.Hashtable docTypes
protected java.util.Hashtable kmTypes
protected UndoHandler undoHandler
protected java.beans.PropertyChangeSupport propSupport
protected java.lang.String defaultExtensionDoc
protected java.lang.String defaultExtensionKM
protected java.awt.print.PageFormat pf
protected boolean kmEditable
Constructor Detail |
protected CreekDocumentGroup()
Method Detail |
protected void addDocument(CreekDocument doc)
doc
- document to add to grouppublic void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l
- new listener to add notification listpublic void addPropertyChangeListener(java.lang.String name, java.beans.PropertyChangeListener l)
name
- name of property to listen to specificallyl
- new listener to add notification listpublic boolean closeDocument()
public boolean deleteContext(CreekDocument selDoc)
public boolean closeModel()
protected void fireDirtyChange(CreekDocument doc)
doc
- document that has changedprotected void fireKMEditChange(boolean newEdit)
protected void fireDocChange(CreekDocument oldDoc, CreekDocument newDoc)
oldDoc
- previous current documentnewDoc
- new current documentprotected void fireDocRemoved(CreekDocument oldDoc)
oldDoc
- previous current documentprotected void fireDocAdded(CreekDocument oldDoc)
protected void fireModelOpened(KnowledgeModel newKM)
newKM
- new KnowledgeModelprotected void fireModelClosed(KnowledgeModel oldKM)
oldKM
- old KnowledgeModelprotected void fireSelectionChange(CreekDocument oldDoc)
oldDoc
- previous current documentpublic CreekDocument getCurrentDocument()
public CreekDocument getDocument(int index)
index
- index of the document to be retrieved
public CreekDocument getDocument(ConceptView view)
view
- view showing the requested documentpublic CreekDocument[] getDocuments()
public Context[] getContexts()
public KnowledgeModel getKM()
public java.util.Hashtable getDocumentTypes()
public java.util.Hashtable getKMTypes()
public static CreekDocumentGroup instanceOf()
public void markDocumentDirty(CreekDocument doc)
public void markSelection(CreekDocument doc)
public boolean newDocument(ConceptView view)
view
- view to associate with this document
public void newKM(KnowledgeModel km)
public boolean openDocument(ConceptView view, CreekDocument doc)
view
- view to associate with this documentdoc
- document to be opened as a Creek document
public void setKM(KnowledgeModel km)
public boolean isActive(CreekDocument doc)
public void openTestKM()
public void openKM(java.io.File f) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void registerDocument(java.lang.String ext, java.lang.Class doc)
The first document type registered will be treated as the default type, used when creating new documents.
ext
- filename extensiondoc
- document classpublic void registerkm(java.lang.String ext, java.lang.Class doc)
The first document type registered will be treated as the default type, used when creating new documents.
ext
- filename extensiondoc
- document classprotected void removeDocument(CreekDocument doc)
doc
- document to be removedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l
- listener to remove from notification listpublic void removePropertyChangeListener(java.lang.String name, java.beans.PropertyChangeListener l)
name
- property name to listen for specificallyl
- listener to remove from notification listpublic boolean revertDocument()
public void saveAsKM(java.lang.String file, java.lang.String dir) throws java.io.IOException
file
- file namedir
- directory path
java.io.IOException
public void saveKM() throws java.io.IOException
java.io.IOException
public void setCurrentDocument(CreekDocument newDoc)
newDoc
- document to make currentpublic boolean isDirty()
protected java.awt.print.PageFormat getDefaultPageFormat()
public java.awt.print.PageFormat getPageFormat()
public void setPageFormat(java.awt.print.PageFormat pf)
public void setKnowledgeModelEditable(boolean editable)
public boolean getKnowledgeModelEditable()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |