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


Java SubstanceLookAndFeel.getAllSkins方法代码示例

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


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

示例1: addMenuItems

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入方法依赖的package包/类
/**
 * Adds the necessary <code>JMenuItem</code>s to the specified menu.
 * 
 * @param menu
 *            Menu.
 */
private void addMenuItems(JMenu menu) {
	menu.add(this.restoreAction);

	menu.add(this.iconifyAction);

	if (Toolkit.getDefaultToolkit().isFrameStateSupported(
			Frame.MAXIMIZED_BOTH)) {
		menu.add(this.maximizeAction);
	}

	if (SubstanceCoreUtilities.toShowExtraWidgets(rootPane)) {
		menu.addSeparator();
		JMenu skinMenu = new JMenu(SubstanceCoreUtilities
				.getResourceBundle(rootPane).getString("SystemMenu.skins"));
		Map<String, SkinInfo> allSkins = SubstanceLookAndFeel.getAllSkins();
		for (Map.Entry<String, SkinInfo> skinEntry : allSkins.entrySet()) {
			final String skinClassName = skinEntry.getValue()
					.getClassName();
			JMenuItem jmiSkin = new JMenuItem(skinEntry.getKey());
			jmiSkin.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					SwingUtilities.invokeLater(new Runnable() {
						public void run() {
							SubstanceLookAndFeel.setSkin(skinClassName);
						}
					});
				}
			});

			skinMenu.add(jmiSkin);
		}
		menu.add(skinMenu);
	}

	menu.addSeparator();

	menu.add(this.closeAction);
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:45,代码来源:SubstanceTitlePane.java

示例2: JPanelConfigGeneral

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入方法依赖的package包/类
public JPanelConfigGeneral() {

        initComponents();

        jtxtMachineHostname.getDocument().addDocumentListener(dirty);
        jcboLAF.addActionListener(dirty);
        jcboFontFamilyName.addActionListener(dirty);
        jtxtFontSize.addActionListener(dirty);
        jcboMachineScreenmode.addActionListener(dirty);
        jcboMachineLeftPanel.addActionListener(dirty);
        jcboTicketsBag.addActionListener(dirty);

        jcboLAF.addItem(new LAFInfo("System", UIManager.getSystemLookAndFeelClassName()));

        // Installed skins
        LookAndFeelInfo[] lafs = UIManager.getInstalledLookAndFeels();
        for (LookAndFeelInfo laf : lafs) {
            jcboLAF.addItem(new LAFInfo(laf.getName(), laf.getClassName()));
        }

        // Substance skins
        // new SubstanceLookAndFeel(); // TODO: Remove in Substance 5.0. Workaround for Substance 4.3 to initialize static variables
        Map<String, SkinInfo> skins = SubstanceLookAndFeel.getAllSkins();
        for (SkinInfo skin : skins.values()) {
            jcboLAF.addItem(new LAFInfo(skin.getDisplayName(), skin.getClassName()));
        }

        jcboLAF.addActionListener(new java.awt.event.ActionListener() {
            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeLAF();
            }
        });

        for (String fontName : GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()) {
            jcboFontFamilyName.addItem(fontName);
        }

        jcboMachineScreenmode.addItem("window");
        jcboMachineScreenmode.addItem("fullscreen");

        jcboMachineLeftPanel.addItem("open");
        jcboMachineLeftPanel.addItem("hide");

        jcboTicketsBag.addItem("simple");
        jcboTicketsBag.addItem("standard");
        jcboTicketsBag.addItem("restaurant");
        jcboTicketsBag.addItem("geomap");

    }
 
开发者ID:nordpos,项目名称:nordpos,代码行数:51,代码来源:JPanelConfigGeneral.java


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