Loading src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ public abstract class BaseFiltersManager implements FiltersManagerInterface { public FilterRepresentation createFilterFromName(String name) { try { return mRepresentationLookup.get(name).clone(); return mRepresentationLookup.get(name).copy(); } catch (Exception e) { Log.v(LOGTAG, "unable to generate a filter representation for \"" + name + "\""); e.printStackTrace(); Loading src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java +9 −8 Original line number Diff line number Diff line Loading @@ -48,17 +48,18 @@ public class FilterBasicRepresentation extends FilterRepresentation implements P } @Override public FilterRepresentation clone() throws CloneNotSupportedException { FilterBasicRepresentation representation = (FilterBasicRepresentation) super.clone(); representation.setMinimum(getMinimum()); representation.setMaximum(getMaximum()); representation.setValue(getValue()); if (mLogVerbose) { Log.v(LOGTAG, "cloning from <" + this + "> to <" + representation + ">"); } public FilterRepresentation copy() { FilterBasicRepresentation representation = new FilterBasicRepresentation(getName(),0,0,0); copyAllParameters(representation); return representation; } @Override protected void copyAllParameters(FilterRepresentation representation) { super.copyAllParameters(representation); representation.useParametersFrom(this); } @Override public void useParametersFrom(FilterRepresentation a) { if (a instanceof FilterBasicRepresentation) { Loading src/com/android/gallery3d/filtershow/filters/FilterColorBorderRepresentation.java +9 −7 Original line number Diff line number Diff line Loading @@ -40,16 +40,18 @@ public class FilterColorBorderRepresentation extends FilterRepresentation { } @Override public FilterRepresentation clone() throws CloneNotSupportedException { setFilterClass(ImageFilterParametricBorder.class); FilterColorBorderRepresentation representation = (FilterColorBorderRepresentation) super.clone(); representation.setName(getName()); representation.setColor(getColor()); representation.setBorderSize(getBorderSize()); representation.setBorderRadius(getBorderRadius()); public FilterRepresentation copy() { FilterColorBorderRepresentation representation = new FilterColorBorderRepresentation(0,0,0); copyAllParameters(representation); return representation; } @Override protected void copyAllParameters(FilterRepresentation representation) { super.copyAllParameters(representation); representation.useParametersFrom(this); } public void useParametersFrom(FilterRepresentation a) { if (a instanceof FilterColorBorderRepresentation) { FilterColorBorderRepresentation representation = (FilterColorBorderRepresentation) a; Loading src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java +10 −4 Original line number Diff line number Diff line Loading @@ -33,10 +33,16 @@ public class FilterCurvesRepresentation extends FilterRepresentation { } @Override public FilterRepresentation clone() throws CloneNotSupportedException { FilterCurvesRepresentation rep = new FilterCurvesRepresentation(); rep.useParametersFrom(this); return rep; public FilterRepresentation copy() { FilterCurvesRepresentation representation = new FilterCurvesRepresentation(); copyAllParameters(representation); return representation; } @Override protected void copyAllParameters(FilterRepresentation representation) { super.copyAllParameters(representation); representation.useParametersFrom(this); } @Override Loading src/com/android/gallery3d/filtershow/filters/FilterDirectRepresentation.java +13 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,19 @@ package com.android.gallery3d.filtershow.filters; public class FilterDirectRepresentation extends FilterRepresentation { @Override public FilterRepresentation copy() { FilterDirectRepresentation representation = new FilterDirectRepresentation(getName()); copyAllParameters(representation); return representation; } @Override protected void copyAllParameters(FilterRepresentation representation) { super.copyAllParameters(representation); representation.useParametersFrom(this); } public FilterDirectRepresentation(String name) { super(name); } Loading Loading
src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ public abstract class BaseFiltersManager implements FiltersManagerInterface { public FilterRepresentation createFilterFromName(String name) { try { return mRepresentationLookup.get(name).clone(); return mRepresentationLookup.get(name).copy(); } catch (Exception e) { Log.v(LOGTAG, "unable to generate a filter representation for \"" + name + "\""); e.printStackTrace(); Loading
src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java +9 −8 Original line number Diff line number Diff line Loading @@ -48,17 +48,18 @@ public class FilterBasicRepresentation extends FilterRepresentation implements P } @Override public FilterRepresentation clone() throws CloneNotSupportedException { FilterBasicRepresentation representation = (FilterBasicRepresentation) super.clone(); representation.setMinimum(getMinimum()); representation.setMaximum(getMaximum()); representation.setValue(getValue()); if (mLogVerbose) { Log.v(LOGTAG, "cloning from <" + this + "> to <" + representation + ">"); } public FilterRepresentation copy() { FilterBasicRepresentation representation = new FilterBasicRepresentation(getName(),0,0,0); copyAllParameters(representation); return representation; } @Override protected void copyAllParameters(FilterRepresentation representation) { super.copyAllParameters(representation); representation.useParametersFrom(this); } @Override public void useParametersFrom(FilterRepresentation a) { if (a instanceof FilterBasicRepresentation) { Loading
src/com/android/gallery3d/filtershow/filters/FilterColorBorderRepresentation.java +9 −7 Original line number Diff line number Diff line Loading @@ -40,16 +40,18 @@ public class FilterColorBorderRepresentation extends FilterRepresentation { } @Override public FilterRepresentation clone() throws CloneNotSupportedException { setFilterClass(ImageFilterParametricBorder.class); FilterColorBorderRepresentation representation = (FilterColorBorderRepresentation) super.clone(); representation.setName(getName()); representation.setColor(getColor()); representation.setBorderSize(getBorderSize()); representation.setBorderRadius(getBorderRadius()); public FilterRepresentation copy() { FilterColorBorderRepresentation representation = new FilterColorBorderRepresentation(0,0,0); copyAllParameters(representation); return representation; } @Override protected void copyAllParameters(FilterRepresentation representation) { super.copyAllParameters(representation); representation.useParametersFrom(this); } public void useParametersFrom(FilterRepresentation a) { if (a instanceof FilterColorBorderRepresentation) { FilterColorBorderRepresentation representation = (FilterColorBorderRepresentation) a; Loading
src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java +10 −4 Original line number Diff line number Diff line Loading @@ -33,10 +33,16 @@ public class FilterCurvesRepresentation extends FilterRepresentation { } @Override public FilterRepresentation clone() throws CloneNotSupportedException { FilterCurvesRepresentation rep = new FilterCurvesRepresentation(); rep.useParametersFrom(this); return rep; public FilterRepresentation copy() { FilterCurvesRepresentation representation = new FilterCurvesRepresentation(); copyAllParameters(representation); return representation; } @Override protected void copyAllParameters(FilterRepresentation representation) { super.copyAllParameters(representation); representation.useParametersFrom(this); } @Override Loading
src/com/android/gallery3d/filtershow/filters/FilterDirectRepresentation.java +13 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,19 @@ package com.android.gallery3d.filtershow.filters; public class FilterDirectRepresentation extends FilterRepresentation { @Override public FilterRepresentation copy() { FilterDirectRepresentation representation = new FilterDirectRepresentation(getName()); copyAllParameters(representation); return representation; } @Override protected void copyAllParameters(FilterRepresentation representation) { super.copyAllParameters(representation); representation.useParametersFrom(this); } public FilterDirectRepresentation(String name) { super(name); } Loading