rename configuration tab
[jSite2.git] / src / net / pterodactylus / jsite / gui / ConfigurationDialog.java
index 4444868..c512c46 100644 (file)
@@ -40,7 +40,7 @@ public class ConfigurationDialog extends JDialog implements I18nable {
        private I18nAction cancelAction;
 
        /** The “beautify GUI” action. */
-       private I18nAction beautifyAction;
+       private I18nAction antialiasAction;
 
        /** The “use custom control font” action. */
        private I18nAction useCustomControlFontAction;
@@ -49,7 +49,7 @@ public class ConfigurationDialog extends JDialog implements I18nable {
        private I18nAction useCustomUserFontAction;
 
        /** The “beautify” checkbox. */
-       private JCheckBox beautifyCheckBox;
+       private JCheckBox antialiasCheckBox;
 
        /** The “use custom” fonts checkbox. */
        private JCheckBox useCustomControlFontCheckBox;
@@ -104,22 +104,18 @@ public class ConfigurationDialog extends JDialog implements I18nable {
         * @return <code>true</code> if the checkbox was selected,
         *         <code>false</code> otherwise
         */
-       public boolean getBeautify() {
-               return beautifyCheckBox.isSelected();
+       public boolean isAntialias() {
+               return antialiasCheckBox.isSelected();
        }
 
        /**
-        * Sets the state of the “beautify” checkbox.
+        * Sets the state of the “antialias” checkbox.
         *
-        * @param beautify
+        * @param antialias
         *            The state of the checkbox
         */
-       public void setBeautify(boolean beautify) {
-               beautifyCheckBox.setSelected(beautify);
-               useCustomControlFontCheckBox.setEnabled(beautify);
-               controlFontList.setEnabled(beautify && useCustomControlFontCheckBox.isSelected());
-               useCustomUserFontCheckBox.setEnabled(beautify);
-               userFontList.setEnabled(beautify && useCustomUserFontCheckBox.isSelected());
+       public void setAntialias(boolean antialias) {
+               antialiasCheckBox.setSelected(antialias);
        }
 
        /**
@@ -129,7 +125,7 @@ public class ConfigurationDialog extends JDialog implements I18nable {
         *         font is to be used
         */
        public String getControlFont() {
-               return (String) ((beautifyCheckBox.isSelected() && useCustomControlFontCheckBox.isSelected()) ? controlFontList.getSelectedItem() : null);
+               return (String) (useCustomControlFontCheckBox.isSelected() ? controlFontList.getSelectedItem() : null);
        }
 
        /**
@@ -141,7 +137,7 @@ public class ConfigurationDialog extends JDialog implements I18nable {
         */
        public void setControlFont(String controlFont) {
                useCustomControlFontCheckBox.setSelected(controlFont != null);
-               controlFontList.setEnabled(beautifyCheckBox.isSelected() && (controlFont != null));
+               controlFontList.setEnabled(controlFont != null);
                controlFontList.setSelectedItem(controlFont);
        }
 
@@ -152,7 +148,7 @@ public class ConfigurationDialog extends JDialog implements I18nable {
         *         input font is to be used
         */
        public String getUserFont() {
-               return (String) ((beautifyCheckBox.isSelected() && useCustomUserFontCheckBox.isSelected()) ? userFontList.getSelectedItem() : null);
+               return (String) (useCustomUserFontCheckBox.isSelected() ? userFontList.getSelectedItem() : null);
        }
 
        /**
@@ -164,7 +160,7 @@ public class ConfigurationDialog extends JDialog implements I18nable {
         */
        public void setUserFont(String userFont) {
                useCustomUserFontCheckBox.setSelected(userFont != null);
-               userFontList.setEnabled(beautifyCheckBox.isSelected() && (userFont != null));
+               userFontList.setEnabled(userFont != null);
                userFontList.setSelectedItem(userFont);
        }
 
@@ -196,14 +192,13 @@ public class ConfigurationDialog extends JDialog implements I18nable {
                                actionCancel();
                        }
                };
-               beautifyAction = new I18nAction("configurationDialog.page.interface.item.beautify") {
+               antialiasAction = new I18nAction("configurationDialog.page.interface.item.beautify") {
 
                        /**
                         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
                         */
-                       @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
-                               setBeautify(beautifyCheckBox.isSelected());
+                               /* do nothing. */
                        }
                };
                useCustomControlFontAction = new I18nAction("configurationDialog.page.interface.item.useCustomControlFont") {
@@ -239,7 +234,7 @@ public class ConfigurationDialog extends JDialog implements I18nable {
                contentPane.add(tabbedPane, BorderLayout.CENTER);
 
                JComponent interfaceConfig = createInterfaceConfig();
-               tabbedPane.add("Swing Interface", interfaceConfig);
+               tabbedPane.add(I18n.get("configurationDialog.page.interface.name"), interfaceConfig);
 
                JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING, 12, 12));
                contentPane.add(buttonPanel, BorderLayout.PAGE_END);
@@ -261,17 +256,17 @@ public class ConfigurationDialog extends JDialog implements I18nable {
                JPanel interfaceConfigPanel = new JPanel(new GridBagLayout());
                interfaceConfigPanel.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12));
 
-               beautifyCheckBox = new JCheckBox(beautifyAction);
-               interfaceConfigPanel.add(beautifyCheckBox, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
+               antialiasCheckBox = new JCheckBox(antialiasAction);
+               interfaceConfigPanel.add(antialiasCheckBox, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
 
                useCustomControlFontCheckBox = new JCheckBox(useCustomControlFontAction);
-               interfaceConfigPanel.add(useCustomControlFontCheckBox, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 18, 0, 0), 0, 0));
+               interfaceConfigPanel.add(useCustomControlFontCheckBox, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 0, 0, 0), 0, 0));
 
                controlFontList = new FontComboBox();
                interfaceConfigPanel.add(controlFontList, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 6, 0, 0), 0, 0));
 
                useCustomUserFontCheckBox = new JCheckBox(useCustomUserFontAction);
-               interfaceConfigPanel.add(useCustomUserFontCheckBox, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0));
+               interfaceConfigPanel.add(useCustomUserFontCheckBox, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 0, 0, 0), 0, 0));
 
                userFontList = new FontComboBox();
                interfaceConfigPanel.add(userFontList, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 6, 0, 0), 0, 0));
@@ -311,7 +306,9 @@ public class ConfigurationDialog extends JDialog implements I18nable {
        public void updateI18n() {
                okayAction.updateI18n();
                cancelAction.updateI18n();
-               beautifyAction.updateI18n();
+               antialiasAction.updateI18n();
+               useCustomControlFontAction.updateI18n();
+               useCustomUserFontAction.updateI18n();
                SwingUtils.repackCentered(this);
        }