X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=src%2Ftim%2Fprune%2Fundo%2FUndoRotatePhoto.java;fp=src%2Ftim%2Fprune%2Fundo%2FUndoRotatePhoto.java;h=72cf40f92d68d800d0c3f202f9f4305fa8eb6d82;hp=0000000000000000000000000000000000000000;hb=ce6f2161b8596f7018d6a76bff79bc9e571f35fd;hpb=2d8cb72e84d5cc1089ce77baf1e34ea3ea2f8465 diff --git a/src/tim/prune/undo/UndoRotatePhoto.java b/src/tim/prune/undo/UndoRotatePhoto.java new file mode 100644 index 0000000..72cf40f --- /dev/null +++ b/src/tim/prune/undo/UndoRotatePhoto.java @@ -0,0 +1,48 @@ +package tim.prune.undo; + +import tim.prune.I18nManager; +import tim.prune.UpdateMessageBroker; +import tim.prune.data.Photo; +import tim.prune.data.TrackInfo; + +/** + * Operation to undo the rotation of a photo + */ +public class UndoRotatePhoto implements UndoOperation +{ + private Photo _photo = null; + private boolean _rightwards = true; + + + /** + * Constructor + * @param inPhoto photo + * @param inDir true if original operation was rightwards (clockwise) rotation + */ + public UndoRotatePhoto(Photo inPhoto, boolean inDir) + { + _photo = inPhoto; + _rightwards = inDir; + } + + + /** + * @return description of operation including photo name + */ + public String getDescription() + { + return I18nManager.getText("undo.rotatephoto") + " " + _photo.getName(); + } + + + /** + * Perform the undo operation on the given Track + * @param inTrackInfo TrackInfo object on which to perform the operation + */ + public void performUndo(TrackInfo inTrackInfo) throws UndoException + { + _photo.rotate(!_rightwards); + // inform subscribers + UpdateMessageBroker.informSubscribers(); + } +} \ No newline at end of file