EditorRotate.java revision be31e587c1485fb8e3d7c8b079250ffbdc26e1b9
1d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford/*
2d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford * Copyright (C) 2013 The Android Open Source Project
3d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford *
4d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford * Licensed under the Apache License, Version 2.0 (the "License");
5d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford * you may not use this file except in compliance with the License.
6d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford * You may obtain a copy of the License at
7d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford *
8d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford *      http://www.apache.org/licenses/LICENSE-2.0
9d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford *
10d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford * Unless required by applicable law or agreed to in writing, software
11d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford * distributed under the License is distributed on an "AS IS" BASIS,
12d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford * See the License for the specific language governing permissions and
14d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford * limitations under the License.
15d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford */
16d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford
17d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hofordpackage com.android.gallery3d.filtershow.editors;
18d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford
19d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hofordimport android.content.Context;
20d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hofordimport android.widget.FrameLayout;
21d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford
22d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hofordimport com.android.gallery3d.R;
23d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hofordimport com.android.gallery3d.filtershow.imageshow.ImageRotate;
24d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hofordimport com.android.gallery3d.filtershow.imageshow.MasterImage;
25d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford
26d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hofordpublic class EditorRotate extends Editor implements EditorInfo {
27d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    public static final int ID = R.id.editorRotate;
28d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    ImageRotate mImageRotate;
29d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford
30d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    public EditorRotate() {
31d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford        super(ID);
32d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    }
33d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford
34d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    @Override
35d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    public void createEditor(Context context, FrameLayout frameLayout) {
36d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford        super.createEditor(context, frameLayout);
37839d529f800adcd1ef5fcd262322bc939c2c2089nicolasroard        if (mImageRotate == null) {
38839d529f800adcd1ef5fcd262322bc939c2c2089nicolasroard            mImageRotate = new ImageRotate(context);
39839d529f800adcd1ef5fcd262322bc939c2c2089nicolasroard        }
40839d529f800adcd1ef5fcd262322bc939c2c2089nicolasroard        mView = mImageShow = mImageRotate;
41d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford        mImageRotate.setImageLoader(MasterImage.getImage().getImageLoader());
42d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford        mImageRotate.setEditor(this);
43d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford        mImageRotate.syncLocalToMasterGeometry();
44d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    }
45d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford
46d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    @Override
47d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    public int getTextId() {
48d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford        return R.string.rotate;
49d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    }
50d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford
51d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    @Override
52d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    public int getOverlayId() {
53d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford        return R.drawable.filtershow_button_geometry_rotate;
54d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    }
55d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford
56d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    @Override
57d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    public boolean getOverlayOnly() {
58d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford        return true;
59d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford    }
6091be98c35f6c5f19d7629bb29e7261970b2f4c67nicolasroard
6191be98c35f6c5f19d7629bb29e7261970b2f4c67nicolasroard    @Override
6291be98c35f6c5f19d7629bb29e7261970b2f4c67nicolasroard    public boolean showsSeekBar() {
6391be98c35f6c5f19d7629bb29e7261970b2f4c67nicolasroard        return false;
6491be98c35f6c5f19d7629bb29e7261970b2f4c67nicolasroard    }
65be31e587c1485fb8e3d7c8b079250ffbdc26e1b9nicolasroard
66be31e587c1485fb8e3d7c8b079250ffbdc26e1b9nicolasroard    @Override
67be31e587c1485fb8e3d7c8b079250ffbdc26e1b9nicolasroard    public boolean showsPopupIndicator() {
68be31e587c1485fb8e3d7c8b079250ffbdc26e1b9nicolasroard        return false;
69be31e587c1485fb8e3d7c8b079250ffbdc26e1b9nicolasroard    }
70d61a2f9fcaad0309132b6b9b666c3dc6df62fed7John Hoford}
71