new plotter

This commit is contained in:
Sergey Solovyev
2013-01-19 02:47:33 +04:00
parent 6af5239c6e
commit 05e9026048
13 changed files with 165 additions and 71 deletions

View File

@@ -132,8 +132,6 @@ public final class CalculatorPreferences {
public static class Graph {
public static final Preference<Boolean> interpolate = new BooleanPreference("graph_interpolate", true);
public static final Preference<PlotLineColor> lineColorReal = StringPreference.newInstance("graph_line_color_real", PlotLineColor.white, PlotLineColor.class);
public static final Preference<PlotLineColor> lineColorImag = StringPreference.newInstance("graph_line_color_imag", PlotLineColor.blue, PlotLineColor.class);
public static final Preference<Boolean> plotImag = new BooleanPreference("graph_plot_imag", false);
}
@@ -189,8 +187,6 @@ public final class CalculatorPreferences {
applyDefaultPreference(preferences, Gui.hideNumeralBaseDigits);
applyDefaultPreference(preferences, Graph.interpolate);
applyDefaultPreference(preferences, Graph.lineColorImag);
applyDefaultPreference(preferences, Graph.lineColorReal);
applyDefaultPreference(preferences, Graph.plotImag);
applyDefaultPreference(preferences, History.showIntermediateCalculations);
applyDefaultPreference(preferences, Calculations.calculateOnFly);

View File

@@ -28,8 +28,6 @@ public class AndroidCalculatorPlotter implements CalculatorPlotter, SharedPrefer
preferences.registerOnSharedPreferenceChangeListener(this);
onSharedPreferenceChanged(preferences, CalculatorPreferences.Graph.plotImag.getKey());
onSharedPreferenceChanged(preferences, CalculatorPreferences.Graph.lineColorReal.getKey());
onSharedPreferenceChanged(preferences, CalculatorPreferences.Graph.lineColorImag.getKey());
}
@Override
@@ -165,21 +163,5 @@ public class AndroidCalculatorPlotter implements CalculatorPlotter, SharedPrefer
if (CalculatorPreferences.Graph.plotImag.getKey().equals(key)) {
setPlotImag(CalculatorPreferences.Graph.plotImag.getPreference(preferences));
}
if (CalculatorPreferences.Graph.lineColorReal.getKey().equals(key)) {
setRealLineColor(CalculatorPreferences.Graph.lineColorReal.getPreference(preferences));
}
if (CalculatorPreferences.Graph.lineColorImag.getKey().equals(key)) {
setImagLineColor(CalculatorPreferences.Graph.lineColorImag.getPreference(preferences));
}
}
public void setImagLineColor(@NotNull PlotLineColor imagLineColor) {
plotter.setImagLineColor(imagLineColor);
}
public void setRealLineColor(@NotNull PlotLineColor realLineColor) {
plotter.setRealLineColor(realLineColor);
}
}