use of org.pushingpixels.substance.api.skin.SkinInfo in project jgnash by ccavanaugh.
the class ThemeManager method buildSubstanceMenu.
private JMenu buildSubstanceMenu() {
LookAndFeel lf = UIManager.getLookAndFeel();
JMenu substanceMenu = new JMenu(rb.getString("Menu.SubstanceThemes.Name"));
for (SkinInfo info : SubstanceLookAndFeel.getAllSkins().values()) {
JRadioButtonMenuItem button = new JRadioButtonMenuItem();
button.setText(info.getDisplayName());
button.setActionCommand(info.getClassName());
// add the button to the global look and feel
lfButtonGroup.add(button);
button.addActionListener(e -> {
Preferences pref = Preferences.userNodeForPackage(ThemeManager.class);
pref.put(LF, e.getActionCommand());
restartUI();
});
substanceMenu.add(button);
// select the button as the active L&F if it is the current skin
if (lf instanceof SubstanceLookAndFeel) {
if (SubstanceLookAndFeel.getCurrentSkin().getClass().getName().equals(info.getClassName())) {
button.setSelected(true);
}
}
}
return substanceMenu;
}
Aggregations