Example usage for com.jgoodies.looks Options getCrossPlatformLookAndFeelClassName

List of usage examples for com.jgoodies.looks Options getCrossPlatformLookAndFeelClassName

Introduction

In this page you can find the example usage for com.jgoodies.looks Options getCrossPlatformLookAndFeelClassName.

Prototype

public static String getCrossPlatformLookAndFeelClassName() 

Source Link

Document

Returns the class name for a cross-platform LookAndFeel .

Usage

From source file:de.maklerpoint.office.Gui.CRMView.java

License:Open Source License

private void plasticMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_plasticMenuItemActionPerformed
    String name = LookUtils.IS_OS_WINDOWS_XP ? Options.getCrossPlatformLookAndFeelClassName()
            : Options.getSystemLookAndFeelClassName();

    configureUI(name);// w w  w .  jav a2s  . c  o  m
}

From source file:de.xplib.xdbm.ui.Settings.java

License:Open Source License

/**
 * GoF Factory method./*from  w  w w . ja  v a2s .co m*/
 * 
 * @return A <code>Settings</code> instance.
 */
public static Settings createDefault() {
    Settings settings = new Settings();
    //settings.setSelectedLookAndFeel(new PlasticXPLookAndFeel());
    settings.setSelectedLookAndFeel(new Plastic3DLookAndFeel());
    //settings.setSelectedTheme(PlasticLookAndFeel.createMyDefaultTheme());
    settings.setSelectedTheme(new SkyBluerTahoma());
    settings.setUseSystemFonts(Boolean.TRUE);
    settings.setFontSizeHints(FontSizeHints.MIXED);
    settings.setUseNarrowButtons(false);
    settings.setTabIconsEnabled(true);
    settings.setPlasticTabStyle(PlasticLookAndFeel.TAB_STYLE_DEFAULT_VALUE);
    settings.setPlasticHighContrastFocusEnabled(false);
    settings.setMenuBarHeaderStyle(null);
    settings.setMenuBarPlasticBorderStyle(null);
    settings.setMenuBarWindowsBorderStyle(null);
    settings.setMenuBar3DHint(Boolean.TRUE);
    settings.setToolBarHeaderStyle(null);
    settings.setToolBarPlasticBorderStyle(null);
    settings.setToolBarWindowsBorderStyle(null);
    settings.setToolBar3DHint(Boolean.TRUE);
    settings.setPopupDropShadowEnabled(Boolean.TRUE);

    String name = LookUtils.IS_OS_WINDOWS_XP ? Options.getCrossPlatformLookAndFeelClassName()
            : Options.getSystemLookAndFeelClassName();

    try {
        settings.setSelectedLookAndFeel((LookAndFeel) Class.forName(name).newInstance());
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    }

    return settings;
}

From source file:net.dpml.depot.prefs.DepotPreferencesFrame.java

License:Apache License

private void configureUI() {

    UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
    Options.setGlobalFontSizeHints(FontSizeHints.MIXED);
    Options.setDefaultIconSize(new Dimension(18, 18));

    String lafName = LookUtils.IS_OS_WINDOWS_XP ? Options.getCrossPlatformLookAndFeelClassName()
            : Options.getSystemLookAndFeelClassName();

    com.jgoodies.looks.plastic.PlasticLookAndFeel
            .setMyCurrentTheme(new com.jgoodies.looks.plastic.theme.SkyBlue());
    try {/*from   w  ww  .j  a v  a 2  s .  c o  m*/
        UIManager.setLookAndFeel(lafName);
    } catch (Exception e) {
        System.err.println("Can't set look & feel:" + e);
    }
}

From source file:org.neugen.gui.NeuGenApp.java

License:Open Source License

/** At startup create and show the main frame of the application. */
@Override//from  w w  w .j  a  v a 2s  . c o m
protected void startup() {
    //UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
    //Options.setDefaultIconSize(new Dimension(18, 18));
    String lafName = LookUtils.IS_OS_WINDOWS ? Options.getCrossPlatformLookAndFeelClassName()
            : Options.getSystemLookAndFeelClassName();

    try {
        UIManager.setLookAndFeel(lafName);
        logger.info("Look and feel name: " + lafName);
    } catch (Exception e) {
        logger.error("Can't set look & feel:" + e, e);
    }

    /*
    PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
    try {
    UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
    } catch (Exception e) {
    }
     *
     */
    NeuGenView ngView = new NeuGenView(this);
    ngView.getFrame().setLocationRelativeTo(null);

    NeuGenView.setInstance(ngView);
    show(ngView);
}

From source file:org.qi4j.envisage.Envisage.java

License:Apache License

private void initLookAndFeel() {
    String osName = System.getProperty("os.name").toUpperCase();

    // set to use swing anti alias text only for JVM <= 1.5
    System.setProperty("swing.aatext", "true");

    // set default swing bold to false, only for JVM 1.5 or above
    UIManager.put("swing.boldMetal", Boolean.FALSE);

    // set LaF/*from  ww  w .  j a  va 2 s  . c  o m*/
    LookAndFeel lnf = UIManager.getLookAndFeel();
    if (lnf != null && lnf.getID().equalsIgnoreCase("Metal")) {
        final String lnfClassName;
        if (osName.startsWith("MAC")) {
            System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Envisage"); //TODO i18n
            System.setProperty("apple.laf.useScreenMenuBar", "true");
            lnfClassName = UIManager.getSystemLookAndFeelClassName();
        } else if (osName.startsWith("WINDOWS")) {
            UIManager.put("ClassLoader", LookUtils.class.getClassLoader());
            lnfClassName = Options.getSystemLookAndFeelClassName();
            Options.setUseNarrowButtons(false);
        } else {
            UIManager.put("ClassLoader", LookUtils.class.getClassLoader());
            lnfClassName = Options.getCrossPlatformLookAndFeelClassName();
            PlasticLookAndFeel.setTabStyle(PlasticLookAndFeel.TAB_STYLE_METAL_VALUE);
            PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue());
            Options.setUseNarrowButtons(false);
            //PlasticLookAndFeel.setMyCurrentTheme(new ExperienceBlueDefaultFont());  // for CJK Font
        }

        if (lnfClassName != null) {
            try {
                UIManager.setLookAndFeel(lnfClassName);
            } catch (Exception ex) {
                System.err.println("Unable to set LookAndFeel, use default LookAndFeel.\n" + ex.getMessage());
            }
        }
    }
}

From source file:progresswatcher.GuiHelper.java

License:Open Source License

/**
 * Set a new look and feel//from   w ww  .j  av a  2  s .c  o  m
 */
public static void configureUI() {
    UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
    Options.setDefaultIconSize(new Dimension(18, 18));

    String lafName = LookUtils.IS_OS_WINDOWS_XP ? Options.getCrossPlatformLookAndFeelClassName()
            : Options.getSystemLookAndFeelClassName();

    try {
        UIManager.setLookAndFeel(lafName);
    } catch (Exception e) {
        System.err.println("Can't set look & feel:" + e);
    }
}

From source file:uk.nhs.cfh.dsp.srth.desktop.appservice.utils.LookAndFeelUtils.java

License:Apache License

/**
 * Sets the default lnf.//from w ww .ja  v  a 2 s .  c om
 */
public static void setDefaultLNF() {

    UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
    Options.setDefaultIconSize(new Dimension(dim, dim));

    String lafName = Options.getCrossPlatformLookAndFeelClassName();
    // set look and feel
    if (LookUtils.IS_OS_WINDOWS || LookUtils.IS_OS_MAC) {
        lafName = UIManager.getSystemLookAndFeelClassName();
    }

    logger.info("Setting look and feel to : " + lafName);
    // set the look n feel
    try {
        UIManager.setLookAndFeel(lafName);
        LookAndFeelFactory.installDefaultLookAndFeel();
        LookAndFeelFactory.installDefaultLookAndFeelAndExtension();
    } catch (Exception e) {
        logger.warning("Nested exception is : " + e.fillInStackTrace());
    }
}