freemind.modes

Class NodeAdapter

Implemented Interfaces:
MindMapNode, MutableTreeNode
Known Direct Subclasses:
BrowseNodeModel, FileNodeModel, MindMapNodeModel, SchemeNodeModel

public abstract class NodeAdapter
extends java.lang.Object
implements MindMapNode

This class represents a single Node of a Tree. It contains direct handles to its parent and children and to its view.

Field Summary

protected List
children
protected MindMapCloud
cloud
parameters of an eventually associated cloud
protected Color
color
protected boolean
folded
protected Font
font
protected Vector
icons
stores the icons associated with this node.
protected String
style
protected boolean
underlined
protected Object
userObject

Fields inherited from interface freemind.modes.MindMapNode

STYLE_BUBBLE, STYLE_FORK

Constructor Summary

NodeAdapter(Object userObject, FreeMindMain frame)
NodeAdapter(FreeMindMain frame)

Method Summary

void
addIcon(MindIcon _icon)
protected MindMapNode
basicCopy()
Enumeration
children()
AFAIK there is no way to get an enumeration out of a linked list.
ListIterator
childrenFolded()
ListIterator
childrenUnfolded()
void
estabilishOwnFont()
boolean
getAllowsChildren()
TreeNode
getChildAt(int childIndex)
int
getChildCount()
int
getChildPosition(MindMapNode childNode)
MindMapCloud
getCloud()
Color
getColor()
The Foreground/Font Color
MindMapEdge
getEdge()
Font
getFont()
String
getFontFamilyName()
String
getFontSize()
FreeMindMain
getFrame()
Vector
getIcons()
int
getIndex(TreeNode node)
String
getLink()
int
getNodeLevel()
TreeNode
getParent()
MindMapNode
getParentNode()
TreePath
getPath()
Creates the TreePath recursively
MindMapNode
getPreferredChild()
String
getStyle()
A Node-Style like MindMapNode.STYLE_FORK or MindMapNode.STYLE_BUBBLE
NodeView
getViewer()
boolean
hasChildren()
boolean
hasFoldedStrictDescendant()
True iff one of node's strict descendants is folded.
void
insert(MutableTreeNode child, int index)
boolean
isBold()
boolean
isDescendantOf(MindMapNode node)
Returns whether the argument is parent or parent of one of the grandpa's of this node.
boolean
isFolded()
boolean
isItalic()
boolean
isLeaf()
Tools.BooleanHolder
isLeft()
boolean
isRoot()
boolean
isUnderlined()
void
remove(MutableTreeNode node)
void
remove(int index)
void
removeFromParent()
int
removeLastIcon()
void
setBold(boolean bold)
void
setCloud(MindMapCloud cloud)
void
setColor(Color color)
void
setEdge(MindMapEdge edge)
void
setFolded(boolean folded)
void
setFont(Font font)
void
setFontSize(int fontSize)
void
setItalic(boolean italic)
void
setLeft(boolean isLeft)
void
setLink(String link)
void
setParent(MutableTreeNode newParent)
void
setParent(MindMapNode newParent)
void
setPreferredChild(MindMapNode node)
void
setStyle(String style)
void
setUnderlined(boolean underlined)
void
setUserObject(Object object)
void
setViewer(NodeView viewer)
MindMapNode
shallowCopy()
String
toString()
void
toggleBold()
void
toggleItalic()

Field Details

children

protected List children

cloud

protected MindMapCloud cloud
parameters of an eventually associated cloud

color

protected Color color

folded

protected boolean folded

font

protected Font font

icons

protected Vector icons
stores the icons associated with this node.

style

protected String style

underlined

protected boolean underlined

userObject

protected Object userObject

Constructor Details

NodeAdapter

protected NodeAdapter(Object userObject,
                      FreeMindMain frame)

NodeAdapter

protected NodeAdapter(FreeMindMain frame)

Method Details

addIcon

public void addIcon(MindIcon _icon)
Specified by:
addIcon in interface MindMapNode

basicCopy

protected MindMapNode basicCopy()

children

public Enumeration children()
AFAIK there is no way to get an enumeration out of a linked list. So this exception must be thrown, or we can't implement TreeNode anymore (maybe we shouldn't?)

childrenFolded

public ListIterator childrenFolded()
Specified by:
childrenFolded in interface MindMapNode

childrenUnfolded

public ListIterator childrenUnfolded()
Specified by:
childrenUnfolded in interface MindMapNode

estabilishOwnFont

public void estabilishOwnFont()

getAllowsChildren

public boolean getAllowsChildren()

getChildAt

public TreeNode getChildAt(int childIndex)

getChildCount

public int getChildCount()

getChildPosition

public int getChildPosition(MindMapNode childNode)
Specified by:
getChildPosition in interface MindMapNode

getCloud

public MindMapCloud getCloud()
Specified by:
getCloud in interface MindMapNode

getColor

public Color getColor()
The Foreground/Font Color
Specified by:
getColor in interface MindMapNode

getEdge

public MindMapEdge getEdge()
Specified by:
getEdge in interface MindMapNode

getFont

public Font getFont()
Specified by:
getFont in interface MindMapNode

getFontFamilyName

public String getFontFamilyName()
Specified by:
getFontFamilyName in interface MindMapNode

getFontSize

public String getFontSize()
Specified by:
getFontSize in interface MindMapNode

getFrame

public FreeMindMain getFrame()

getIcons

public Vector getIcons()
Specified by:
getIcons in interface MindMapNode

getIndex

public int getIndex(TreeNode node)

getLink

public String getLink()
Specified by:
getLink in interface MindMapNode

getNodeLevel

public int getNodeLevel()
Specified by:
getNodeLevel in interface MindMapNode

getParent

public TreeNode getParent()

getParentNode

public MindMapNode getParentNode()
Specified by:
getParentNode in interface MindMapNode

getPath

public TreePath getPath()
Creates the TreePath recursively
Specified by:
getPath in interface MindMapNode

getPreferredChild

public MindMapNode getPreferredChild()
Specified by:
getPreferredChild in interface MindMapNode

getStyle

public String getStyle()
A Node-Style like MindMapNode.STYLE_FORK or MindMapNode.STYLE_BUBBLE
Specified by:
getStyle in interface MindMapNode

getViewer

public NodeView getViewer()
Specified by:
getViewer in interface MindMapNode

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in interface MindMapNode

hasFoldedStrictDescendant

public boolean hasFoldedStrictDescendant()
True iff one of node's strict descendants is folded. A node N is not its strict descendant - the fact that node itself is folded is not sufficient to return true.

insert

public void insert(MutableTreeNode child,
                   int index)

isBold

public boolean isBold()
Specified by:
isBold in interface MindMapNode

isDescendantOf

public boolean isDescendantOf(MindMapNode node)
Returns whether the argument is parent or parent of one of the grandpa's of this node. (transitive)
Specified by:
isDescendantOf in interface MindMapNode

isFolded

public boolean isFolded()
Specified by:
isFolded in interface MindMapNode

isItalic

public boolean isItalic()
Specified by:
isItalic in interface MindMapNode

isLeaf

public boolean isLeaf()

isLeft

public Tools.BooleanHolder isLeft()
Specified by:
isLeft in interface MindMapNode

isRoot

public boolean isRoot()
Specified by:
isRoot in interface MindMapNode

isUnderlined

public boolean isUnderlined()
Specified by:
isUnderlined in interface MindMapNode

remove

public void remove(MutableTreeNode node)

remove

public void remove(int index)

removeFromParent

public void removeFromParent()

removeLastIcon

public int removeLastIcon()
Specified by:
removeLastIcon in interface MindMapNode

setBold

public void setBold(boolean bold)

setCloud

public void setCloud(MindMapCloud cloud)

setColor

public void setColor(Color color)
Specified by:
setColor in interface MindMapNode

setEdge

public void setEdge(MindMapEdge edge)

setFolded

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

setFont

public void setFont(Font font)
Specified by:
setFont in interface MindMapNode

setFontSize

public void setFontSize(int fontSize)
Specified by:
setFontSize in interface MindMapNode

setItalic

public void setItalic(boolean italic)

setLeft

public void setLeft(boolean isLeft)
Specified by:
setLeft in interface MindMapNode

setLink

public void setLink(String link)
Specified by:
setLink in interface MindMapNode

setParent

public void setParent(MutableTreeNode newParent)

setParent

public void setParent(MindMapNode newParent)

setPreferredChild

public void setPreferredChild(MindMapNode node)
Specified by:
setPreferredChild in interface MindMapNode

setStyle

public void setStyle(String style)

setUnderlined

public void setUnderlined(boolean underlined)

setUserObject

public void setUserObject(Object object)

setViewer

public void setViewer(NodeView viewer)
Specified by:
setViewer in interface MindMapNode

shallowCopy

public MindMapNode shallowCopy()
Specified by:
shallowCopy in interface MindMapNode

toString

public String toString()
Specified by:
toString in interface MindMapNode

toggleBold

public void toggleBold()

toggleItalic

public void toggleItalic()