List of usage examples for com.jgoodies.looks.plastic PlasticLookAndFeel PlasticLookAndFeel
public PlasticLookAndFeel()
From source file:edu.ku.brc.specify.tools.ireportspecify.MainFrameSpecify.java
License:Open Source License
/** * @param args//from w w w .ja va2 s .co m */ public static void main(String[] args) { log.debug("********* Current [" + (new File(".").getAbsolutePath()) + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ // This is for Windows and Exe4J, turn the args into System Properties // Set App Name, MUST be done very first thing! //UIRegistry.setAppName("iReports4Specify"); //$NON-NLS-1$ UIRegistry.setAppName("Specify"); //$NON-NLS-1$ UIRegistry.setEmbeddedDBPath(UIRegistry.getDefaultEmbeddedDBPath()); // on the local machine AppBase.processArgs(args); AppBase.setupTeeForStdErrStdOut(true, false); // 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$ Specify.setUpSystemProperties(); AppPreferences localPrefs = AppPreferences.getLocalPrefs(); localPrefs.setDirPath(UIRegistry.getAppDataDir()); adjustLocaleFromPrefs(); HibernateUtil.setListener("post-commit-update", new edu.ku.brc.specify.dbsupport.PostUpdateEventListener()); //$NON-NLS-1$ HibernateUtil.setListener("post-commit-insert", new edu.ku.brc.specify.dbsupport.PostInsertEventListener()); //$NON-NLS-1$ HibernateUtil.setListener("post-commit-delete", new edu.ku.brc.specify.dbsupport.PostDeleteEventListener()); //$NON-NLS-1$ ImageIcon helpIcon = IconManager.getIcon(IconManager.makeIconName("AppIcon"), IconSize.Std16); //$NON-NLS-1$ HelpMgr.initializeHelp("SpecifyHelp", helpIcon.getImage()); //$NON-NLS-1$ 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) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(MainFrameSpecify.class, e); log.error("Can't change L&F: ", e); //$NON-NLS-1$ } 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(); // On UI Thread } } }); } else { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { startupContinuing(); } }); } }
From source file:edu.ku.brc.specify.tools.l10nios.StrLocalizerAppForiOS.java
License:Open Source License
/** * @param args//from w ww. j a v a 2 s.com */ 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.schemalocale.SchemaLocalizerFrame.java
License:Open Source License
/** * @param args/*from ww w . j a va2s . com*/ */ public static void main(String[] args) { log.debug("********* Current [" + (new File(".").getAbsolutePath()) + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ // This is for Windows and Exe4J, turn the args into System Properties for (String s : args) { String[] pairs = s.split("="); //$NON-NLS-1$ if (pairs.length == 2) { log.debug("[" + pairs[0] + "][" + pairs[1] + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ if (pairs[0].startsWith("-D")) //$NON-NLS-1$ { System.setProperty(pairs[0].substring(2, pairs[0].length()), pairs[1]); } } } // Now check the System Properties String appDir = System.getProperty("appdir"); //$NON-NLS-1$ if (StringUtils.isNotEmpty(appDir)) { UIRegistry.setDefaultWorkingPath(appDir); } String appdatadir = System.getProperty("appdatadir"); //$NON-NLS-1$ if (StringUtils.isNotEmpty(appdatadir)) { UIRegistry.setBaseAppDataDir(appdatadir); } SwingUtilities.invokeLater(new Runnable() { public void run() { // Set App Name, MUST be done very first thing! UIRegistry.setAppName("Specify"); //$NON-NLS-1$ // 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$ try { UIHelper.OSTYPE osType = UIHelper.getOSType(); if (osType == UIHelper.OSTYPE.Windows) { //UIManager.setLookAndFeel(new WindowsLookAndFeel()); UIManager.setLookAndFeel(new PlasticLookAndFeel()); PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue()); } else if (osType == UIHelper.OSTYPE.Linux) { //UIManager.setLookAndFeel(new GTKLookAndFeel()); PlasticLookAndFeel.setPlasticTheme(new SkyKrupp()); //PlasticLookAndFeel.setPlasticTheme(new DesertBlue()); //PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue()); //PlasticLookAndFeel.setPlasticTheme(new ExperienceRoyale()); UIManager.setLookAndFeel(new PlasticLookAndFeel()); } } catch (Exception e) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(SchemaLocalizerFrame.class, e); e.printStackTrace(); } AppPreferences localPrefs = AppPreferences.getLocalPrefs(); localPrefs.setDirPath(UIRegistry.getAppDataDir()); //Specify.adjustLocaleFromPrefs(); System.setProperty(AppContextMgr.factoryName, "edu.ku.brc.specify.config.SpecifyAppContextMgr"); // Needed by AppContextMgr //$NON-NLS-1$ System.setProperty(SchemaI18NService.factoryName, "edu.ku.brc.specify.config.SpecifySchemaI18NService"); // Needed for Localization and Schema //$NON-NLS-1$ System.setProperty(UIFieldFormatterMgr.factoryName, "edu.ku.brc.specify.ui.SpecifyUIFieldFormatterMgr"); // Needed for CatalogNumbering //$NON-NLS-1$ System.setProperty(WebLinkMgr.factoryName, "edu.ku.brc.specify.config.SpecifyWebLinkMgr"); // Needed for WebLnkButton //$NON-NLS-1$ System.setProperty(DataObjFieldFormatMgr.factoryName, "edu.ku.brc.specify.config.SpecifyDataObjFieldFormatMgr"); // Needed for WebLnkButton //$NON-NLS-1$ SpecifyDataObjFieldFormatMgr.setDoingLocal(true); SpecifyUIFieldFormatterMgr.setDoingLocal(true); SpecifyWebLinkMgr.setDoingLocal(true); Object[] options = { getResourceString("SchemaLocalizerFrame.FULL_SCHEMA"), //$NON-NLS-1$ getResourceString("SchemaLocalizerFrame.WB_SCHEMA") }; //$NON-NLS-1$ int retVal = JOptionPane.showOptionDialog(null, getResourceString("SchemaLocalizerFrame.WHICH_SCHEMA"), //$NON-NLS-1$ getResourceString("SchemaLocalizerFrame.CHOOSE_SCHEMA"), JOptionPane.YES_NO_CANCEL_OPTION, //$NON-NLS-1$ JOptionPane.QUESTION_MESSAGE, null, options, options[0]); SchemaLocalizerFrame sla; if (retVal == JOptionPane.NO_OPTION) { DBTableIdMgr schema = new DBTableIdMgr(false); schema.initialize(new File(XMLHelper.getConfigDirPath("specify_workbench_datamodel.xml"))); //$NON-NLS-1$ sla = new SchemaLocalizerFrame(SpLocaleContainer.WORKBENCH_SCHEMA, schema); } else { sla = new SchemaLocalizerFrame(SpLocaleContainer.CORE_SCHEMA, DBTableIdMgr.getInstance()); } AppContextMgr.getInstance().setHasContext(true); sla.createDisplay(); sla.pack(); Dimension size = sla.getSize(); size.width += 250; sla.setSize(size); UIHelper.centerAndShow(sla); final SchemaLocalizerFrame slaf = sla; slaf.setDefaultCloseOperation(EXIT_ON_CLOSE); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { slaf.chooseCurrentLocale(); } }); } }); }
From source file:edu.ku.brc.specify.tools.StrLocalizerApp.java
License:Open Source License
/** * @param args// w w w .j a v a 2s . com */ 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.mexconabio.GBIFFullTextSearchFrame.java
License:Open Source License
/** * @param args/*from www. j ava 2s . com*/ */ public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { // Set App Name, MUST be done very first thing! UIRegistry.setAppName("Specify"); //$NON-NLS-1$ // 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$ try { UIHelper.OSTYPE osType = UIHelper.getOSType(); if (osType == UIHelper.OSTYPE.Windows) { //UIManager.setLookAndFeel(new WindowsLookAndFeel()); UIManager.setLookAndFeel(new PlasticLookAndFeel()); PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue()); } else if (osType == UIHelper.OSTYPE.Linux) { //UIManager.setLookAndFeel(new GTKLookAndFeel()); PlasticLookAndFeel.setPlasticTheme(new SkyKrupp()); //PlasticLookAndFeel.setPlasticTheme(new DesertBlue()); //PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue()); //PlasticLookAndFeel.setPlasticTheme(new ExperienceRoyale()); UIManager.setLookAndFeel(new PlasticLookAndFeel()); } } catch (Exception e) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(SchemaLocalizerFrame.class, e); e.printStackTrace(); } System.setProperty(AppContextMgr.factoryName, "edu.ku.brc.specify.config.SpecifyAppContextMgr"); // Needed by AppContextMgr //$NON-NLS-1$ System.setProperty(SchemaI18NService.factoryName, "edu.ku.brc.specify.config.SpecifySchemaI18NService"); // Needed for Localization and Schema //$NON-NLS-1$ System.setProperty(UIFieldFormatterMgr.factoryName, "edu.ku.brc.specify.ui.SpecifyUIFieldFormatterMgr"); // Needed for CatalogNumbering //$NON-NLS-1$ System.setProperty(WebLinkMgr.factoryName, "edu.ku.brc.specify.config.SpecifyWebLinkMgr"); // Needed for WebLnkButton //$NON-NLS-1$ System.setProperty(DataObjFieldFormatMgr.factoryName, "edu.ku.brc.specify.config.SpecifyDataObjFieldFormatMgr"); // Needed for WebLnkButton //$NON-NLS-1$ SpecifyDataObjFieldFormatMgr.setDoingLocal(true); SpecifyUIFieldFormatterMgr.setDoingLocal(true); SpecifyWebLinkMgr.setDoingLocal(true); GBIFFullTextSearchFrame dlg = new GBIFFullTextSearchFrame(); dlg.createDBConnection("localhost", "3306", "gbif", "root", "root"); dlg.setCancelLabel("Close"); dlg.setSize(900, 700); UIHelper.centerAndShow(dlg); dlg.cleanup(); System.exit(0); } }); }
From source file:edu.ku.brc.specify.toycode.UpdatesApp.java
License:Open Source License
/** * @param args/*from w ww . j a v a 2s .co m*/ */ public static void main(String[] args) { if (args.length == 9) { for (int i = 0; i < args.length; i++) { System.out.println(i + "=" + args[i]); } doingCmdLine = true; UpdatesApp updateApp = new UpdatesApp(); try { updateApp.merge(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]); } catch (java.lang.NullPointerException ex) { System.err.println("****The merge process failed: check for errors above."); } } else { SwingUtilities.invokeLater(new Runnable() { public void run() { try { UIHelper.OSTYPE osType = UIHelper.getOSType(); if (osType == UIHelper.OSTYPE.Windows) { //UIManager.setLookAndFeel(new WindowsLookAndFeel()); UIManager.setLookAndFeel(new PlasticLookAndFeel()); PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue()); } else if (osType == UIHelper.OSTYPE.Linux) { //UIManager.setLookAndFeel(new GTKLookAndFeel()); UIManager.setLookAndFeel(new PlasticLookAndFeel()); //PlasticLookAndFeel.setPlasticTheme(new SkyKrupp()); //PlasticLookAndFeel.setPlasticTheme(new DesertBlue()); //PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue()); //PlasticLookAndFeel.setPlasticTheme(new DesertGreen()); } } catch (Exception e) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(UpdatesApp.class, e); System.err.println("Can't change L&F: " + e); //$NON-NLS-1$ } UpdatesApp panel = new UpdatesApp(); JFrame frame = new JFrame(); frame.setTitle("Install4J XML Updater"); frame.setContentPane(panel); JMenuBar menuBar = panel.createMenus(); if (menuBar != null) { //top.add(menuBar, BorderLayout.NORTH); frame.setJMenuBar(menuBar); } frame.pack(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }); } }
From source file:edu.ku.brc.specify.utilapps.CreateTextSchema.java
License:Open Source License
/** * @param args//w w w .ja v a2s.c o m */ public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @SuppressWarnings("synthetic-access") //$NON-NLS-1$ 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) { } String schemaVersion = JOptionPane.showInputDialog("Enter Schema Version:"); Locale.setDefault(currLang); try { ResourceBundle.getBundle("resources", Locale.getDefault()); //$NON-NLS-1$ } catch (MissingResourceException ex) { Locale.setDefault(Locale.ENGLISH); UIRegistry.setResourceLocale(Locale.ENGLISH); } CreateTextSchema cts = new CreateTextSchema(); cts.process(schemaVersion); //File file = XMLHelper.getConfigDir(specifyDescFileName); //file.delete(); JOptionPane.showMessageDialog(null, "Done"); } }); }
From source file:edu.ku.brc.specify.utilapps.DataModelClassGenerator.java
License:Open Source License
/** * @param args//from www. ja v a 2s .co m */ public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @SuppressWarnings("synthetic-access") public void run() { try { UIHelper.OSTYPE osType = UIHelper.getOSType(); if (osType == UIHelper.OSTYPE.Windows) { //UIManager.setLookAndFeel(new WindowsLookAndFeel()); UIManager.setLookAndFeel(new PlasticLookAndFeel()); PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue()); } else if (osType == UIHelper.OSTYPE.Linux) { //UIManager.setLookAndFeel(new GTKLookAndFeel()); UIManager.setLookAndFeel(new PlasticLookAndFeel()); //PlasticLookAndFeel.setPlasticTheme(new SkyKrupp()); //PlasticLookAndFeel.setPlasticTheme(new DesertBlue()); //PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue()); //PlasticLookAndFeel.setPlasticTheme(new DesertGreen()); } } catch (Exception e) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(DataModelClassGenerator.class, e); //log.error("Can't change L&F: ", e); } DataModelClassGenerator dmcg = new DataModelClassGenerator(Appraisal.class); UIHelper.centerAndShow(dmcg); } }); }
From source file:fi.smaa.jsmaa.JSMAAMain.java
License:Open Source License
private void start() { try {/*from w w w. j a v a 2s .com*/ String osName = System.getProperty("os.name"); if (osName.startsWith("Windows")) { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } else if (osName.startsWith("Mac")) { // do nothing, use the Mac Aqua L&f } else { try { UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel"); } catch (Exception e) { UIManager.setLookAndFeel(new PlasticLookAndFeel()); } } } catch (Exception e) { // Likely the Looks library is not in the class path; ignore. } app = new JSMAAMainFrame(DefaultModels.getSMAA2Model()); app.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent evt) { quitApplication(); } }); app.setVisible(true); GUIHelper.centerWindow(app); }
From source file:jsattrak.gui.JSatTrak.java
License:Open Source License
/** * @return true if the user has java 6u10 (and therefore Nimbus is * supported/used)//from w w w .ja v a 2s . c o m */ private boolean setLookAndFeel() { boolean usingNimbus = false; try { // TEMP UNTIL NIMBUS WORKS WITH INTERNAL WINDOWS String laf = "org.jvnet.substance.skin.Substance" + "Raven" + "LookAndFeel"; LafChanger.changeLaf(this, laf); } catch (Exception ex2) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); // usingNimbus = true; } catch (Exception ex1) // default using jgoodies looks plastic // theme { PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue()); PlasticLookAndFeel.setTabStyle("Metal"); // makes tabes look // much better try { UIManager.setLookAndFeel(new PlasticLookAndFeel()); } catch (Exception ex) { ex.printStackTrace(); } } } return usingNimbus; }