/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

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