summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java
index 4d0651edb..368e5c029 100644
--- a/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java
+++ b/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java
@@ -31,6 +31,8 @@ public class FilterBasicRepresentation extends FilterRepresentation implements P
private int mMaximum;
private int mDefaultValue;
private int mPreviewValue;
+ public static final String SERIAL_NAME = "Name";
+ public static final String SERIAL_VALUE = "Value";
private boolean mLogVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
public FilterBasicRepresentation(String name, int minimum, int value, int maximum) {
@@ -171,4 +173,23 @@ public class FilterBasicRepresentation extends FilterRepresentation implements P
public void copyFrom(Parameter src) {
useParametersFrom((FilterBasicRepresentation) src);
}
+
+ @Override
+ public String[][] serializeRepresentation() {
+ String[][] ret = {
+ {SERIAL_NAME , getName() },
+ {SERIAL_VALUE , Integer.toString(mValue)}};
+ return ret;
+ }
+
+ @Override
+ public void deSerializeRepresentation(String[][] rep) {
+ super.deSerializeRepresentation(rep);
+ for (int i = 0; i < rep.length; i++) {
+ if (SERIAL_VALUE.equals(rep[i][0])) {
+ mValue = Integer.parseInt(rep[i][1]);
+ break;
+ }
+ }
+ }
}