+++ /dev/null
-package tim.prune.undo;\r
-\r
-import tim.prune.I18nManager;\r
-import tim.prune.UpdateMessageBroker;\r
-import tim.prune.data.DataPoint;\r
-import tim.prune.data.Photo;\r
-import tim.prune.data.TrackInfo;\r
-\r
-/**\r
- * Operation to undo the disconnection of a photo from a point\r
- */\r
-public class UndoDisconnectPhoto implements UndoOperation\r
-{\r
- private DataPoint _point = null;\r
- private Photo _photo = null;\r
- private String _filename = null;\r
-\r
-\r
- /**\r
- * Constructor\r
- * @param inPoint data point\r
- * @param inFilename filename of photo\r
- */\r
- public UndoDisconnectPhoto(DataPoint inPoint, String inFilename)\r
- {\r
- _point = inPoint;\r
- _photo = inPoint.getPhoto();\r
- _filename = inFilename;\r
- }\r
-\r
-\r
- /**\r
- * @return description of operation including photo filename\r
- */\r
- public String getDescription()\r
- {\r
- String desc = I18nManager.getText("undo.disconnectphoto") + " " + _filename;\r
- return desc;\r
- }\r
-\r
-\r
- /**\r
- * Perform the undo operation on the given Track\r
- * @param inTrackInfo TrackInfo object on which to perform the operation\r
- */\r
- public void performUndo(TrackInfo inTrackInfo) throws UndoException\r
- {\r
- // Connect again\r
- if (_point != null && _photo != null)\r
- {\r
- _point.setPhoto(_photo);\r
- _photo.setDataPoint(_point);\r
- // inform subscribers\r
- UpdateMessageBroker.informSubscribers();\r
- }\r
- else\r
- {\r
- // throw exception if failed\r
- throw new UndoException(getDescription());\r
- }\r
- }\r
-}
\ No newline at end of file