1 package tim.prune.function;
4 import tim.prune.DataSubscriber;
5 import tim.prune.GenericFunction;
6 import tim.prune.I18nManager;
7 import tim.prune.UpdateMessageBroker;
8 import tim.prune.data.Photo;
9 import tim.prune.undo.UndoRotatePhoto;
12 * Class to provide the function to rotate a photo
13 * either clockwise or anticlockwise
15 public class RotatePhoto extends GenericFunction
17 /** Direction of rotation */
18 private boolean _direction = true;
22 * @param inApp application object for callback
23 * @param inDir true for clockwise, false for anticlockwise
25 public RotatePhoto(App inApp, boolean inDir)
31 /** Get the name key */
32 public String getNameKey() {
33 return _direction?"function.rotatephotoright":"function.rotatephotoleft";
41 Photo photo = _app.getTrackInfo().getCurrentPhoto();
44 UndoRotatePhoto undo = new UndoRotatePhoto(photo, _direction);
45 photo.rotate(_direction);
46 UpdateMessageBroker.informSubscribers(DataSubscriber.PHOTOS_MODIFIED);
47 _app.completeFunction(undo, I18nManager.getText("confirm.rotatephoto"));