Class marimba.gui.TreeNodeWidget
All Packages Class Hierarchy This Package Previous Next Index
Class marimba.gui.TreeNodeWidget
java.lang.Object
|
+----marimba.gui.Widget
|
+----marimba.gui.ContainerWidget
|
+----marimba.gui.GroupWidget
|
+----marimba.gui.TreeNodeWidget
- public class TreeNodeWidget
- extends GroupWidget
A node in a hierarchical list. This needs to be
generalized so that it can be customized easier.
- Version:
- 1.37, 12/18/96
- Author:
- Arthur van Hoff
-
collapsed
- True if the node is collapsed, the children are invisible.
-
INDENT1
-
-
INDENT2
-
-
label
- The label of this node.
-
selected
- True if this node is currently selected.
-
src
- The name of the source file for the image.
-
TreeNodeWidget()
- Constructor
-
TreeNodeWidget(String)
- Some handy constructors.
-
action()
- The user double clicked this node.
-
add(TreeNodeWidget)
- Add a node to the tree.
-
addSorted(TreeNodeWidget)
- Add a child node sorted.
-
clear()
- Remove all the children of this node.
-
collapse()
- Collapse the node.
-
collapse(boolean)
- Collapse the node.
-
collapseAll()
- Collapse all children.
-
collapseAll(boolean)
- Collapse all children.
-
expand()
- Expand the node.
-
expandAll()
- Expand all children.
-
focus()
- Focus on this widget.
-
focusInterest()
- A treeNode is interested in the focus if it is selected.
-
getAllNodes()
- Return a vector of all nodes, in linear order.
-
getChildren()
- Returns a vector containing all the direct
children of this node, in linear order.
-
getImage()
- Get the image for this node
-
getLabelHeight()
- Compute the height of the Label
-
getLabelWidth()
- Compute the width of the Label
-
getNodes()
- Return a vector of nodes that are visible, in linear order.
-
getProperties(PropertyList)
- Get the properties of this widget.
-
getRoot()
- Get root of the Tree.
-
getSelected()
- Get the selected widget in this subtree.
-
getText()
- Get the label of this node
-
getTreeWidget()
- Get the TreeWidget in which this treenode is embedded;
if the tree has not been set, a search all the way up
is performed by this method and the tree is set.
-
gotoNextNode()
- Goto the next node, used in handleEvent.
-
gotoPreviousNode()
- Goto the previous node, used in handleEvent.
-
handleEvent(Event)
- Handle mouse events.
-
hasChildren()
- True if the node has children.
-
imageUpdate(Image, int, int, int, int, int)
- Update the image.
-
invalidate()
- Invalidate this widget (and its parent)
-
isCollapsed()
- True if the node is collapsed.
-
isRoot()
- Check whether this tree node is the root.
-
isSelected()
- Check if this node is selected.
-
key()
- The key by which this item is sorted.
-
layout()
- Layout the children of the node.
-
paint(Graphics, int, int, int, int)
- Paint the node: the label, the lines to the child widgets.
-
paintIcon(Graphics)
- Paint the label.
-
paintLabel(Graphics)
- Paint the label.
-
paramString(StringBuffer)
- Debugging
-
select()
- Select this widget.
-
select(boolean)
- Select this widget.
-
setImage(String)
- Set the image for this node
-
setProperties(PropertyList)
- Set the properties of this widget.
-
setText(String)
- Set the label of this node
-
setTreeWidget(TreeWidget)
- Set the TreeWidget in which this node is embedded,
by setting this the search for the tree all the way
up is not necessary anymore.
-
start()
- Start loading the image.
INDENT1
public static int INDENT1
INDENT2
public static int INDENT2
src
public String src
- The name of the source file for the image.
- See Also:
- getImage, setImage
label
public String label
- The label of this node.
- See Also:
- getText, setText
collapsed
public boolean collapsed
- True if the node is collapsed, the children are invisible.
- See Also:
- isCollapsed, collapse, expand, collapseAll, expandAll
selected
public boolean selected
- True if this node is currently selected.
- See Also:
- isSelected, select, getSelected
TreeNodeWidget
public TreeNodeWidget()
- Constructor
TreeNodeWidget
public TreeNodeWidget(String label)
- Some handy constructors.
getProperties
public void getProperties(PropertyList list)
- Get the properties of this widget.
- Overrides:
- getProperties in class GroupWidget
setProperties
public void setProperties(PropertyList list)
- Set the properties of this widget.
- Overrides:
- setProperties in class GroupWidget
getTreeWidget
public TreeWidget getTreeWidget()
- Get the TreeWidget in which this treenode is embedded;
if the tree has not been set, a search all the way up
is performed by this method and the tree is set.
- See Also:
- setTreeWidget
setTreeWidget
public void setTreeWidget(TreeWidget tree)
- Set the TreeWidget in which this node is embedded,
by setting this the search for the tree all the way
up is not necessary anymore.
- See Also:
- getTreeWidget
getRoot
public TreeNodeWidget getRoot()
- Get root of the Tree.
isRoot
public boolean isRoot()
- Check whether this tree node is the root.
clear
public void clear()
- Remove all the children of this node.
getNodes
public Vector getNodes()
- Return a vector of nodes that are visible, in linear order.
getAllNodes
public Vector getAllNodes()
- Return a vector of all nodes, in linear order.
hasChildren
public boolean hasChildren()
- True if the node has children.
getChildren
public Vector getChildren()
- Returns a vector containing all the direct
children of this node, in linear order.
isCollapsed
public boolean isCollapsed()
- True if the node is collapsed.
- See Also:
- collapsed
collapse
public void collapse()
- Collapse the node.
- See Also:
- collapsed
collapse
public void collapse(boolean collapsed)
- Collapse the node.
- See Also:
- collapsed
expand
public void expand()
- Expand the node.
- See Also:
- collapsed
expandAll
public void expandAll()
- Expand all children.
- See Also:
- collapsed
collapseAll
public void collapseAll()
- Collapse all children.
- See Also:
- collapsed
collapseAll
public void collapseAll(boolean collapsed)
- Collapse all children.
- See Also:
- collapsed
focus
public void focus()
- Focus on this widget.
addSorted
public void addSorted(TreeNodeWidget node)
- Add a child node sorted.
add
public void add(TreeNodeWidget node)
- Add a node to the tree. This takes into account
whether the node is currently collapsed or expanded.
isSelected
public boolean isSelected()
- Check if this node is selected.
- See Also:
- selected
select
public void select()
- Select this widget. Unselect all other selected widgets
in this tree.
- See Also:
- selected
select
public void select(boolean selected)
- Select this widget.
- See Also:
- selected
getSelected
public TreeNodeWidget getSelected()
- Get the selected widget in this subtree.
- See Also:
- selected
getText
public String getText()
- Get the label of this node
- Overrides:
- getText in class Widget
- See Also:
- label
setText
public void setText(String label)
- Set the label of this node
- Overrides:
- setText in class Widget
- See Also:
- label
getImage
public String getImage()
- Get the image for this node
- See Also:
- src
setImage
public void setImage(String src)
- Set the image for this node
- See Also:
- src
key
public String key()
- The key by which this item is sorted.
invalidate
public void invalidate()
- Invalidate this widget (and its parent)
- Overrides:
- invalidate in class Widget
layout
public void layout()
- Layout the children of the node.
- Overrides:
- layout in class ContainerWidget
start
public void start()
- Start loading the image.
- Overrides:
- start in class Widget
imageUpdate
public boolean imageUpdate(Image newimg,
int flags,
int x,
int y,
int w,
int h)
- Update the image.
- Overrides:
- imageUpdate in class Widget
getLabelWidth
public int getLabelWidth()
- Compute the width of the Label
getLabelHeight
public int getLabelHeight()
- Compute the height of the Label
paintIcon
public void paintIcon(Graphics g)
- Paint the label.
paintLabel
public void paintLabel(Graphics g)
- Paint the label.
paint
public void paint(Graphics g,
int x,
int y,
int width,
int height)
- Paint the node: the label, the lines to the child widgets.
- Overrides:
- paint in class GroupWidget
gotoNextNode
protected void gotoNextNode()
- Goto the next node, used in handleEvent.
- See Also:
- handleEvent
gotoPreviousNode
protected void gotoPreviousNode()
- Goto the previous node, used in handleEvent.
- See Also:
- handleEvent
handleEvent
public boolean handleEvent(Event evt)
- Handle mouse events.
- Overrides:
- handleEvent in class Widget
action
public void action()
- The user double clicked this node.
- Overrides:
- action in class Widget
focusInterest
public boolean focusInterest()
- A treeNode is interested in the focus if it is selected.
- Overrides:
- focusInterest in class Widget
paramString
public void paramString(StringBuffer buf)
- Debugging
- Overrides:
- paramString in class GroupWidget
All Packages Class Hierarchy This Package Previous Next Index