Changeset 12107 in josm for trunk/src/org/openstreetmap/josm
- Timestamp:
- 2017-05-11T00:18:12+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r12103 r12107 52 52 import org.openstreetmap.josm.gui.MapViewState.MapViewRectangle; 53 53 import org.openstreetmap.josm.gui.datatransfer.OsmTransferHandler; 54 import org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable;55 54 import org.openstreetmap.josm.gui.layer.GpxLayer; 56 55 import org.openstreetmap.josm.gui.layer.ImageryLayer; … … 124 123 */ 125 124 public synchronized void addTo(MapViewPaintable p) { 126 if (p instanceof AbstractMapViewPaintable) { 127 ((AbstractMapViewPaintable) p).addInvalidationListener(this); 128 } 125 p.addInvalidationListener(this); 129 126 } 130 127 … … 134 131 */ 135 132 public synchronized void removeFrom(MapViewPaintable p) { 136 if (p instanceof AbstractMapViewPaintable) { 137 ((AbstractMapViewPaintable) p).removeInvalidationListener(this); 138 } 133 p.removeInvalidationListener(this); 139 134 invalidatedLayers.remove(p); 140 135 } -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractMapViewPaintable.java
r12014 r12107 70 70 } 71 71 72 /** 73 * Adds a new paintable invalidation listener. 74 * @param l The listener to add. 75 */ 72 @Override 76 73 public void addInvalidationListener(PaintableInvalidationListener l) { 77 74 invalidationListeners.add(l); 78 75 } 79 76 80 /** 81 * Removes an added paintable invalidation listener. 82 * @param l The listener to remove. 83 */ 77 @Override 84 78 public void removeInvalidationListener(PaintableInvalidationListener l) { 85 79 invalidationListeners.remove(l); -
trunk/src/org/openstreetmap/josm/gui/layer/MapViewPaintable.java
r11713 r12107 142 142 */ 143 143 void paint(Graphics2D g, MapView mv, Bounds bbox); 144 145 /** 146 * Adds a new paintable invalidation listener. 147 * @param l The listener to add. 148 * @since 12107 149 */ 150 default void addInvalidationListener(PaintableInvalidationListener l) { 151 } 152 153 /** 154 * Removes an added paintable invalidation listener. May throw an exception if the listener is added twice. 155 * @param l The listener to remove. 156 * @since 12107 157 */ 158 default void removeInvalidationListener(PaintableInvalidationListener l) { 159 } 160 144 161 }
Note:
See TracChangeset
for help on using the changeset viewer.