Changeset 10242 for trunk/gli/src/org/greenstone/gatherer/GathererProg.java
- Timestamp:
- 2005-07-13T14:10:18+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/GathererProg.java
r9877 r10242 6 6 * University of Waikato, New Zealand. 7 7 * 8 * Author: John Thompson, Greenstone Digital Library, University of Waikato8 * Author: John Thompson, NZDL Project, University of Waikato 9 9 * 10 * Copyright (C) 1999New Zealand Digital Library Project10 * Copyright (C) 2005 New Zealand Digital Library Project 11 11 * 12 12 * This program is free software; you can redistribute it and/or modify … … 28 28 29 29 30 import java.awt.*;31 30 import java.io.*; 32 import java.util.*;33 31 import javax.swing.*; 34 import org.greenstone.gatherer.feedback.ActionRecorderDialog;35 import org.greenstone.gatherer.gui.GUIManager;36 32 import org.greenstone.gatherer.util.Utility; 37 33 38 34 39 /** Containing the main() method for the Gatherer, this class is the 40 * starting point for the rest of the application. Using GetOpt and 41 * GathererBase it first parses the command line arguments, preparing to 42 * update the configuration as required. Next it loads several important 43 * support classes such as the Configuration and Dictionary. Finally it 44 * creates the other important managers and sends them on their way. 45 * @author John Thompson, Greenstone Digital Library, University of Waikato 46 * @version 2.3 35 /** 36 * Containing the main() method, this class is the entry point for the 37 * stand-alone (non-Applet) GLI. The main point of this class is to set 38 * some stand-alone specific properties and then create an instance of the 39 * Gatherer class. 40 * @author John Thompson, NZDL Project, University of Waikato 47 41 */ 48 42 public class GathererProg 49 43 { 50 /** The entry point into the Gatherer. Parses arguments.44 /** The entry point into the stand-alone GLI. 51 45 * @param args A collection of arguments that may include: initial screen size, dictionary, path to the GSDL etc. 52 * @see java.io.File53 * @see java.io.FileInputStream54 * @see java.lang.Exception55 * @see java.util.Properties56 * @see org.greenstone.gatherer.Dictionary57 * @see org.greenstone.gatherer.Gatherer58 46 */ 59 static public void main(String[] args) { 47 static public void main(String[] args) 48 { 60 49 // A serious hack, but its good enough to stop crappy 'Could not 61 50 // lock user prefs' error messages. Thanks to Walter Schatz from 62 51 // the java forums. 63 52 System.setProperty("java.util.prefs.syncInterval","2000000"); 64 // => results in One message every 600 hours!53 // => results in one message every 600 hours! 65 54 66 55 // Ensure platform specific LAF … … 73 62 74 63 // Ensure the GLI user directory exists 75 File gli_user_directory = Utility.setGLIUserFolder(null); // # defaults to user's home area76 if (!gli_user_directory.exists() ) {77 gli_user_directory.mkdirs();64 File gli_user_directory = Utility.setGLIUserFolder(null); // Defaults to user's home area 65 if (!gli_user_directory.exists() && !gli_user_directory.mkdirs()) { 66 System.err.println("Error: Unable to make directory: " + gli_user_directory.toString()); 78 67 } 79 68 80 Gatherer gatherer = new Gatherer(); 69 // Create an instance of the Gatherer class, which will parse the args and prepare the rest of the GLI 70 Gatherer gatherer = new Gatherer(args); 81 71 82 Dimension size = new Dimension(800, 540); 72 // Display the GUI immediately 73 gatherer.openGUI(); 83 74 84 GetOpt go = new GetOpt(args); 85 86 if (go.feedback_enabled) { 87 // If feedback is enabled, set up the recorder dialog. 88 // Use the default locale for now - this will be changed by the 89 // Gatherer run method 90 Locale currLocale = Locale.getDefault(); 91 ActionRecorderDialog dlg = new ActionRecorderDialog (currLocale); 92 gatherer.feedback_enabled = true; 93 gatherer.feedback_dialog = dlg; 94 } 95 96 if (go.collect_directory_path != null) { 97 // Use non-standard collect directory (for when running one GLI in a network environment) 98 Gatherer.setCollectDirectoryPath(go.collect_directory_path); 99 } 100 101 GUIManager g_man 102 = gatherer.init(size, go.gsdl_path, go.gsdl3_path, go.local_library_path, 103 go.library_url_string, go.debug, go.perl_path, 104 go.no_load, go.filename, go.site_name, 105 go.servlet_path, go.wget_path); 106 gatherer.run(size, g_man); 107 108 // If there was an open collection last session, reopen it. 75 // If there was an open collection last session, reopen it 109 76 if (Gatherer.open_collection_file_path != null) { 110 77 Gatherer.c_man.loadCollection(Gatherer.open_collection_file_path);
Note:
See TracChangeset
for help on using the changeset viewer.