Selaa lähdekoodia

ehh work in progress

Saurav Kamath 6 vuotta sitten
vanhempi
commit
8a588b8ed7

+ 2
- 2
pom.xml Näytä tiedosto

@@ -13,8 +13,8 @@
13 13
                 <groupId>org.apache.maven.plugins</groupId>
14 14
                 <artifactId>maven-compiler-plugin</artifactId>
15 15
                 <configuration>
16
-                    <source>1.7</source>
17
-                    <target>1.7</target>
16
+                    <source>8</source>
17
+                    <target>8</target>
18 18
                 </configuration>
19 19
             </plugin>
20 20
         </plugins>

+ 49
- 4
src/main/java/rocks/zipcode/calcskin/CalcEngine.java Näytä tiedosto

@@ -6,18 +6,63 @@ public class CalcEngine {
6 6
     }
7 7
 
8 8
     public double add(double v, double v1) {
9
-        return Double.NaN;
9
+        return v+v1;
10 10
     }
11 11
 
12 12
     public double subtract(double v, double v1) {
13
-        return Double.NaN;
13
+        return v-v1;
14 14
     }
15 15
 
16 16
     public double multiply(double v, double v1) {
17
-        return Double.NaN;
17
+        return v*v1;
18 18
     }
19 19
 
20 20
     public double divide(double v, double v1) {
21
-        return Double.NaN;
21
+        return v/v1;
22 22
     }
23
+    public double square(double v)
24
+    {
25
+        return Math.pow(v, 2.0);
26
+    }
27
+
28
+    public double root(double v) {
29
+        return Math.sqrt(v);
30
+    }
31
+
32
+    public double inverse(double v){
33
+        return 1.0 / v;
34
+    }
35
+
36
+    public double expo(double v, double v1) {
37
+        return Math.pow(v, v1);
38
+    }
39
+
40
+    public double tan(double v) {
41
+        return Math.tan(v);
42
+    }
43
+
44
+    public double log(double v) {
45
+        return Math.log10(v);
46
+    }
47
+
48
+    public double sin(double v) {
49
+        return Math.sin(v);
50
+    }
51
+
52
+    public double cos(double v) {
53
+        return Math.cos(v);
54
+    }
55
+
56
+    public double atan(double v) {
57
+        return Math.atan(v);
58
+    }
59
+
60
+    public double asin(double v) {
61
+        return Math.asin(v);
62
+    }
63
+
64
+    public double acos(double v) {
65
+        return Math.acos(v);
66
+    }
67
+
23 68
 }

+ 8
- 6
src/main/java/rocks/zipcode/calcskin/CalcSkin.java Näytä tiedosto

@@ -2,17 +2,21 @@ package rocks.zipcode.calcskin;
2 2
 
3 3
 import javafx.application.Application;
4 4
 import javafx.beans.binding.Bindings;
5
-import javafx.beans.property.*;
5
+import javafx.beans.property.DoubleProperty;
6
+import javafx.beans.property.ObjectProperty;
7
+import javafx.beans.property.SimpleDoubleProperty;
8
+import javafx.beans.property.SimpleObjectProperty;
6 9
 import javafx.event.ActionEvent;
7 10
 import javafx.event.EventHandler;
8 11
 import javafx.geometry.Pos;
9 12
 import javafx.scene.Scene;
10
-import javafx.scene.control.*;
13
+import javafx.scene.control.Button;
14
+import javafx.scene.control.TextField;
11 15
 import javafx.scene.input.KeyEvent;
12
-import javafx.scene.layout.*;
16
+import javafx.scene.layout.TilePane;
17
+import javafx.scene.layout.VBox;
13 18
 import javafx.stage.Stage;
14 19
 import javafx.stage.StageStyle;
15
-import rocks.zipcode.calcskin.CalcEngine;
16 20
 
17 21
 import java.util.HashMap;
18 22
 import java.util.Map;
@@ -190,5 +194,3 @@ public class CalcSkin extends Application {
190 194
         });
191 195
     }
192 196
 }
193
-
194
-