From 898ac936df364c4d1a733644953d558547f49e66 Mon Sep 17 00:00:00 2001 From: serso Date: Sun, 18 Sep 2011 00:08:04 +0400 Subject: [PATCH] complex number support added --- pom.xml | 22 +++++ res/layout-land/main.xml | 30 +++--- res/layout-port/main.xml | 30 +++--- res/values/strings.xml | 3 +- res/values/styles.xml | 2 +- .../android/calculator/CalculatorDisplay.java | 47 +++++++++ .../CalculatorDisplayHistoryState.java | 38 ++++++++ .../calculator/CalculatorHistoryState.java | 8 +- .../android/calculator/CalculatorModel.java | 62 ++++++++++-- .../android/calculator/CalculatorView.java | 95 ++++++++++++------- .../android/calculator/Preprocessor.java | 81 +++++++++++----- .../java/org/solovyev/util/math/Complex.java | 37 ++++++++ .../org/solovyev/util/math/Functions.java | 40 ++++++++ .../org/solovyev/util/math/MathEntity.java | 42 -------- .../solovyev/util/math/MathEntityType.java | 6 +- .../calculator/CalculatorModelTest.java | 58 +++++++++++ 16 files changed, 458 insertions(+), 143 deletions(-) create mode 100644 src/main/java/org/solovyev/android/calculator/CalculatorDisplay.java create mode 100644 src/main/java/org/solovyev/android/calculator/CalculatorDisplayHistoryState.java create mode 100644 src/main/java/org/solovyev/util/math/Complex.java create mode 100644 src/main/java/org/solovyev/util/math/Functions.java delete mode 100644 src/main/java/org/solovyev/util/math/MathEntity.java create mode 100644 src/test/java/org/solovyev/android/calculator/CalculatorModelTest.java diff --git a/pom.xml b/pom.xml index 226bf92d..40d7c787 100644 --- a/pom.xml +++ b/pom.xml @@ -15,8 +15,24 @@ ${basedir}/src/misc/lib + + + congrace.de + releases + http://nexus.congrace.de/nexus/content/repositories/releases/ + default + + + + + junit + junit + 4.8.2 + test + + org.solovyev common @@ -37,6 +53,12 @@ ${additionalLibs}/jscl.jar + + de.congrace + exp4j + 0.2.8 + + com.intellij annotations diff --git a/res/layout-land/main.xml b/res/layout-land/main.xml index d72988fb..281323cd 100644 --- a/res/layout-land/main.xml +++ b/res/layout-land/main.xml @@ -38,7 +38,7 @@ style="@style/control_button_style" a:onClick="eraseButtonClickHandler"/> - - - - - - - - Calculator Calculator - Syntax error + Syntax error + Result copied to clipboard! Settings Help Main settings diff --git a/res/values/styles.xml b/res/values/styles.xml index 7bf09d88..eb061e64 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -27,7 +27,7 @@