Changeset 12267 in josm
- Timestamp:
- 2017-05-28T03:43:59+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r12220 r12267 4 4 import java.io.File; 5 5 import java.text.MessageFormat; 6 import java.util.AbstractCollection;7 6 import java.util.ArrayList; 8 7 import java.util.Collection; … … 24 23 import org.openstreetmap.josm.data.gpx.GpxTrack.GpxTrackChangeListener; 25 24 import org.openstreetmap.josm.tools.ListenerList; 25 import org.openstreetmap.josm.tools.ListeningCollection; 26 26 27 27 /** … … 668 668 669 669 /** 670 * This is a proxy of a collection that notifies a listener on every collection change671 * @author Michael Zangl672 *673 * @param <T> The entry type674 * @since 12156675 */676 private static class ListeningCollection<T> extends AbstractCollection<T> {677 private final ArrayList<T> base;678 private final Runnable runOnModification;679 680 ListeningCollection(ArrayList<T> base, Runnable runOnModification) {681 this.base = base;682 this.runOnModification = runOnModification;683 }684 685 @Override686 public Iterator<T> iterator() {687 Iterator<T> it = base.iterator();688 return new Iterator<T>() {689 private T cursor;690 691 @Override692 public boolean hasNext() {693 return it.hasNext();694 }695 696 @Override697 public T next() {698 cursor = it.next();699 return cursor;700 }701 702 @Override703 public void remove() {704 if (cursor != null) {705 removed(cursor);706 cursor = null;707 }708 it.remove();709 }710 };711 }712 713 @Override714 public int size() {715 return base.size();716 }717 718 @Override719 @SuppressWarnings("unchecked")720 public boolean remove(Object o) {721 boolean remove = base.remove(o);722 if (remove) {723 removed((T) o);724 }725 return remove;726 }727 728 @Override729 public boolean add(T e) {730 boolean add = base.add(e);731 added(e);732 return add;733 }734 735 protected void removed(T cursor) {736 runOnModification.run();737 }738 739 protected void added(T cursor) {740 runOnModification.run();741 }742 }743 744 /**745 670 * A listener that listens to GPX data changes. 746 671 * @author Michael Zangl -
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r12177 r12267 784 784 } 785 785 // if this is really a change (and not the first active layer) 786 if (e.getPreviousActiveLayer() != null) { 787 if (!modeChanged && mapMode != null) { 788 // Let mapmodes know about new active layer 789 mapMode.exitMode(); 790 mapMode.enterMode(); 791 } 786 if (e.getPreviousActiveLayer() != null && !modeChanged && mapMode != null) { 787 // Let mapmodes know about new active layer 788 mapMode.exitMode(); 789 mapMode.enterMode(); 792 790 } 793 791 -
trunk/src/org/openstreetmap/josm/io/session/ImagerySessionExporter.java
r12134 r12267 98 98 } 99 99 100 private void addAttributes(Element element, Map<String, String> props, ExportSupport support) {100 private static void addAttributes(Element element, Map<String, String> props, ExportSupport support) { 101 101 for (Map.Entry<String, String> entry : props.entrySet()) { 102 102 Element attrElem = support.createElement(entry.getKey()); -
trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java
r12134 r12267 59 59 } 60 60 61 private Map<String, String> readProperties(Element elem) {61 private static Map<String, String> readProperties(Element elem) { 62 62 Map<String, String> attributes = new HashMap<>(); 63 63 NodeList nodes = elem.getChildNodes(); -
trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
r12219 r12267 174 174 || (javaVersion == 9 && javaUpdate == 0 && javaBuild < 171))) { 175 175 // Workaround from https://bugs.openjdk.java.net/browse/JDK-8179014 176 UIManager.put("FileChooser.useSystemExtensionHiding", false);176 UIManager.put("FileChooser.useSystemExtensionHiding", Boolean.FALSE); 177 177 } 178 178 } catch (NumberFormatException | ReflectiveOperationException e) {
Note:
See TracChangeset
for help on using the changeset viewer.