Changeset 31194 in osm for applications/editors


Ignore:
Timestamp:
2015-06-03T11:38:58+02:00 (10 years ago)
Author:
nokutu
Message:

Fixed bug which would duplicate some images and now the Mapillary layer is set as active when being created

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java

    r31183 r31194  
    9494                MapillaryPlugin.setMenuEnabled(MapillaryPlugin.EXPORT_MENU, true);
    9595                download();
     96                Main.map.mapView.setActiveLayer(this);
    9697        }
    9798
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java

    r31185 r31194  
    3333                        "mapiconselected.png").get();
    3434        public static final int ICON_SIZE = 24;
    35        
     35
    3636        public static CacheAccess<String, BufferedImageCacheEntry> CACHE;
    3737
     
    5656                EXPORT_MENU.setEnabled(false);
    5757                try {
    58                         CACHE = JCSCacheManager.getCache("mapillary", 10, 10000, this.getPluginDir() + "/cache/");
     58                        CACHE = JCSCacheManager.getCache("mapillary", 10, 10000,
     59                                        this.getPluginDir() + "/cache/");
    5960                } catch (IOException e) {
    6061                        Main.error(e);
     
    7071                }
    7172                if (oldFrame != null && newFrame == null) { // map frame destroyed
    72                         MapillaryToggleDialog.deleteInstance();
     73                        MapillaryToggleDialog.destroyInstance();
    7374                }
    7475        }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySequence.java

    r31170 r31194  
    1414        private final List<MapillaryImage> images;
    1515        private String timestamp;
     16        private final String key;
    1617
    17         public MapillarySequence() {
     18        public MapillarySequence(String key) {
    1819                this.images = new ArrayList<>();
     20                this.key = key;
    1921        }
    2022
    21         public MapillarySequence(List<MapillaryImage> images) {
    22                 this.images = images;
    23         }
    2423
    2524        /**
     
    4746        public synchronized void add(MapillaryImage image) {
    4847                this.images.add(image);
     48        }
     49       
     50        public String getKey() {
     51                return this.key;
    4952        }
    5053
     
    115118                                - this.images.indexOf(image2));
    116119        }
     120       
     121        public boolean equals(MapillarySequence sequence) {
     122                return this.getKey() == sequence.getKey();
     123        }
    117124}
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryToggleDialog.java

    r31185 r31194  
    8282        }
    8383
    84         public static void deleteInstance() {
     84        public static void destroyInstance() {
    8585                INSTANCE = null;
    8686        }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java

    r31179 r31194  
    7777                                if (isSequenceWrong)
    7878                                        break;
    79                                 MapillarySequence sequence = new MapillarySequence();
     79                                MapillarySequence sequence = new MapillarySequence(jsonobj.getString("key"));
     80                                for (MapillaryImage mimage : MapillaryData.getInstance().getImages())
     81                                        if (mimage.getSequence().getKey() == sequence.getKey())
     82                                                break;
    8083                                int first = -1;
    8184                                int last = -1;
Note: See TracChangeset for help on using the changeset viewer.