144a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford/* 244a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * Copyright (C) 2012 The Android Open Source Project 344a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * 444a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * Licensed under the Apache License, Version 2.0 (the "License"); 544a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * you may not use this file except in compliance with the License. 644a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * You may obtain a copy of the License at 744a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * 844a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * http://www.apache.org/licenses/LICENSE-2.0 944a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * 1044a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * Unless required by applicable law or agreed to in writing, software 1144a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * distributed under the License is distributed on an "AS IS" BASIS, 1244a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1344a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * See the License for the specific language governing permissions and 1444a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford * limitations under the License. 1544a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford */ 1644a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford 1744a499a64158cd5a12f8e44655f82b68c33bf3b2John Hofordpackage com.android.gallery3d.filtershow.editors; 1844a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford 1944a499a64158cd5a12f8e44655f82b68c33bf3b2John Hofordimport android.content.Context; 2044a499a64158cd5a12f8e44655f82b68c33bf3b2John Hofordimport android.widget.FrameLayout; 2144a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford 2244a499a64158cd5a12f8e44655f82b68c33bf3b2John Hofordimport com.android.gallery3d.R; 2344a499a64158cd5a12f8e44655f82b68c33bf3b2John Hofordimport com.android.gallery3d.filtershow.filters.FilterRepresentation; 2444a499a64158cd5a12f8e44655f82b68c33bf3b2John Hofordimport com.android.gallery3d.filtershow.filters.FilterTinyPlanetRepresentation; 2544a499a64158cd5a12f8e44655f82b68c33bf3b2John Hofordimport com.android.gallery3d.filtershow.imageshow.ImageTinyPlanet; 2644a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford 2744a499a64158cd5a12f8e44655f82b68c33bf3b2John Hofordpublic class EditorTinyPlanet extends BasicEditor { 2844a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford public static final int ID = R.id.tinyPlanetEditor; 2944a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford private static final String LOGTAG = "EditorTinyPlanet"; 3044a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford ImageTinyPlanet mImageTinyPlanet; 3144a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford 3244a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford public EditorTinyPlanet() { 3344a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford super(ID, R.layout.filtershow_tiny_planet_editor, R.id.imageTinyPlanet); 3444a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford } 3544a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford 3644a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford @Override 3744a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford public void createEditor(Context context, FrameLayout frameLayout) { 3844a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford super.createEditor(context, frameLayout); 3944a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford mImageTinyPlanet = (ImageTinyPlanet) mImageShow; 4044a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford mImageTinyPlanet.setEditor(this); 4144a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford } 4244a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford 4344a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford @Override 4444a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford public void reflectCurrentFilter() { 4544a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford super.reflectCurrentFilter(); 4644a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford FilterRepresentation rep = getLocalRepresentation(); 476a07dfbe03c8396cc43840a1630ea480a2cff663John Hoford if (rep != null && rep instanceof FilterTinyPlanetRepresentation) { 4844a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford FilterTinyPlanetRepresentation drawRep = (FilterTinyPlanetRepresentation) rep; 4944a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford mImageTinyPlanet.setRepresentation(drawRep); 5044a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford } 5144a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford } 5291d26f6c3b183862eeffc1856e2d758e800d13f4John Hoford 5391d26f6c3b183862eeffc1856e2d758e800d13f4John Hoford public void updateUI() { 5491d26f6c3b183862eeffc1856e2d758e800d13f4John Hoford if (mControl != null) { 5591d26f6c3b183862eeffc1856e2d758e800d13f4John Hoford mControl.updateUI(); 5691d26f6c3b183862eeffc1856e2d758e800d13f4John Hoford } 5791d26f6c3b183862eeffc1856e2d758e800d13f4John Hoford } 5844a499a64158cd5a12f8e44655f82b68c33bf3b2John Hoford} 59