Changeset 6764 in josm
- Timestamp:
- 2014-01-28T11:23:54+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/preferences/display
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
r6624 r6764 49 49 import org.openstreetmap.josm.tools.GBC; 50 50 51 /** 52 * Color preferences. 53 */ 51 54 public class ColorPreference implements SubPreferenceSetting { 52 55 … … 65 68 private List<String> del = new ArrayList<String>(); 66 69 67 JButton colorEdit; 68 JButton defaultSet; 69 JButton remove; 70 private JButton colorEdit; 71 private JButton defaultSet; 72 private JButton remove; 70 73 71 74 /** … … 108 111 } 109 112 } 110 113 111 114 private void addColorRows(Map<String, String> colorMap, Map<String, String> keyMap) { 112 115 for (String value : keyMap.values()) { … … 139 142 } 140 143 141 private String getName(String o) 142 { 144 private String getName(String o) { 143 145 return Main.pref.getColorName(o); 144 146 } … … 251 253 } 252 254 253 Boolean isRemoveColor(int row) 254 { 255 Boolean isRemoveColor(int row) { 255 256 return ((String)colors.getValueAt(row, 0)).startsWith("layer "); 256 257 } -
trunk/src/org/openstreetmap/josm/gui/preferences/display/DisplayPreference.java
r6529 r6764 12 12 import org.openstreetmap.josm.tools.GBC; 13 13 14 /** 15 * Display preferences (various settings that influence the visual representation of the whole program). 16 * @since 4969 17 */ 14 18 public final class DisplayPreference extends DefaultTabPreferenceSetting { 15 19 … … 23 27 } 24 28 } 25 29 26 30 private DisplayPreference() { 27 31 super("display", tr("Display Settings"), tr("Various settings that influence the visual representation of the whole program."), false, new JTabbedPane()); 28 32 } 29 33 30 34 @Override 31 35 public boolean ok() { -
trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java
r6529 r6764 24 24 import org.openstreetmap.josm.tools.GBC; 25 25 26 /** 27 * Map drawing preferences. 28 */ 26 29 public class DrawingPreference implements SubPreferenceSetting { 27 30 … … 127 130 discardableKeys.setToolTipText(tr("Display keys which have been deemed uninteresting to the point that they can be silently removed.")); 128 131 discardableKeys.setSelected(Main.pref.getBoolean("display.discardable-keys", false)); 129 132 130 133 JLabel performanceLabel = new JLabel(tr("Options that affect drawing performance")); 131 134 … … 169 172 @Override 170 173 public boolean ok() { 171 gpxPanel.savePreferences(); 174 boolean restart = gpxPanel.savePreferences(); 172 175 Main.pref.put("draw.data.area_outline_only", outlineOnly.isSelected()); 173 176 Main.pref.put("draw.segment.direction", directionHint.isSelected()); … … 192 195 } 193 196 Main.pref.putInteger("mappaint.node.virtual-size", vn); 194 return false;197 return restart; 195 198 } 196 199 -
trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
r6267 r6764 27 27 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.ValidationListener; 28 28 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 29 import org.openstreetmap.josm.gui.widgets.JosmTextField; 29 30 import org.openstreetmap.josm.tools.GBC; 30 31 import org.openstreetmap.josm.tools.template_engine.ParseError; 31 32 import org.openstreetmap.josm.tools.template_engine.TemplateParser; 32 import org.openstreetmap.josm.gui.widgets.JosmTextField; 33 33 34 /** 35 * Panel for GPX settings. 36 */ 34 37 public class GPXSettingsPanel extends JPanel implements ValidationListener { 35 38 … … 71 74 72 75 private String layerName; 73 private boolean local; // flag to display LocalOnly checkbox 74 private boolean nonlocal; // flag to display AllLines checkbox 75 76 private final boolean local; // flag to display LocalOnly checkbox 77 private final boolean nonlocal; // flag to display AllLines checkbox 78 79 /** 80 * Constructs a new {@code GPXSettingsPanel} for a given layer name. 81 * @param layerName The GPX layer name 82 * @param local flag to display LocalOnly checkbox 83 * @param nonlocal flag to display AllLines checkbox 84 */ 76 85 public GPXSettingsPanel(String layerName, boolean local, boolean nonlocal) { 77 86 super(new GridBagLayout()); 78 this.local=local; this.nonlocal=nonlocal; 87 this.local=local; 88 this.nonlocal=nonlocal; 79 89 this.layerName = "layer "+layerName; 80 90 initComponents(); … … 82 92 } 83 93 94 /** 95 * Constructs a new {@code GPXSettingsPanel}. 96 */ 84 97 public GPXSettingsPanel() { 85 98 super(new GridBagLayout()); 86 99 initComponents(); 87 local=false; nonlocal=false; 100 local=false; 101 nonlocal=false; 88 102 loadPreferences(); // preferences -> controls 89 103 } … … 356 370 357 371 /** 358 * Save preferences from UI controls for specified layer 359 * if layerName==null, global preferences are written 372 * Save preferences from UI controls, globally or for a specified layer. 373 * @param layerName The GPX layer name. Can be {@code null}, in that case, global preferences are written 374 * @param locLayer {@code true} if the GPX layer is a local one. Ignored if {@code layerName} is null 375 * @return {@code true} when restart is required, {@code false} otherwise 360 376 */ 361 public boolean savePreferences 377 public boolean savePreferences(String layerName, boolean locLayer) { 362 378 String layerNameDot = ".layer "+layerName; 363 379 if (layerName==null) { … … 421 437 /** 422 438 * Save preferences from UI controls for initial layer or globally 439 * @return {@code true} when restart is required, {@code false} otherwise 423 440 */ 424 public voidsavePreferences() {425 savePreferences(null, false); 441 public boolean savePreferences() { 442 return savePreferences(null, false); 426 443 } 427 444 … … 472 489 return true; 473 490 } 474 475 491 } -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
r6752 r6764 30 30 import org.openstreetmap.josm.tools.GBC; 31 31 32 /** 33 * Look-and-feel preferences. 34 */ 32 35 public class LafPreference implements SubPreferenceSetting { 33 36 … … 46 49 */ 47 50 private JosmComboBox lafCombo; 48 publicJPanel panel;51 JPanel panel; 49 52 private JCheckBox showSplashScreen = new JCheckBox(tr("Show splash screen at startup")); 50 53 private JCheckBox showID = new JCheckBox(tr("Show object ID in selection lists")); -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java
r6529 r6764 28 28 import org.openstreetmap.josm.tools.I18n; 29 29 30 /** 31 * Language preferences. 32 */ 30 33 public class LanguagePreference implements SubPreferenceSetting { 31 34
Note:
See TracChangeset
for help on using the changeset viewer.