Example usage for com.jgoodies.looks Options setUseSystemFonts

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

Introduction

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

Prototype

public static void setUseSystemFonts(boolean useSystemFonts) 

Source Link

Document

Sets a value in the UIManager to indicate, that a look&feel may use the native system fonts.

Usage

From source file:ambit2.ui.test.QueryBrowserTest.java

License:Open Source License

@Test
public void test() throws Exception {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    //UIManager.setLookAndFeel(Options.getSystemLookAndFeelClassName());
    Options.setPopupDropShadowEnabled(true);
    Options.setUseSystemFonts(true);
    TestTableModel dataModel = new TestTableModel();
    /*/*from w w w  .j  a v  a 2 s.  co m*/
    AbstractTableModel dataModel = new AbstractTableModel()  {
       public int getColumnCount() {
    return 10;
       }
       public int getRowCount() {
    return 33;
       }
       public Object getValueAt(int row, int col) {
    return new Integer((row+1)*(col));
       }
    };
    */

    //QueryBrowser<TestTableModel> browser = new QueryBrowser<TestTableModel>();
    //QueryBrowser<BrowsableTableModel> browser = new QueryBrowser<BrowsableTableModel>(new BrowsableTableModel(dataModel));
    QueryBrowser<BrowsableTableModel> browser = new QueryBrowser<BrowsableTableModel>() {
        protected int setRecord(int row, int col) {
            int record = super.setRecord(row, col);
            System.out.println("Record " + record);
            return record;
        }
    };
    browser.setObject(new BrowsableTableModel(dataModel));
    browser.setPreferredSize(new Dimension(800, 600));
    JOptionPane.showMessageDialog(null, browser, "", JOptionPane.PLAIN_MESSAGE, null);
}

From source file:com.salas.bb.core.ApplicationLauncher.java

License:Open Source License

/**
 * Configures fonts./*from  w  w  w.ja  va 2  s .  c om*/
 */
private void configureFonts() {
    Options.setUseSystemFonts(true);

    if (SystemUtils.IS_OS_LINUX)
        PlasticLookAndFeel.setFontPolicy(new SmallPlasticFontPolicy());
}

From source file:cytoscape.CyMain.java

License:Open Source License

protected void setupLookAndFeel() {
    try {/*from   w  w  w  .j ava  2  s.co  m*/
        if (LookUtils.IS_OS_WINDOWS) {
            /*
             * For Windows: just use platform default look & feel.
             */
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        } else if (LookUtils.IS_OS_MAC) {
            /*
             * For Mac: move menu bar to OS X default bar (next to Apple
             * icon)
             */
            System.setProperty("apple.laf.useScreenMenuBar", "true");

        } else {
            final JavaVersion javaVersion = JavaVersion.getJavaVersion();
            if (javaVersion.getMajor() >= 2 || javaVersion.getMinor() > 6
                    || (javaVersion.getMinor() == 6 && javaVersion.getUpdate() >= 10))
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
            else {
                /*
                 * For Unix platforms, use JGoodies Looks
                 */
                UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
                Plastic3DLookAndFeel.set3DEnabled(true);
                Plastic3DLookAndFeel.setCurrentTheme(new com.jgoodies.looks.plastic.theme.SkyBluer());
                Plastic3DLookAndFeel.setTabStyle(Plastic3DLookAndFeel.TAB_STYLE_METAL_VALUE);
                Plastic3DLookAndFeel.setHighContrastFocusColorsEnabled(true);

                Options.setDefaultIconSize(new Dimension(18, 18));
                Options.setHiResGrayFilterEnabled(true);
                Options.setPopupDropShadowEnabled(true);
                Options.setUseSystemFonts(true);

                UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
                UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
            }
        }
    } catch (Exception e) {
        logger.warn("Can't set look & feel:" + e.getMessage(), e);
    }
}

From source file:musite.MusiteMain.java

License:Open Source License

private static void setupLookAndFeel() {
    try {//from ww w .j a v a 2 s . c  o m
        if (SystemUtils.IS_OS_WINDOWS) {
            /*
             * For Windows: just use platform default look & feel.
             */
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        } else if (SystemUtils.IS_OS_MAC) {
            /*
             * For Mac: move menue bar to OS X default bar (next to Apple
             * icon)
             */
            System.setProperty("apple.laf.useScreenMenuBar", "true");
        } else {
            /*
             * For Unix platforms, use JGoodies Looks
             */
            UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
            Plastic3DLookAndFeel.set3DEnabled(true);
            Plastic3DLookAndFeel.setCurrentTheme(new com.jgoodies.looks.plastic.theme.SkyBluer());
            Plastic3DLookAndFeel.setTabStyle(Plastic3DLookAndFeel.TAB_STYLE_METAL_VALUE);
            Plastic3DLookAndFeel.setHighContrastFocusColorsEnabled(true);

            Options.setDefaultIconSize(new Dimension(18, 18));
            Options.setHiResGrayFilterEnabled(true);
            Options.setPopupDropShadowEnabled(true);
            Options.setUseSystemFonts(true);

            UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
            UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:org.springframework.richclient.application.config.JGoodiesLooksConfigurer.java

License:Apache License

/**
 * @param enabled set to <code>true</code> if narrow buttons should be used.
 * @see com.jgoodies.looks.Options#setUseSystemFonts(boolean)
 *///from ww w  .  j a  v  a2s .c  o m
public void setUseSystemFonts(boolean enabled) {
    Options.setUseSystemFonts(enabled);
}

From source file:xapps.browser.api.MostMain.java

License:Open Source License

/**
 * Class Constructor.//  ww  w . ja  va  2  s .co  m
 */
public void setLnF() {

    try {

        // Set the look and feel early
        // Java Web Start
        // If you use a third party l&f in a network launchable environment such as Java Web Start, you must indicate where to find the l&f classes:
        UIManager.put("ClassLoader", LookUtils.class.getClassLoader());

        try {
            if (!SystemUtils.isMac()) {
                PlasticXPLookAndFeel.setMyCurrentTheme(new ExperienceBlue());
                UIManager.setLookAndFeel(new com.jgoodies.looks.plastic.PlasticXPLookAndFeel());
                //UIManager.setLookAndFeel(new com.jgoodies.looks.));
                //PlasticLookAndFeel.setMyCurrentTheme(new Silver());
                //UIManager.setLookAndFeel(new com.jgoodies.looks.plastic.PlasticLookAndFeel());

            }

        } catch (Throwable t) {
            t.printStackTrace();
        }
        //UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
        //UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
        //UIManager.setLookAndFeel("com.jgoodies.looks.plastic.ExtWindowsLookAndFeel");
        // PlasticXPLookAndFeel.setMyCurrentTheme(new DarkStar());
        //PlasticXPLookAndFeel.setMyCurrentTheme(new DesertBlue());

        // Some UI tweaks thanks to jgoodies suggestions
        // You can force the JGoodies looks and the 1.4 versions of the
        // // Sun looks to use system fonts using a String key, or JGoodies constant:
        UIManager.put("Application.useSystemFontSettings", Boolean.TRUE);
        UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);

        // In Microsoft environments that use Tahoma as dialog font, you can
        // tweak the choosen font sizes by setting optional JGoodies font size hints. The global hints can be overriden by look-specific hints:
        Options.setUseSystemFonts(true);
        // @note api deprecated jgoodies 2.0 feb 2006
        //setGlobalFontSizeHints(FontSizeHints.MIXED);

        // Dont know if the font stuff actualy did anything!!

        //You can choose between two styles for Plastic focus colors: low vs. high contrast;
        // the default is low. You can choose one of:
        //PlasticXPLookAndFeel.setHighContrastFocusColorsEnabled(true);

        // lthough ClearLook will typlically improve the appearance of your application,
        // it may lead to incompatible layout, and so, it is switched off by default.
        // You can switch it on, enable a verbose mode, which will log reports about
        // the performed modifications to the console or use the debug mode. In debug mode,
        // ClearLook will mark decorations that it has identified as visual clutter using saturated colors.

        //ClearLookManager.setMode(ClearLookMode.DEBUG);

        // enable tooltips application wide
        ToolTipManager.sharedInstance().setEnabled(true);

        // make tooltips persist for a wee bit longer than the default
        ToolTipManager.sharedInstance().setDismissDelay(15 * 1000);

    } catch (Exception e) {
        e.printStackTrace();
    }

}