--- /dev/null
+package tim.prune.undo;\r
+\r
+import tim.prune.I18nManager;\r
+import tim.prune.UpdateMessageBroker;\r
+import tim.prune.data.Photo;\r
+import tim.prune.data.TrackInfo;\r
+\r
+/**\r
+ * Operation to undo the rotation of a photo\r
+ */\r
+public class UndoRotatePhoto implements UndoOperation\r
+{\r
+ private Photo _photo = null;\r
+ private boolean _rightwards = true;\r
+\r
+\r
+ /**\r
+ * Constructor\r
+ * @param inPhoto photo\r
+ * @param inDir true if original operation was rightwards (clockwise) rotation\r
+ */\r
+ public UndoRotatePhoto(Photo inPhoto, boolean inDir)\r
+ {\r
+ _photo = inPhoto;\r
+ _rightwards = inDir;\r
+ }\r
+\r
+\r
+ /**\r
+ * @return description of operation including photo name\r
+ */\r
+ public String getDescription()\r
+ {\r
+ return I18nManager.getText("undo.rotatephoto") + " " + _photo.getName();\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
+ _photo.rotate(!_rightwards);\r
+ // inform subscribers\r
+ UpdateMessageBroker.informSubscribers();\r
+ }\r
+}
\ No newline at end of file