Ignore:
Timestamp:
2004-10-08T09:46:12+13:00 (20 years ago)
Author:
mdewsnip
Message:

Replaced all Gatherer.print* with DebugStream.print*.

File:
1 edited

Legend:

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

    r6622 r8236  
    3131import javax.swing.SwingUtilities;
    3232import javax.swing.tree.*;
    33 import org.greenstone.gatherer.Gatherer;
     33import org.greenstone.gatherer.DebugStream;
     34
    3435/** Due to the TreeModel objects not having any synchronization, certain assumptions, such as the model state remaining constant during a repaint, don't always hold - especially given that I'm changing the tree model on a different thread. In order to get around this I will use the latest swing paradigm wherein you flag a section of code to be executed by the AWT GUI Event queue, as soon as other gui tasks have finished. This way I shouldn't have tree redraws throwing NPEs because the array size of the children of a certain node has changed -while- the repaint call was made, i.e. repaint() calls getChildCount() = 13, removeNodeFromParent() called, repaint calls getChildAt(12) = ArrayIndexOutOfBoundsException.
    3536 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    4647        public void run() {
    4748            ///ystem.err.print("Running task... ");
    48             Gatherer.println("insertNodeInto(" + model + ", " + parent + ", " + target_node + ", " + wait_allowed);
     49            DebugStream.println("insertNodeInto(" + model + ", " + parent + ", " + target_node + ", " + wait_allowed);
    4950            int index = -1;
    5051            int pos = 0;
     
    8990    }
    9091    catch (Exception exception) {
    91         Gatherer.printStackTrace(exception);
     92        DebugStream.printStackTrace(exception);
    9293    }
    9394    ///ystem.err.print("Added Task... ");
     
    110111    }
    111112    catch (Exception exception) {
    112         Gatherer.printStackTrace(exception);
     113        DebugStream.printStackTrace(exception);
    113114        ///ystem.err.println(e);
    114115    }
     
    142143    }
    143144    catch (Exception exception) {
    144         Gatherer.printStackTrace(exception);
     145        DebugStream.printStackTrace(exception);
    145146    }
    146147    }
Note: See TracChangeset for help on using the changeset viewer.