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.
-
Tree()
- Creates a List component.
-
addActionListener(ActionListener)
-
-
addItem(String[], String[])
- Add an item to the tree.
-
addItemListener(ItemListener)
-
-
adjustmentValueChanged(AdjustmentEvent)
-
-
clear()
- Remove all the entries from the List.
-
deselect(int)
- Deselect the requested item.
-
deselectAll()
- Deselect all of the items.
-
getBranch(TreeBranch, String)
- Get the handle to the branch that has this displayed name and is a
child of the selected branch.
-
getBranchItem(int)
- Get the text value of a specific item.
-
getExpanded(int)
- Get whether this item is expanded.
-
getItem(int)
- Get the text value of a specific item.
-
getItem(String)
- Get the index value of a specific item.
-
getItemCount()
- Get the number of items in the List.
-
getItemKey(int)
- Get the key value of the selected item.
-
getMultipleSelections()
- Allow multiple selections to be made on the list
-
getPreferredSize()
- Gets the preferred size of this component.
-
getSelectedBranchNames()
- Get the currently selected key value.
-
getSelectedIndex()
- Get the selected indexes in the List.
-
getSelectedIndexes()
- Get the selected indexes in the List.
-
getSelectedItem()
- Get the selected indexes in the List.
-
getSelectedKey()
- Get the currently selected key value.
-
getSelectedObjects()
- Returns the selected tree branches or null if no items are selected.
-
isSelected(int)
- Check is the requested item is selected.
-
paint(Graphics)
-
Paints the component.
-
processMouseEvent(MouseEvent)
-
Processes mouse events occurring on this component by
dispatching them to any registered MouseListener objects.
-
remove(int)
- Remove an item from the List.
-
remove(String)
- Remove an item from the List.
-
removeActionListener(ActionListener)
-
-
removeItemListener(ItemListener)
-
-
select(int)
- Select the requested item.
-
select(String)
- Select the requested item.
-
setExpanded(int, boolean)
- Set the expanded flag for the selected item
-
setMasterDrawRegion(Rectangle)
-
Set the master drawing region for this coomponent.
-
setMultipleSelections(boolean)
- Allow multiple selections to be made on the list
-
setRoot(String)
- Reset the tree to an empty state and add a root branch with the specified name
-
update(Graphics)
-
Updates the component.
Tree
public Tree()
- Creates a List component.
- Parameters:
- JDPUser - the global user parameter used to pass handles in JDP.
addActionListener
public void addActionListener(ActionListener al)
removeActionListener
public void removeActionListener(ActionListener al)
addItemListener
public void addItemListener(ItemListener al)
removeItemListener
public void removeItemListener(ItemListener al)
getSelectedObjects
public Object[] getSelectedObjects()
- Returns the selected tree branches or null if no items are selected.
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
getMultipleSelections
public boolean getMultipleSelections()
- Allow multiple selections to be made on the list
- Returns:
- Allow multiple selections to be made on the list
select
public void select(int item)
- Select the requested item.
- Parameters:
- item - the item to select.
select
public void select(String item)
- Select the requested item.
- Parameters:
- item - the item to select.
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
getExpanded
public boolean getExpanded(int item)
- Get whether this item is expanded.
- Parameters:
- item - the item to check whether it is expanded.
deselect
public void deselect(int item)
- Deselect the requested item.
- Parameters:
- item - the item to deselect.
deselectAll
public void deselectAll()
- Deselect all of the items.
isSelected
public boolean isSelected(int item)
- Check is the requested item is selected.
- Parameters:
- item - the item to check.
- Returns:
- true if selected
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 "")
addItem
public void addItem(String branchNames[],
String actualValues[])
- Add an item to the tree.
- Parameters:
- item - the TreeBranch handle of the item.
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.
getItemCount
public int getItemCount()
- Get the number of items in the List.
- Returns:
- the number of items.
getItem
public String getItem(int item)
- Get the text value of a specific item.
- Parameters:
- itemNumber - the item number.
- Returns:
- the item.
getBranchItem
public TreeBranch getBranchItem(int item)
- Get the text value of a specific item.
- Parameters:
- itemNumber - the item number.
- Returns:
- the item.
getItem
public int getItem(String item)
- Get the index value of a specific item.
- Parameters:
- item - the item.
- Returns:
- the index of the item.
clear
public void clear()
- Remove all the entries from the List.
remove
public void remove(int item)
- Remove an item from the List.
- Parameters:
- itemNumber - the item.
remove
public void remove(String item)
- Remove an item from the List.
- Parameters:
- itemValue - the item.
getItemKey
public String[] getItemKey(int item)
- Get the key value of the selected item.
- Parameters:
- the - item number.
- Returns:
- the item key value.
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.
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.
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.
getSelectedKey
public String[] getSelectedKey()
- Get the currently selected key value.
- Returns:
- the item key value.
getSelectedBranchNames
public String[] getSelectedBranchNames()
- Get the currently selected key value.
- Returns:
- the item key value.
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
update
public void update(Graphics g)
- Updates the component.
- Overrides:
- update in class Component
paint
public synchronized void paint(Graphics g)
- Paints the component.
- Overrides:
- paint in class Component
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
adjustmentValueChanged
public void adjustmentValueChanged(AdjustmentEvent e)
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