freemind.modes
Interface MindMapNode

All Superinterfaces:
javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
All Known Implementing Classes:
BrowseNodeModel, EncryptedBrowseNode, EncryptedMindMapNode, FileNodeModel, MindMapNodeModel, NodeAdapter, SchemeNodeModel

public interface MindMapNode
extends javax.swing.tree.MutableTreeNode


Field Summary
static java.lang.String[] NODE_STYLES
           
static java.lang.String STYLE_AS_PARENT
           
static java.lang.String STYLE_BUBBLE
           
static java.lang.String STYLE_COMBINED
           
static java.lang.String STYLE_FORK
           
 
Method Summary
 void acceptViewVisitor(NodeViewVisitor visitor)
           
 PermanentNodeHook addHook(PermanentNodeHook hook)
          Adds the hook to the list of hooks to my node.
 void addIcon(MindIcon icon, int position)
           
 void addTreeModelListener(javax.swing.event.TreeModelListener l)
           
 void addViewer(NodeView viewer)
           
 int calcShiftY()
           
 java.util.ListIterator childrenFolded()
           
 java.util.ListIterator childrenUnfolded()
           
 void createAttributeTableModel()
           
 java.util.Collection getActivatedHooks()
           
 java.lang.String getAdditionalInfo()
           
 Attribute getAttribute(int pPosition)
           
 java.lang.String getAttribute(java.lang.String pKey)
          Searches for the first attribute with the given key.
 java.util.List getAttributeKeyList()
           
 int getAttributePosition(java.lang.String key)
           
 NodeAttributeTableModel getAttributes()
          use getAttributeKeyList, getAttribute, isAttributeExisting and setAttribute instead, if you want to access the attributes like a dictionary.
 int getAttributeTableLength()
           
 java.awt.Color getBackgroundColor()
           
 int getChildPosition(MindMapNode childNode)
           
 java.util.List getChildren()
           
 MindMapCloud getCloud()
           
 java.awt.Color getColor()
           
 MindMapEdge getEdge()
           
 FilterInfo getFilterInfo()
           
 java.awt.Font getFont()
           
 java.lang.String getFontFamilyName()
           
 java.lang.String getFontSize()
           
 int getHGap()
           
 HistoryInformation getHistoryInformation()
           
 java.util.List getHooks()
           
 java.util.List getIcons()
          Is a vector of MindIcon s
 java.lang.String getLink()
           
 javax.swing.event.EventListenerList getListeners()
           
 MindMap getMap()
           
 int getNodeLevel()
           
 java.lang.String getNoteText()
           
 java.lang.String getObjectId(ModeController controller)
           
 MindMapNode getParentNode()
           
 javax.swing.tree.TreePath getPath()
           
 java.lang.String getPlainTextContent()
           
 int getShiftY()
           
 java.lang.String getShortText(ModeController controller)
          returns a short textual description of the text contained in the node.
 java.util.Map getStateIcons()
          State icons are icons that are not saved.
 java.lang.String getStyle()
           
 java.lang.String getText()
           
 java.util.SortedMap getToolTip()
           
 int getVGap()
           
 java.util.Collection getViewers()
           
 java.lang.String getXmlNoteText()
           
 java.lang.String getXmlText()
           
 boolean hasChildren()
           
 boolean hasOneVisibleChild()
           
 boolean hasStyle()
           
 void invokeHook(NodeHook hook)
           
 boolean isBold()
           
 boolean isDescendantOf(MindMapNode node)
           
 boolean isFolded()
           
 boolean isItalic()
           
 boolean isLeft()
           
 boolean isNewChildLeft()
           
 boolean isRoot()
           
 boolean isUnderlined()
           
 boolean isVisible()
           
 boolean isWriteable()
          Some nodes can't get new children or have other changes (encrypted nodes for example).
 void removeHook(PermanentNodeHook hook)
          Removes the hook from the activated hooks, calls shutdown method of the hook and removes the hook from allHook belonging to the node afterwards.
 int removeIcon(int position)
           
 void removeTreeModelListener(javax.swing.event.TreeModelListener l)
           
 void removeViewer(NodeView viewer)
           
 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 setAttribute(int pPosition, Attribute pAttribute)
          Sets the attribute to the given value.
 void setBackgroundColor(java.awt.Color color)
           
 void setCloud(MindMapCloud cloud)
           
 void setColor(java.awt.Color color)
           
 void setFolded(boolean folded)
           
 void setFont(java.awt.Font font)
           
 void setFontSize(int fontSize)
           
 void setHGap(int i)
           
 void setHistoryInformation(HistoryInformation historyInformation)
           
 void setLeft(boolean isLeft)
           
 void setLink(java.lang.String link)
           
 void setNoteText(java.lang.String noteText)
          Sets both noteText and xmlNoteText.
 void setShiftY(int y)
           
 void setStateIcon(java.lang.String key, javax.swing.ImageIcon icon)
           
 void setStyle(java.lang.String style)
          currently the style may be one of MindMapNode.STYLE_BUBBLE or MindMapNode.STYLE_FORK.
 void setText(java.lang.String text)
          Sets both text and xmlText.
 void setToolTip(java.lang.String key, java.lang.String tip)
           
 void setVGap(int i)
           
 void setXmlNoteText(java.lang.String structuredNoteText)
          Sets both noteText and xmlNoteText.
 void setXmlText(java.lang.String structuredText)
          Sets both text and xmlText.
 MindMapNode shallowCopy()
           
 java.lang.String toString()
           
 
Methods inherited from interface javax.swing.tree.MutableTreeNode
insert, remove, remove, removeFromParent, setParent, setUserObject
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
 

Field Detail

STYLE_BUBBLE

static final java.lang.String STYLE_BUBBLE
See Also:
Constant Field Values

STYLE_FORK

static final java.lang.String STYLE_FORK
See Also:
Constant Field Values

STYLE_COMBINED

static final java.lang.String STYLE_COMBINED
See Also:
Constant Field Values

STYLE_AS_PARENT

static final java.lang.String STYLE_AS_PARENT
See Also:
Constant Field Values

NODE_STYLES

static final java.lang.String[] NODE_STYLES
Method Detail

getText

java.lang.String getText()
Returns:
the text representation of the nodes content. HTML is represented as .... see getXmlText

setText

void setText(java.lang.String text)
Sets both text and xmlText.


getXmlText

java.lang.String getXmlText()
Returns:
the text representation of the nodes content as valid XML. HTML is represented as .... with proper tags (like \
instead of \ and so on).

setXmlText

void setXmlText(java.lang.String structuredText)
Sets both text and xmlText.


getXmlNoteText

java.lang.String getXmlNoteText()
Returns:
the text representation of the notes content as valid XML. HTML is represented as .... with proper tags (like
instead of
and so on).

setXmlNoteText

void setXmlNoteText(java.lang.String structuredNoteText)
Sets both noteText and xmlNoteText.


getNoteText

java.lang.String getNoteText()
Returns:
the text representation of the notes content as valid HTML 3.2.

setNoteText

void setNoteText(java.lang.String noteText)
Sets both noteText and xmlNoteText.


getObjectId

java.lang.String getObjectId(ModeController controller)
Returns:
returns the unique id of the node. It is generated using the LinkRegistry.

childrenFolded

java.util.ListIterator childrenFolded()
Returns:
returns a ListIterator of all children of the node if the node is unfolded. EMPTY_LIST_ITERATOR otherwise.

childrenUnfolded

java.util.ListIterator childrenUnfolded()
Returns:
returns a ListIterator of all (and not only the unfolded ones!!) children of the node.

getChildren

java.util.List getChildren()
Returns:
a list of (unmodifiable) children (all ones, folded and unfolded) of type MindMapNode.

hasChildren

boolean hasChildren()

getFilterInfo

FilterInfo getFilterInfo()

getChildPosition

int getChildPosition(MindMapNode childNode)
Returns:
-1 if the argument childNode is not a child.

getNodeLevel

int getNodeLevel()

getLink

java.lang.String getLink()

getShortText

java.lang.String getShortText(ModeController controller)
returns a short textual description of the text contained in the node. Html is filtered out.


getEdge

MindMapEdge getEdge()

getColor

java.awt.Color getColor()

getStyle

java.lang.String getStyle()

setStyle

void setStyle(java.lang.String style)
currently the style may be one of MindMapNode.STYLE_BUBBLE or MindMapNode.STYLE_FORK.


hasStyle

boolean hasStyle()

getParentNode

MindMapNode getParentNode()

isBold

boolean isBold()

isItalic

boolean isItalic()

isUnderlined

boolean isUnderlined()

getFont

java.awt.Font getFont()

getFontSize

java.lang.String getFontSize()

getFontFamilyName

java.lang.String getFontFamilyName()

getViewers

java.util.Collection getViewers()

addViewer

void addViewer(NodeView viewer)

removeViewer

void removeViewer(NodeView viewer)

toString

java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPlainTextContent

java.lang.String getPlainTextContent()

getPath

javax.swing.tree.TreePath getPath()

isDescendantOf

boolean isDescendantOf(MindMapNode node)

isRoot

boolean isRoot()

isFolded

boolean isFolded()

isLeft

boolean isLeft()

setLeft

void setLeft(boolean isLeft)

setFolded

void setFolded(boolean folded)

setFont

void setFont(java.awt.Font font)

setShiftY

void setShiftY(int y)

getShiftY

int getShiftY()

calcShiftY

int calcShiftY()

setVGap

void setVGap(int i)

getVGap

int getVGap()

setHGap

void setHGap(int i)

getHGap

int getHGap()

setLink

void setLink(java.lang.String link)

setFontSize

void setFontSize(int fontSize)

setColor

void setColor(java.awt.Color color)

getIcons

java.util.List getIcons()
Is a vector of MindIcon s


addIcon

void addIcon(MindIcon icon,
             int position)

removeIcon

int removeIcon(int position)

getCloud

MindMapCloud getCloud()

setCloud

void setCloud(MindMapCloud cloud)

getBackgroundColor

java.awt.Color getBackgroundColor()

setBackgroundColor

void setBackgroundColor(java.awt.Color color)

getHooks

java.util.List getHooks()

getActivatedHooks

java.util.Collection getActivatedHooks()

addHook

PermanentNodeHook addHook(PermanentNodeHook hook)
Adds the hook to the list of hooks to my node. Does not invoke the hook!

Returns:
returns the input parameter hook

invokeHook

void invokeHook(NodeHook hook)

removeHook

void removeHook(PermanentNodeHook hook)
Removes the hook from the activated hooks, calls shutdown method of the hook and removes the hook from allHook belonging to the node afterwards.


setToolTip

void setToolTip(java.lang.String key,
                java.lang.String tip)

getToolTip

java.util.SortedMap getToolTip()

setAdditionalInfo

void setAdditionalInfo(java.lang.String info)
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.


getAdditionalInfo

java.lang.String getAdditionalInfo()

shallowCopy

MindMapNode shallowCopy()
Returns:
a flat copy of this node including all extras like notes, etc. But the children are not copied!

save

XMLElement save(java.io.Writer writer,
                MindMapLinkRegistry registry,
                boolean saveHidden,
                boolean saveChildren)
                throws java.io.IOException
Parameters:
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

getStateIcons

java.util.Map getStateIcons()
State icons are icons that are not saved. They indicate that this node is special.


setStateIcon

void setStateIcon(java.lang.String key,
                  javax.swing.ImageIcon icon)
Parameters:
icon - use null to remove the state icon. Then it is not required, that the key already exists.

getHistoryInformation

HistoryInformation getHistoryInformation()

setHistoryInformation

void setHistoryInformation(HistoryInformation historyInformation)

isVisible

boolean isVisible()

hasOneVisibleChild

boolean hasOneVisibleChild()

getMap

MindMap getMap()

getAttributes

NodeAttributeTableModel getAttributes()
use getAttributeKeyList, getAttribute, isAttributeExisting and setAttribute instead, if you want to access the attributes like a dictionary. If you want to put several Attribute elements with the samw name, you have to use this method.


createAttributeTableModel

void createAttributeTableModel()

getAttributeKeyList

java.util.List getAttributeKeyList()
Returns:
an unmodifiable list of all attribute keys as String. There can be double entries.

getAttributeTableLength

int getAttributeTableLength()
Returns:
the amount of attributes.

getAttribute

Attribute getAttribute(int pPosition)
Parameters:
pPosition - the null based position.
Returns:
a copy of the node's attribute.

getAttribute

java.lang.String getAttribute(java.lang.String pKey)
Searches for the first attribute with the given key. This is a convenience function. see MindMapActions.editAttribute to set the value to a different one.

Parameters:
pKey - is the name of the attribute
Returns:
the value of the attribute or null, if not found.

getAttributePosition

int getAttributePosition(java.lang.String key)
Parameters:
key - the name of the attribute
Returns:
the index of the first occurence of an attribute with this key, or -1 if not found.

setAttribute

void setAttribute(int pPosition,
                  Attribute pAttribute)
Sets the attribute to the given value.


addTreeModelListener

void addTreeModelListener(javax.swing.event.TreeModelListener l)

removeTreeModelListener

void removeTreeModelListener(javax.swing.event.TreeModelListener l)

acceptViewVisitor

void acceptViewVisitor(NodeViewVisitor visitor)

getListeners

javax.swing.event.EventListenerList getListeners()

isNewChildLeft

boolean isNewChildLeft()

isWriteable

boolean isWriteable()
Some nodes can't get new children or have other changes (encrypted nodes for example).