source: trunk/gli/src/org/greenstone/gatherer/GathererProg.java@ 9058

Last change on this file since 9058 was 9058, checked in by mdewsnip, 19 years ago

Removed splash screen. It is no longer needed because the GLI now opens fully before opening the last loaded collection.

  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1/**
2 *#########################################################################
3 *
4 * A component of the Gatherer application, part of the Greenstone digital
5 * library suite from the New Zealand Digital Library Project at the
6 * University of Waikato, New Zealand.
7 *
8 * Author: John Thompson, Greenstone Digital Library, University of Waikato
9 *
10 * Copyright (C) 1999 New Zealand Digital Library Project
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 *########################################################################
26 */
27package org.greenstone.gatherer;
28
29
30import java.awt.*;
31import java.util.*;
32import javax.swing.*;
33import org.greenstone.gatherer.feedback.ActionRecorderDialog;
34import org.greenstone.gatherer.gui.GUIManager;
35
36
37/** Containing the main() method for the Gatherer, this class is the
38 * starting point for the rest of the application. Using GetOpt and
39 * GathererBase it first parses the command line arguments, preparing to
40 * update the configuration as required. Next it loads several important
41 * support classes such as the Configuration and Dictionary. Finally it
42 * creates the other important managers and sends them on their way.
43 * @author John Thompson, Greenstone Digital Library, University of Waikato
44 * @version 2.3
45 */
46public class GathererProg
47{
48 /** The entry point into the Gatherer. Parses arguments.
49 * @param args A collection of arguments that may include: initial screen size, dictionary, path to the GSDL etc.
50 * @see java.io.File
51 * @see java.io.FileInputStream
52 * @see java.lang.Exception
53 * @see java.util.Properties
54 * @see org.greenstone.gatherer.Dictionary
55 * @see org.greenstone.gatherer.Gatherer
56 * @see org.greenstone.gatherer.Gatherer
57 */
58 static public void main(String[] args) {
59 // A serious hack, but its good enough to stop crappy 'Could not
60 // lock user prefs' error messages. Thanks to Walter Schatz from
61 // the java forums.
62 System.setProperty("java.util.prefs.syncInterval","2000000");
63 // => results in One message every 600 hours!
64
65 // Ensure platform specific LAF
66 try {
67 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
68 }
69 catch(Exception exception) {
70 exception.printStackTrace();
71 }
72
73 Gatherer gatherer = new Gatherer();
74
75 Dimension size = new Dimension(800, 540);
76
77 GetOpt go = new GetOpt(args);
78
79 if (go.feedback_enabled) {
80 // If feedback is enabled, set up the recorder dialog.
81 // Use the default locale for now - this will be changed by the
82 // Gatherer run method
83 Locale currLocale = Locale.getDefault();
84 ActionRecorderDialog dlg = new ActionRecorderDialog (currLocale);
85 gatherer.feedback_enabled = true;
86 gatherer.feedback_dialog = dlg;
87 }
88
89 if (go.collect_directory_path != null) {
90 // Use non-standard collect directory (for when running one GLI in a network environment)
91 Gatherer.setCollectDirectoryPath(go.collect_directory_path);
92 }
93
94 GUIManager g_man
95 = gatherer.init(size, go.gsdl_path, go.gsdl3_path, go.local_library_path,
96 go.library_url_string, go.debug, go.perl_path,
97 go.no_load, go.filename, go.site_name,
98 go.servlet_path, go.wget_version_str, go.wget_path);
99 gatherer.run(size, g_man);
100
101 // If there was an open collection last session, reopen it.
102 if (Gatherer.open_collection_file_path != null) {
103 Gatherer.c_man.loadCollection(Gatherer.open_collection_file_path);
104 }
105 }
106}
Note: See TracBrowser for help on using the repository browser.