当前位置: 首页>>代码示例>>Java>>正文


Java Options.getCrossPlatformLookAndFeelClassName方法代码示例

本文整理汇总了Java中com.jgoodies.looks.Options.getCrossPlatformLookAndFeelClassName方法的典型用法代码示例。如果您正苦于以下问题:Java Options.getCrossPlatformLookAndFeelClassName方法的具体用法?Java Options.getCrossPlatformLookAndFeelClassName怎么用?Java Options.getCrossPlatformLookAndFeelClassName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jgoodies.looks.Options的用法示例。


在下文中一共展示了Options.getCrossPlatformLookAndFeelClassName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureUI

import com.jgoodies.looks.Options; //导入方法依赖的package包/类
/**
 * Configures the UI; tries to set the system look on Mac,
 * <code>WindowsLookAndFeel</code> on general Windows, and
 * <code>Plastic3DLookAndFeel</code> on Windows XP and all other OS.<p>
 *
 * The JGoodies Swing Suite's <code>ApplicationStarter</code>,
 * <code>ExtUIManager</code>, and <code>LookChoiceStrategies</code>
 * classes provide a much more fine grained algorithm to choose and
 * restore a look and theme.
 */
private void configureUI ()
{
    UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
    //Options.setGlobalFontSizeHints(FontSizeHints.MIXED);
    Options.setDefaultIconSize(new Dimension(18, 18));

    String lafName
            = LookUtils.IS_OS_WINDOWS_XP
                    ? Options.getCrossPlatformLookAndFeelClassName()
                    : Options.getSystemLookAndFeelClassName();

    try {
        UIManager.setLookAndFeel(lafName);
    } catch (Exception e) {
        System.err.println("Can't set look & feel:" + e);
    }
}
 
开发者ID:Audiveris,项目名称:audiveris,代码行数:28,代码来源:Tiny.java

示例2: configureUI

import com.jgoodies.looks.Options; //导入方法依赖的package包/类
/**
 * Configures the UI; tries to set the system look on Mac, 
 * <code>WindowsLookAndFeel</code> on general Windows, and
 * <code>Plastic3DLookAndFeel</code> on Windows XP and all other OS.<p>
 * 
 * The JGoodies Swing Suite's <code>ApplicationStarter</code>,
 * <code>ExtUIManager</code>, and <code>LookChoiceStrategies</code>
 * classes provide a much more fine grained algorithm to choose and
 * restore a look and theme.
 */
private void configureUI() {
    UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
    //Options.setGlobalFontSizeHints(FontSizeHints.MIXED);
    Options.setDefaultIconSize(new Dimension(18, 18));

    String lafName =
        LookUtils.IS_OS_WINDOWS_XP
            ? Options.getCrossPlatformLookAndFeelClassName()
            : Options.getSystemLookAndFeelClassName();

    try {
        UIManager.setLookAndFeel(lafName);
    } catch (Exception e) {
        System.err.println("Can't set look & feel:" + e);
    }
}
 
开发者ID:jlpoolen,项目名称:libreveris,代码行数:27,代码来源:Tiny.java

示例3: startup

import com.jgoodies.looks.Options; //导入方法依赖的package包/类
/** At startup create and show the main frame of the application. */
@Override
protected void startup() {
    //UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
    //Options.setDefaultIconSize(new Dimension(18, 18));
    String lafName =
            LookUtils.IS_OS_WINDOWS
            ? Options.getCrossPlatformLookAndFeelClassName()
            : Options.getSystemLookAndFeelClassName();

    try {
        UIManager.setLookAndFeel(lafName);
        logger.info("Look and feel name: " + lafName);
    } catch (Exception e) {
        logger.error("Can't set look & feel:" + e, e);
    }

    /*
    PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
    try {
    UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
    } catch (Exception e) {
    }
     *
     */
    NeuGenView ngView = new NeuGenView(this);
    ngView.getFrame().setLocationRelativeTo(null);

    NeuGenView.setInstance(ngView);
    show(ngView);
}
 
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:32,代码来源:NeuGenApp.java

示例4: initLookAndFeel

import com.jgoodies.looks.Options; //导入方法依赖的package包/类
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
    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( ClassNotFoundException | IllegalAccessException | InstantiationException |
                   UnsupportedLookAndFeelException ex )
            {
                System.err.println( "Unable to set LookAndFeel, use default LookAndFeel.\n" + ex.getMessage() );
            }
        }
    }
}
 
开发者ID:apache,项目名称:polygene-java,代码行数:52,代码来源:Envisage.java


注:本文中的com.jgoodies.looks.Options.getCrossPlatformLookAndFeelClassName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。