- Timestamp:
- 2017-05-11T01:53:27+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/event/SelectionEventManager.java
r12109 r12116 42 42 } 43 43 44 private abstract static class AbstractListenerInfo {45 abstractvoid fire(SelectionChangeEvent event);46 } 47 48 private static class ListenerInfo extends AbstractListenerInfo {44 private interface ListenerInfo { 45 void fire(SelectionChangeEvent event); 46 } 47 48 private static class OldListenerInfo implements ListenerInfo { 49 49 private final SelectionChangedListener listener; 50 50 51 ListenerInfo(SelectionChangedListener listener) {51 OldListenerInfo(SelectionChangedListener listener) { 52 52 this.listener = listener; 53 53 } 54 54 55 55 @Override 56 void fire(SelectionChangeEvent event) {56 public void fire(SelectionChangeEvent event) { 57 57 listener.selectionChanged(event.getSelection()); 58 58 } … … 67 67 if (this == o) return true; 68 68 if (o == null || getClass() != o.getClass()) return false; 69 ListenerInfo that = (ListenerInfo) o;69 OldListenerInfo that = (OldListenerInfo) o; 70 70 return Objects.equals(listener, that.listener); 71 71 } 72 72 } 73 73 74 private static class DataListenerInfo extends AbstractListenerInfo {74 private static class DataListenerInfo implements ListenerInfo { 75 75 private final DataSelectionListener listener; 76 76 … … 80 80 81 81 @Override 82 void fire(SelectionChangeEvent event) {82 public void fire(SelectionChangeEvent event) { 83 83 listener.selectionChanged(event); 84 84 } … … 98 98 } 99 99 100 private final CopyOnWriteArrayList< AbstractListenerInfo> inEDTListeners = new CopyOnWriteArrayList<>();101 private final CopyOnWriteArrayList< AbstractListenerInfo> immedatelyListeners = new CopyOnWriteArrayList<>();100 private final CopyOnWriteArrayList<ListenerInfo> inEDTListeners = new CopyOnWriteArrayList<>(); 101 private final CopyOnWriteArrayList<ListenerInfo> immedatelyListeners = new CopyOnWriteArrayList<>(); 102 102 103 103 /** … … 123 123 throw new UnsupportedOperationException("IN_EDT mode not supported, you probably want to use IN_EDT_CONSOLIDATED."); 124 124 } else if (fireMode == FireMode.IN_EDT_CONSOLIDATED) { 125 inEDTListeners.addIfAbsent(new ListenerInfo(listener));125 inEDTListeners.addIfAbsent(new OldListenerInfo(listener)); 126 126 } else { 127 immedatelyListeners.addIfAbsent(new ListenerInfo(listener));127 immedatelyListeners.addIfAbsent(new OldListenerInfo(listener)); 128 128 } 129 129 } … … 153 153 */ 154 154 public void removeSelectionListener(SelectionChangedListener listener) { 155 remove(new ListenerInfo(listener));155 remove(new OldListenerInfo(listener)); 156 156 } 157 157 … … 165 165 } 166 166 167 private void remove( AbstractListenerInfo searchListener) {167 private void remove(ListenerInfo searchListener) { 168 168 inEDTListeners.remove(searchListener); 169 169 immedatelyListeners.remove(searchListener); … … 199 199 } 200 200 201 private static void fireEvent(List< AbstractListenerInfo> listeners, SelectionChangeEvent event) {202 for ( AbstractListenerInfo listener: listeners) {201 private static void fireEvent(List<ListenerInfo> listeners, SelectionChangeEvent event) { 202 for (ListenerInfo listener: listeners) { 203 203 listener.fire(event); 204 204 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r12115 r12116 170 170 * Adds recently closed relation. 171 171 * @param relation new entry for the list of recently closed relations 172 * @see #PROPERTY_RECENT_RELATIONS_NUMBER 172 173 * @since 9668 173 * @see #PROPERTY_RECENT_RELATIONS_NUMBER174 174 */ 175 175 public void setRecentRelation(Relation relation) {
Note:
See TracChangeset
for help on using the changeset viewer.