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

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

Introduction

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

Prototype

SkyKrupp

Source Link

Usage

From source file:edu.ku.brc.specify.tools.schemalocale.SchemaLocalizerFrame.java

License:Open Source License

/**
 * @param args/*  w ww  .j ava2 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
    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.toycode.mexconabio.GBIFFullTextSearchFrame.java

License:Open Source License

/**
 * @param args/*from  ww  w.ja va2s . c om*/
 */
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:etomica.virial.cluster2.mvc.view.ApplicationUI.java

License:Mozilla Public License

/**
 * Translates the THM_CHOICE field into a PlasticThem class instance.
 *//*  ww w.  j a v a  2 s. c om*/
public static PlasticTheme getTheme() {

    if (THM_DESERTBR.equalsIgnoreCase(THM_CHOICE)) {
        return new DesertBluer();
    } else if (THM_EXPERIENCEB.equalsIgnoreCase(THM_CHOICE)) {
        return new ExperienceBlue();
    } else if (THM_EXPERIENCER.equalsIgnoreCase(THM_CHOICE)) {
        return new ExperienceRoyale();
    } else if (THM_LIGHTGRAY.equalsIgnoreCase(THM_CHOICE)) {
        return new LightGray();
    } else if (THM_SILVER.equalsIgnoreCase(THM_CHOICE)) {
        return new Silver();
    } else if (THM_SKYBLUE.equalsIgnoreCase(THM_CHOICE)) {
        return new SkyBlue();
    } else {
        return new SkyKrupp();
    }
}

From source file:it.pdfsam.util.ThemeSelector.java

License:Open Source License

/**
 * Sets the theme// w  w  w. j a  v a  2  s  . c  o  m
 * @param theme_number Theme number
 * @return true if no exception in threw
 */
public boolean setTheme(String theme_number) {
    try {
        switch (Integer.parseInt(theme_number)) {
        case 1:
            PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
            break;
        case 2:
            PlasticLookAndFeel.setPlasticTheme(new DesertRed());
            break;
        case 3:
            PlasticLookAndFeel.setPlasticTheme(new Silver());
            break;
        case 4:
            PlasticLookAndFeel.setPlasticTheme(new SkyPink());
            break;
        case 5:
            PlasticLookAndFeel.setPlasticTheme(new SkyKrupp());
            break;
        case 6:
            PlasticLookAndFeel.setPlasticTheme(new SkyYellow());
            break;
        case 7:
            PlasticLookAndFeel.setPlasticTheme(new SkyGreen());
            break;
        case 8:
            PlasticLookAndFeel.setPlasticTheme(new DarkStar());
            break;
        case 9:
            PlasticLookAndFeel.setPlasticTheme(new BrownSugar());
            break;
        case 10:
            PlasticLookAndFeel.setPlasticTheme(new DesertGreen());
            break;
        case 11:
            PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue());
            break;
        case 12:
            PlasticLookAndFeel.setPlasticTheme(new ExperienceGreen());
            break;
        case 13:
            PlasticLookAndFeel.setPlasticTheme(new SkyBlue());
            break;
        case 14:
            PlasticLookAndFeel.setPlasticTheme(new SkyBluer());
        default:
            break;
        }
        return true;
    } catch (NumberFormatException e) {
        return false;
    }
}

From source file:it.pdfsam.utils.ThemeSelector.java

License:Open Source License

/**
 * Sets the theme/*from   w w  w .j  av a 2s.com*/
 * @param theme_number Theme number
 * @return true if no exception in threw
 */
public boolean setTheme(String theme_number) {
    try {
        switch (Integer.parseInt(theme_number)) {
        case 1:
            PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
            break;
        case 2:
            PlasticLookAndFeel.setPlasticTheme(new DesertRed());
            break;
        case 3:
            PlasticLookAndFeel.setPlasticTheme(new Silver());
            break;
        case 4:
            PlasticLookAndFeel.setPlasticTheme(new SkyPink());
            break;
        case 5:
            PlasticLookAndFeel.setPlasticTheme(new SkyKrupp());
            break;
        case 6:
            PlasticLookAndFeel.setPlasticTheme(new SkyYellow());
            break;
        case 7:
            PlasticLookAndFeel.setPlasticTheme(new SkyGreen());
            break;
        case 8:
            PlasticLookAndFeel.setPlasticTheme(new DarkStar());
            break;
        case 9:
            PlasticLookAndFeel.setPlasticTheme(new BrownSugar());
            break;
        case 10:
            PlasticLookAndFeel.setPlasticTheme(new DesertGreen());
            break;
        case 11:
            PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue());
            break;
        case 12:
            PlasticLookAndFeel.setPlasticTheme(new ExperienceGreen());
            break;
        case 13:
            PlasticLookAndFeel.setPlasticTheme(new SkyBlue());
            break;
        default:
            break;
        }
        return true;
    } catch (NumberFormatException e) {
        return false;
    }
}

From source file:net.littlelite.jurpedemo.frames.AbstractJurpeMain.java

License:Open Source License

/**
 * Set Look And Feel//from  w ww  . j  ava2s  .  c o  m
 * 
 * @param n
 */
protected void setLookAndFeel(JurpeLookAndFeel n) {
    String laf = "";

    switch (n) {
    case XPLATFORM:
        laf = UIManager.getCrossPlatformLookAndFeelClassName();
        break;
    case SYSTEM:
        laf = UIManager.getSystemLookAndFeelClassName();
        break;
    case WINDOWS:
        laf = "com.jgoodies.looks.windows.WindowsLookAndFeel";
        break;
    case METAL:
        laf = "javax.swing.plaf.metal.MetalLookAndFeel";
        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
        break;
    case OCEAN:
        laf = "javax.swing.plaf.metal.MetalLookAndFeel";
        try {
            MetalLookAndFeel.class.getMethod("getCurrentTheme", (Class[]) null);
            MetalLookAndFeel.setCurrentTheme(
                    (MetalTheme) Class.forName("javax.swing.plaf.metal.OceanTheme").newInstance());
        } catch (Exception e) {
            MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
        }
        break;
    case PLASTIC:
        PlasticLookAndFeel.setTabStyle(PlasticLookAndFeel.TAB_STYLE_METAL_VALUE);
        PlasticLookAndFeel.setPlasticTheme(new SkyKrupp());
        laf = "com.jgoodies.looks.plastic.PlasticLookAndFeel";
        break;
    case PLASTICXP:
        PlasticLookAndFeel.setTabStyle(PlasticLookAndFeel.TAB_STYLE_METAL_VALUE);
        PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue());
        laf = "com.jgoodies.looks.plastic.PlasticXPLookAndFeel";
        break;
    case LOOKS:
        PlasticLookAndFeel.setTabStyle(PlasticLookAndFeel.TAB_STYLE_DEFAULT_VALUE);
        PlasticLookAndFeel.setPlasticTheme(new Silver());
        laf = "com.jgoodies.looks.plastic.Plastic3DLookAndFeel";
        break;
    default:
        laf = UIManager.getSystemLookAndFeelClassName();
        break;
    }

    try {
        UIManager.setLookAndFeel(laf);
        SwingUtilities.updateComponentTreeUI(this);
        this.validate();
    } catch (ClassNotFoundException cnfe) {
        this.announce("Unknown Look And Feel: " + laf, true);
    } catch (UnsupportedLookAndFeelException ulafe) {
        this.announce("Unsupported Look And Feel: " + laf, true);
    } catch (Exception e) {
        System.err.println(e.getMessage());
        e.printStackTrace();
    }
}

From source file:org.codehaus.griffon.runtime.lookandfeel.jgoodies.AbstractJGoodiesLookAndFeelHandler.java

License:Apache License

public AbstractJGoodiesLookAndFeelHandler(@Nonnull String name, @Nonnull LookAndFeel lookAndFeel) {
    super("JGoodies - " + name);
    this.lookAndFeel = lookAndFeel;

    List<JGoodiesLookAndFeelDescriptor> lafs = new ArrayList<>();
    lafs.add(new JGoodiesLookAndFeelDescriptor("BrownSugar", new BrownSugar()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("DarkStar", new DarkStar()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("DesertBlue", new DesertBlue()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("DesertBluer", new DesertBluer()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("DesertGreen", new DesertGreen()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("DesertRed", new DesertRed()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("DesertYellow", new DesertYellow()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("ExperienceBlue", new ExperienceBlue()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("ExperienceGreen", new ExperienceGreen()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("ExperienceRoyale", new ExperienceRoyale()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("LightGray", new LightGray()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("Silver", new Silver()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("SkyBlue", new SkyBlue()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("SkyBluer", new SkyBluer()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("SkyGreen", new SkyGreen()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("SkyKrupp", new SkyKrupp()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("SkyPink", new SkyPink()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("SkyRed", new SkyRed()));
    lafs.add(new JGoodiesLookAndFeelDescriptor("SkyYellow", new SkyYellow()));
    this.supportedDescriptors = lafs.toArray(new JGoodiesLookAndFeelDescriptor[lafs.size()]);
}

From source file:org.pdfsam.guiclient.utils.ThemeUtility.java

License:Open Source License

/**
 * Sets the theme/*w ww  .j av  a2 s  . co m*/
 * @param themeNumber Theme number
 */
public static void setTheme(int themeNumber) {
    switch (themeNumber) {
    case 1:
        PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
        break;
    case 2:
        PlasticLookAndFeel.setPlasticTheme(new DesertRed());
        break;
    case 3:
        PlasticLookAndFeel.setPlasticTheme(new Silver());
        break;
    case 4:
        PlasticLookAndFeel.setPlasticTheme(new SkyPink());
        break;
    case 5:
        PlasticLookAndFeel.setPlasticTheme(new SkyKrupp());
        break;
    case 6:
        PlasticLookAndFeel.setPlasticTheme(new SkyYellow());
        break;
    case 7:
        PlasticLookAndFeel.setPlasticTheme(new SkyGreen());
        break;
    case 8:
        PlasticLookAndFeel.setPlasticTheme(new DarkStar());
        break;
    case 9:
        PlasticLookAndFeel.setPlasticTheme(new BrownSugar());
        break;
    case 10:
        PlasticLookAndFeel.setPlasticTheme(new DesertGreen());
        break;
    case 11:
        PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue());
        break;
    case 12:
        PlasticLookAndFeel.setPlasticTheme(new ExperienceGreen());
        break;
    case 13:
        PlasticLookAndFeel.setPlasticTheme(new SkyBlue());
        break;
    case 14:
        PlasticLookAndFeel.setPlasticTheme(new SkyBluer());
        break;
    default:
        break;
    }
}