|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--prolog.treeview.Node
the node class implements a node storing a object as value. this class also contains a static renderer map mapping a Class to a renderer. So the node knows how to render the content.
| Field Summary | |
protected java.util.List |
childs
list of all childs of this node |
protected java.lang.Object |
content
the user content stored in this node |
protected static INodeRenderer |
defaultRenderer
is the default renderer used when no renderer was found in the renderer map |
protected static java.util.Map |
gvNodeRendererMap
static node renderer map, key is a node object's class and value is the INodeRenderer |
protected Node |
parent
the parent node of this node |
protected java.awt.Rectangle |
rect
the nodes layout in the tree space |
| Constructor Summary | |
Node()
constructor |
|
Node(Node parent)
constructor |
|
Node(java.lang.String userString)
constructor - the userString will become the node's user object |
|
| Method Summary | |
void |
addChild(Node node)
adds a child node to this node |
protected boolean |
fireTreeChanged()
relayouts and repaints the tree |
void |
genXml(java.io.Writer out)
generates a xml representation of this object |
java.awt.Point |
getCenter()
returns the point in the center of this node in tree space |
java.awt.Point |
getCenterBottom()
returns the point in the middle+bottom of this node in tree space |
java.awt.Point |
getCenterTop()
returns the point in the middle+top of this node in tree space |
Node |
getChild(int index)
return the node at the specified index |
int |
getChildCount()
returns the number of childs direct of this node |
java.util.Iterator |
getChilds()
returns a iterator over all childs |
java.lang.Object |
getContent()
return the content of this map |
static INodeRenderer |
getDefaultRenderer()
returns the default rederer used to render unknown content. |
java.awt.Dimension |
getDimension()
calculates the dimension this node requires in tree space |
int |
getMaximalHeight()
recursive method calculating the height of this node and all childs required for rendering. |
int |
getMaximalWidth()
recursive method calculating the with this node requires for rendering |
Node |
getParent()
returns the parent of this node |
java.awt.Rectangle |
getRect()
returns the rect of this node in tree space |
static INodeRenderer |
getRenderer(java.lang.Class key)
returns a renderer (if one was found) from the renderer map |
RootNode |
getRoot()
returns the root of this node |
Tree |
getTree()
returns the tree this node is contained in |
boolean |
hasChild(Node node)
returns true if the given node is a direct child of this node |
void |
paint(java.awt.Graphics2D g)
paints this node and all recursive childs |
void |
paintLine(java.awt.Graphics2D g)
paints all lines between all recursive childs |
void |
recursiveDimensionUpdate()
recaltulates and caches the space required by the renderer to render this node. |
static void |
registerRenderer(java.lang.Class key,
INodeRenderer renderer)
registers a INodeRenderer for a specified Node content |
void |
removeChild(Node node)
removes the specified child node from this node |
void |
setContent(java.lang.Object content)
sets the content of this map |
void |
setParent(Node parent)
sets the parent of this node |
java.lang.String |
toString()
returns a string representation of this object |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected static java.util.Map gvNodeRendererMap
protected static INodeRenderer defaultRenderer
protected java.awt.Rectangle rect
protected java.util.List childs
protected Node parent
protected java.lang.Object content
| Constructor Detail |
public Node()
public Node(java.lang.String userString)
s - public Node(Node parent)
parent - | Method Detail |
public Node getParent()
public void setParent(Node parent)
public java.lang.Object getContent()
public void setContent(java.lang.Object content)
public void addChild(Node node)
public void removeChild(Node node)
public int getChildCount()
public boolean hasChild(Node node)
public Node getChild(int index)
public java.util.Iterator getChilds()
public RootNode getRoot()
public Tree getTree()
public java.awt.Rectangle getRect()
public void paint(java.awt.Graphics2D g)
public void paintLine(java.awt.Graphics2D g)
public java.awt.Dimension getDimension()
public void recursiveDimensionUpdate()
public java.awt.Point getCenter()
public java.awt.Point getCenterTop()
public java.awt.Point getCenterBottom()
public java.lang.String toString()
toString in class java.lang.Objectprotected boolean fireTreeChanged()
public void genXml(java.io.Writer out)
throws java.io.IOException
public static void registerRenderer(java.lang.Class key,
INodeRenderer renderer)
key - renderer - public static INodeRenderer getRenderer(java.lang.Class key)
key - public static INodeRenderer getDefaultRenderer()
public int getMaximalHeight()
public int getMaximalWidth()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||