artofillusion.ui
Class TreeElement

java.lang.Object
  extended by artofillusion.ui.TreeElement
Direct Known Subclasses:
GenericTreeElement, ObjectRefTreeElement, ObjectTreeElement, TrackTreeElement

public abstract class TreeElement
extends java.lang.Object

This is an abstract class representing an element in a tree.


Constructor Summary
TreeElement()
           
 
Method Summary
abstract  void addChild(TreeElement el, int position)
          Add another element as a child of this one.
abstract  boolean canAcceptAsParent(TreeElement el)
          Determine whether this element can be added as a child of another one If el is null, return whether this element can be added at the root level of the tree.
 TreeElement getChild(int which)
          Get a particular child of this element.
 javax.swing.Icon getIcon()
          Get the icon to display for this element (may be null).
abstract  java.lang.String getLabel()
          Get the label to display for this element.
 int getNumChildren()
          Get the number of children which this element has.
abstract  java.lang.Object getObject()
          Get the object corresponding to this element.
 TreeElement getParent()
          Get the parent of this element.
 boolean isExpanded()
          Determine whether this element in the tree is expanded.
abstract  boolean isGray()
          Get whether this element should be drawn in gray (i.e.
 boolean isSelectable()
          Determine whether this element in the tree can be selected.
 boolean isSelected()
          Determine whether this element in the tree is selected.
abstract  void removeChild(java.lang.Object obj)
          Remove any elements corresponding to the given object from this element's list of children.
 boolean selectWithParent()
          This returns true if this element should automatically be selected whenever its parent is selected.
 void setExpanded(boolean expanded)
          Set whether this element in the tree is expanded.
 void setSelectable(boolean selectable)
          Set whether this element in the tree can be selected.
 void setSelected(boolean selected)
          Set whether this element in the tree is selected.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeElement

public TreeElement()
Method Detail

getLabel

public abstract java.lang.String getLabel()
Get the label to display for this element.


getIcon

public javax.swing.Icon getIcon()
Get the icon to display for this element (may be null).


isSelected

public boolean isSelected()
Determine whether this element in the tree is selected.


setSelected

public void setSelected(boolean selected)
Set whether this element in the tree is selected.


isExpanded

public boolean isExpanded()
Determine whether this element in the tree is expanded.


setExpanded

public void setExpanded(boolean expanded)
Set whether this element in the tree is expanded.


isSelectable

public boolean isSelectable()
Determine whether this element in the tree can be selected.


setSelectable

public void setSelectable(boolean selectable)
Set whether this element in the tree can be selected.


selectWithParent

public boolean selectWithParent()
This returns true if this element should automatically be selected whenever its parent is selected.


getParent

public TreeElement getParent()
Get the parent of this element.


getNumChildren

public int getNumChildren()
Get the number of children which this element has.


getChild

public TreeElement getChild(int which)
Get a particular child of this element.


canAcceptAsParent

public abstract boolean canAcceptAsParent(TreeElement el)
Determine whether this element can be added as a child of another one If el is null, return whether this element can be added at the root level of the tree.


addChild

public abstract void addChild(TreeElement el,
                              int position)
Add another element as a child of this one.


removeChild

public abstract void removeChild(java.lang.Object obj)
Remove any elements corresponding to the given object from this element's list of children.


getObject

public abstract java.lang.Object getObject()
Get the object corresponding to this element.


isGray

public abstract boolean isGray()
Get whether this element should be drawn in gray (i.e. to indicate it is deactivated).



Copyright © 1999-2011 by Peter Eastman.