- Timestamp:
- 2020-06-07T18:40:25+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r16553 r16562 24 24 import org.openstreetmap.josm.io.FileWatcher; 25 25 import org.openstreetmap.josm.spi.preferences.Config; 26 import org.openstreetmap.josm.spi.preferences.IPreferences; 27 import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent; 28 import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener; 26 29 import org.openstreetmap.josm.tools.ImageProvider; 27 30 import org.openstreetmap.josm.tools.ListenerList; … … 45 48 private static final ListenerList<MapPaintSylesUpdateListener> listeners = ListenerList.createUnchecked(); 46 49 50 private static final class MapPaintStylesPreferenceListener implements PreferenceChangedListener { 51 private final IPreferences pref; 52 53 MapPaintStylesPreferenceListener(IPreferences pref) { 54 this.pref = pref; 55 } 56 57 @Override 58 public void preferenceChanged(PreferenceChangeEvent e) { 59 if (e.getKey().contains("mappaint")) { 60 // We need to remove this from the listeners, so that we don't recursively call ourselves. 61 pref.removePreferenceChangeListener(this); 62 MapPaintStyles.readFromPreferences(); 63 pref.addPreferenceChangeListener(this); 64 } 65 } 66 } 67 47 68 static { 48 69 listeners.addListener(new MapPaintSylesUpdateListener() { … … 57 78 } 58 79 }); 80 Config.getPref().addPreferenceChangeListener(new MapPaintStylesPreferenceListener(Config.getPref())); 59 81 } 60 82 -
trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
r15496 r16562 391 391 @Override 392 392 public boolean ok() { 393 boolean ret = false;394 393 for (ColorEntry d : tableModel.getDeleted()) { 395 394 d.toProperty().remove(); 396 395 } 397 396 for (ColorEntry e : tableModel.getData()) { 398 if (e.info.getValue() != null && e.toProperty().put(e.info.getValue()) 399 && NamedColorProperty.COLOR_CATEGORY_MAPPAINT.equals(e.info.getCategory())) { 400 ret = true; 397 if (e.info.getValue() != null) { 398 e.toProperty().put(e.info.getValue()); 401 399 } 402 400 } 403 401 OsmDataLayer.createHatchTexture(); 404 return ret;402 return false; 405 403 } 406 404
Note:
See TracChangeset
for help on using the changeset viewer.