freemind.modes.mindmapmode
Class EncryptedMindMapNode

java.lang.Object
  extended by freemind.modes.NodeAdapter
      extended by freemind.modes.mindmapmode.MindMapNodeModel
          extended by freemind.modes.mindmapmode.EncryptedMindMapNode
All Implemented Interfaces:
MindMapNode, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class EncryptedMindMapNode
extends MindMapNodeModel


Field Summary
 
Fields inherited from class freemind.modes.NodeAdapter
backgroundColor, children, cloud, color, folded, font, HGAP, icons, LEFT_POSITION, logger, RIGHT_POSITION, stateIcons, style, underlined, UNKNOWN_POSITION, userObject, VGAP
 
Fields inherited from interface freemind.modes.MindMapNode
NODE_STYLES, STYLE_AS_PARENT, STYLE_BUBBLE, STYLE_COMBINED, STYLE_FORK
 
Constructor Summary
EncryptedMindMapNode(java.lang.Object userObject, FreeMindMain frame, MindMap map)
           
 
Method Summary
 boolean checkPassword(java.lang.StringBuffer givenPassword)
           
 java.util.ListIterator childrenFolded()
           
 java.util.ListIterator childrenUnfolded()
           
 boolean decrypt(java.lang.StringBuffer givenPassword)
           
 void encrypt()
           
 java.lang.String getAdditionalInfo()
          Is only used to store encrypted content of an encrypted mind map node.
 int getChildCount()
           
 boolean hasChildren()
           
 void insert(javax.swing.tree.MutableTreeNode pChild, int pIndex)
           
 boolean isAccessible()
           
 boolean isFolded()
           
 boolean isStoringEncryptedContent()
           
 boolean isWriteable()
          Some nodes can't get new children or have other changes (encrypted nodes for example).
 XMLElement save(java.io.Writer writer, MindMapLinkRegistry registry, boolean saveHidden, boolean saveChildren)
           
 void setAdditionalInfo(java.lang.String info)
          This method can be used to store non-visual additions to a node.
 void setFolded(boolean folded)
           
 void setMap(MindMap map)
           
 void setPassword(java.lang.StringBuffer password)
           
 void setShuttingDown(boolean isShuttingDown)
          isShuttingDown is used to fold an encrypted node properly.
 void setStoringEncryptedContent(boolean pIsStoringEncryptedContent)
           
 void updateIcon()
           
 
Methods inherited from class freemind.modes.mindmapmode.MindMapNodeModel
collectColors, getPlainTextContent, saveRTF, saveTXT
 
Methods inherited from class freemind.modes.NodeAdapter
acceptViewVisitor, addHook, addIcon, addTreeModelListener, addViewer, calcShiftY, children, createAttributeTableModel, establishOwnFont, getActivatedHooks, getAllowsChildren, getAttribute, getAttribute, getAttributeKeyList, getAttributePosition, getAttributes, getAttributeTableLength, getBackgroundColor, getChildAt, getChildPosition, getChildren, getCloud, getColor, getEdge, getFilterInfo, getFont, getFontFamilyName, getFontSize, getFrame, getHGap, getHistoryInformation, getHooks, getIcons, getIndex, getLink, getListeners, getMap, getModeController, getNodeLevel, getNoteText, getObjectId, getParent, getParentNode, getPath, getShiftY, getShortText, getStateIcons, getStyle, getText, getToolTip, getVGap, getViewers, getXmlNoteText, getXmlText, hasFoldedStrictDescendant, hasOneVisibleChild, hasStyle, invokeHook, isBold, isDescendantOf, isItalic, isLeaf, isLeft, isNewChildLeft, isRoot, isUnderlined, isVisible, remove, remove, removeFromParent, removeHook, removeIcon, removeTreeModelListener, removeViewer, setAttribute, setBackgroundColor, setBold, setCloud, setColor, setEdge, setFont, setFontSize, setHGap, setHistoryInformation, setItalic, setLeft, setLink, setNoteText, setParent, setParent, setShiftY, setStateIcon, setStyle, setText, setToolTip, setUnderlined, setUserObject, setVGap, setXmlNoteText, setXmlText, shallowCopy, toggleBold, toggleItalic, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EncryptedMindMapNode

public EncryptedMindMapNode(java.lang.Object userObject,
                            FreeMindMain frame,
                            MindMap map)
Method Detail

setMap

public void setMap(MindMap map)
Overrides:
setMap in class NodeAdapter

decrypt

public boolean decrypt(java.lang.StringBuffer givenPassword)
Returns:
true, if the password was correct.

checkPassword

public boolean checkPassword(java.lang.StringBuffer givenPassword)

encrypt

public void encrypt()

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface javax.swing.tree.TreeNode
Overrides:
getChildCount in class NodeAdapter

childrenFolded

public java.util.ListIterator childrenFolded()
Specified by:
childrenFolded in interface MindMapNode
Overrides:
childrenFolded in class NodeAdapter
Returns:
returns a ListIterator of all children of the node if the node is unfolded. EMPTY_LIST_ITERATOR otherwise.

childrenUnfolded

public java.util.ListIterator childrenUnfolded()
Specified by:
childrenUnfolded in interface MindMapNode
Overrides:
childrenUnfolded in class NodeAdapter
Returns:
returns a ListIterator of all (and not only the unfolded ones!!) children of the node.

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in interface MindMapNode
Overrides:
hasChildren in class NodeAdapter

updateIcon

public void updateIcon()

setPassword

public void setPassword(java.lang.StringBuffer password)

isFolded

public boolean isFolded()
Specified by:
isFolded in interface MindMapNode
Overrides:
isFolded in class NodeAdapter

setFolded

public void setFolded(boolean folded)
Specified by:
setFolded in interface MindMapNode
Overrides:
setFolded in class NodeAdapter

setAdditionalInfo

public void setAdditionalInfo(java.lang.String info)
Description copied from interface: MindMapNode
This method can be used to store non-visual additions to a node. Currently, it is used for encrypted nodes to store the encrypted content.

Specified by:
setAdditionalInfo in interface MindMapNode
Overrides:
setAdditionalInfo in class NodeAdapter

getAdditionalInfo

public java.lang.String getAdditionalInfo()
Description copied from interface: MindMapNode
Is only used to store encrypted content of an encrypted mind map node.

Specified by:
getAdditionalInfo in interface MindMapNode
Overrides:
getAdditionalInfo in class NodeAdapter
See Also:
MindMapNode.setAdditionalInfo(String)

save

public XMLElement save(java.io.Writer writer,
                       MindMapLinkRegistry registry,
                       boolean saveHidden,
                       boolean saveChildren)
                throws java.io.IOException
Specified by:
save in interface MindMapNode
Overrides:
save in class NodeAdapter
saveHidden - TODO: Seems not to be used. Remove or fill with live.
saveChildren - if true, the save recurses to all of the nodes children.
Throws:
java.io.IOException

setShuttingDown

public void setShuttingDown(boolean isShuttingDown)
isShuttingDown is used to fold an encrypted node properly. If it is encrypted, it has no children. Thus, the formely existing children can't be removed. Thus, this flag postpones the childlessness of a node until it tree structure is updated.

Parameters:
isShuttingDown - The isShuttingDown to set.

isAccessible

public boolean isAccessible()
Returns:
Returns the isAccessible (ie. if the node is decrypted (isAccessible==true) or not).

insert

public void insert(javax.swing.tree.MutableTreeNode pChild,
                   int pIndex)
Specified by:
insert in interface javax.swing.tree.MutableTreeNode
Overrides:
insert in class NodeAdapter

isWriteable

public boolean isWriteable()
Description copied from interface: MindMapNode
Some nodes can't get new children or have other changes (encrypted nodes for example).

Specified by:
isWriteable in interface MindMapNode
Overrides:
isWriteable in class MindMapNodeModel

isStoringEncryptedContent

public boolean isStoringEncryptedContent()

setStoringEncryptedContent

public void setStoringEncryptedContent(boolean pIsStoringEncryptedContent)