artofillusion.ui
Class TreeList

java.lang.Object
  extended by CustomWidget
      extended by artofillusion.ui.TreeList

public class TreeList
extends CustomWidget

This is a Widget which displays a hierarchy of objects. It provides functionality for opening and closing parts of the hierarchy, selecting elements, and moving elements around.


Nested Class Summary
 class TreeList.ElementDoubleClickedEvent
          Inner class representing an event when an element is double-clicked.
 class TreeList.ElementExpandedEvent
          Inner class representing an event when an element is expanded or collapsed.
 class TreeList.ElementMovedEvent
          Inner class representing an event when one or more elements are moved in the tree.
 class TreeList.TreeElementEvent
          Inner class which is the superclass of various events generated by tree.
 
Constructor Summary
TreeList(EditingWindow win)
           
 
Method Summary
 void addElement(TreeElement el)
          Add an element to the tree.
 void addElement(TreeElement el, int position)
          Add an element to the tree.
 void deselectAll()
          Deselect all elements in the tree.
 void expandToShowObject(java.lang.Object obj)
          Expand all parents of the specified object to make it visible.
 TreeElement findElement(java.lang.Object obj)
          Find the TreeElement corresponding to an object, or null if there is none.
 TreeElement[] getElements()
          Get an array of all the TreeElements in the tree.
 java.awt.Dimension getMinimumSize()
           
 java.awt.Dimension getPreferredSize()
           
 int getRowHeight()
          Get the height (in pixels) of each row in the list.
 java.lang.Object[] getSelectedObjects()
          Get an array of the objects corresponding to selected TreeElements.
 java.lang.Object[] getVisibleObjects()
          Get an array of the objects corresponding to visible TreeElements, in the order that they appear.
 void removeAllElements()
          Remove all elements from the tree.
 void removeObject(java.lang.Object obj)
          Remove the element from the tree which corresponds to the specified object.
 void setAllowMultiple(boolean allow)
          Set whether this tree allows multiple selections (default is true).
 void setPopupMenuManager(PopupMenuManager manager)
          Set the PopupMenuManager for this list.
 void setSelected(java.lang.Object obj, boolean selected)
          Select or deselect the element corresponding to a particular object.
 void setUpdateEnabled(boolean enabled)
          Temporarily disable updating of the tree.
 void setYOffset(int offset)
          Set the y offset (for vertically scrolling the panel).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeList

public TreeList(EditingWindow win)
Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()

getMinimumSize

public java.awt.Dimension getMinimumSize()

setAllowMultiple

public void setAllowMultiple(boolean allow)
Set whether this tree allows multiple selections (default is true).


setUpdateEnabled

public void setUpdateEnabled(boolean enabled)
Temporarily disable updating of the tree. This is useful when several elements are going to be added or removed at once.


addElement

public void addElement(TreeElement el)
Add an element to the tree.


addElement

public void addElement(TreeElement el,
                       int position)
Add an element to the tree.


findElement

public TreeElement findElement(java.lang.Object obj)
Find the TreeElement corresponding to an object, or null if there is none.


removeObject

public void removeObject(java.lang.Object obj)
Remove the element from the tree which corresponds to the specified object.


removeAllElements

public void removeAllElements()
Remove all elements from the tree.


getElements

public TreeElement[] getElements()
Get an array of all the TreeElements in the tree.


getSelectedObjects

public java.lang.Object[] getSelectedObjects()
Get an array of the objects corresponding to selected TreeElements.


deselectAll

public void deselectAll()
Deselect all elements in the tree.


getVisibleObjects

public java.lang.Object[] getVisibleObjects()
Get an array of the objects corresponding to visible TreeElements, in the order that they appear.


getRowHeight

public int getRowHeight()
Get the height (in pixels) of each row in the list.


setSelected

public void setSelected(java.lang.Object obj,
                        boolean selected)
Select or deselect the element corresponding to a particular object.


expandToShowObject

public void expandToShowObject(java.lang.Object obj)
Expand all parents of the specified object to make it visible.


setYOffset

public void setYOffset(int offset)
Set the y offset (for vertically scrolling the panel).


setPopupMenuManager

public void setPopupMenuManager(PopupMenuManager manager)
Set the PopupMenuManager for this list.



Copyright © 1999-2011 by Peter Eastman.