formatting fixes

This commit is contained in:
Ben Fry
2015-04-03 16:46:46 -04:00
parent c746bcca19
commit 1787e378bd
2 changed files with 8 additions and 20 deletions

View File

@@ -63,7 +63,7 @@ public class Preferences {
* Standardized width for buttons. Mac OS X 10.3 wants 70 as its default,
* Windows XP needs 66, and my Ubuntu machine needs 80+, so 80 seems proper.
*/
static public int BUTTON_WIDTH =
static public int BUTTON_WIDTH =
Integer.parseInt(Language.text("preferences.button.width"));
// /** height of the EditorHeader, EditorToolbar, and EditorStatus */
@@ -182,7 +182,6 @@ public class Preferences {
static protected void save() {
// try {
// on startup, don't worry about it
// this is trying to update the prefs for who is open
// before Preferences.init() has been called.
@@ -191,11 +190,6 @@ public class Preferences {
// Fix for 0163 to properly use Unicode when writing preferences.txt
PrintWriter writer = PApplet.createWriter(preferencesFile);
// Enumeration e = table.keys(); //properties.propertyNames();
// while (e.hasMoreElements()) {
// String key = (String) e.nextElement();
// writer.println(key + "=" + ((String) table.get(key)));
// }
String[] keyList = table.keySet().toArray(new String[table.size()]);
keyList = PApplet.sort(keyList);
for (String key : keyList) {
@@ -204,10 +198,6 @@ public class Preferences {
writer.flush();
writer.close();
// } catch (Exception ex) {
// Base.showWarning(null, "Error while saving the settings file", ex);
// }
}

View File

@@ -398,7 +398,8 @@ public class PreferencesFrame {
// [ ] Enable Code Completion - PDE X
codeCompletionBox =
new JCheckBox(Language.text("preferences.code_completion") + " Ctrl-" + Language.text("preferences.cmd_space"));
new JCheckBox(Language.text("preferences.code_completion") +
" Ctrl-" + Language.text("preferences.cmd_space"));
pain.add(codeCompletionBox);
d = codeCompletionBox.getPreferredSize();
codeCompletionBox.setBounds(left, top, d.width + 10, d.height);
@@ -516,7 +517,7 @@ public class PreferencesFrame {
// More preferences are in the ...
label = new JLabel(Language.text("preferences.file")+":");
label = new JLabel(Language.text("preferences.file") + ":");
pain.add(label);
d = label.getPreferredSize();
label.setForeground(Color.gray);
@@ -545,7 +546,7 @@ public class PreferencesFrame {
right = Math.max(right, left + d.width);
top += d.height;
label = new JLabel("("+Language.text("preferences.file.hint")+")");
label = new JLabel("(" + Language.text("preferences.file.hint") + ")");
pain.add(label);
d = label.getPreferredSize();
label.setForeground(Color.gray);
@@ -782,8 +783,7 @@ public class PreferencesFrame {
//codeCompletionTriggerBox.setSelected(Preferences.getBoolean("pdex.completion.trigger"));
//codeCompletionTriggerBox.setEnabled(codeCompletionBox.isSelected());
importSuggestionsBox.setSelected(Preferences.getBoolean("pdex.importSuggestEnabled"));
deletePreviousBox.
setSelected(Preferences.getBoolean("export.delete_target_folder")); //$NON-NLS-1$
deletePreviousBox.setSelected(Preferences.getBoolean("export.delete_target_folder")); //$NON-NLS-1$
sketchbookLocationField.setText(Preferences.getSketchbookPath());
checkUpdatesBox.setSelected(Preferences.getBoolean("update.check")); //$NON-NLS-1$
@@ -817,8 +817,7 @@ public class PreferencesFrame {
memoryField.setEnabled(memoryOverrideBox.isSelected());
if (autoAssociateBox != null) {
autoAssociateBox.
setSelected(Preferences.getBoolean("platform.auto_file_type_associations")); //$NON-NLS-1$
autoAssociateBox.setSelected(Preferences.getBoolean("platform.auto_file_type_associations")); //$NON-NLS-1$
}
dialog.setVisible(true);
@@ -828,14 +827,13 @@ public class PreferencesFrame {
/**
* I have some ideas on how we could make Swing even more obtuse for the
* most basic usage scenarios. Is there someone on the team I can contact?
* Oracle, are you listening?
* Oracle staffer, are you reading this? This could be your meal ticket.
*/
static class FontNamer extends JLabel implements ListCellRenderer<Font> {
public Component getListCellRendererComponent(JList<? extends Font> list,
Font value, int index,
boolean isSelected,
boolean cellHasFocus) {
//if (Base.isMacOS()) {
setText(value.getFamily() + " / " + value.getName() + " (" + value.getPSName() + ")");
return this;
}