import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JOptionPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
import net.pterodactylus.jsite.core.Core;
import net.pterodactylus.jsite.core.CoreListener;
/** The user font. */
private String userFont;
+ /** The class name of the look and feel. */
+ private String lookAndFeel;
+
/**
* Creates a new swing interface.
*
this.configDirectory = configDirectory;
I18n.setLocale(Locale.ENGLISH);
loadConfig();
+ if (lookAndFeel != null) {
+ try {
+ UIManager.setLookAndFeel(lookAndFeel);
+ } catch (ClassNotFoundException cnfe1) {
+ logger.log(Level.WARNING, "could not load look and feel", cnfe1);
+ } catch (InstantiationException ie1) {
+ logger.log(Level.WARNING, "could not load look and feel", ie1);
+ } catch (IllegalAccessException iae1) {
+ logger.log(Level.WARNING, "could not load look and feel", iae1);
+ } catch (UnsupportedLookAndFeelException ulafe1) {
+ logger.log(Level.WARNING, "could not load look and feel", ulafe1);
+ }
+ }
if (antialias) {
System.setProperty("swing.aatext", "true");
}
if (configProperties.containsKey("userFont")) {
userFont = configProperties.getProperty("userFont");
}
+ if (configProperties.containsKey("lookAndFeel")) {
+ lookAndFeel = configProperties.getProperty("lookAndFeel");
+ }
if (configProperties.containsKey("language")) {
I18n.setLocale(new Locale(configProperties.getProperty("language")));
}
if (userFont != null) {
configProperties.setProperty("userFont", userFont);
}
+ if (lookAndFeel != null) {
+ configProperties.setProperty("lookAndFeel", lookAndFeel);
+ }
configProperties.setProperty("language", I18n.getLocale().getLanguage());
FileOutputStream configOutputStream = null;
try {
configurationDialog.setAntialias(antialias);
configurationDialog.setControlFont(controlFont);
configurationDialog.setUserFont(userFont);
+ configurationDialog.setLookAndFeel(lookAndFeel);
configurationDialog.setVisible(true);
if (!configurationDialog.wasCancelled()) {
advancedMode = configurationDialog.isAdvancedMode();
antialias = configurationDialog.isAntialias();
controlFont = configurationDialog.getControlFont();
userFont = configurationDialog.getUserFont();
+ lookAndFeel = configurationDialog.getLookAndFeel();
saveConfig();
}
}