1 package tim.prune.undo;
\r
3 import tim.prune.I18nManager;
\r
4 import tim.prune.data.DataPoint;
\r
5 import tim.prune.data.Photo;
\r
6 import tim.prune.data.TrackInfo;
\r
9 * Operation to undo the connection of a photo to a point
\r
11 public class UndoConnectPhoto implements UndoOperation
\r
13 private DataPoint _point = null;
\r
14 private String _filename = null;
\r
19 * @param inPoint data point
\r
20 * @param inFilename filename of photo
\r
22 public UndoConnectPhoto(DataPoint inPoint, String inFilename)
\r
25 _filename = inFilename;
\r
30 * @return description of operation including photo filename
\r
32 public String getDescription()
\r
34 String desc = I18nManager.getText("undo.connectphoto") + " " + _filename;
\r
40 * Perform the undo operation on the given Track
\r
41 * @param inTrackInfo TrackInfo object on which to perform the operation
\r
43 public void performUndo(TrackInfo inTrackInfo) throws UndoException
\r
46 Photo photo = _point.getPhoto();
\r
49 _point.setPhoto(null);
\r
50 photo.setDataPoint(null);
\r
51 // inform subscribers
\r
52 inTrackInfo.triggerUpdate();
\r
56 // throw exception if failed
\r
57 throw new UndoException(getDescription());
\r