freemind.modes.mindmapmode
Class MindMapMapModel

java.lang.Object
  extended byfreemind.modes.MapAdapter
      extended byfreemind.modes.mindmapmode.MindMapMapModel
All Implemented Interfaces:
MindMap, javax.swing.tree.TreeModel

public class MindMapMapModel
extends MapAdapter


Field Summary
 
Fields inherited from class freemind.modes.MapAdapter
changesPerformedSinceLastSave, logger, readOnly
 
Constructor Summary
MindMapMapModel(FreeMindMain frame)
           
MindMapMapModel(MindMapNodeModel root, FreeMindMain frame)
           
 
Method Summary
 java.awt.datatransfer.Transferable copy(MindMapNode node)
           
 void destroy()
          When a map is closed, this method is called.
 java.lang.String getAsPlainText(java.util.List mindMapNodes)
           
 java.lang.String getAsRTF(java.util.List mindMapNodes)
           
 MindMapLinkRegistry getLinkRegistry()
           
 java.lang.String getRestoreable()
          Returns a string that may be given to the modes restore() to get this map again.
 void getXml(java.io.Writer fileout)
          writes the content of the map to a writer.
 void load(java.io.File file)
           
 boolean save(java.io.File file)
          Return the success of saving
 boolean saveHTML(MindMapNodeModel rootNodeOfBranch, java.io.File file)
           
 boolean saveRTF(java.util.List mindMapNodes, java.io.BufferedWriter fileout)
           
 boolean saveTXT(MindMapNodeModel rootNodeOfBranch, java.io.File file)
           
 java.lang.String toString()
           
 java.lang.String tryToLock(java.io.File file)
          Attempts to lock the map using a semaphore file
 
Methods inherited from class freemind.modes.MapAdapter
addTreeModelListener, copy, copy, copySingle, cut, getBackgroundColor, getChild, getChildCount, getFile, getFrame, getIndexOfChild, getNumberOfChangesSinceLastSave, getPathToRoot, getRoot, getText, getURL, insertNodeInto, insertNodeInto, insertNodeInto, insertNodeIntoNoEvent, insertNodeIntoNoEvent, isLeaf, isReadOnly, isSaved, nodeChanged, nodeChangedMapInternal, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, removeNodeFromParent, removeNodeFromParent, removeTreeModelListener, setBackgroundColor, setFile, setRoot, setSaved, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MindMapMapModel

public MindMapMapModel(FreeMindMain frame)

MindMapMapModel

public MindMapMapModel(MindMapNodeModel root,
                       FreeMindMain frame)
Method Detail

getLinkRegistry

public MindMapLinkRegistry getLinkRegistry()
Specified by:
getLinkRegistry in interface MindMap
Overrides:
getLinkRegistry in class MapAdapter

getRestoreable

public java.lang.String getRestoreable()
Description copied from interface: MindMap
Returns a string that may be given to the modes restore() to get this map again. The Mode must take care that two different maps don't give the same restoreable key.

Specified by:
getRestoreable in interface MindMap
Overrides:
getRestoreable in class MapAdapter

toString

public java.lang.String toString()

saveHTML

public boolean saveHTML(MindMapNodeModel rootNodeOfBranch,
                        java.io.File file)

getAsPlainText

public java.lang.String getAsPlainText(java.util.List mindMapNodes)
Specified by:
getAsPlainText in interface MindMap
Overrides:
getAsPlainText in class MapAdapter

saveTXT

public boolean saveTXT(MindMapNodeModel rootNodeOfBranch,
                       java.io.File file)

getAsRTF

public java.lang.String getAsRTF(java.util.List mindMapNodes)
Specified by:
getAsRTF in interface MindMap
Overrides:
getAsRTF in class MapAdapter

saveRTF

public boolean saveRTF(java.util.List mindMapNodes,
                       java.io.BufferedWriter fileout)

save

public boolean save(java.io.File file)
Return the success of saving

Specified by:
save in class MapAdapter

getXml

public void getXml(java.io.Writer fileout)
            throws java.io.IOException
writes the content of the map to a writer.

Parameters:
fileout -
Throws:
java.io.IOException

tryToLock

public java.lang.String tryToLock(java.io.File file)
                           throws java.lang.Exception
Attempts to lock the map using a semaphore file

Overrides:
tryToLock in class MapAdapter
Parameters:
file -
Returns:
If the map is locked, return the name of the locking user, otherwise return null.
Throws:
Exception, - when the locking failed for other reasons than that the file is being edited.
java.lang.Exception

load

public void load(java.io.File file)
          throws java.io.FileNotFoundException,
                 java.io.IOException,
                 XMLParseException
Specified by:
load in class MapAdapter
Throws:
java.io.FileNotFoundException
java.io.IOException
XMLParseException

destroy

public void destroy()
When a map is closed, this method is called.

Specified by:
destroy in interface MindMap
Overrides:
destroy in class MapAdapter

copy

public java.awt.datatransfer.Transferable copy(MindMapNode node)
Specified by:
copy in interface MindMap
Overrides:
copy in class MapAdapter