Example usage for com.jgoodies.looks Options JGOODIES_WINDOWS_NAME

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

Introduction

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

Prototype

String JGOODIES_WINDOWS_NAME

To view the source code for com.jgoodies.looks Options JGOODIES_WINDOWS_NAME.

Click Source Link

Document

The class name of the JGoodies Windows L&f.

Usage

From source file:etomica.virial.cluster2.mvc.view.ApplicationUI.java

License:Mozilla Public License

/**
 * Translates the LF_CHOICE field into a LookAndFeel class name.
 *///from   www  .  j  a  v  a2  s  .  c o  m
private static String getLookAndFeel() {

    if (LF_WINDOWS.equalsIgnoreCase(LF_CHOICE)) {
        return Options.JGOODIES_WINDOWS_NAME;
    } else if (LF_PLASTIC.equalsIgnoreCase(LF_CHOICE)) {
        return Options.PLASTIC_NAME;
    } else if (LF_PLASTIC3D.equalsIgnoreCase(LF_CHOICE)) {
        return Options.PLASTIC3D_NAME;
    } else if (LF_PLASTICXP.equalsIgnoreCase(LF_CHOICE)) {
        return Options.PLASTICXP_NAME;
    } else {
        return LF_CHOICE;
    }
}

From source file:net.sf.housekeeper.util.PlatformAwareUIConfigurer.java

License:Open Source License

public void afterPropertiesSet() throws Exception {
    if (configurer == null) {
        configurer = new UIManagerConfigurer();
    }/*from   ww  w  . j ava2 s.  c  om*/

    if (LookUtils.IS_OS_WINDOWS) {
        LOG.info("Windows detected");
        setLookAndFeel(Options.JGOODIES_WINDOWS_NAME);
    } else if (isOS((MAC_OS_X))) {
        LOG.info("Macintosh OS X detected");
        setLookAndFeel(Options.getSystemLookAndFeelClassName());
    } else {
        setLookAndFeel(Options.PLASTICXP_NAME);
    }
}

From source file:org.jutils.apps.filespy.ui.FileSpyFrameView.java

/***************************************************************************
 * @return//  www. j  a v a 2  s  .  c o m
 **************************************************************************/
private JMenu createViewMenu() {
    JMenu viewMenu = new JMenu("View");

    JMenuItem menuItem;

    menuItem = new JMenuItem("JG Windows");
    menuItem.addActionListener(new SetLafListener(Options.JGOODIES_WINDOWS_NAME));
    viewMenu.add(menuItem);

    menuItem = new JMenuItem("Plastic");
    menuItem.addActionListener(new SetLafListener(Options.PLASTIC_NAME));
    viewMenu.add(menuItem);

    menuItem = new JMenuItem("Plastic 3D");
    menuItem.addActionListener(new SetLafListener(Options.PLASTIC3D_NAME));
    viewMenu.add(menuItem);

    menuItem = new JMenuItem("Plastic XP");
    menuItem.addActionListener(new SetLafListener(Options.PLASTICXP_NAME));
    viewMenu.add(menuItem);

    viewMenu.addSeparator();

    menuItem = new JMenuItem("Nimbus");
    menuItem.addActionListener(new SetLafListener("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"));
    viewMenu.add(menuItem);

    return viewMenu;
}

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

License:Open Source License

public static void main(final String[] args) {
    // load configuration file
    try {// w ww .  j a  v a  2s  . c  o  m
        QedeqGuiConfig.init(new File(IoUtility.getStartDirectory("qedeq"), "config/org.qedeq.properties"),
                IoUtility.getStartDirectory("qedeq"));
    } catch (Throwable e) {
        e.printStackTrace();
        JOptionPane.showInternalMessageDialog(null, "Configuration file not found!\n\n" + e,
                "Hilbert II - Error", JOptionPane.ERROR_MESSAGE);
        System.exit(-1);
        return;
    }

    try {
        // we make a local file copy of the log4j.properties if it dosen't exist already
        initLog4J(QedeqGuiConfig.getInstance());
    } catch (Throwable e) {
        e.printStackTrace();
        JOptionPane.showMessageDialog(null, "Initialization of Log4J failed!\n\n" + e, "Hilbert II - Error",
                JOptionPane.ERROR_MESSAGE);
        System.exit(-2);
        return;
    }

    try {
        final GuiOptions options = new GuiOptions();
        {
            String lafShortName = QedeqGuiConfig.getInstance().getLookAndFeel();
            String lafClassName;
            if ("Windows".equalsIgnoreCase(lafShortName)) {
                lafClassName = Options.JGOODIES_WINDOWS_NAME;
            } else if ("Plastic".equalsIgnoreCase(lafShortName)) {
                lafClassName = Options.PLASTIC_NAME;
            } else if ("Plastic3D".equalsIgnoreCase(lafShortName)) {
                lafClassName = Options.PLASTIC3D_NAME;
            } else if ("PlasticXP".equalsIgnoreCase(lafShortName)) {
                lafClassName = Options.PLASTICXP_NAME;
            } else if ("Metal".equalsIgnoreCase(lafShortName)) {
                lafClassName = "javax.swing.plaf.metal.MetalLookAndFeel";
            } else {
                lafClassName = lafShortName;
            }
            options.setSelectedLookAndFeel(lafClassName);
        }
        final QedeqMainFrame instance;
        try {
            instance = new QedeqMainFrame(options);
        } catch (IOException e) {
            e.printStackTrace(System.out);
            JOptionPane.showMessageDialog(null, "Application start failed!\n\n" + e, "Hilbert II - Error",
                    JOptionPane.ERROR_MESSAGE);
            KernelContext.getInstance().shutdown();
            System.exit(-3);
            return;
        }
        instance.setSize(PREFERRED_SIZE);
        Dimension paneSize = instance.getSize();
        Dimension screenSize = instance.getToolkit().getScreenSize();
        instance.setLocation((screenSize.width - paneSize.width) / 2,
                (screenSize.height - paneSize.height) / 2);
        instance.setVisible(true);

        // wait till GUI is ready
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                // now we are ready to fire up the kernel
                KernelContext.getInstance().startup();
            }
        });
    } catch (Throwable e) {
        e.printStackTrace(System.out);
        Trace.fatal(QedeqMainFrame.class, "main(String[])", "Unexpected major failure!", e);
        JOptionPane.showMessageDialog(null, "Unexpected major failure!\n\n" + e, "Hilbert II - Error",
                JOptionPane.ERROR_MESSAGE);
        System.exit(-4);
        return;
    }
}