Example usage for com.jgoodies.looks.plastic PlasticLookAndFeel TAB_STYLE_METAL_VALUE

List of usage examples for com.jgoodies.looks.plastic PlasticLookAndFeel TAB_STYLE_METAL_VALUE

Introduction

In this page you can find the example usage for com.jgoodies.looks.plastic PlasticLookAndFeel TAB_STYLE_METAL_VALUE.

Prototype

String TAB_STYLE_METAL_VALUE

To view the source code for com.jgoodies.looks.plastic PlasticLookAndFeel TAB_STYLE_METAL_VALUE.

Click Source Link

Document

A System property value that indicates that Plastic shall render tabs in the Metal L&F style.

Usage

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

License:Open Source License

/**
 * Set Look And Feel/*from   w w w. j av a 2s.  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:net.sf.nmedit.nomad.core.NomadLoader.java

License:Open Source License

private void initLookAndFeel(String lafClassName, String themeClassName, String defaultLafOnPlatform) {
    EnumSet<Platform.OS> defaultLafPlatforms = EnumSet.noneOf(Platform.OS.class);
    {//from   w w  w.  ja  v a2 s.com
        // remove whitespace + lowercase
        defaultLafOnPlatform = defaultLafOnPlatform.replaceAll("\\s", "").toLowerCase();
        // split comma separated list
        String[] dlop = defaultLafOnPlatform.split(",");
        // check items
        for (String s : dlop) {
            if (s.equals("all")) {
                // on all platforms
                defaultLafPlatforms.addAll(EnumSet.allOf(Platform.OS.class));
                break;
            } else if (s.equals("mac")) {
                defaultLafPlatforms.add(Platform.OS.MacOSFlavor);
            } else if (s.equals("unix")) {
                defaultLafPlatforms.add(Platform.OS.UnixFlavor);
            } else if (s.equals("windows")) {
                defaultLafPlatforms.add(Platform.OS.WindowsFlavor);
            }
        }
    }

    // jgoodies specific properties

    PlasticLookAndFeel.setTabStyle(PlasticLookAndFeel.TAB_STYLE_METAL_VALUE);
    //UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY, Boolean.FALSE);
    Options.setPopupDropShadowEnabled(false);
    Options.setUseNarrowButtons(true);

    //UIManager.put(Options.PLASTIC_MENU_FONT_KEY, new FontUIResource("Verdana", Font.PLAIN, 9));
    //PlasticLookAndFeel.setFontPolicy(FontPolicies.getDefaultWindowsPolicy());
    /*
            UIManager.put("MenuItem.margin", new InsetsUIResource(2,2,1,2));
            UIManager.put("Menu.margin", new InsetsUIResource(1,2,1,2));
            */
    // set the metal theme

    if (defaultLafPlatforms.contains(Platform.flavor())) {
        // use default LAF on current platform

        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Throwable e) {
            Log log = LogFactory.getLog(getClass());
            log.warn("could not set look and feel theme", e);

        }

        if (Platform.isFlavor(Platform.OS.MacOSFlavor)) {
            System.setProperty("apple.laf.useScreenMenuBar", "true");
        }

    } else {
        // use LAF setting

        MetalTheme theme = null;
        if (themeClassName != null) {
            try {
                theme = (MetalTheme) Class.forName(themeClassName).newInstance();
                UIManager.put("Plastic.theme", themeClassName);

                if (theme instanceof PlasticTheme) {
                    PlasticLookAndFeel.setPlasticTheme((PlasticTheme) theme);
                    // PlasticLookAndFeel.setTabStyle(settings.getPlasticTabStyle());
                } else if (theme instanceof MetalTheme) {
                    MetalLookAndFeel.setCurrentTheme(theme);
                }

            } catch (Throwable e) {
                Log log = LogFactory.getLog(getClass());
                log.warn("could not set look and feel theme", e);
            }
        }
        // set the look and feel
        if (lafClassName != null) {
            try {
                LookAndFeel LAF = (LookAndFeel) Class.forName(lafClassName).newInstance();
                // it is very important to set the classloader  
                UIManager.getDefaults().put("ClassLoader", getClass().getClassLoader());
                UIManager.setLookAndFeel(LAF);
            } catch (Throwable e) {
                Log log = LogFactory.getLog(getClass());
                log.warn("could not set custom look and feel", e);
            }
        }
    }

}

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  ava2  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:org.tentackle.plaf.tlooks.TLooksLookAndFeel.java

License:Open Source License

public void configureTLooksLookAndFeel() {
    PlasticLookAndFeel.setTabStyle(PlasticLookAndFeel.TAB_STYLE_METAL_VALUE);
    PlasticLookAndFeel.set3DEnabled(true);
    Options.setPopupDropShadowEnabled(true);
    UIManager.put(Options.PLASTIC_MICRO_LAYOUT_POLICY_KEY, TLooksMicroLayoutPolicies.getDefaultPlasticPolicy());
}

From source file:org.wremja.launcher.Launcher.java

License:Open Source License

/**
 * Initialize the look & feel of the application.
 *///from  www. jav a2  s  .  c  o m
private static void initLookAndFeel() {
    LOG.debug("Initializing look and feel ...");

    // enable antialiasing
    System.setProperty("swing.aatext", "true");

    // use Xrender pipeline on Linux, if available
    System.setProperty("sun.java2d.xrender", "true");

    try {
        // a) Try windows
        UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
        Plastic3DLookAndFeel.setTabStyle(PlasticLookAndFeel.TAB_STYLE_METAL_VALUE);
        Plastic3DLookAndFeel.setHighContrastFocusColorsEnabled(true);
    } catch (UnsupportedLookAndFeelException e) {
        // b) Try system look & feel
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception ex) {
            LOG.error(ex, ex);
        }
    }
    String s = LookAndFeelAddons.getBestMatchAddonClassName();
    try {
        LookAndFeelAddons.setAddon(s);
    } catch (Exception e) {
        LOG.warn(e, e);
    }
}

From source file:salomon.engine.controller.LocalController.java

License:Open Source License

/**
 * @see salomon.engine.controller.IController#start(salomon.engine.platform.IManagerEngine)
 *//*  ww  w  .  j  a  v a  2  s .  c  om*/
public void start(IManagerEngine managerEngine) {
    _managerEngine = managerEngine;
    SplashScreen.show();
    try {
        PlasticLookAndFeel.setTabStyle(PlasticLookAndFeel.TAB_STYLE_METAL_VALUE);
        PlasticLookAndFeel.setMyCurrentTheme(new ExperienceBlue());
        UIManager.setLookAndFeel(new PlasticXPLookAndFeel());
    } catch (Exception e) {
        LOGGER.warn("Cannot set look&feel!", e); //$NON-NLS-1$
    }
    //TODO: add cascade model support (?)
    try {
        _solutionManagerGUI = new SolutionManagerGUI(_managerEngine.getSolutionManager());
        _projectManagerGUI = new ProjectManagerGUI(_managerEngine.getProjectManager());
        _taskManagerGUI = new TaskManagerGUI(_managerEngine.getTasksManager());
        _pluginMangerGUI = new PluginManagerGUI(_managerEngine.getPluginManager());
    } catch (PlatformException e) {
        LOGGER.fatal("", e); //$NON-NLS-1$
        Utils.showErrorMessage("ERR_CANNOT_SHOW_GUI"); //$NON-NLS-1$
        return;
    }

    _actionManager = new ActionManager(_solutionManagerGUI, _projectManagerGUI, _taskManagerGUI,
            _pluginMangerGUI);

    _guiMenu = new LocalGUIMenu(_actionManager);
    ControllerFrame frame = new ControllerFrame();
    _solutionManagerGUI.setParent(frame);
    _projectManagerGUI.setParent(frame);
    _pluginMangerGUI.setParent(frame);
    _taskManagerGUI.setParent(frame);

    _solutionManagerGUI.setActionManager(_actionManager);
    _pluginMangerGUI.setActionManager(_actionManager);
    _taskManagerGUI.setActionManager(_actionManager);
    _projectManagerGUI.setTaskManagerGUI(_taskManagerGUI);

    SplashScreen.hide();

    frame.setContentPane(getJContentPane());
    frame.setJMenuBar(getJMenuBar());
    frame.setJToolBar(getToolBar());
    frame.setControllerPanel(_contentPane);
    Utils.setParent(frame);

    //showSolutionChooser();
    _solutionManagerGUI.showSolutionChooser();
}