- Timestamp:
- 2015-11-01T17:32:50+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategy.java
r8849 r8973 8 8 9 9 import org.openstreetmap.josm.Main; 10 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent; 11 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener; 10 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; 11 13 import org.openstreetmap.josm.tools.LanguageInfo; … … 148 150 } 149 151 150 public static class DeriveLabelFromNameTagsCompositionStrategy extends LabelCompositionStrategy { 152 public static class DeriveLabelFromNameTagsCompositionStrategy 153 extends LabelCompositionStrategy implements PreferenceChangedListener { 151 154 152 155 /** … … 176 179 /** 177 180 * <p>Creates the strategy and initializes its name tags from the preferences.</p> 178 *179 * <p><strong>Note:</strong> If the list of name tags in the preferences changes, strategy instances180 * are not notified. It's up to the client to listen to preference changes and181 * invoke {@link #initNameTagsFromPreferences()} accordingly.</p>182 *183 181 */ 184 182 public DeriveLabelFromNameTagsCompositionStrategy() { … … 296 294 return "{" + getClass().getSimpleName() +'}'; 297 295 } 296 297 @Override 298 public void preferenceChanged(PreferenceChangeEvent e) { 299 if (e.getKey() != null && e.getKey().startsWith("mappaint.name")) { 300 initNameTagsFromPreferences(); 301 } 302 } 298 303 } 299 304 }
Note:
See TracChangeset
for help on using the changeset viewer.