+ /**
+ * Delete the currently selected photo and optionally its point too
+ * @param inPointToo true to also delete associated point
+ * @return true if delete successful
+ */
+ public boolean deleteCurrentPhoto(boolean inPointToo)
+ {
+ // delete currently selected photo
+ int photoIndex = _selection.getCurrentPhotoIndex();
+ if (photoIndex >= 0)
+ {
+ Photo photo = _photoList.getPhoto(photoIndex);
+ _photoList.deletePhoto(photoIndex);
+ // has it got a point?
+ if (photo.getDataPoint() != null)
+ {
+ if (inPointToo)
+ {
+ // delete point
+ int pointIndex = _track.getPointIndex(photo.getDataPoint());
+ _track.deletePoint(pointIndex);
+ }
+ else
+ {
+ // disconnect point from photo
+ photo.getDataPoint().setPhoto(null);
+ photo.setDataPoint(null);
+ }
+ }
+ // update subscribers
+ _selection.modifyPointDeleted();
+ _broker.informSubscribers();
+ }
+ return true;
+ }
+
+