Преглед на файлове

implemented basic functions, changed appearance

jacob andersen преди 6 години
родител
ревизия
c4909bf67f
променени са 3 файла, в които са добавени 6 реда и са изтрити 6 реда
  1. BIN
      .DS_Store
  2. 4
    4
      src/main/java/rocks/zipcode/calcskin/CalcEngine.java
  3. 2
    2
      src/main/java/rocks/zipcode/calcskin/CalcSkin.java

BIN
.DS_Store Целия файл


+ 4
- 4
src/main/java/rocks/zipcode/calcskin/CalcEngine.java Целия файл

@@ -6,18 +6,18 @@ 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 23
 }

+ 2
- 2
src/main/java/rocks/zipcode/calcskin/CalcSkin.java Целия файл

@@ -60,7 +60,7 @@ public class CalcSkin extends Application {
60 60
     private VBox createLayout(TextField screen, TilePane buttons) {
61 61
         final VBox layout = new VBox(20);
62 62
         layout.setAlignment(Pos.CENTER);
63
-        layout.setStyle("-fx-background-color: silver; -fx-padding: 20; -fx-font-size: 20;");
63
+        layout.setStyle("-fx-background-color: gold; -fx-padding: 20; -fx-font-size: 20;");
64 64
         layout.getChildren().setAll(screen, buttons);
65 65
         handleAccelerators(layout);
66 66
         screen.prefWidthProperty().bind(buttons.widthProperty());
@@ -81,7 +81,7 @@ public class CalcSkin extends Application {
81 81
 
82 82
     private TextField createScreen() {
83 83
         final TextField screen = new TextField();
84
-        screen.setStyle("-fx-background-color: aquamarine;");
84
+        screen.setStyle("-fx-background-color: green;");
85 85
         screen.setAlignment(Pos.CENTER_RIGHT);
86 86
         screen.setEditable(false);
87 87
         screen.textProperty().bind(Bindings.format("%.0f", currentValue));