Changeset 8577


Ignore:
Timestamp:
2004-11-17T10:03:30+13:00 (19 years ago)
Author:
mdewsnip
Message:

Removed an unused function.

File:
1 edited

Legend:

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

    r8236 r8577  
    2828
    2929import java.lang.Runnable;
    30 import java.lang.Thread;
    3130import javax.swing.SwingUtilities;
    3231import javax.swing.tree.*;
     
    9594    return doInsertNodeInto;
    9695    }
     96
     97
    9798    /** Adds a removeNodeFromParent model update onto the AWT Event queue. This gets around the lack of synchronization illustrated above.
    9899     * @param model The <strong>GTreeModel</strong> we want to remove the node from.
     
    112113    catch (Exception exception) {
    113114        DebugStream.printStackTrace(exception);
    114         ///ystem.err.println(e);
    115115    }
    116116    // If we've thrown an error because we tried to invoke the runnable task and wait, when we are in the AWTEvent thread already, then try agin but with an invoke later.
     
    121121    }
    122122    }
    123     /** Adds a replaceNode model update onto the AWT Event queue. This gets around the lack of synchronization illustrated above.
    124      * @param model The <strong>GTreeModel</strong> we want to change.
    125      * @param old_node The <strong>GTreeNode</strong> to replace.
    126      * @param new_node The <strong>GTreeNode</strong> to replace it with.
    127      */
    128     static final public void replaceNode(final DefaultTreeModel model, final MutableTreeNode old_node, final MutableTreeNode new_node) {
    129     final Runnable doReplaceNode = new Runnable() {
    130         public void run() {
    131             MutableTreeNode parent = (MutableTreeNode) old_node.getParent();
    132             if(parent != null) {
    133             int index = parent.getIndex(old_node);
    134             model.removeNodeFromParent(old_node);
    135             model.insertNodeInto(new_node, parent, index);
    136             }
    137             parent = null;
    138         }
    139         };
    140     try {
    141         //SwingUtilities.invokeLater(doReplaceNode);
    142         SwingUtilities.invokeAndWait(doReplaceNode);
    143     }
    144     catch (Exception exception) {
    145         DebugStream.printStackTrace(exception);
    146     }
    147     }
    148123}
Note: See TracChangeset for help on using the changeset viewer.