Changeset 16563 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-06-07T18:45:04+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r15717 r16563 67 67 import org.openstreetmap.josm.gui.layer.markerlayer.PlayHeadMarker; 68 68 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 69 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintS ylesUpdateListener;69 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintStylesUpdateListener; 70 70 import org.openstreetmap.josm.gui.util.GuiHelper; 71 71 import org.openstreetmap.josm.io.audio.AudioPlayer; … … 95 95 96 96 static { 97 MapPaintStyles.addMapPaintS ylesUpdateListener(new MapPaintSylesUpdateListener() {97 MapPaintStyles.addMapPaintStylesUpdateListener(new MapPaintStylesUpdateListener() { 98 98 @Override 99 99 public void mapPaintStylesUpdated() { -
trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
r16438 r16563 60 60 import org.openstreetmap.josm.gui.SideButton; 61 61 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 62 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintS ylesUpdateListener;62 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintStylesUpdateListener; 63 63 import org.openstreetmap.josm.gui.mappaint.StyleSettingGroupGui; 64 64 import org.openstreetmap.josm.gui.mappaint.StyleSource; … … 180 180 @Override 181 181 public void showNotify() { 182 MapPaintStyles.addMapPaintS ylesUpdateListener(model);182 MapPaintStyles.addMapPaintStylesUpdateListener(model); 183 183 model.mapPaintStylesUpdated(); 184 184 MainApplication.getMenu().wireFrameToggleAction.addButtonModel(cbWireframe.getModel()); … … 188 188 public void hideNotify() { 189 189 MainApplication.getMenu().wireFrameToggleAction.removeButtonModel(cbWireframe.getModel()); 190 MapPaintStyles.removeMapPaintS ylesUpdateListener(model);191 } 192 193 protected class StylesModel extends AbstractTableModel implements MapPaintS ylesUpdateListener {190 MapPaintStyles.removeMapPaintStylesUpdateListener(model); 191 } 192 193 protected class StylesModel extends AbstractTableModel implements MapPaintStylesUpdateListener { 194 194 195 195 private final Class<?>[] columnClasses = {Boolean.class, StyleSource.class}; -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java
r16509 r16563 17 17 import org.openstreetmap.josm.gui.layer.GpxLayer; 18 18 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 19 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintS ylesUpdateListener;19 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintStylesUpdateListener; 20 20 import org.openstreetmap.josm.gui.util.StayOpenCheckBoxMenuItem; 21 21 import org.openstreetmap.josm.tools.ImageProvider; … … 25 25 * @since 5086 26 26 */ 27 public class MapPaintMenu extends JMenu implements MapPaintS ylesUpdateListener {27 public class MapPaintMenu extends JMenu implements MapPaintStylesUpdateListener { 28 28 29 29 private static class MapPaintAction extends JosmAction { … … 88 88 super(tr("Map Paint Styles")); 89 89 setIcon(ImageProvider.get("dialogs", "mapstyle", ImageProvider.ImageSizes.MENU)); 90 MapPaintStyles.addMapPaintS ylesUpdateListener(this);90 MapPaintStyles.addMapPaintStylesUpdateListener(this); 91 91 putClientProperty("help", ht("/Dialog/MapPaint")); 92 92 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r16562 r16563 37 37 * the ElemStyles singleton. 38 38 * 39 * On change, {@link MapPaintS ylesUpdateListener#mapPaintStylesUpdated()} is fired39 * On change, {@link MapPaintStylesUpdateListener#mapPaintStylesUpdated()} is fired 40 40 * for all listeners. 41 41 */ … … 46 46 "misc/deprecated.png"); 47 47 48 private static final ListenerList<MapPaintS ylesUpdateListener> listeners = ListenerList.createUnchecked();48 private static final ListenerList<MapPaintStylesUpdateListener> listeners = ListenerList.createUnchecked(); 49 49 50 50 private static final class MapPaintStylesPreferenceListener implements PreferenceChangedListener { … … 67 67 68 68 static { 69 listeners.addListener(new MapPaintS ylesUpdateListener() {69 listeners.addListener(new MapPaintStylesUpdateListener() { 70 70 @Override 71 71 public void mapPaintStylesUpdated() { … … 316 316 } 317 317 } 318 fireMapPaintS ylesUpdated();318 fireMapPaintStylesUpdated(); 319 319 } 320 320 … … 373 373 styles.setStyleSources(data); 374 374 MapPaintPrefHelper.INSTANCE.put(data); 375 fireMapPaintS ylesUpdated();375 fireMapPaintStylesUpdated(); 376 376 } 377 377 … … 413 413 fireMapPaintStyleEntryUpdated(sel[0]); 414 414 } else { 415 fireMapPaintS ylesUpdated();415 fireMapPaintStylesUpdated(); 416 416 } 417 417 } … … 444 444 private static void refreshStyles() { 445 445 MapPaintPrefHelper.INSTANCE.put(styles.getStyleSources()); 446 fireMapPaintS ylesUpdated();446 fireMapPaintStylesUpdated(); 447 447 } 448 448 449 449 /*********************************** 450 * MapPaintS ylesUpdateListener & related code450 * MapPaintStylesUpdateListener & related code 451 451 * (get informed when the list of MapPaint StyleSources changes) 452 452 */ 453 public interface MapPaintS ylesUpdateListener {453 public interface MapPaintStylesUpdateListener { 454 454 /** 455 455 * Called on any style source changes that are not handled by {@link #mapPaintStyleEntryUpdated(int)} … … 468 468 * @param listener The listener 469 469 */ 470 public static void addMapPaintS ylesUpdateListener(MapPaintSylesUpdateListener listener) {470 public static void addMapPaintStylesUpdateListener(MapPaintStylesUpdateListener listener) { 471 471 listeners.addListener(listener); 472 472 } … … 476 476 * @param listener The listener 477 477 */ 478 public static void removeMapPaintS ylesUpdateListener(MapPaintSylesUpdateListener listener) {478 public static void removeMapPaintStylesUpdateListener(MapPaintStylesUpdateListener listener) { 479 479 listeners.removeListener(listener); 480 480 } … … 483 483 * Notifies all listeners that there was any update to the map paint styles 484 484 */ 485 public static void fireMapPaintS ylesUpdated() {486 listeners.fireEvent(MapPaintS ylesUpdateListener::mapPaintStylesUpdated);485 public static void fireMapPaintStylesUpdated() { 486 listeners.fireEvent(MapPaintStylesUpdateListener::mapPaintStylesUpdated); 487 487 } 488 488 -
trunk/src/org/openstreetmap/josm/gui/mappaint/loader/MapPaintStyleLoader.java
r16438 r16563 41 41 @Override 42 42 protected void finish() { 43 MapPaintStyles.fireMapPaintS ylesUpdated();43 MapPaintStyles.fireMapPaintStylesUpdated(); 44 44 } 45 45
Note:
See TracChangeset
for help on using the changeset viewer.