freemind.modes.mindmapmode

Class MindMapMapModel

Implemented Interfaces:
MindMap, TreeModel

public class MindMapMapModel
extends MapAdapter

Field Summary

Fields inherited from class freemind.modes.MapAdapter

changesPerformedSinceLastSave, readOnly

Constructor Summary

MindMapMapModel(FreeMindMain frame)
MindMapMapModel(MindMapNodeModel root, FreeMindMain frame)

Method Summary

void
addIcon(MindMapNodeModel node, MindIcon icon)
void
addLink(MindMapNodeModel source, MindMapNodeModel target)
Source holds the MindMapArrowLinkModel and points to the id placed in target.
void
blendNodeColor(MindMapNodeModel node)
void
changeArrowsOfArrowLink(MindMapNode source, MindMapArrowLinkModel arrowLink, boolean hasStartArrow, boolean hasEndArrow)
Transferable
copy(MindMapNode node)
void
destroy()
When a map is closed, this method is called.
String
getAsPlainText(List mindMapNodes)
String
getAsRTF(List mindMapNodes)
MindMapLinkRegistry
getLinkRegistry()
String
getRestoreable()
Returns a string that may be given to the modes restore() to get this map again.
boolean
importExplorerFavorites(File folder, MindMapNode target, boolean redisplay)
void
importFolderStructure(File folder, MindMapNode target, boolean redisplay)
void
increaseFontSize(MindMapNodeModel node, int increment)
void
joinNodes()
void
load(File file)
void
paste(Transferable t, MindMapNode target, boolean asSibling, boolean isLeft)
int
removeLastIcon(MindMapNodeModel node)
void
removeReference(MindMapNode source, MindMapArrowLinkModel arrowLink)
boolean
save(File file)
Return the success of saving
boolean
saveHTML(MindMapNodeModel rootNodeOfBranch, File file)
boolean
saveRTF(List mindMapNodes, BufferedWriter fileout)
boolean
saveTXT(MindMapNodeModel rootNodeOfBranch, File file)
void
setArrowLinkColor(MindMapNode source, MindMapArrowLinkModel arrowLink, Color color)
void
setBold(MindMapNodeModel node)
void
setCloud(MindMapNodeModel node)
void
setCloudColor(MindMapNodeModel node, Color color)
void
setCloudStyle(MindMapNodeModel node, String style)
void
setCloudWidth(MindMapNodeModel node, int width)
void
setEdgeColor(MindMapNodeModel node, Color color)
void
setEdgeStyle(MindMapNodeModel node, String style)
void
setEdgeWidth(MindMapNodeModel node, int width)
void
setFontFamily(MindMapNodeModel node, String fontFamily)
void
setFontSize(MindMapNodeModel node, int fontSize)
void
setItalic(MindMapNodeModel node)
void
setNodeColor(MindMapNodeModel node, Color color)
void
setNodeFont(MindMapNodeModel node, Font font)
void
setNodeStyle(MindMapNodeModel node, String style)
void
setNormalFont(MindMapNodeModel node)
void
setUnderlined(MindMapNodeModel node)
void
splitNode(MindMapNode node, int caretPosition, String newText)
String
toString()
String
tryToLock(File file)
Attempts to lock the map using a semaphore file

Methods inherited from class freemind.modes.MapAdapter

addTreeModelListener, applyPattern, applyPattern, changeNode, copy, copy, copySingle, cut, cut, destroy, displayNode, find, findNext, getAsPlainText, getAsRTF, getBackgroundColor, getChild, getChildCount, getFile, getFindFromText, getFindWhat, getFrame, getIndexOfChild, getLink, getLinkRegistry, getNumberOfChangesSinceLastSave, getPathToRoot, getRestoreable, getRoot, getText, getURL, insertNodeInto, insertNodeInto, insertNodeIntoNoEvent, insertNodeIntoNoEvent, isLeaf, isReadOnly, isSaved, load, moveNodeTo, nodeChanged, nodeStructureChanged, nodesChanged, nodesWereInserted, nodesWereRemoved, paste, paste, paste, reload, removeNodeFromParent, removeNodeFromParent, removeTreeModelListener, save, setBackgroundColor, setFile, setFolded, setLink, setRoot, setSaved, splitNode, tryToLock, valueForPathChanged

Constructor Details

MindMapMapModel

public MindMapMapModel(FreeMindMain frame)

MindMapMapModel

public MindMapMapModel(MindMapNodeModel root,
                       FreeMindMain frame)

Method Details

addIcon

public void addIcon(MindMapNodeModel node,
                    MindIcon icon)

addLink

public void addLink(MindMapNodeModel source,
                    MindMapNodeModel target)
Source holds the MindMapArrowLinkModel and points to the id placed in target.

blendNodeColor

public void blendNodeColor(MindMapNodeModel node)

changeArrowsOfArrowLink

public void changeArrowsOfArrowLink(MindMapNode source,
                                    MindMapArrowLinkModel arrowLink,
                                    boolean hasStartArrow,
                                    boolean hasEndArrow)

copy

public Transferable copy(MindMapNode node)
Specified by:
copy in interface MindMap
Overrides:
copy in interface MapAdapter

destroy

public void destroy()
When a map is closed, this method is called.
Specified by:
destroy in interface MindMap
Overrides:
destroy in interface MapAdapter

getAsPlainText

public String getAsPlainText(List mindMapNodes)
Specified by:
getAsPlainText in interface MindMap
Overrides:
getAsPlainText in interface MapAdapter

getAsRTF

public String getAsRTF(List mindMapNodes)
Specified by:
getAsRTF in interface MindMap
Overrides:
getAsRTF in interface MapAdapter

getLinkRegistry

public MindMapLinkRegistry getLinkRegistry()
Specified by:
getLinkRegistry in interface MindMap
Overrides:
getLinkRegistry in interface MapAdapter
Returns:
returns the link registry associated with this mode, or null, if no registry is present.

getRestoreable

public String getRestoreable()
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 interface MapAdapter

importExplorerFavorites

public boolean importExplorerFavorites(File folder,
                                       MindMapNode target,
                                       boolean redisplay)

importFolderStructure

public void importFolderStructure(File folder,
                                  MindMapNode target,
                                  boolean redisplay)

increaseFontSize

public void increaseFontSize(MindMapNodeModel node,
                             int increment)

joinNodes

public void joinNodes()

load

public void load(File file)
            throws FileNotFoundException,
                   IOException,
                   XMLParseException
Overrides:
load in interface MapAdapter

paste

public void paste(Transferable t,
                  MindMapNode target,
                  boolean asSibling,
                  boolean isLeft)
Specified by:
paste in interface MindMap
Overrides:
paste in interface MapAdapter
Parameters:
isLeft - determines, whether or not the node is placed on the left or right. *

removeLastIcon

public int removeLastIcon(MindMapNodeModel node)

removeReference

public void removeReference(MindMapNode source,
                            MindMapArrowLinkModel arrowLink)

save

public boolean save(File file)
Return the success of saving
Overrides:
save in interface MapAdapter

saveHTML

public boolean saveHTML(MindMapNodeModel rootNodeOfBranch,
                        File file)

saveRTF

public boolean saveRTF(List mindMapNodes,
                       BufferedWriter fileout)

saveTXT

public boolean saveTXT(MindMapNodeModel rootNodeOfBranch,
                       File file)

setArrowLinkColor

public void setArrowLinkColor(MindMapNode source,
                              MindMapArrowLinkModel arrowLink,
                              Color color)

setBold

public void setBold(MindMapNodeModel node)

setCloud

public void setCloud(MindMapNodeModel node)

setCloudColor

public void setCloudColor(MindMapNodeModel node,
                          Color color)

setCloudStyle

public void setCloudStyle(MindMapNodeModel node,
                          String style)

setCloudWidth

public void setCloudWidth(MindMapNodeModel node,
                          int width)

setEdgeColor

public void setEdgeColor(MindMapNodeModel node,
                         Color color)

setEdgeStyle

public void setEdgeStyle(MindMapNodeModel node,
                         String style)

setEdgeWidth

public void setEdgeWidth(MindMapNodeModel node,
                         int width)

setFontFamily

public void setFontFamily(MindMapNodeModel node,
                          String fontFamily)

setFontSize

public void setFontSize(MindMapNodeModel node,
                        int fontSize)

setItalic

public void setItalic(MindMapNodeModel node)

setNodeColor

public void setNodeColor(MindMapNodeModel node,
                         Color color)

setNodeFont

public void setNodeFont(MindMapNodeModel node,
                        Font font)

setNodeStyle

public void setNodeStyle(MindMapNodeModel node,
                         String style)

setNormalFont

public void setNormalFont(MindMapNodeModel node)

setUnderlined

public void setUnderlined(MindMapNodeModel node)

splitNode

public void splitNode(MindMapNode node,
                      int caretPosition,
                      String newText)
Specified by:
splitNode in interface MindMap
Overrides:
splitNode in interface MapAdapter

toString

public String toString()

tryToLock

public String tryToLock(File file)
            throws Exception
Attempts to lock the map using a semaphore file
Overrides:
tryToLock in interface MapAdapter
Parameters:
file -
Returns:
If the map is locked, return the name of the locking user, otherwise return null.