/** Updates the title of the dialog. */
 public synchronized void updateTitle() {
   if (!SwingUtilities.isEventDispatchThread()) {
     SwingUtilities.invokeLater(this::updateTitle);
   } else if (this.image != null) {
     StringBuilder title = new StringBuilder(tr(BASE_TITLE));
     if (this.image instanceof MapillaryImage) {
       MapillaryImage mapillaryImage = (MapillaryImage) this.image;
       if (mapillaryImage.getUser() != null) title.append(" — ").append(mapillaryImage.getUser());
       if (mapillaryImage.getCapturedAt() != 0)
         title.append(" — ").append(mapillaryImage.getDate());
       setTitle(title.toString());
     } else if (this.image instanceof MapillaryImportedImage) {
       MapillaryImportedImage mapillaryImportedImage = (MapillaryImportedImage) this.image;
       title.append(" — ").append(mapillaryImportedImage.getFile().getName());
       title.append(" — ").append(mapillaryImportedImage.getDate());
       setTitle(title.toString());
     }
   }
 }