[33053] | 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, NZDL Project, University of Waikato
|
---|
| 9 | *
|
---|
| 10 | * Copyright (C) 2005 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 | */
|
---|
| 27 | package org.greenstone.gatherer;
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 | import java.io.*;
|
---|
| 31 | import javax.swing.*;
|
---|
| 32 | import org.greenstone.gatherer.util.Utility;
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 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
|
---|
| 41 | */
|
---|
| 42 | public class GathererProg
|
---|
| 43 | {
|
---|
| 44 | /** The entry point into the stand-alone GLI.
|
---|
| 45 | * @param args A collection of arguments that may include: initial screen size, dictionary, path to the GSDL etc.
|
---|
| 46 | */
|
---|
| 47 | static public void main(String[] args)
|
---|
| 48 | {
|
---|
| 49 | // A serious hack, but its good enough to stop crappy 'Could not
|
---|
| 50 | // lock user prefs' error messages. Thanks to Walter Schatz from
|
---|
| 51 | // the java forums.
|
---|
| 52 | System.setProperty("java.util.prefs.syncInterval","2000000");
|
---|
| 53 | // => results in one message every 600 hours!
|
---|
| 54 |
|
---|
| 55 | // Ensure platform specific LAF
|
---|
| 56 | try {
|
---|
| 57 | // UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
---|
| 58 | UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
|
---|
| 59 | }
|
---|
| 60 | catch (Exception exception) {
|
---|
| 61 | exception.printStackTrace();
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | // Determine the GLI user directory path
|
---|
| 65 | String gli_user_directory_path = System.getProperty("user.home") + File.separator;
|
---|
| 66 | if (Utility.isWindows()) {
|
---|
| 67 | gli_user_directory_path += "Application Data" + File.separator + "Greenstone" + File.separator + "GLI" + File.separator;
|
---|
| 68 | }
|
---|
| 69 | else {
|
---|
| 70 | gli_user_directory_path += ".gli" + File.separator;
|
---|
| 71 | }
|
---|
| 72 | Gatherer.setGLIUserDirectoryPath(gli_user_directory_path);
|
---|
| 73 |
|
---|
| 74 | // We have a local GLI
|
---|
| 75 | Gatherer.setGLIDirectoryPath(System.getProperty("user.dir") + File.separator);
|
---|
| 76 |
|
---|
| 77 | // Create an instance of the Gatherer class, which will parse the args and prepare the rest of the GLI
|
---|
| 78 | Gatherer gatherer = new Gatherer(args);
|
---|
| 79 |
|
---|
| 80 | // Display the GUI immediately
|
---|
| 81 | gatherer.openGUI();
|
---|
| 82 | }
|
---|
| 83 | }
|
---|