Class JtvNode
public class JtvNode
A general-purpose tree node used by JtvOutline and JtvOutlineViewer.
JtvNode stores a display label and links to a sibling (next) and a
child list (childList). Children are themselves TNode instances,
linked through their own next pointers. The expanded flag
controls whether children are visible in the outline viewer.
Tree structure example
root ──next──► sibling
│
childList
│
child1 ──next──► child2
Traversal: start at the root, follow childList for depth-first
descent, follow next for sibling iteration.
org.viktor44.jtvision.views.JtvNode
Summary
Constructors
| Visibility | Signature |
|---|---|
| public | JtvNode(String aText) |
| public | JtvNode(String aText, JtvNode aChildren, JtvNode aNext, boolean initialState) |
Fields
| Modifiers | Field name | Type |
|---|---|---|
| private | next | org.viktor44.jtvision.views.JtvNode |
| private | text | String |
| private | childList | org.viktor44.jtvision.views.JtvNode |
| private | expanded | boolean |
Methods
| Modifiers | Method signature | Return type |
|---|---|---|
| public | getNext() | org.viktor44.jtvision.views.JtvNode |
| public | setNext(JtvNode next) | void |
| public | getText() | String |
| public | setText(String text) | void |
| public | getChildList() | org.viktor44.jtvision.views.JtvNode |
| public | setChildList(JtvNode childList) | void |
| public | isExpanded() | boolean |
| public | setExpanded(boolean expanded) | void |
Constructors
JtvNode(String aText)
Constructs a leaf node with the given label, no children, no sibling,
and expanded set to true.
Parameters
aText- the display label for this node
JtvNode(String aText, JtvNode aChildren, JtvNode aNext, boolean initialState)
Constructs a fully specified node.
Parameters
aText- the display labelaChildren- the first child node, ornullfor a leafaNext- the next sibling node, ornullinitialState-trueif the node starts expanded
Fields
org.viktor44.jtvision.views.JtvNode next
The next sibling of this node at the same tree level, or null if this is the last sibling.
String text
The text label displayed in the outline viewer for this node.
org.viktor44.jtvision.views.JtvNode childList
The first child of this node, or null if the node is a leaf.
Remaining children are reached by following next on this node.
boolean expanded
Whether this node's children are currently expanded (visible) in the outline. true by default.
Methods
getNext()
The next sibling of this node at the same tree level, or null if this is the last sibling.
setNext(JtvNode next)
The next sibling of this node at the same tree level, or null if this is the last sibling.
Parameters
next
getText()
The text label displayed in the outline viewer for this node.
setText(String text)
The text label displayed in the outline viewer for this node.
Parameters
text
getChildList()
The first child of this node, or null if the node is a leaf.
Remaining children are reached by following next on this node.
setChildList(JtvNode childList)
The first child of this node, or null if the node is a leaf.
Remaining children are reached by following next on this node.
Parameters
childList
isExpanded()
Whether this node's children are currently expanded (visible) in the outline. true by default.
setExpanded(boolean expanded)
Whether this node's children are currently expanded (visible) in the outline. true by default.
Parameters
expanded