Changeset 4555 for trunk/gli


Ignore:
Timestamp:
2003-06-11T13:39:48+12:00 (21 years ago)
Author:
jmt12
Message:

2030119: Had removed all TreeSelectionListeners when I only really wanted to prevent synchronization between the trees involved. MetaAuditFrame is also registered as a listener.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/util/TreeSynchronizer.java

    r4364 r4555  
    3535import javax.swing.tree.TreePath;
    3636import org.greenstone.gatherer.gui.tree.DragTree;
    37 /** My latest diabolical class synchronizes the expansion state of two or more JTrees. Muh-hahahaha. Note that these tree should be based on the same model.
     37/** My latest diabolical class synchronizes the expansion state of two or more JTrees. Muh-hahahaha. Note that these tree should be based on the same model. If they aren't it won't work. So there.
    3838 * @author John Thompson, Greenstone Digital Library, University of Waikato
    3939 * @version 2.1
     
    5252    super.add(tree);
    5353    tree.addTreeExpansionListener(this);
    54     //tree.addTreeSelectionListener(this);
     54    tree.addTreeSelectionListener(this);
    5555    }
    5656
     
    8686    if(!ignore) {
    8787        ignore = true;
    88                 // Expand that path in all registered trees.
     88        // Expand that path in all registered trees.
    8989        JTree tree = (JTree)event.getSource();
    9090        TreePath path = event.getPath();
     
    104104    if(!ignore) {
    105105        ignore = true;
    106                 // Recover the tree that is the source.
     106        // Recover the tree that is the source.
    107107        JTree tree = (JTree) event.getSource();
    108                 // Brute Force approach.
    109                 // Extract the currently selected paths.
     108        // Brute Force approach.
     109        // Extract the currently selected paths.
    110110        TreePath paths[] = tree.getSelectionPaths();
    111                 // Then for every registered tree, that isn't this one, ensure those paths are selected.
     111        // Then for every registered tree, that isn't this one, ensure those paths are selected.
     112        /*
    112113        for(int i = size(); paths != null && i != 0; i--) {
    113114        JTree sibling = (JTree) get(i - 1);
     
    128129        }
    129130        }
    130                 // Pass on message to all listeners.
     131        */
     132        // Pass on message to all listeners.
    131133        for(int i = 0; i < selection_listeners.size(); i++) {
    132134        ((TreeSelectionListener) selection_listeners.get(i)).valueChanged(event);
Note: See TracChangeset for help on using the changeset viewer.