/** The “about” dialog. */
private AboutDialog aboutDialog;
+ /** The configuration dialog. */
+ private ConfigurationDialog configurationDialog;
+
/** The list of all defined nodes. */
private List<Node> nodeList;
+ //
+ // CONFIGURATION
+ //
+
+ /** Whether to beautify the GUI. */
+ private boolean beautify;
+
/**
* Creates a new swing interface.
*
public SwingInterface(Core core) {
this.core = core;
I18n.setLocale(Locale.ENGLISH); /* TODO - load config */
- System.setProperty("swing.aatext", "true");
- System.setProperty("swing.plaf.metal.controlFont", "Tahoma");
- System.setProperty("swing.plaf.metal.userFont", "Tahoma");
+ loadConfig();
+ if (beautify) {
+ System.setProperty("swing.aatext", "true");
+ System.setProperty("swing.plaf.metal.controlFont", "Tahoma");
+ System.setProperty("swing.plaf.metal.userFont", "Tahoma");
+ }
initActions();
initDialogs();
}
//
/**
+ * Loads the configuration of the interface.
+ */
+ private void loadConfig() {
+ beautify = true;
+ }
+
+ /**
* Initializes all actions.
*/
private void initActions() {
private void initDialogs() {
manageNodesDialog = new ManageNodesDialog(this);
aboutDialog = new AboutDialog(this);
+ configurationDialog = new ConfigurationDialog(this);
}
//
* Shows the configuration dialog.
*/
private void configure() {
+ configurationDialog.setBeautify(beautify);
+ configurationDialog.setVisible(true);
+ if (!configurationDialog.wasCancelled()) {
+ beautify = configurationDialog.getBeautify();
+ }
}
/**