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

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

Introduction

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

Prototype

String TAB_STYLE_DEFAULT_VALUE

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

Click Source Link

Document

A System property value that indicates that Plastic shall render tabs in the Plastic 1.0 style.

Usage

From source file:ch.fork.AdHocRailway.ui.AdHocRailway.java

License:Open Source License

public AdHocRailway(org.apache.commons.cli.CommandLine parsedCommandLine) {
    super(TITLE);
    try {/*from ww w . jav  a2 s.c  o m*/

        appContext = new ApplicationContext();
        appContext.getMainBus().register(appContext);
        appContext.getMainBus().register(this);
        appContext.setMainApp(this);
        appContext.setMainFrame(this);
        setUpLogging();

        LOGGER.info("****************************************");
        LOGGER.info("AdHoc-Railway starting up!!!");
        LOGGER.info("****************************************");

        PlasticLookAndFeel.setTabStyle(PlasticLookAndFeel.TAB_STYLE_DEFAULT_VALUE);
        PlasticLookAndFeel.setHighContrastFocusColorsEnabled(false);

        UIManager.setLookAndFeel(new PlasticXPLookAndFeel());

        splash = new SplashWindow(createImageIconFromCustom("splash.png"), this, 500, 12);
        setIconImage(createImageIconFromCustom("2-Hot-Train-icon 128.png").getImage());

        initProceeded("Loading Persistence Layer (Preferences)");

        preferences = Preferences.getInstance();
        preferences.loadPreferences(parsedCommandLine.hasOption("c"));
        appContext.setPreferences(preferences);

        railwayDeviceManager = new RailwayDeviceManager(appContext);
        appContext.setRailwayDeviceManager(railwayDeviceManager);
        railwayDeviceManager.loadControlLayer();

        persistenceManager = new PersistenceManager(appContext);
        persistenceManager.loadPersistenceLayer();

        initProceeded("Creating GUI ...");

        initGUI();
        disableEnableMenuItems();
        LOGGER.info("Finished Creating GUI");
        splash.setVisible(false);

        persistenceManager.loadLastFileOrLoadDataFromAdHocServerIfRequested();

        updateGUI();
        railwayDeviceManager.autoConnectToRailwayDeviceIfRequested();

        setSize(1600, 1000);

        initProceeded("AdHoc-Railway started");
        updateCommandHistory("AdHoc-Railway started");
        Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
            @Override
            public void uncaughtException(final Thread t, final Throwable e) {
                handleException(e);
            }
        });
        setLocationByPlatform(true);
        setVisible(true);
    } catch (final Exception e) {
        handleException(e);
    }
}

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

License:Open Source License

/**
 * GoF Factory method.//from   www.  j ava 2s .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:etomica.virial.cluster2.mvc.view.JGoodiesSettings.java

License:Mozilla Public License

public static JGoodiesSettings createDefault() {

    JGoodiesSettings settings = new JGoodiesSettings();
    settings.setSelectedLookAndFeel(new PlasticXPLookAndFeel());
    settings.setSelectedTheme(PlasticLookAndFeel.createMyDefaultTheme());
    settings.setUseNarrowButtons(true);//  ww w . ja  v  a 2s.c o  m
    settings.setTabIconsEnabled(true);
    settings.setPlasticTabStyle(PlasticLookAndFeel.TAB_STYLE_DEFAULT_VALUE);
    settings.setPlasticHighContrastFocusEnabled(false);
    settings.setPopupDropShadowEnabled(null);
    settings.setMenuBarHeaderStyle(null);
    settings.setMenuBarPlasticBorderStyle(null);
    settings.setMenuBarWindowsBorderStyle(null);
    settings.setMenuBar3DHint(null);
    settings.setToolBarHeaderStyle(null);
    settings.setToolBarPlasticBorderStyle(null);
    settings.setToolBarWindowsBorderStyle(null);
    settings.setToolBar3DHint(null);
    return settings;
}

From source file:net.dpml.depot.desktop.Settings.java

License:Apache License

public static Settings createDefault() {
    Settings settings = new Settings();
    settings.setSelectedLookAndFeel(new PlasticXPLookAndFeel());
    //settings.setSelectedTheme(PlasticLookAndFeel.createMyDefaultTheme());
    settings.setSelectedTheme(new Silver());
    settings.setUseSystemFonts(Boolean.TRUE);
    settings.setFontSizeHints(FontSizeHints.MIXED);
    settings.setUseNarrowButtons(false);
    settings.setTabIconsEnabled(true);//from   w w  w .j  a  v  a 2  s  .c o  m
    settings.setPlasticTabStyle(PlasticLookAndFeel.TAB_STYLE_DEFAULT_VALUE);
    settings.setPlasticHighContrastFocusEnabled(false);
    settings.setMenuBarHeaderStyle(null);
    settings.setMenuBarPlasticBorderStyle(null);
    settings.setMenuBarWindowsBorderStyle(null);
    settings.setMenuBar3DHint(null);
    settings.setToolBarHeaderStyle(null);
    settings.setToolBarPlasticBorderStyle(null);
    settings.setToolBarWindowsBorderStyle(null);
    settings.setToolBar3DHint(null);
    return settings;
}

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

License:Open Source License

/**
 * Set Look And Feel//from   w  ww .  ja  v  a 2  s  .  c  om
 * 
 * @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.pms.newgui.LooksFrame.java

License:Open Source License

static void initializeLookAndFeel() {
    if (lookAndFeelInitialized) {
        return;/*  w ww  . j ava  2  s.c  o  m*/
    }

    LookAndFeel selectedLaf = null;
    if (Platform.isWindows()) {
        try {
            selectedLaf = (LookAndFeel) Class.forName("com.jgoodies.looks.windows.WindowsLookAndFeel")
                    .newInstance();
        } catch (Exception e) {
            selectedLaf = new PlasticLookAndFeel();
        }
    } else if (System.getProperty("nativelook") == null && !Platform.isMac()) {
        selectedLaf = new PlasticLookAndFeel();
    } else {
        try {
            String systemClassName = UIManager.getSystemLookAndFeelClassName();
            // workaround for Gnome
            try {
                String gtkLAF = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
                Class.forName(gtkLAF);

                if (systemClassName.equals("javax.swing.plaf.metal.MetalLookAndFeel")) {
                    systemClassName = gtkLAF;
                }
            } catch (ClassNotFoundException ce) {
                logger.error("Error loading GTK look and feel: ", ce);
            }

            logger.trace("Choosing Java look and feel: " + systemClassName);
            UIManager.setLookAndFeel(systemClassName);
        } catch (Exception e1) {
            selectedLaf = new PlasticLookAndFeel();
            logger.error("Error while setting native look and feel: ", e1);
        }
    }

    if (selectedLaf instanceof PlasticLookAndFeel) {
        PlasticLookAndFeel.setPlasticTheme(PlasticLookAndFeel.createMyDefaultTheme());
        PlasticLookAndFeel.setTabStyle(PlasticLookAndFeel.TAB_STYLE_DEFAULT_VALUE);
        PlasticLookAndFeel.setHighContrastFocusColorsEnabled(false);
    } else if (selectedLaf != null && selectedLaf.getClass() == MetalLookAndFeel.class) {
        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    }

    // Work around caching in MetalRadioButtonUI
    JRadioButton radio = new JRadioButton();
    radio.getUI().uninstallUI(radio);
    JCheckBox checkBox = new JCheckBox();
    checkBox.getUI().uninstallUI(checkBox);

    if (selectedLaf != null) {
        try {
            UIManager.setLookAndFeel(selectedLaf);
        } catch (UnsupportedLookAndFeelException e) {
            logger.warn("Can't change look and feel", e);
        }
    }

    lookAndFeelInitialized = true;
}

From source file:org.qedeq.gui.se.main.GuiOptions.java

License:Open Source License

/**
 * Constructor.// w w w  .  j av  a2s .  c om
 */
public GuiOptions() {
    setSelectedLookAndFeel(new PlasticXPLookAndFeel());
    setSelectedTheme(PlasticLookAndFeel.createMyDefaultTheme());
    setUseNarrowButtons(true);
    setTabIconsEnabled(true);
    setPlasticTabStyle(PlasticLookAndFeel.TAB_STYLE_DEFAULT_VALUE);
    setPlasticHighContrastFocusEnabled(false);
    setPopupDropShadowEnabled(null);
    setMenuBarHeaderStyle(null);
    setMenuBarPlasticBorderStyle(null);
    setMenuBarWindowsBorderStyle(null);
    setMenuBar3DHint(null);
    setToolBarHeaderStyle(null);
    setToolBarPlasticBorderStyle(null);
    setToolBarWindowsBorderStyle(null);
    setToolBar3DHint(null);
}