List of usage examples for com.jgoodies.looks.plastic Plastic3DLookAndFeel Plastic3DLookAndFeel
public Plastic3DLookAndFeel()
From source file:edu.ku.brc.specify.conversion.GroupPermittedToViewFixer.java
License:Open Source License
/** * @param args/*from ww w.jav a 2 s .com*/ */ 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//ww w .j a v a 2s . c o m * @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 w w. j a v a 2 s .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/* ww w . ja v a2 s . co 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/*from www .j a v a 2s. c om*/ */ 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 w ww .jav a2s. c o m */ 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 . ja va2s. com */ 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); } } }); }
From source file:edu.ku.brc.specify.utilapps.BuildSampleDatabase.java
License:Open Source License
/** * @param args// w w w . jav a2 s . c o m */ public static void main(final String[] args) { System.setProperty(DBMSUserMgr.factoryName, "edu.ku.brc.dbsupport.MySQLDMBSUserMgr"); try { ResourceBundle.getBundle("resources", Locale.getDefault()); //$NON-NLS-1$ } catch (MissingResourceException ex) { Locale.setDefault(Locale.ENGLISH); setResourceLocale(Locale.ENGLISH); } new HiddenTableMgr(); try { if (!System.getProperty("os.name").equals("Mac OS X")) { UIManager.setLookAndFeel(new Plastic3DLookAndFeel()); PlasticLookAndFeel.setPlasticTheme(new DesertBlue()); } } catch (Exception e) { e.printStackTrace(); } if (StringUtils.isEmpty(getAppName())) { setAppName("Specify"); } SwingUtilities.invokeLater(new Runnable() { public void run() { BuildSampleDatabase builder = new BuildSampleDatabase(); builder.buildSetup(args); } }); }
From source file:edu.ku.brc.specify.utilapps.sp5utils.Sp5Forms.java
License:Open Source License
/** * @param args/*w w w. java 2s .c om*/ */ public static void main(String[] args) { // 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 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); } 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()); } final Sp5Forms frame = new Sp5Forms(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setBounds(0, 0, 800, 800); new MacOSAppHandler(frame); frame.startup(); frame.createUI(); JMenuBar mb = new JMenuBar(); JMenu fileMenu = new JMenu("File"); JMenuItem openMI = new JMenuItem("Open XML File"); fileMenu.add(openMI); openMI.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { frame.openXML(); } }); JMenuItem openDBMI = new JMenuItem("Open Database"); fileMenu.add(openDBMI); openDBMI.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { frame.openDB(); } }); JMenuItem saveMI = new JMenuItem("Save"); fileMenu.add(saveMI); saveMI.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { frame.saveXML(); } }); if (!UIHelper.isMacOS()) { fileMenu.addSeparator(); JMenuItem mi = new JMenuItem("Exit"); fileMenu.add(mi); mi.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { System.exit(0); } }); } mb.add(fileMenu); frame.setJMenuBar(mb); centerAndShow(frame); } catch (Exception e) { log.error("Can't change L&F: ", e); } } }); }
From source file:it.unibas.spicygui.Installer.java
License:Open Source License
private void setLookAndFeel() { try {/* ww w. j av a2 s . c om*/ if ((Utilities.getOperatingSystem() & Utilities.OS_LINUX) != 0) { Plastic3DLookAndFeel.setPlasticTheme(new LightGray()); UIManager.setLookAndFeel(new Plastic3DLookAndFeel()); } } catch (UnsupportedLookAndFeelException ex) { Exceptions.printStackTrace(ex); } }