All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.bulletproof.gui.Tree

java.lang.Object
   |
   +----com.bulletproof.gui.Component
           |
           +----com.bulletproof.gui.Tree

public class Tree
extends Component
implements ItemSelectable, AdjustmentListener
Class Tree represents an extended tree class that allows for auto loading from a database and also tracks key values for displayed values.


Constructor Index

 o Tree()
Creates a List component.

Method Index

 o addActionListener(ActionListener)
 o addItem(String[], String[])
Add an item to the tree.
 o addItemListener(ItemListener)
 o adjustmentValueChanged(AdjustmentEvent)
 o clear()
Remove all the entries from the List.
 o deselect(int)
Deselect the requested item.
 o deselectAll()
Deselect all of the items.
 o getBranch(TreeBranch, String)
Get the handle to the branch that has this displayed name and is a child of the selected branch.
 o getBranchItem(int)
Get the text value of a specific item.
 o getExpanded(int)
Get whether this item is expanded.
 o getItem(int)
Get the text value of a specific item.
 o getItem(String)
Get the index value of a specific item.
 o getItemCount()
Get the number of items in the List.
 o getItemKey(int)
Get the key value of the selected item.
 o getMultipleSelections()
Allow multiple selections to be made on the list
 o getPreferredSize()
Gets the preferred size of this component.
 o getSelectedBranchNames()
Get the currently selected key value.
 o getSelectedIndex()
Get the selected indexes in the List.
 o getSelectedIndexes()
Get the selected indexes in the List.
 o getSelectedItem()
Get the selected indexes in the List.
 o getSelectedKey()
Get the currently selected key value.
 o getSelectedObjects()
Returns the selected tree branches or null if no items are selected.
 o isSelected(int)
Check is the requested item is selected.
 o paint(Graphics)
Paints the component.
 o processMouseEvent(MouseEvent)
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.
 o remove(int)
Remove an item from the List.
 o remove(String)
Remove an item from the List.
 o removeActionListener(ActionListener)
 o removeItemListener(ItemListener)
 o select(int)
Select the requested item.
 o select(String)
Select the requested item.
 o setExpanded(int, boolean)
Set the expanded flag for the selected item
 o setMasterDrawRegion(Rectangle)
Set the master drawing region for this coomponent.
 o setMultipleSelections(boolean)
Allow multiple selections to be made on the list
 o setRoot(String)
Reset the tree to an empty state and add a root branch with the specified name
 o update(Graphics)
Updates the component.

Constructors

 o Tree
 public Tree()
Creates a List component.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.

Methods

 o addActionListener
 public void addActionListener(ActionListener al)
 o removeActionListener
 public void removeActionListener(ActionListener al)
 o addItemListener
 public void addItemListener(ItemListener al)
 o removeItemListener
 public void removeItemListener(ItemListener al)
 o getSelectedObjects
 public Object[] getSelectedObjects()
Returns the selected tree branches or null if no items are selected.

 o setMultipleSelections
 public void setMultipleSelections(boolean allowMultiple)
Allow multiple selections to be made on the list

Parameters:
allowMultiple - Allow multiple selections to be made on the list
 o getMultipleSelections
 public boolean getMultipleSelections()
Allow multiple selections to be made on the list

Returns:
Allow multiple selections to be made on the list
 o select
 public void select(int item)
Select the requested item.

Parameters:
item - the item to select.
 o select
 public void select(String item)
Select the requested item.

Parameters:
item - the item to select.
 o setExpanded
 public boolean setExpanded(int item,
                            boolean expanded)
Set the expanded flag for the selected item

Parameters:
item - the item to adjust.
expanded - whether the item should be expanded or not.
Returns:
whether the item expanded flag was changed
 o getExpanded
 public boolean getExpanded(int item)
Get whether this item is expanded.

Parameters:
item - the item to check whether it is expanded.
 o deselect
 public void deselect(int item)
Deselect the requested item.

Parameters:
item - the item to deselect.
 o deselectAll
 public void deselectAll()
Deselect all of the items.

 o isSelected
 public boolean isSelected(int item)
Check is the requested item is selected.

Parameters:
item - the item to check.
Returns:
true if selected
 o setRoot
 public void setRoot(String rootName)
Reset the tree to an empty state and add a root branch with the specified name

Parameters:
rootName - the name of the root branch (may be "")
 o addItem
 public void addItem(String branchNames[],
                     String actualValues[])
Add an item to the tree.

Parameters:
item - the TreeBranch handle of the item.
 o getBranch
 public TreeBranch getBranch(TreeBranch parent,
                             String name)
Get the handle to the branch that has this displayed name and is a child of the selected branch. Returns null if the branch does not exist

Parameters:
parent - the TreeBranch handle of the item.
name - the displayed name of the branch we are looking for.
 o getItemCount
 public int getItemCount()
Get the number of items in the List.

Returns:
the number of items.
 o getItem
 public String getItem(int item)
Get the text value of a specific item.

Parameters:
itemNumber - the item number.
Returns:
the item.
 o getBranchItem
 public TreeBranch getBranchItem(int item)
Get the text value of a specific item.

Parameters:
itemNumber - the item number.
Returns:
the item.
 o getItem
 public int getItem(String item)
Get the index value of a specific item.

Parameters:
item - the item.
Returns:
the index of the item.
 o clear
 public void clear()
Remove all the entries from the List.

 o remove
 public void remove(int item)
Remove an item from the List.

Parameters:
itemNumber - the item.
 o remove
 public void remove(String item)
Remove an item from the List.

Parameters:
itemValue - the item.
 o getItemKey
 public String[] getItemKey(int item)
Get the key value of the selected item.

Parameters:
the - item number.
Returns:
the item key value.
 o getSelectedItem
 public String getSelectedItem()
Get the selected indexes in the List. Presently multiple selections are not supported so this function only returns one item.

Returns:
the list indexes that are selected.
 o getSelectedIndex
 public int getSelectedIndex()
Get the selected indexes in the List. Presently multiple selections are not supported so this function only returns one item.

Returns:
the list indexes that are selected.
 o getSelectedIndexes
 public int[] getSelectedIndexes()
Get the selected indexes in the List. Presently multiple selections are not supported so this function only returns one item.

Returns:
the list indexes that are selected.
 o getSelectedKey
 public String[] getSelectedKey()
Get the currently selected key value.

Returns:
the item key value.
 o getSelectedBranchNames
 public String[] getSelectedBranchNames()
Get the currently selected key value.

Returns:
the item key value.
 o setMasterDrawRegion
 public void setMasterDrawRegion(Rectangle region)
Set the master drawing region for this coomponent.

Parameters:
region - the specified master drawing region
Overrides:
setMasterDrawRegion in class Component
 o update
 public void update(Graphics g)
Updates the component.

Overrides:
update in class Component
 o paint
 public synchronized void paint(Graphics g)
Paints the component.

Overrides:
paint in class Component
 o processMouseEvent
 public synchronized void processMouseEvent(MouseEvent me)
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.

Overrides:
processMouseEvent in class Component
 o adjustmentValueChanged
 public void adjustmentValueChanged(AdjustmentEvent e)
 o getPreferredSize
 public Dimension getPreferredSize()
Gets the preferred size of this component.

Overrides:
getPreferredSize in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index