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


Java PlasticLookAndFeel.setPlasticTheme方法代码示例

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


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

示例1: main

import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
public static void main(String[] args)
{
    LOGGER.info("Starting JFreeStock version: " + VERSION);

    try
    {
        PlasticLookAndFeel.setPlasticTheme(new Silver());
        UIManager.setLookAndFeel(new PlasticXPLookAndFeel());
    }
    catch (Exception e)
    {
        LOGGER.error("Failed to set look and feel", e);
        System.exit(1);
    }

    JFreeStockFrame frame = new JFreeStockFrame();
    frame.setVisible(true);
}
 
开发者ID:joshpassenger,项目名称:jfreestock,代码行数:19,代码来源:JFreeStockApp.java

示例2: setLookAndTheme

import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
public static void setLookAndTheme(LookAndFeel laf, Object theme)
/* 134:    */     throws UnsupportedLookAndFeelException
/* 135:    */   {
/* 136:419 */     if (((laf instanceof PlasticLookAndFeel)) && (theme != null) && ((theme instanceof PlasticTheme))) {
/* 137:422 */       PlasticLookAndFeel.setPlasticTheme((PlasticTheme)theme);
/* 138:    */     }
/* 139:424 */     UIManager.setLookAndFeel(laf);
/* 140:    */   }
 
开发者ID:xiwc,项目名称:confluence.keygen,代码行数:9,代码来源:LookUtils.java

示例3: setLookAndFeel

import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
/**
 * Sets the look and feel to the default utilities look and feel. First
 * tries to use Nimbus, if Nimbus is not supported then PlasticXPLookAndFeel
 * is used.
 * 
 * @exception IOException exception somehow thrown when starting from a zip file
 * @return true if the Nimbus look and feel is used, false otherwise
 */
public static boolean setLookAndFeel() throws IOException {

    boolean nimbusLookAndFeelFound = false;

    try {
        for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                nimbusLookAndFeelFound = true;
                break;
            }
        }
    } catch (Exception e) {
        // ignore error, use look and feel below
    }

    if (!nimbusLookAndFeelFound) {
        try {
            PlasticLookAndFeel.setPlasticTheme(new SkyKrupp());
            UIManager.setLookAndFeel(new PlasticXPLookAndFeel());
        } catch (Exception ex) {
            // this should not be possible...
            // use default look and feel
        }
    }

    return nimbusLookAndFeelFound;
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:37,代码来源:UtilitiesGUIDefaults.java

示例4: setLookAndFeel

import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
/**
 * Sets the look and feel. First tries to use Nimbus, if Nimbus is not
 * supported then PlasticXPLookAndFeel is used.
 *
 * @return true if the Nimbus look and feel is used, false otherwise
 */
public static boolean setLookAndFeel() {

    boolean nimbusLookAndFeelFound = false;

    try {
        for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                nimbusLookAndFeelFound = true;
                break;
            }
        }
    } catch (Exception e) {
        // ignore error, use look and feel below
    }

    if (!nimbusLookAndFeelFound) {
        try {
            PlasticLookAndFeel.setPlasticTheme(new SkyKrupp());
            UIManager.setLookAndFeel(new PlasticXPLookAndFeel());
        } catch (UnsupportedLookAndFeelException ex) {
            // this should not be possible...
        }
    }

    return nimbusLookAndFeelFound;
}
 
开发者ID:compomics,项目名称:mitraq,代码行数:34,代码来源:MiTRAQ.java

示例5: configureUI

import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
private void configureUI() {
	Options.setDefaultIconSize(new Dimension(18, 18));

	Options.setUseNarrowButtons(this.settings.isUseNarrowButtons());

	Options.setTabIconsEnabled(this.settings.isTabIconsEnabled());
	UIManager.put("jgoodies.popupDropShadowEnabled", this.settings
			.isPopupDropShadowEnabled());

	LookAndFeel selectedLaf = this.settings.getSelectedLookAndFeel();
	if ((selectedLaf instanceof PlasticLookAndFeel)) {
		PlasticLookAndFeel
				.setPlasticTheme(this.settings.getSelectedTheme());
		PlasticLookAndFeel.setTabStyle(this.settings.getPlasticTabStyle());
		PlasticLookAndFeel.setHighContrastFocusColorsEnabled(this.settings
				.isPlasticHighContrastFocusEnabled());
	} else if (selectedLaf.getClass() == MetalLookAndFeel.class) {
		MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
	}

	JRadioButton radio = new JRadioButton();
	radio.getUI().uninstallUI(radio);
	JCheckBox checkBox = new JCheckBox();
	checkBox.getUI().uninstallUI(checkBox);
	try {
		UIManager.setLookAndFeel(selectedLaf);
	} catch (Exception e) {
		System.out.println("Can't change L&F: " + e);
	}
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:31,代码来源:IBMExtractGUI2.java

示例6: setLookAndTheme

import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
public static void setLookAndTheme(LookAndFeel laf, Object theme)
    throws UnsupportedLookAndFeelException {
    if (laf instanceof PlasticLookAndFeel
        && theme != null
        && theme instanceof PlasticTheme) {
        PlasticLookAndFeel.setPlasticTheme((PlasticTheme) theme);
    }
    UIManager.setLookAndFeel(laf);
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:10,代码来源:LookUtils.java

示例7: initLookAndFeel

import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的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

示例8: setTheme

import com.jgoodies.looks.plastic.PlasticLookAndFeel; //导入方法依赖的package包/类
/**
 * @param theme PlasticTheme to use.
 * @see com.jgoodies.looks.plastic.PlasticLookAndFeel#setPlasticTheme(com.jgoodies.looks.plastic.PlasticTheme)
 */
public void setTheme(PlasticTheme theme) {
    PlasticLookAndFeel.setPlasticTheme(theme);
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:8,代码来源:JGoodiesLooksConfigurer.java


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