From 8305b7ed10e6f28765d8854adebcbb265fcf30e7 Mon Sep 17 00:00:00 2001 From: serso Date: Mon, 17 Oct 2011 23:53:50 +0400 Subject: [PATCH] rename --- .../android/calculator/CalculatorActivity.java | 12 ++++++------ .../android/calculator/CalculatorVarsActivity.java | 8 ++++---- .../android/calculator/CalculatorView.java | 10 +++++----- .../solovyev/android/calculator/math/MathType.java | 4 ++-- ...{CalculatorModel.java => CalculatorEngine.java} | 4 ++-- .../calculator/model/FromJsclTextProcessor.java | 2 +- .../calculator/model/ToJsclTextProcessor.java | 6 +++--- .../android/calculator/math/MathTypeTest.java | 4 ++-- ...torModelTest.java => CalculatorEngineTest.java} | 14 +++++++------- .../calculator/model/ToJsclTextProcessorTest.java | 2 +- 10 files changed, 33 insertions(+), 33 deletions(-) rename src/main/java/org/solovyev/android/calculator/model/{CalculatorModel.java => CalculatorEngine.java} (96%) rename src/test/java/org/solovyev/android/calculator/model/{CalculatorModelTest.java => CalculatorEngineTest.java} (91%) diff --git a/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java b/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java index 0b5f3654..79334e7e 100644 --- a/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java +++ b/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java @@ -23,7 +23,7 @@ import android.widget.TextView; import bsh.EvalError; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.solovyev.android.calculator.model.CalculatorModel; +import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.view.FontSizeAdjuster; import org.solovyev.android.view.widgets.*; import org.solovyev.common.BooleanMapper; @@ -73,7 +73,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh firstTimeInit(preferences); - calculatorView = CalculatorView.instance.init(this, preferences, CalculatorModel.instance); + calculatorView = CalculatorView.instance.init(this, preferences, CalculatorEngine.instance); dpclRegister.clear(); @@ -90,7 +90,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh ((DragButton) findViewById(R.id.leftButton)).setOnDragListener(toPositionOnDragListener); dpclRegister.addListener(toPositionOnDragListener); - CalculatorModel.instance.reset(this, preferences); + CalculatorEngine.instance.reset(this, preferences); preferences.registerOnSharedPreferenceChangeListener(this); } @@ -157,7 +157,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh private synchronized void firstTimeInit(@NotNull SharedPreferences preferences) { if (!initialized) { try { - CalculatorModel.instance.init(this, preferences); + CalculatorEngine.instance.init(this, preferences); } catch (EvalError evalError) { throw new RuntimeException("Could not initialize interpreter!"); } @@ -362,7 +362,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh restart(); } - calculatorView = CalculatorView.instance.init(this, preferences, CalculatorModel.instance); + calculatorView = CalculatorView.instance.init(this, preferences, CalculatorEngine.instance); this.calculatorView.evaluate(); } @@ -371,7 +371,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh public void onSharedPreferenceChanged(SharedPreferences preferences, @Nullable String s) { dpclRegister.announce().onDragPreferencesChange(SimpleOnDragListener.getPreferences(preferences, this)); - CalculatorModel.instance.reset(this, preferences); + CalculatorEngine.instance.reset(this, preferences); final Boolean colorExpressionsInBracketsDefault = new BooleanMapper().parseValue(this.getString(R.string.p_calc_color_display)); assert colorExpressionsInBracketsDefault != null; diff --git a/src/main/java/org/solovyev/android/calculator/CalculatorVarsActivity.java b/src/main/java/org/solovyev/android/calculator/CalculatorVarsActivity.java index 8d9281ea..67b32919 100644 --- a/src/main/java/org/solovyev/android/calculator/CalculatorVarsActivity.java +++ b/src/main/java/org/solovyev/android/calculator/CalculatorVarsActivity.java @@ -18,7 +18,7 @@ import android.widget.*; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.solovyev.android.calculator.math.MathType; -import org.solovyev.android.calculator.model.CalculatorModel; +import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.calculator.model.Var; import org.solovyev.android.calculator.model.VarsRegister; import org.solovyev.common.utils.StringUtils; @@ -45,7 +45,7 @@ public class CalculatorVarsActivity extends ListActivity { setContentView(R.layout.vars); - adapter = new VarsArrayAdapter(this, R.layout.var, R.id.var_text, new ArrayList(CalculatorModel.instance.getVarsRegister().getVars())); + adapter = new VarsArrayAdapter(this, R.layout.var, R.id.var_text, new ArrayList(CalculatorEngine.instance.getVarsRegister().getVars())); setListAdapter(adapter); final ListView lv = getListView(); @@ -191,7 +191,7 @@ public class CalculatorVarsActivity extends ListActivity { String description = editDescription.getText().toString(); - final VarsRegister varsRegister = CalculatorModel.instance.getVarsRegister(); + final VarsRegister varsRegister = CalculatorEngine.instance.getVarsRegister(); if (!StringUtils.isEmpty(name)) { final Var varFromRegister = varsRegister.getVar(name); if (varFromRegister == null || varFromRegister == editedInstance) { @@ -334,7 +334,7 @@ public class CalculatorVarsActivity extends ListActivity { builder.create().show(); } else { adapter.remove(var); - final VarsRegister varsRegister = CalculatorModel.instance.getVarsRegister(); + final VarsRegister varsRegister = CalculatorEngine.instance.getVarsRegister(); varsRegister.remove(var); varsRegister.save(CalculatorVarsActivity.this); CalculatorVarsActivity.this.adapter.notifyDataSetChanged(); diff --git a/src/main/java/org/solovyev/android/calculator/CalculatorView.java b/src/main/java/org/solovyev/android/calculator/CalculatorView.java index eb537210..cd41d26c 100644 --- a/src/main/java/org/solovyev/android/calculator/CalculatorView.java +++ b/src/main/java/org/solovyev/android/calculator/CalculatorView.java @@ -19,7 +19,7 @@ import bsh.EvalError; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.solovyev.android.calculator.math.MathType; -import org.solovyev.android.calculator.model.CalculatorModel; +import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.calculator.model.ParseException; import org.solovyev.android.view.CursorControl; import org.solovyev.android.view.HistoryControl; @@ -47,10 +47,10 @@ public enum CalculatorView implements CursorControl, HistoryControl