Ignore:
Timestamp:
2015-07-15T16:34:41+02:00 (10 years ago)
Author:
nokutu
Message:

Imported images show their names and capture time in the dialog titlebar

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

Legend:

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

    r31358 r31377  
    228228      if (image instanceof MapillaryImage) {
    229229        MapillaryImage mapillaryImage = (MapillaryImage) image;
    230         // Donwloadins thumbnails of surrounding pictures.
     230        // Downloading thumbnails of surrounding pictures.
    231231        if (mapillaryImage.next() != null) {
    232232          new MapillaryCache(((MapillaryImage) mapillaryImage.next()).getKey(), MapillaryCache.Type.THUMBNAIL).submit(
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java

    r31358 r31377  
    163163        mapillaryImageDisplay.hyperlink.setVisible(true);
    164164        MapillaryImage mapillaryImage = (MapillaryImage) this.image;
    165         updateTitle();
    166 
    167165        mapillaryImageDisplay.hyperlink.setURL(mapillaryImage.getKey());
    168166        // Downloads the thumbnail.
     
    182180      } else if (image instanceof MapillaryImportedImage) {
    183181        mapillaryImageDisplay.hyperlink.setVisible(false);
     182        mapillaryImageDisplay.hyperlink.setURL(null);
    184183        MapillaryImportedImage mapillaryImage = (MapillaryImportedImage) this.image;
    185184        try {
     
    188187          Main.error(e);
    189188        }
    190         mapillaryImageDisplay.hyperlink.setURL(null);
    191       }
     189      }
     190      updateTitle();
    192191    }
    193192  }
     
    223222    } else {
    224223      if (this.image != null) {
    225         MapillaryImage mapillaryImage = (MapillaryImage) this.image;
    226         String title = tr(BASE_TITLE);
    227         if (mapillaryImage.getUser() != null)
    228           title += " -- " + mapillaryImage.getUser();
    229         if (mapillaryImage.getCapturedAt() != 0)
    230           title += " -- " + mapillaryImage.getDate();
    231         setTitle(title);
     224        if (this.image instanceof MapillaryImage) {
     225          MapillaryImage mapillaryImage = (MapillaryImage) this.image;
     226          String title = tr(BASE_TITLE);
     227          if (mapillaryImage.getUser() != null)
     228            title += " -- " + mapillaryImage.getUser();
     229          if (mapillaryImage.getCapturedAt() != 0)
     230            title += " -- " + mapillaryImage.getDate();
     231          setTitle(title);
     232        }
     233        else if (this.image instanceof MapillaryImportedImage) {
     234          MapillaryImportedImage mapillaryImportedImage = (MapillaryImportedImage) this.image;
     235          String title = tr(BASE_TITLE);
     236          title += " -- " + mapillaryImportedImage.getFile().getName();
     237          title += " -- " + mapillaryImportedImage.getDate();
     238          setTitle(title);
     239        }
    232240      }
    233241    }
     
    257265    @Override
    258266    public void actionPerformed(ActionEvent e) {
    259       if (MapillaryMainDialog.getInstance().getImage() != null) {
    260         MapillaryData.getInstance().selectNext();
    261       }
     267      MapillaryData.getInstance().selectNext();
    262268    }
    263269  }
     
    278284    @Override
    279285    public void actionPerformed(ActionEvent e) {
    280       if (MapillaryMainDialog.getInstance().getImage() != null) {
    281         MapillaryData.getInstance().selectPrevious();
    282       }
     286      MapillaryData.getInstance().selectPrevious();
    283287    }
    284288  }
     
    395399  public void selectedImageChanged(MapillaryAbstractImage oldImage,
    396400      MapillaryAbstractImage newImage) {
    397     setImage(MapillaryData.getInstance().getSelectedImage());
     401    setImage(newImage);
    398402    updateImage();
    399403  }
Note: See TracChangeset for help on using the changeset viewer.