private I18nAction cancelAction;
/** The “beautify GUI” action. */
- private I18nAction beautifyAction;
+ private I18nAction antialiasAction;
/** The “use custom control font” action. */
private I18nAction useCustomControlFontAction;
private I18nAction useCustomUserFontAction;
/** The “beautify” checkbox. */
- private JCheckBox beautifyCheckBox;
+ private JCheckBox antialiasCheckBox;
/** The “use custom” fonts checkbox. */
private JCheckBox useCustomControlFontCheckBox;
* @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);
}
/**
* font is to be used
*/
public String getControlFont() {
- return (String) ((beautifyCheckBox.isSelected() && useCustomControlFontCheckBox.isSelected()) ? controlFontList.getSelectedItem() : null);
+ return (String) (useCustomControlFontCheckBox.isSelected() ? controlFontList.getSelectedItem() : null);
}
/**
*/
public void setControlFont(String controlFont) {
useCustomControlFontCheckBox.setSelected(controlFont != null);
- controlFontList.setEnabled(beautifyCheckBox.isSelected() && (controlFont != null));
+ controlFontList.setEnabled(controlFont != null);
controlFontList.setSelectedItem(controlFont);
}
* 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);
}
/**
*/
public void setUserFont(String userFont) {
useCustomUserFontCheckBox.setSelected(userFont != null);
- userFontList.setEnabled(beautifyCheckBox.isSelected() && (userFont != null));
+ userFontList.setEnabled(userFont != null);
userFontList.setSelectedItem(userFont);
}
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") {
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);
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));
public void updateI18n() {
okayAction.updateI18n();
cancelAction.updateI18n();
- beautifyAction.updateI18n();
+ antialiasAction.updateI18n();
+ useCustomControlFontAction.updateI18n();
+ useCustomUserFontAction.updateI18n();
SwingUtils.repackCentered(this);
}
// CONFIGURATION
//
- /** Whether to beautify the GUI. */
- private boolean beautify;
+ /** Whether to antialias the GUI. */
+ private boolean antialias;
/** The control font. */
private String controlFont;
this.configDirectory = configDirectory;
I18n.setLocale(Locale.ENGLISH);
loadConfig();
- if (beautify) {
+ if (antialias) {
System.setProperty("swing.aatext", "true");
- if (controlFont != null) {
- System.setProperty("swing.plaf.metal.controlFont", controlFont);
- }
- if (userFont != null) {
- System.setProperty("swing.plaf.metal.userFont", userFont);
- }
+ }
+ if (controlFont != null) {
+ System.setProperty("swing.plaf.metal.controlFont", controlFont);
+ }
+ if (userFont != null) {
+ System.setProperty("swing.plaf.metal.userFont", userFont);
}
initActions();
initDialogs();
*/
private void loadConfig() {
/* initialize default stuff. */
- beautify = false;
+ antialias = false;
/* now read config. */
File configFile = new File(configDirectory, "swing-interface.properties");
if (!configFile.exists() || !configFile.canRead() || !configFile.isFile()) {
} finally {
Closer.close(configInputStream);
}
- if (configProperties.containsKey("beautify")) {
- beautify = Boolean.valueOf(configProperties.getProperty("beautify"));
+ if (configProperties.containsKey("antialias")) {
+ antialias = Boolean.valueOf(configProperties.getProperty("antialias"));
}
if (configProperties.containsKey("controlFont")) {
controlFont = configProperties.getProperty("controlFont");
}
File configFile = new File(configDirectory, "swing-interface.properties");
Properties configProperties = new Properties();
- configProperties.setProperty("beautify", String.valueOf(beautify));
+ configProperties.setProperty("antialias", String.valueOf(antialias));
if (controlFont != null) {
configProperties.setProperty("controlFont", controlFont);
}
* Shows the configuration dialog.
*/
private void configure() {
- configurationDialog.setBeautify(beautify);
+ configurationDialog.setAntialias(antialias);
configurationDialog.setControlFont(controlFont);
configurationDialog.setUserFont(userFont);
configurationDialog.setVisible(true);
if (!configurationDialog.wasCancelled()) {
- beautify = configurationDialog.getBeautify();
+ antialias = configurationDialog.isAntialias();
controlFont = configurationDialog.getControlFont();
userFont = configurationDialog.getUserFont();
saveConfig();