Changeset 4686


Ignore:
Timestamp:
2003-06-16T12:05:19+12:00 (21 years ago)
Author:
jmt12
Message:

Replaced System.err.println with Gatherer.println

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r4682 r4686  
    185185    // We set the closing thread, as it should be the only one who can actually see the collection is closed, at least until the closing thread expires.
    186186    closing_thread = Thread.currentThread();
    187     // System.err.println("Closing collection...");
     187    ///ystem.err.println("Closing collection...");
    188188    // Remove the lock on this file, then remove the collection.
    189189    File lock_file = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path) + collection.getName() + File.separator + LOCK_FILE);
     
    196196    Gatherer.config.setCollectionConfiguration(null);
    197197    Gatherer.g_man.collectionChanged(false);
    198     // System.err.println("Closed collection.");
     198    ///ystem.err.println("Closed collection.");
    199199    // All of the consequences of a close should have been processed by now, so others should now see the collection as non-ready.
    200200    closing_thread = null;
     
    796796            // Open the collection file
    797797            collection = new Collection(collection_file);
    798             // System.err.println("In CollectionManager::loadCollection(), collection: " + collection);
     798            ///ystem.err.println("In CollectionManager::loadCollection(), collection: " + collection);
    799799            collection.msm = new MetadataSetManager();
    800800            msm = collection.msm; // Legacy
     
    812812            }
    813813            result = true;
    814             // System.err.println("Done loadCollection().");
     814            ///ystem.err.println("Done loadCollection().");
    815815            } catch (Exception error) {
    816816            // There is obviously no existing collection present.
  • trunk/gli/src/org/greenstone/gatherer/file/FileNode.java

    r4675 r4686  
    250250            String collection_name = Gatherer.c_man.getCollection().getName();
    251251            for(int j = 0; j < files.length; j++) {
    252             System.err.println("Does " + files[j].getName() + " equal " + collection_name + "?");
     252            ///ystem.err.println("Does " + files[j].getName() + " equal " + collection_name + "?");
    253253            if(files[j].getName().equals(collection_name) || files[j].getName().equals("modelcol")) {
    254254                // Remove the offending directory
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r4683 r4686  
    676676
    677677    public void run() {
    678         // System.err.println("Running CreationTask...");
     678        ///ystem.err.println("Running CreationTask...");
    679679        if(ncm_prompt == null) {
    680680        Gatherer.c_man.createCollection(ncd_prompt.getDescription(), ncd_prompt.getEmail(), ncd_prompt.getName(), ncd_prompt.getTitle(), ncd_prompt.getBase(), null);
  • trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPane.java

    r4675 r4686  
    873873     */
    874874    public void valueChanged(TreeSelectionEvent event) {
    875     // System.err.println("\n(MEP) valueChanged(TreeSelectionEvent)...");
     875    ///ystem.err.println("\n(MEP) valueChanged(TreeSelectionEvent)...");
    876876
    877877    // Don't bother if this isn't the selected view
  • trunk/gli/src/org/greenstone/gatherer/gui/OpenCollectionDialog.java

    r4675 r4686  
    6262    public OpenCollectionDialog(File file) {
    6363    super(file);
    64     System.err.println("Size = " + getSize());
     64    ///ystem.err.println("Size = " + getSize());
    6565    // Other initialization
    6666    setAcceptAllFileFilterUsed(false);
  • trunk/gli/src/org/greenstone/gatherer/gui/OptionsPane.java

    r4675 r4686  
    628628        }
    629629        } catch (FileNotFoundException fnfe) {
    630         System.err.println("Error: log file not found: "+ this.file.toString());
     630        Gatherer.println("Error: log file not found: "+ this.file.toString());
    631631        return "";
    632632        } catch (IOException ioe) {
    633         System.err.println("Error: exception occurred when trying to read in file "+this.file.toString()+", "+ioe.getMessage());
     633        Gatherer.println("Error: exception occurred when trying to read in file "+this.file.toString()+", "+ioe.getMessage());
    634634
    635635        }
  • trunk/gli/src/org/greenstone/gatherer/gui/table/GTableModel.java

    r4668 r4686  
    289289    if(0 <= row && row < current_metadata.size()) {
    290290        Metadata entry = (Metadata) current_metadata.get(row);
    291         // System.err.println("Of the " + file_nodes.length + " selected files, " + entry + " is attached to " + entry.getCount() + " of them.");
     291        ///ystem.err.println("Of the " + file_nodes.length + " selected files, " + entry + " is attached to " + entry.getCount() + " of them.");
    292292        if (entry.getCount() == file_nodes.length) {
    293293        return true;
     
    314314        }
    315315
    316         // System.err.println("\nBuilding metadata model...");
     316        ///ystem.err.println("\nBuilding metadata model...");
    317317        Vector elements = Gatherer.c_man.getCollection().msm.getElements();
    318318        ArrayList known_elements = new ArrayList();
     
    321321        for (int i = 0; i < file_nodes.length && !killed; i++) {
    322322        File current_file = file_nodes[i].getFile();
    323         // System.err.println("File " + i + " (of " + file_nodes.length + "): " + current_file);
     323        ///ystem.err.println("File " + i + " (of " + file_nodes.length + "): " + current_file);
    324324
    325325        // Get the currently assigned metadata for this file
     
    328328            Metadata metadatum = (Metadata) metadata.get(j);
    329329            ElementWrapper element = metadatum.getElement();
    330             // System.err.println("  Metadatum: " + metadatum + " (" + metadatum.getCount() + ")");
     330            ///ystem.err.println("  Metadatum: " + metadatum + " (" + metadatum.getCount() + ")");
    331331
    332332            // Ignore hidden metadata
     
    361361        for (int i = 0; i < elements.size() && !killed; i++) {
    362362        ElementWrapper element = (ElementWrapper) elements.get(i);
    363         // System.err.println("Element: " + element);
     363        ///ystem.err.println("Element: " + element);
    364364
    365365        // If we haven't seen this metadata element, add it now
  • trunk/gli/src/org/greenstone/gatherer/help/ContentModel.java

    r4365 r4686  
    3030import java.util.HashMap;
    3131import javax.swing.tree.DefaultTreeModel;
     32import org.greenstone.gatherer.Gatherer;
    3233import org.greenstone.gatherer.cdm.CommandTokenizer;
    3334import org.greenstone.gatherer.help.HelpItem;
     
    106107    }
    107108    catch (Exception error) {
    108         System.err.println("Cannot build help contents. Possible error in index.txt");
    109         error.printStackTrace();
     109        Gatherer.println("Cannot build help contents. Possible error in index.txt");
     110        Gatherer.printStackTrace(error);
    110111    }
    111112    }
  • trunk/gli/src/org/greenstone/gatherer/shell/GImportProgressMonitor.java

    r4364 r4686  
    162162    num_dirs = Gatherer.c_man.getCollection().getFolderCount();
    163163    progress_bar.setValue(MIN);
    164     System.err.println("Number of directories is " + num_dirs);
     164    Gatherer.println("Number of directories is " + num_dirs);
    165165    }
    166166    /** This method indicates the process is complete.
  • trunk/gli/src/org/greenstone/gatherer/undo/UndoManager.java

    r4675 r4686  
    436436        break;
    437437        default:
    438         System.err.println("Unknown code.");
     438        ///ystem.err.println("Unknown code.");
    439439        }
    440440    }
  • trunk/gli/src/org/greenstone/gatherer/util/DragGroup.java

    r4674 r4686  
    148148    public void setSource(DragTree drag_source) {
    149149    this.drag_source = drag_source;
    150     System.err.println("The drag source is now " + drag_source);
     150    ///ystem.err.println("The drag source is now " + drag_source);
    151151    }
    152152}
  • trunk/gli/src/org/greenstone/gatherer/util/Generator.java

    r4674 r4686  
    9797
    9898    public void out(String msg) {
    99     System.err.println(msg);
     99    ///ystem.err.println(msg);
    100100    try {
    101101        if(file_output_stream == null) {
     
    106106    catch(Exception error) {
    107107        error.printStackTrace();
    108         System.err.println("An error has occured. View output.txt for more information.");
     108        System.out.println("An error has occured. View output.txt for more information.");
    109109        exit();
    110110    }
     
    112112
    113113    static public void main(String args[]) {
    114     System.err.println("Rapid repeated HTML generation tool.");
    115     System.err.println("  written by John Thompson, 2002\n");
     114    System.out.println("Rapid repeated HTML generation tool.");
     115    System.out.println("  written by John Thompson, 2002\n");
    116116    boolean usage = false;
    117117    // Attempt to generate html from text
     
    132132    // Print usage message
    133133    if(usage) {
    134         System.err.println("Usage: GenHelp <text_file> <template_file>");
    135         System.err.println("text_file     - A file containing text marked up using special tags.");
    136         System.err.println("template_file - An HTML file using tags to specify where to insert text.");
     134        System.out.println("Usage: GenHelp <text_file> <template_file>");
     135        System.out.println("text_file     - A file containing text marked up using special tags.");
     136        System.out.println("template_file - An HTML file using tags to specify where to insert text.");
    137137    }
    138138    }
     
    351351        catch (Exception error) {
    352352        error.printStackTrace();
    353         System.err.println("An error has occured. View output.txt for more information.");
     353        System.out.println("An error has occured. View output.txt for more information.");
    354354        exit();
    355355        }
     
    431431        catch (Exception error) {
    432432        error.printStackTrace();
    433         System.err.println("An error has occured. View output.txt for more information.");
     433        System.out.println("An error has occured. View output.txt for more information.");
    434434        exit();
    435435        }
  • trunk/gli/src/org/greenstone/gatherer/util/TreeModelTest.java

    r4674 r4686  
    4141    /** Testing - usage message. */
    4242    static void printUsage() {
    43         System.err.println("Usage: java Test3 [-safe] [-debug]");
    44         System.err.println(" safe  - use SynchronizedTreeModel");
    45         System.err.println(" debug - write debug messages to debug.txt file\n");
    46         System.err.println("Actions:");
    47         System.err.println(" 'Add Node' - Adds a new node to the selected node. Since this happens on the AWTEvent Thread it should always be safe.");
    48         System.err.println(" 'Remove Node' - Removes the selected node. Since this happens on the AWTEvent Thread it should always be safe.");
    49         System.err.println(" 'Preset Structure' - Generates a small preset structure on a seperate (dangerous) thread.");
    50         System.err.println(" 'Dangerous' - The ultimate test. Hammers the model with incessant random mutations from a separate thread.");
     43        System.out.println("Usage: java Test3 [-safe] [-debug]");
     44        System.out.println(" safe  - use SynchronizedTreeModel");
     45        System.out.println(" debug - write debug messages to debug.txt file\n");
     46        System.out.println("Actions:");
     47        System.out.println(" 'Add Node' - Adds a new node to the selected node. Since this happens on the AWTEvent Thread it should always be safe.");
     48        System.out.println(" 'Remove Node' - Removes the selected node. Since this happens on the AWTEvent Thread it should always be safe.");
     49        System.out.println(" 'Preset Structure' - Generates a small preset structure on a seperate (dangerous) thread.");
     50        System.out.println(" 'Dangerous' - The ultimate test. Hammers the model with incessant random mutations from a separate thread.");
    5151        System.exit(0);
    5252    }
  • trunk/gli/src/org/greenstone/gatherer/valuetree/GValueModel.java

    r4582 r4686  
    111111        }
    112112        value_node = new GValueNode(new_subject);
    113         // System.err.println("(GValueModel) addValue()... " + value_node);
     113        ///ystem.err.println("(GValueModel) addValue()... " + value_node);
    114114       
    115115        // Figure out where this node will be inserted in subjects
     
    130130        ///ystem.err.println("Inserting '" + value + "' at position " + position);
    131131        insertNodeInto(value_node, subject, position);
    132         // System.err.println("(GValueModel) Done insert node into...");
     132        ///ystem.err.println("(GValueModel) Done insert node into...");
    133133        // SynchronizedTreeModelTools.insertNodeInto(this, subject, value_node);
    134134        // Inform listeners that we've changed.
  • trunk/gli/src/org/greenstone/gatherer/valuetree/GValueTree.java

    r4543 r4686  
    169169    public void setSelectedMetadataElement(ElementWrapper element)
    170170    {
    171     // System.err.println("Setting selected metadata element to: " + element);
     171    ///ystem.err.println("Setting selected metadata element to: " + element);
    172172    if (element == null) {
    173173        selected_metadata_element = null;
     
    229229    // Setting the text of the field causes the DocumentListener to be notified, and
    230230    //   updating the tree is handled there (DocumentListenerImpl::validate())
    231     // System.err.println("Setting selected value to: " + val);
     231    ///ystem.err.println("Setting selected value to: " + val);
    232232    if (!card_showing.equals(NONE)) {
    233233        manual_text_edit_event = val.equals("");  // Set to false unless val == ""
     
    333333    {
    334334        String value_text = value.getText();
    335         // System.err.println("\n(Validate) Value text: " + value_text);
     335        ///ystem.err.println("\n(Validate) Value text: " + value_text);
    336336
    337337        // Ignore the validate() with empty text that occurs when value.setText() is used
Note: See TracChangeset for help on using the changeset viewer.