Example usage for com.jgoodies.looks.plastic.theme DesertBlue DesertBlue

List of usage examples for com.jgoodies.looks.plastic.theme DesertBlue DesertBlue

Introduction

In this page you can find the example usage for com.jgoodies.looks.plastic.theme DesertBlue DesertBlue.

Prototype

DesertBlue

Source Link

Usage

From source file:edu.ku.brc.specify.config.init.secwiz.SpecifyDBSecurityWizardFrame.java

License:Open Source License

/**
 * @param args/*from  w  w w. ja va 2 s .com*/
 */
public static void main(String[] args) {
    // Set App Name, MUST be done very first thing!
    UIRegistry.setAppName("Specify"); //$NON-NLS-1$

    try {
        ResourceBundle.getBundle("resources", Locale.getDefault()); //$NON-NLS-1$

    } catch (MissingResourceException ex) {
        Locale.setDefault(Locale.ENGLISH);
        UIRegistry.setResourceLocale(Locale.ENGLISH);
    }

    try {
        if (!System.getProperty("os.name").equals("Mac OS X")) {
            UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
            PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
        }
    } catch (Exception e) {
        edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount();
        edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(SpecifyDBSecurityWizard.class, e);
        e.printStackTrace();
    }

    AppBase.processArgs(args);
    AppBase.setupTeeForStdErrStdOut(true, false);

    System.setProperty("appdatadir", "..");

    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            // Then set this
            IconManager.setApplicationClass(Specify.class);
            IconManager.loadIcons(XMLHelper.getConfigDir("icons_datamodel.xml")); //$NON-NLS-1$
            IconManager.loadIcons(XMLHelper.getConfigDir("icons_plugins.xml")); //$NON-NLS-1$
            IconManager.loadIcons(XMLHelper.getConfigDir("icons_disciplines.xml")); //$NON-NLS-1$

            // Load Local Prefs
            AppPreferences localPrefs = AppPreferences.getLocalPrefs();
            //try {
            //System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> "+(new File(UIRegistry.getAppDataDir()).getCanonicalPath())+"]");
            //} catch (IOException ex) {}

            localPrefs.setDirPath(UIRegistry.getAppDataDir());

            // Check to see if we should check for a new version
            String VERSION_CHECK = "version_check.auto";
            if (localPrefs.getBoolean(VERSION_CHECK, null) == null) {
                localPrefs.putBoolean(VERSION_CHECK, true);
            }

            String EXTRA_CHECK = "extra.check";
            if (localPrefs.getBoolean(EXTRA_CHECK, null) == null) {
                localPrefs.putBoolean(EXTRA_CHECK, true);
            }

            if (UIHelper.isLinux()) {
                Specify.checkForSpecifyAppsRunning();
            }

            if (UIRegistry.isEmbedded()) {
                checkForMySQLProcesses();
            }

            Specify.setUpSystemProperties();

            final SpecifyDBSecurityWizardFrame wizardFrame = new SpecifyDBSecurityWizardFrame();

            if (localPrefs.getBoolean(VERSION_CHECK, true) && localPrefs.getBoolean(EXTRA_CHECK, true)) {
                try {
                    com.install4j.api.launcher.SplashScreen.hide();
                    ApplicationLauncher.Callback callback = new ApplicationLauncher.Callback() {
                        public void exited(int exitValue) {
                            UIHelper.centerAndShow(wizardFrame);
                        }

                        public void prepareShutdown() {

                        }
                    };
                    ApplicationLauncher.launchApplication("100", null, true, callback);

                } catch (Exception ex) {
                    UIHelper.centerAndShow(wizardFrame);
                }
            } else {
                UIHelper.centerAndShow(wizardFrame);
            }
        }
    });
}

From source file:edu.ku.brc.specify.config.init.SpecifyDBSetupWizardFrame.java

License:Open Source License

/**
 * @param args//from   ww w . j a  va 2 s  .c o  m
 */
public static void main(String[] args) {
    // Set App Name, MUST be done very first thing!
    UIRegistry.setAppName("Specify"); //$NON-NLS-1$

    try {
        ResourceBundle.getBundle("resources", Locale.getDefault()); //$NON-NLS-1$

    } catch (MissingResourceException ex) {
        Locale.setDefault(Locale.ENGLISH);
        UIRegistry.setResourceLocale(Locale.ENGLISH);
    }

    try {
        if (!System.getProperty("os.name").equals("Mac OS X")) {
            UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
            PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
        }
    } catch (Exception e) {
        edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount();
        edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(SpecifyDBSetupWizard.class, e);
        e.printStackTrace();
    }

    AppBase.processArgs(args);
    AppBase.setupTeeForStdErrStdOut(true, false);

    System.setProperty("appdatadir", "..");

    // Then set this
    IconManager.setApplicationClass(Specify.class);
    IconManager.loadIcons(XMLHelper.getConfigDir("icons_datamodel.xml")); //$NON-NLS-1$
    IconManager.loadIcons(XMLHelper.getConfigDir("icons_plugins.xml")); //$NON-NLS-1$
    IconManager.loadIcons(XMLHelper.getConfigDir("icons_disciplines.xml")); //$NON-NLS-1$

    // Load Local Prefs
    AppPreferences localPrefs = AppPreferences.getLocalPrefs();
    //try {
    //System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> "+(new File(UIRegistry.getAppDataDir()).getCanonicalPath())+"]");
    //} catch (IOException ex) {}

    localPrefs.setDirPath(UIRegistry.getAppDataDir());

    // Check to see if we should check for a new version
    if (localPrefs.getBoolean(VERSION_CHECK, null) == null) {
        localPrefs.putBoolean(VERSION_CHECK, true);
    }

    if (localPrefs.getBoolean(EXTRA_CHECK, null) == null) {
        localPrefs.putBoolean(EXTRA_CHECK, true);
    }

    if (UIHelper.isLinux()) {
        Specify.checkForSpecifyAppsRunning();
    }

    if (UIRegistry.isEmbedded()) {
        ProcessListUtil.checkForMySQLProcesses(new ProcessListener() {
            @Override
            public void done(PROC_STATUS status) // called on the UI thread
            {
                if (status == PROC_STATUS.eOK || status == PROC_STATUS.eFoundAndKilled) {
                    startupContinuing();
                }
            }
        });
    } else {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                startupContinuing();
            }
        });
    }
}

From source file:edu.ku.brc.specify.conversion.ConvertVerifier.java

License:Open Source License

/**
 * @param args/*www  .java  2s  .com*/
 */
public static void main(String[] args) {

    UIRegistry.setAppName("Specify");
    AppBase.processArgs(args);

    // Create Specify Application
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            try {
                if (!System.getProperty("os.name").equals("Mac OS X")) {
                    UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
                    PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
                }
            } catch (Exception e) {
                edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount();
                edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(ConvertVerifier.class, e);
                log.error("Can't change L&F: ", e);
            }

            final ConvertVerifier cv = new ConvertVerifier();

            if (cv.selectedDBsToConvert()) {
                try {
                    final Pair<String, String> pair = cv.chooseTable();
                    if (pair != null) {
                        SwingWorker workerThread = new SwingWorker() {
                            @Override
                            public Object construct() {
                                try {
                                    boolean compareTo6DBS = false;
                                    if (compareTo6DBS) {
                                        pair.first = "ku_fish";
                                        pair.second = "kui_fish_dbo_6";
                                        cv.setCompareTo6DBs(compareTo6DBS);
                                    }

                                    cv.verifyDB(pair.first, pair.second);

                                } catch (Exception ex) {
                                    ex.printStackTrace();
                                }
                                return null;
                            }

                            @Override
                            public void finished() {
                            }
                        };

                        // start the background task
                        workerThread.start();

                    } else {
                        JOptionPane.showMessageDialog(null, "The ConvertVerifier was unable to login",
                                "Not Logged In", JOptionPane.ERROR_MESSAGE);
                        System.exit(0);
                    }
                } catch (Exception ex) {
                    ex.printStackTrace();
                    System.exit(0);
                }
            }

        }
    });

}

From source file:edu.ku.brc.specify.conversion.GroupPermittedToViewFixer.java

License:Open Source License

/**
 * @param args/*  w ww .j ava2s. c  o m*/
 */
public static void main(String[] args) {

    UIRegistry.setAppName("Specify");

    // Create Specify Application
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            try {
                if (!System.getProperty("os.name").equals("Mac OS X")) {
                    UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
                    PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
                }
            } catch (Exception e) {
                edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount();
                edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(ConvertVerifier.class, e);
                log.error("Can't change L&F: ", e);
            }

            final GroupPermittedToViewFixer cv = new GroupPermittedToViewFixer();

            if (cv.selectedDBsToConvert()) {
                try {
                    final Pair<String, String> pair = cv.chooseTable();
                    if (pair != null) {
                        SwingWorker workerThread = new SwingWorker() {
                            @Override
                            public Object construct() {
                                try {
                                    cv.fixDB(pair.first, pair.second);

                                } catch (Exception ex) {
                                    ex.printStackTrace();
                                }
                                return null;
                            }

                            @Override
                            public void finished() {
                            }
                        };

                        // start the background task
                        workerThread.start();

                    } else {
                        JOptionPane.showMessageDialog(null, "The GroupPermittedToViewFixer was unable to login",
                                "Not Logged In", JOptionPane.ERROR_MESSAGE);
                        System.exit(0);
                    }
                } catch (Exception ex) {
                    ex.printStackTrace();
                    System.exit(0);
                }
            }

        }
    });

}

From source file:edu.ku.brc.specify.conversion.SpecifyDBConverter.java

License:Open Source License

/**
 * @param args//from w  ww  .ja  v  a2  s . c om
 * @throws Exception
 */
public static void main(String args[]) throws Exception {
    /*try
    {
    List<String>   list = FileUtils.readLines(new File("/Users/rods/drop.sql"));
    Vector<String> list2 = new Vector<String>();
    for (String line : list)
    {
        list2.add(line+";");
    }
    FileUtils.writeLines(new File("/Users/rods/drop2.sql"), list2);
    return;
            
    } catch (Exception ex)
    {
    ex.printStackTrace();
    }*/

    // Set App Name, MUST be done very first thing!
    UIRegistry.setAppName("Specify"); //$NON-NLS-1$

    log.debug("********* Current [" + (new File(".").getAbsolutePath()) + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    UIRegistry.setEmbeddedDBPath(UIRegistry.getDefaultEmbeddedDBPath()); // on the local machine

    AppBase.processArgs(args);

    final SpecifyDBConverter converter = new SpecifyDBConverter();

    Logger logger = LogManager.getLogger("edu.ku.brc");
    if (logger != null) {
        logger.setLevel(Level.ALL);
        System.out.println("Setting " + logger.getName() + " to " + logger.getLevel());
    }

    logger = LogManager.getLogger(edu.ku.brc.dbsupport.HibernateUtil.class);
    if (logger != null) {
        logger.setLevel(Level.INFO);
        System.out.println("Setting " + logger.getName() + " to " + logger.getLevel());
    }

    // Create Specify Application
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {

            try {
                if (!System.getProperty("os.name").equals("Mac OS X")) {
                    UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
                    PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
                }
            } catch (Exception e) {
                log.error("Can't change L&F: ", e);
            }

            Pair<String, String> namePair = null;
            try {
                if (converter.selectedDBsToConvert(false)) {
                    namePair = converter.chooseTable("Select a DB to Convert", "Specify 5 Databases", true);
                }

            } catch (SQLException ex) {
                ex.printStackTrace();
                JOptionPane.showConfirmDialog(null, "The Converter was unable to login.", "Error",
                        JOptionPane.CLOSED_OPTION);
            }

            if (namePair != null) {
                frame = new ProgressFrame("Converting");

                converter.processDB();
            } else {
                JOptionPane.showConfirmDialog(null, "The Converter was unable to login.", "Error",
                        JOptionPane.CLOSED_OPTION);
                System.exit(0);
            }
        }
    });
}

From source file:edu.ku.brc.specify.tests.PickListTestApp.java

License:Open Source License

/**
* Create the GUI and show it.  For thread safety,
* this method should be invoked from the
* event-dispatching thread./* w ww. ja  v  a  2s .  c o m*/
*/
private void initialize() {
    SpecifyAppPrefs.initialPrefs(); // Must be done first thing!

    try {
        //System.out.println(System.getProperty("os.name"));

        if (!System.getProperty("os.name").equals("Mac OS X")) {
            UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
            PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
        }

        //UIManager.setLookAndFeel(new PlasticLookAndFeel()); 
        //UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
    } catch (Exception e) {
        edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount();
        edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(PickListTestApp.class, e);
        log.error("Can't change L&F: ", e);
    }

    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    // Create and set up the window.
    mainFrame = new JFrame("Specify Form Editor");
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    UIRegistry.setTopWindow(mainFrame);

    // Create and set up the content pane.
    contentPane = buildContentPane();
    contentPane.setOpaque(true); //content panes must be opaque
    mainFrame.setContentPane(contentPane);

    JMenuBar menuBar = createMenus();
    if (menuBar != null) {
        mainFrame.setJMenuBar(menuBar);
    }

    mainFrame.pack();
    //mainFrame.setSize(new Dimension(1024, 764));
    //frame.pack();
    UIHelper.centerAndShow(mainFrame);

}

From source file:edu.ku.brc.specify.tools.l10nios.StrLocalizerAppForiOS.java

License:Open Source License

/**
  * @param args/*from  w w w.j a  v a  2  s .  c o  m*/
  */
public static void main(String[] args) {
    setAppName("Specify"); //$NON-NLS-1$
    System.setProperty(AppPreferences.factoryName, "edu.ku.brc.specify.config.AppPrefsDBIOIImpl"); // Needed by AppReferences //$NON-NLS-1$

    for (String s : args) {
        String[] pairs = s.split("="); //$NON-NLS-1$
        if (pairs.length == 2) {
            if (pairs[0].startsWith("-D")) //$NON-NLS-1$
            {
                //System.err.println("["+pairs[0].substring(2, pairs[0].length())+"]["+pairs[1]+"]");
                System.setProperty(pairs[0].substring(2, pairs[0].length()), pairs[1]);
            }
        } else {
            String symbol = pairs[0].substring(2, pairs[0].length());
            //System.err.println("["+symbol+"]");
            System.setProperty(symbol, symbol);
        }
    }

    // Now check the System Properties
    String appDir = System.getProperty("appdir");
    if (StringUtils.isNotEmpty(appDir)) {
        UIRegistry.setDefaultWorkingPath(appDir);
    }

    String appdatadir = System.getProperty("appdatadir");
    if (StringUtils.isNotEmpty(appdatadir)) {
        UIRegistry.setBaseAppDataDir(appdatadir);
    }

    // Then set this
    IconManager.setApplicationClass(Specify.class);
    IconManager.loadIcons(XMLHelper.getConfigDir("icons.xml")); //$NON-NLS-1$
    //ImageIcon icon = IconManager.getIcon("AppIcon", IconManager.IconSize.Std16);

    try {
        ResourceBundle.getBundle("resources", Locale.getDefault()); //$NON-NLS-1$

    } catch (MissingResourceException ex) {
        Locale.setDefault(Locale.ENGLISH);
        UIRegistry.setResourceLocale(Locale.ENGLISH);
    }

    try {
        if (!System.getProperty("os.name").equals("Mac OS X")) {
            UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
            PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
        }
    } catch (Exception e) {
        //whatever
    }
    AppPreferences localPrefs = AppPreferences.getLocalPrefs();
    localPrefs.setDirPath(UIRegistry.getAppDataDir());

    boolean doIt = false;
    if (doIt)

    {
        Charset utf8charset = Charset.forName("UTF-8");
        Charset iso88591charset = Charset.forName("ISO-8859-1");

        ByteBuffer inputBuffer = ByteBuffer.wrap(new byte[] { (byte) 0xC3, (byte) 0xA2 });

        // decode UTF-8
        CharBuffer data = utf8charset.decode(inputBuffer);

        // encode ISO-8559-1
        ByteBuffer outputBuffer = iso88591charset.encode(data);
        byte[] outputData = outputBuffer.array();
        System.out.println(new String(outputData));
        return;
    }

    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            try {
                UIHelper.OSTYPE osType = UIHelper.getOSType();
                if (osType == UIHelper.OSTYPE.Windows) {
                    UIManager.setLookAndFeel(new PlasticLookAndFeel());
                    PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue());

                } else if (osType == UIHelper.OSTYPE.Linux) {
                    UIManager.setLookAndFeel(new PlasticLookAndFeel());
                }
            } catch (Exception e) {
                log.error("Can't change L&F: ", e); //$NON-NLS-1$
            }

            JFrame frame = new JFrame(getResourceString("StrLocalizerApp.AppTitle"));
            frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
            final StrLocalizerAppForiOS sl = new StrLocalizerAppForiOS();
            sl.addMenuBar(frame);
            frame.setContentPane(sl);
            frame.setSize(768, 1024);

            //Dimension size = frame.getPreferredSize();
            //size.height = 500;
            //frame.setSize(size);
            frame.addWindowListener(sl);
            IconManager.setApplicationClass(Specify.class);
            frame.setIconImage(IconManager.getImage(IconManager.makeIconName("SpecifyWhite32")).getImage());

            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    sl.startUp();
                }
            });
        }
    });
}

From source file:edu.ku.brc.specify.tools.StrLocalizerApp.java

License:Open Source License

/**
  * @param args/*  w  w  w .  ja v  a2  s . c o  m*/
  */
public static void main(String[] args) {
    setAppName("Specify"); //$NON-NLS-1$
    System.setProperty(AppPreferences.factoryName, "edu.ku.brc.specify.config.AppPrefsDBIOIImpl"); // Needed by AppReferences //$NON-NLS-1$

    for (String s : args) {
        String[] pairs = s.split("="); //$NON-NLS-1$
        if (pairs.length == 2) {
            if (pairs[0].startsWith("-D")) //$NON-NLS-1$
            {
                //System.err.println("["+pairs[0].substring(2, pairs[0].length())+"]["+pairs[1]+"]");
                System.setProperty(pairs[0].substring(2, pairs[0].length()), pairs[1]);
            }
        } else {
            String symbol = pairs[0].substring(2, pairs[0].length());
            //System.err.println("["+symbol+"]");
            System.setProperty(symbol, symbol);
        }
    }

    // Now check the System Properties
    String appDir = System.getProperty("appdir");
    if (StringUtils.isNotEmpty(appDir)) {
        UIRegistry.setDefaultWorkingPath(appDir);
    }

    String appdatadir = System.getProperty("appdatadir");
    if (StringUtils.isNotEmpty(appdatadir)) {
        UIRegistry.setBaseAppDataDir(appdatadir);
    }

    // Then set this
    IconManager.setApplicationClass(Specify.class);
    IconManager.loadIcons(XMLHelper.getConfigDir("icons.xml")); //$NON-NLS-1$
    //ImageIcon icon = IconManager.getIcon("AppIcon", IconManager.IconSize.Std16);

    try {
        ResourceBundle.getBundle("resources", Locale.getDefault()); //$NON-NLS-1$

    } catch (MissingResourceException ex) {
        Locale.setDefault(Locale.ENGLISH);
        UIRegistry.setResourceLocale(Locale.ENGLISH);
    }

    try {
        if (!System.getProperty("os.name").equals("Mac OS X")) {
            UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
            PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
        }
    } catch (Exception e) {
        //whatever
    }
    AppPreferences localPrefs = AppPreferences.getLocalPrefs();
    localPrefs.setDirPath(UIRegistry.getAppDataDir());

    boolean doIt = false;
    if (doIt)

    {
        Charset utf8charset = Charset.forName("UTF-8");
        Charset iso88591charset = Charset.forName("ISO-8859-1");

        ByteBuffer inputBuffer = ByteBuffer.wrap(new byte[] { (byte) 0xC3, (byte) 0xA2 });

        // decode UTF-8
        CharBuffer data = utf8charset.decode(inputBuffer);

        // encode ISO-8559-1
        ByteBuffer outputBuffer = iso88591charset.encode(data);
        byte[] outputData = outputBuffer.array();
        System.out.println(new String(outputData));
        return;
    }

    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            try {
                UIHelper.OSTYPE osType = UIHelper.getOSType();
                if (osType == UIHelper.OSTYPE.Windows) {
                    UIManager.setLookAndFeel(new PlasticLookAndFeel());
                    PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue());

                } else if (osType == UIHelper.OSTYPE.Linux) {
                    UIManager.setLookAndFeel(new PlasticLookAndFeel());
                }
            } catch (Exception e) {
                log.error("Can't change L&F: ", e); //$NON-NLS-1$
            }

            JFrame frame = new JFrame(getResourceString("StrLocalizerApp.AppTitle"));
            frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
            final StrLocalizerApp sl = new StrLocalizerApp();
            sl.addMenuBar(frame);
            frame.setContentPane(sl);
            frame.setSize(768, 1024);

            //Dimension size = frame.getPreferredSize();
            //size.height = 500;
            //frame.setSize(size);
            frame.addWindowListener(sl);
            IconManager.setApplicationClass(Specify.class);
            frame.setIconImage(IconManager.getImage(IconManager.makeIconName("SpecifyWhite32")).getImage());
            UIHelper.centerAndShow(frame);

            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    sl.startUp();
                }
            });
        }
    });
}

From source file:edu.ku.brc.specify.toycode.BasicHibernateMain.java

License:Open Source License

/**
 *
 *
 * @param args/*from   ww w. j  a  va  2 s  .c om*/
 */
public static void main(String[] args) throws UnsupportedLookAndFeelException {
    if (!System.getProperty("os.name").equals("Mac OS X")) {
        UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
        PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
    }

    // Name factories
    System.setProperty(AppContextMgr.factoryName, "edu.ku.brc.specify.config.SpecifyAppContextMgr"); // Needed by AppContextMgr
    System.setProperty(AppPreferences.factoryName, "edu.ku.brc.specify.config.AppPrefsDBIOIImpl"); // Needed by AppReferences
    System.setProperty("edu.ku.brc.ui.ViewBasedDialogFactoryIFace", "edu.ku.brc.specify.ui.DBObjDialogFactory"); // Needed By UIRegistry
    System.setProperty("edu.ku.brc.ui.forms.DraggableRecordIdentifierFactory",
            "edu.ku.brc.specify.ui.SpecifyDraggableRecordIdentiferFactory"); // Needed By the Form System
    System.setProperty("edu.ku.brc.dbsupport.AuditInterceptor",
            "edu.ku.brc.specify.dbsupport.AuditInterceptor"); // Needed By the Form System for updating Lucene and loggin transactions
    System.setProperty("edu.ku.brc.dbsupport.DataProvider",
            "edu.ku.brc.specify.dbsupport.HibernateDataProvider"); // Needed By the Form System and any Data Get/Set
    System.setProperty("edu.ku.brc.ui.db.PickListDBAdapterFactory",
            "edu.ku.brc.specify.ui.db.PickListDBAdapterFactory"); // Needed By the Auto Cosmplete UI

    IconManager.setApplicationClass(Specify.class);
    IconManager.loadIcons(XMLHelper.getConfigDir("icons_datamodel.xml"));
    IconManager.loadIcons(XMLHelper.getConfigDir("icons_plugins.xml"));

    UIRegistry.getInstance(); // initializes it first thing
    UIRegistry.setAppName("Specify");

    // Load Local Prefs
    AppPreferences localPrefs = AppPreferences.getLocalPrefs();
    localPrefs.setDirPath(UIRegistry.getAppDataDir());
    localPrefs.load();

    Pair<String, String> usernamePassword = UserAndMasterPasswordMgr.getInstance().getUserNamePasswordForDB();
    BasicHibernateMain tester = new BasicHibernateMain();
    UIHelper.doLogin(usernamePassword.first, usernamePassword.second, true, true, false, tester, null,
            "SpecifyWhite32", "login");
}

From source file:edu.ku.brc.specify.toycode.mexconabio.FileMakerToMySQL.java

License:Open Source License

/**
 * @param args//from   w w w.  j a v a 2  s  .  c om
 */
public static void main(String[] args) {
    if (!System.getProperty("os.name").equals("Mac OS X")) {
        try {
            UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
        } catch (UnsupportedLookAndFeelException e) {
            e.printStackTrace();
        }
        PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
    }

    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            //FileDialog dlg = new FileDialog((Frame)null, "Choose a FileMaker XML File");
            //dlg.setVisible(true);
            String fileName = "xxx.xml";//dlg.getFile();

            if (StringUtils.isNotEmpty(fileName)) {
                //String path = dlg.getDirectory() + File.separator + fileName;

                //String name = "AgentsBryo_Vasc";
                String tableName = "Conabio";
                //String name = "TaxonomicBryo_Vasc";
                boolean addKey = true;

                FileMakerToMySQL fm2mysql = new FileMakerToMySQL(tableName, null, addKey);
                //fm2mysql.cleanFile("/Users/rods/Documents/"+name+".xml");
                fm2mysql.process(true);
                fm2mysql.process(false);

                fm2mysql.shutdown();

            } else {
                System.exit(0);
            }

        }
    });

}