[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] Patch: expand/collapse for JTree
From: |
Lillian Angel |
Subject: |
[cp-patches] Patch: expand/collapse for JTree |
Date: |
Wed, 06 Jul 2005 13:53:35 -0400 |
Here is the patch for expanding and collapsing the JTree. It appears to
be fully functional. The only remaining issues with expand/collapse are:
the extra long lines drawn vertically for subfolders and the
expand/collapse icons do not appear. The reason for the icons is that,
they are not loaded in the BasicLookAndFeel class.
For selection, I still need to implement the CONTIGUOUS_TREE_SELECTION
option.
There are some other functions/features that I still need to implement.
2005-07-06 Lillian Angel <address@hidden>
* javax/swing/JTree.java
Initialized the HashTable.
(addSelectionPath): removed redundant code.
(doExpandParents): added in line so that state is
changed for current path. Changed while loop to if
statement, an infinite loop was occurring.
* javax/swing/plaf/basic/BasicTreeUI.java
(getPathForRow): Implemented to work with visibility.
(isLeaf): Implemented
(mouseClicked): add in check for expand/collapse.
Selection for DISCONTIGUOUS tree selection is
implemented.
(treeExpanded): called repaint, so the tree updates
visually when something is expanded.
(treeCollapse): Similar to treeExpanded.
(paintLeaf): changed to paint leaf only when visible.
(paintNonLeaf): paints only when visible.
(paintRecursive): lines for tree are only painted when
needed. checked for visibility of current object and
parent.
* javax/swing/tree/DefaultTreeCellRenderer.java
(getTreeCellRendererComponent): setting icons when
expanded.
* javax/swing/tree/DefaultTreeSelectionModel.java
(clearSelection): set leadPath to null because selection
should be completely reset.
current.diff
Description: Text Data
- [cp-patches] Patch: expand/collapse for JTree,
Lillian Angel <=