PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/edu/uncc/parsets/ParallelSets.java

https://code.google.com/p/parsets/
Java | 95 lines | 37 code | 18 blank | 40 comment | 5 complexity | f3855cfb1603cf42f45a0c0d2b9ce335 MD5 | raw file
 1package edu.uncc.parsets;
 2
 3import javax.swing.SwingUtilities;
 4
 5import org.apache.log4j.Level;
 6
 7import edu.uncc.parsets.gui.MainWindow;
 8import edu.uncc.parsets.util.BatchConvert;
 9import edu.uncc.parsets.util.PSLogging;
10import edu.uncc.parsets.util.osabstraction.AbstractOS;
11
12/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
13 * Copyright (c) 2009, Robert Kosara, Caroline Ziemkiewicz,
14 *                     and others (see Authors.txt for full list)
15 * All rights reserved.
16 * 
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions are met:
19 * 
20 *    * Redistributions of source code must retain the above copyright
21 *      notice, this list of conditions and the following disclaimer.
22 *    * Redistributions in binary form must reproduce the above copyright
23 *      notice, this list of conditions and the following disclaimer in the
24 *      documentation and/or other materials provided with the distribution.
25 *    * Neither the name of UNC Charlotte nor the names of its contributors
26 *      may be used to endorse or promote products derived from this software
27 *      without specific prior written permission.
28 *      
29 * THIS SOFTWARE IS PROVIDED BY ITS AUTHORS ''AS IS'' AND ANY
30 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
38 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
40
41/**
42 * Parallel Sets is a visualization technique for categorical data. This class
43 * sets up everything to run the program. 
44 */
45public class ParallelSets {
46
47	public static final int MAJOR_VERSION = 2;
48
49	public static final int MINOR_VERSION = 1;
50
51	public static final String VERSION = MAJOR_VERSION+"."+MINOR_VERSION;
52	
53	public static final String PROGRAMNAME = "Parallel Sets";
54	
55	public static final String WEBSITE = "http://eagereyes.org/parsets/";	
56	
57	/** If true, the program is run installed by a user, and needs to act like that. That includes accessing
58	 * the installed version of the database, showing a crash reporter dialog when the program crashes, etc.
59	 * If false, it's the development version using its local database.
60	 * 
61	 * There are currently two properties that can be set to "true" on the commandline to switch
62	 * this to true: <tt>parsets.use_installed_db</tt> and <tt>parsets.installed</tt>. The former
63	 * will be deprecated eventually.
64	 */
65	protected static boolean installed = false;
66	
67	static {
68		installed = System.getProperty("parsets.use_installed_db", "false").equalsIgnoreCase("true") ||
69				System.getProperty("parsets.installed", "false").equalsIgnoreCase("true");
70	}
71	
72	public static void main(String[] args) {
73		AbstractOS.determineOS();
74		
75		if (args == null || args.length == 0)
76			SwingUtilities.invokeLater(new Runnable() {
77				@Override
78				public void run() {
79					new MainWindow();
80				}
81			});
82		else {
83			installed = false;
84			PSLogging.init(null, Level.ERROR);
85			BatchConvert.batchConvert(args);
86		}
87			
88	}
89
90	
91	public static boolean isInstalled() {
92		return installed;
93	}
94	
95}