本文整理汇总了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);
}
示例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");
}