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

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

Introduction

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

Prototype

public static void setFontPolicy(FontPolicy fontPolicy) 

Source Link

Document

Sets the FontPolicy to be used with the JGoodies Plastic L&F family.

Usage

From source file:br.arthur.temp.tests.JCalendarDemo.java

License:Open Source License

/**
 * Installs the JGoodies Look & Feels, if available, in classpath.
 *//*w  ww  . ja  va  2s .  c  om*/
public final void initializeLookAndFeels() {
    // if in classpath thry to load JGoodies Plastic Look & Feel
    try {
        LookAndFeelInfo[] lnfs = UIManager.getInstalledLookAndFeels();
        boolean found = false;
        for (int i = 0; i < lnfs.length; i++) {
            if (lnfs[i].getName().equals("JGoodies Plastic 3D")) {
                found = true;
            }
        }
        if (!found) {
            UIManager.installLookAndFeel("JGoodies Plastic 3D",
                    "com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
        }
        String os = System.getProperty("os.name");
        FontSet fontSet = null;
        if (os.startsWith("Windows")) {
            fontSet = FontSets.createDefaultFontSet(new Font("arial unicode MS", Font.PLAIN, 12));
        } else {
            fontSet = FontSets.createDefaultFontSet(new Font("arial unicode", Font.PLAIN, 12));
        }
        FontPolicy fixedPolicy = FontPolicies.createFixedPolicy(fontSet);
        PlasticLookAndFeel.setFontPolicy(fixedPolicy);

        UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
    } catch (Throwable t) {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

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

License:Open Source License

/**
 * Configures fonts.//w w  w  .ja  v a  2 s. c o  m
 */
private void configureFonts() {
    Options.setUseSystemFonts(true);

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

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

License:Apache License

/**
 * @param fontPolicy the font policy.//  w  w  w.  j  a va 2s . c om
 * @see com.jgoodies.looks.plastic.PlasticLookAndFeel#setFontPolicy(com.jgoodies.looks.FontPolicy)
 */
public void setFontSizeHints(FontPolicy fontPolicy) {
    PlasticLookAndFeel.setFontPolicy(fontPolicy);
}