| |
|
| javax.swing.JTree org.underworldlabs.swing.tree.DynamicTree
DynamicTree | public class DynamicTree extends JTree (Code) | | Dynamic JTree allowing moving of nodes up/down
and provides convenience methods for removal/insertion of nodes.
author: Takis Diakoumis version: $Revision: 1.6 $ |
MOVE_DOWN | final public static int MOVE_DOWN(Code) | | directional constant for movements down the tree
|
MOVE_UP | final public static int MOVE_UP(Code) | | directional constant for movements up the tree
|
addToRoot | public void addToRoot(TreeNode node)(Code) | | Adds the specified node to the root node of this tree.
Parameters: node - - the tree node to add |
expandSelectedRow | public void expandSelectedRow()(Code) | | Expands the currently selected row.
|
getLastPathComponent | public Object getLastPathComponent()(Code) | | Returns the path component of the selected path.
the component |
getNodeFromRoot | public DefaultMutableTreeNode getNodeFromRoot(Object userObject)(Code) | | Returns the tree node from the root node with the
specified user object. This will traverse the tree from
the root node to the root's children only, not its children's
children.
Parameters: the - user object to search for the tree node or null if not found |
getRowHeight | public int getRowHeight()(Code) | | Returns the height of each row. The default swing implementation
allows the renderer to determine the row height. In most cases this
is ok, though i found that on some LAFs the renderer's value is too
small making the rows too cramped (ie. gtk). as a result, this method
return a value of 20 if the rowHeight <= 0.
This isn't ideal and a bit of a hack, but it works ok.
|
getTreeModel | public DefaultTreeModel getTreeModel()(Code) | | Returns the tree model.
the tree model - an instance of DefaultTreeModel |
moveSelectionDown | public void moveSelectionDown()(Code) | | Moves the selected node down in the tree.
|
moveSelectionUp | public void moveSelectionUp()(Code) | | Moves the selected node up in the tree.
|
nodeChanged | public void nodeChanged(TreeNode node)(Code) | | Invoke this method after you've changed how node is to be
represented in the tree.
|
nodeStructureChanged | public void nodeStructureChanged(TreeNode node)(Code) | | Invoke this method if you've totally changed the children
of node and its childrens children...
This will post a treeStructureChanged event.
|
reload | public void reload(TreeNode node)(Code) | | Invoke this method if you've modified the TreeNodes
upon which this model depends.
|
removeNode | public void removeNode(TreeNode node, String nextSelectionPrefix)(Code) | | Removes the specified node and sets the
next selected node beginning with the specified
prefix.
Parameters: the - node to be removed Parameters: the - prefix of the node to select after removal |
removeNode | public void removeNode(MutableTreeNode node)(Code) | | Removes the specified node from the parent node.
Parameters: node - - the node to be removed |
removeSelection | public void removeSelection(String nextSelectionPrefix)(Code) | | Removes the currently selected node and sets the
next selected node beginning with the specified
prefix.
Parameters: the - prefix of the node to select after removal |
selectNextNode | public void selectNextNode(String prefix)(Code) | | Selects the node that matches the specified prefix forward
from the currently selected node.
Parameters: prefix - - the prefix of the node to select |
valueForPathChanged | public void valueForPathChanged(TreePath path, Object newValue)(Code) | | This sets the user object of the TreeNode identified by
path and posts a node changed. If you use custom user
objects in the TreeModel you're going to need to subclass
this and set the user object of the changed node
to something meaningful.
Parameters: path - to the node that the user has altered Parameters: the - new value from the TreeCellEditor |
Methods inherited from javax.swing.JTree | public void addSelectionInterval(int index0, int index1)(Code)(Java Doc) public void addSelectionPath(TreePath path)(Code)(Java Doc) public void addSelectionPaths(TreePath[] paths)(Code)(Java Doc) public void addSelectionRow(int row)(Code)(Java Doc) public void addSelectionRows(int[] rows)(Code)(Java Doc) public void addTreeExpansionListener(TreeExpansionListener tel)(Code)(Java Doc) public void addTreeSelectionListener(TreeSelectionListener tsl)(Code)(Java Doc) public void addTreeWillExpandListener(TreeWillExpandListener tel)(Code)(Java Doc) public void cancelEditing()(Code)(Java Doc) public void clearSelection()(Code)(Java Doc) protected void clearToggledPaths()(Code)(Java Doc) public void collapsePath(TreePath path)(Code)(Java Doc) public void collapseRow(int row)(Code)(Java Doc) public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)(Code)(Java Doc) protected static TreeModel createTreeModel(Object value)(Code)(Java Doc) protected TreeModelListener createTreeModelListener()(Code)(Java Doc) public void expandPath(TreePath path)(Code)(Java Doc) public void expandRow(int row)(Code)(Java Doc) public void fireTreeCollapsed(TreePath path)(Code)(Java Doc) public void fireTreeExpanded(TreePath path)(Code)(Java Doc) public void fireTreeWillCollapse(TreePath path) throws ExpandVetoException(Code)(Java Doc) public void fireTreeWillExpand(TreePath path) throws ExpandVetoException(Code)(Java Doc) protected void fireValueChanged(TreeSelectionEvent e)(Code)(Java Doc) public AccessibleContext getAccessibleContext()(Code)(Java Doc) public TreePath getAnchorSelectionPath()(Code)(Java Doc) public TreeCellEditor getCellEditor()(Code)(Java Doc) public TreeCellRenderer getCellRenderer()(Code)(Java Doc) public TreePath getClosestPathForLocation(int x, int y)(Code)(Java Doc) public int getClosestRowForLocation(int x, int y)(Code)(Java Doc) protected static TreeModel getDefaultTreeModel()(Code)(Java Doc) protected Enumeration<TreePath> getDescendantToggledPaths(TreePath parent)(Code)(Java Doc) public boolean getDragEnabled()(Code)(Java Doc) final public DropLocation getDropLocation()(Code)(Java Doc) final public DropMode getDropMode()(Code)(Java Doc) public TreePath getEditingPath()(Code)(Java Doc) public Enumeration<TreePath> getExpandedDescendants(TreePath parent)(Code)(Java Doc) public boolean getExpandsSelectedPaths()(Code)(Java Doc) public boolean getInvokesStopCellEditing()(Code)(Java Doc) public Object getLastSelectedPathComponent()(Code)(Java Doc) public TreePath getLeadSelectionPath()(Code)(Java Doc) public int getLeadSelectionRow()(Code)(Java Doc) public int getMaxSelectionRow()(Code)(Java Doc) public int getMinSelectionRow()(Code)(Java Doc) public TreeModel getModel()(Code)(Java Doc) public TreePath getNextMatch(String prefix, int startingRow, Position.Bias bias)(Code)(Java Doc) protected TreePath[] getPathBetweenRows(int index0, int index1)(Code)(Java Doc) public Rectangle getPathBounds(TreePath path)(Code)(Java Doc) public TreePath getPathForLocation(int x, int y)(Code)(Java Doc) public TreePath getPathForRow(int row)(Code)(Java Doc) public Dimension getPreferredScrollableViewportSize()(Code)(Java Doc) public Rectangle getRowBounds(int row)(Code)(Java Doc) public int getRowCount()(Code)(Java Doc) public int getRowForLocation(int x, int y)(Code)(Java Doc) public int getRowForPath(TreePath path)(Code)(Java Doc) public int getRowHeight()(Code)(Java Doc) public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)(Code)(Java Doc) public boolean getScrollableTracksViewportHeight()(Code)(Java Doc) public boolean getScrollableTracksViewportWidth()(Code)(Java Doc) public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)(Code)(Java Doc) public boolean getScrollsOnExpand()(Code)(Java Doc) public int getSelectionCount()(Code)(Java Doc) public TreeSelectionModel getSelectionModel()(Code)(Java Doc) public TreePath getSelectionPath()(Code)(Java Doc) public TreePath[] getSelectionPaths()(Code)(Java Doc) public int[] getSelectionRows()(Code)(Java Doc) public boolean getShowsRootHandles()(Code)(Java Doc) public int getToggleClickCount()(Code)(Java Doc) public String getToolTipText(MouseEvent event)(Code)(Java Doc) public TreeExpansionListener[] getTreeExpansionListeners()(Code)(Java Doc) public TreeSelectionListener[] getTreeSelectionListeners()(Code)(Java Doc) public TreeWillExpandListener[] getTreeWillExpandListeners()(Code)(Java Doc) public TreeUI getUI()(Code)(Java Doc) public String getUIClassID()(Code)(Java Doc) public int getVisibleRowCount()(Code)(Java Doc) public boolean hasBeenExpanded(TreePath path)(Code)(Java Doc) public boolean isCollapsed(TreePath path)(Code)(Java Doc) public boolean isCollapsed(int row)(Code)(Java Doc) public boolean isEditable()(Code)(Java Doc) public boolean isEditing()(Code)(Java Doc) public boolean isExpanded(TreePath path)(Code)(Java Doc) public boolean isExpanded(int row)(Code)(Java Doc) public boolean isFixedRowHeight()(Code)(Java Doc) public boolean isLargeModel()(Code)(Java Doc) public boolean isPathEditable(TreePath path)(Code)(Java Doc) public boolean isPathSelected(TreePath path)(Code)(Java Doc) public boolean isRootVisible()(Code)(Java Doc) public boolean isRowSelected(int row)(Code)(Java Doc) public boolean isSelectionEmpty()(Code)(Java Doc) public boolean isVisible(TreePath path)(Code)(Java Doc) public void makeVisible(TreePath path)(Code)(Java Doc) protected String paramString()(Code)(Java Doc) protected boolean removeDescendantSelectedPaths(TreePath path, boolean includePath)(Code)(Java Doc) protected void removeDescendantToggledPaths(Enumeration<TreePath> toRemove)(Code)(Java Doc) public void removeSelectionInterval(int index0, int index1)(Code)(Java Doc) public void removeSelectionPath(TreePath path)(Code)(Java Doc) public void removeSelectionPaths(TreePath[] paths)(Code)(Java Doc) public void removeSelectionRow(int row)(Code)(Java Doc) public void removeSelectionRows(int[] rows)(Code)(Java Doc) public void removeTreeExpansionListener(TreeExpansionListener tel)(Code)(Java Doc) public void removeTreeSelectionListener(TreeSelectionListener tsl)(Code)(Java Doc) public void removeTreeWillExpandListener(TreeWillExpandListener tel)(Code)(Java Doc) public void scrollPathToVisible(TreePath path)(Code)(Java Doc) public void scrollRowToVisible(int row)(Code)(Java Doc) public void setAnchorSelectionPath(TreePath newPath)(Code)(Java Doc) public void setCellEditor(TreeCellEditor cellEditor)(Code)(Java Doc) public void setCellRenderer(TreeCellRenderer x)(Code)(Java Doc) public void setDragEnabled(boolean b)(Code)(Java Doc) final public void setDropMode(DropMode dropMode)(Code)(Java Doc) public void setEditable(boolean flag)(Code)(Java Doc) protected void setExpandedState(TreePath path, boolean state)(Code)(Java Doc) public void setExpandsSelectedPaths(boolean newValue)(Code)(Java Doc) public void setInvokesStopCellEditing(boolean newValue)(Code)(Java Doc) public void setLargeModel(boolean newValue)(Code)(Java Doc) public void setLeadSelectionPath(TreePath newPath)(Code)(Java Doc) public void setModel(TreeModel newModel)(Code)(Java Doc) public void setRootVisible(boolean rootVisible)(Code)(Java Doc) public void setRowHeight(int rowHeight)(Code)(Java Doc) public void setScrollsOnExpand(boolean newValue)(Code)(Java Doc) public void setSelectionInterval(int index0, int index1)(Code)(Java Doc) public void setSelectionModel(TreeSelectionModel selectionModel)(Code)(Java Doc) public void setSelectionPath(TreePath path)(Code)(Java Doc) public void setSelectionPaths(TreePath[] paths)(Code)(Java Doc) public void setSelectionRow(int row)(Code)(Java Doc) public void setSelectionRows(int[] rows)(Code)(Java Doc) public void setShowsRootHandles(boolean newValue)(Code)(Java Doc) public void setToggleClickCount(int clickCount)(Code)(Java Doc) public void setUI(TreeUI ui)(Code)(Java Doc) public void setVisibleRowCount(int newCount)(Code)(Java Doc) public void startEditingAtPath(TreePath path)(Code)(Java Doc) public boolean stopEditing()(Code)(Java Doc) public void treeDidChange()(Code)(Java Doc) public void updateUI()(Code)(Java Doc)
|
|
|
|