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

Variable Index

 o collapsed
True if the node is collapsed, the children are invisible.
 o INDENT1
 o INDENT2
 o label
The label of this node.
 o selected
True if this node is currently selected.
 o src
The name of the source file for the image.

Constructor Index

 o TreeNodeWidget()
Constructor
 o TreeNodeWidget(String)
Some handy constructors.

Method Index

 o action()
The user double clicked this node.
 o add(TreeNodeWidget)
Add a node to the tree.
 o addSorted(TreeNodeWidget)
Add a child node sorted.
 o clear()
Remove all the children of this node.
 o collapse()
Collapse the node.
 o collapse(boolean)
Collapse the node.
 o collapseAll()
Collapse all children.
 o collapseAll(boolean)
Collapse all children.
 o expand()
Expand the node.
 o expandAll()
Expand all children.
 o focus()
Focus on this widget.
 o focusInterest()
A treeNode is interested in the focus if it is selected.
 o getAllNodes()
Return a vector of all nodes, in linear order.
 o getChildren()
Returns a vector containing all the direct children of this node, in linear order.
 o getImage()
Get the image for this node
 o getLabelHeight()
Compute the height of the Label
 o getLabelWidth()
Compute the width of the Label
 o getNodes()
Return a vector of nodes that are visible, in linear order.
 o getProperties(PropertyList)
Get the properties of this widget.
 o getRoot()
Get root of the Tree.
 o getSelected()
Get the selected widget in this subtree.
 o getText()
Get the label of this node
 o 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.
 o gotoNextNode()
Goto the next node, used in handleEvent.
 o gotoPreviousNode()
Goto the previous node, used in handleEvent.
 o handleEvent(Event)
Handle mouse events.
 o hasChildren()
True if the node has children.
 o imageUpdate(Image, int, int, int, int, int)
Update the image.
 o invalidate()
Invalidate this widget (and its parent)
 o isCollapsed()
True if the node is collapsed.
 o isRoot()
Check whether this tree node is the root.
 o isSelected()
Check if this node is selected.
 o key()
The key by which this item is sorted.
 o layout()
Layout the children of the node.
 o paint(Graphics, int, int, int, int)
Paint the node: the label, the lines to the child widgets.
 o paintIcon(Graphics)
Paint the label.
 o paintLabel(Graphics)
Paint the label.
 o paramString(StringBuffer)
Debugging
 o select()
Select this widget.
 o select(boolean)
Select this widget.
 o setImage(String)
Set the image for this node
 o setProperties(PropertyList)
Set the properties of this widget.
 o setText(String)
Set the label of this node
 o 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.
 o start()
Start loading the image.

Variables

 o INDENT1
  public static int INDENT1
 o INDENT2
  public static int INDENT2
 o src
  public String src
The name of the source file for the image.
See Also:
getImage, setImage
 o label
  public String label
The label of this node.
See Also:
getText, setText
 o collapsed
  public boolean collapsed
True if the node is collapsed, the children are invisible.
See Also:
isCollapsed, collapse, expand, collapseAll, expandAll
 o selected
  public boolean selected
True if this node is currently selected.
See Also:
isSelected, select, getSelected

Constructors

 o TreeNodeWidget
  public TreeNodeWidget()
Constructor
 o TreeNodeWidget
  public TreeNodeWidget(String label)
Some handy constructors.

Methods

 o getProperties
  public void getProperties(PropertyList list)
Get the properties of this widget.
Overrides:
getProperties in class GroupWidget
 o setProperties
  public void setProperties(PropertyList list)
Set the properties of this widget.
Overrides:
setProperties in class GroupWidget
 o 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
 o 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
 o getRoot
  public TreeNodeWidget getRoot()
Get root of the Tree.
 o isRoot
  public boolean isRoot()
Check whether this tree node is the root.
 o clear
  public void clear()
Remove all the children of this node.
 o getNodes
  public Vector getNodes()
Return a vector of nodes that are visible, in linear order.
 o getAllNodes
  public Vector getAllNodes()
Return a vector of all nodes, in linear order.
 o hasChildren
  public boolean hasChildren()
True if the node has children.
 o getChildren
  public Vector getChildren()
Returns a vector containing all the direct children of this node, in linear order.
 o isCollapsed
  public boolean isCollapsed()
True if the node is collapsed.
See Also:
collapsed
 o collapse
  public void collapse()
Collapse the node.
See Also:
collapsed
 o collapse
  public void collapse(boolean collapsed)
Collapse the node.
See Also:
collapsed
 o expand
  public void expand()
Expand the node.
See Also:
collapsed
 o expandAll
  public void expandAll()
Expand all children.
See Also:
collapsed
 o collapseAll
  public void collapseAll()
Collapse all children.
See Also:
collapsed
 o collapseAll
  public void collapseAll(boolean collapsed)
Collapse all children.
See Also:
collapsed
 o focus
  public void focus()
Focus on this widget.
 o addSorted
  public void addSorted(TreeNodeWidget node)
Add a child node sorted.
 o add
  public void add(TreeNodeWidget node)
Add a node to the tree. This takes into account whether the node is currently collapsed or expanded.
 o isSelected
  public boolean isSelected()
Check if this node is selected.
See Also:
selected
 o select
  public void select()
Select this widget. Unselect all other selected widgets in this tree.
See Also:
selected
 o select
  public void select(boolean selected)
Select this widget.
See Also:
selected
 o getSelected
  public TreeNodeWidget getSelected()
Get the selected widget in this subtree.
See Also:
selected
 o getText
  public String getText()
Get the label of this node
Overrides:
getText in class Widget
See Also:
label
 o setText
  public void setText(String label)
Set the label of this node
Overrides:
setText in class Widget
See Also:
label
 o getImage
  public String getImage()
Get the image for this node
See Also:
src
 o setImage
  public void setImage(String src)
Set the image for this node
See Also:
src
 o key
  public String key()
The key by which this item is sorted.
 o invalidate
  public void invalidate()
Invalidate this widget (and its parent)
Overrides:
invalidate in class Widget
 o layout
  public void layout()
Layout the children of the node.
Overrides:
layout in class ContainerWidget
 o start
  public void start()
Start loading the image.
Overrides:
start in class Widget
 o imageUpdate
  public boolean imageUpdate(Image newimg,
                             int flags,
                             int x,
                             int y,
                             int w,
                             int h)
Update the image.
Overrides:
imageUpdate in class Widget
 o getLabelWidth
  public int getLabelWidth()
Compute the width of the Label
 o getLabelHeight
  public int getLabelHeight()
Compute the height of the Label
 o paintIcon
  public void paintIcon(Graphics g)
Paint the label.
 o paintLabel
  public void paintLabel(Graphics g)
Paint the label.
 o 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
 o gotoNextNode
  protected void gotoNextNode()
Goto the next node, used in handleEvent.
See Also:
handleEvent
 o gotoPreviousNode
  protected void gotoPreviousNode()
Goto the previous node, used in handleEvent.
See Also:
handleEvent
 o handleEvent
  public boolean handleEvent(Event evt)
Handle mouse events.
Overrides:
handleEvent in class Widget
 o action
  public void action()
The user double clicked this node.
Overrides:
action in class Widget
 o focusInterest
  public boolean focusInterest()
A treeNode is interested in the focus if it is selected.
Overrides:
focusInterest in class Widget
 o paramString
  public void paramString(StringBuffer buf)
Debugging
Overrides:
paramString in class GroupWidget

All Packages  Class Hierarchy  This Package  Previous  Next  Index