Parcourir la source

This package doesn't work, but I have a working package locally

NedRedmond il y a 6 ans
Parent
révision
380f26906b

+ 98
- 0
src/main/java/rocks/zipcode/atm/AccountController.java Voir le fichier

@@ -0,0 +1,98 @@
1
+package rocks.zipcode.atm;
2
+
3
+import com.jfoenix.controls.JFXButton;
4
+import com.jfoenix.controls.JFXTabPane;
5
+import com.jfoenix.controls.JFXTextArea;
6
+import javafx.event.Event;
7
+import javafx.fxml.FXML;
8
+import javafx.scene.control.Tab;
9
+import javafx.scene.control.TextField;
10
+
11
+import java.util.concurrent.TimeUnit;
12
+
13
+/**
14
+ * Controller class for the second vista.
15
+ */
16
+public class AccountController {
17
+
18
+    /**
19
+     * Event handler fired when the user requests a previous vista.
20
+     *
21
+     * @param event the event that triggered the handler.
22
+     */
23
+
24
+    @FXML
25
+    private JFXTabPane tabPane;
26
+
27
+    @FXML
28
+    private JFXTextArea textArea;
29
+
30
+    @FXML
31
+    protected void initialize() {
32
+        textArea.setText(CashMachine.INSTANCE.toString());
33
+
34
+        amountField.textProperty().addListener((observable, oldValue, newValue) -> {
35
+            if (!newValue.matches("\\d*")) {
36
+                amountField.setText(newValue.replaceAll("[^\\d]", ""));
37
+            }
38
+        });
39
+    }
40
+
41
+    @FXML
42
+    private Tab tabInfo;
43
+
44
+    @FXML
45
+    private Tab tabWithdraw;
46
+
47
+    @FXML
48
+    private Tab tabDeposit;
49
+
50
+    @FXML
51
+    private TextField amountField;
52
+
53
+    @FXML
54
+    private JFXButton amountSubmit;
55
+
56
+    @FXML
57
+    void displayInfo(Event event) {
58
+        CashMachine.INSTANCE.toString();
59
+    }
60
+
61
+    @FXML
62
+    void transactionTab(Event event) {
63
+        if (amountField.isDisabled()) {
64
+            amountField.setDisable(false);
65
+            amountSubmit.setDisable(false);
66
+        } else {
67
+            amountField.setDisable((true));
68
+            amountSubmit.setDisable(true);
69
+        }
70
+    }
71
+
72
+    @FXML
73
+    void submit(Event event) {
74
+        int amount = Integer.parseInt(amountField.getText());
75
+
76
+        switch (tabPane.getSelectionModel().getSelectedItem().getText())
77
+        {
78
+            case "Withdraw": CashMachine.INSTANCE.withdraw(amount);
79
+                break;
80
+            case "Deposit": CashMachine.INSTANCE.deposit(amount);
81
+                break;
82
+            default: textArea.setText("Please select a tab.");
83
+        }
84
+        textArea.setText(CashMachine.INSTANCE.toString());
85
+    }
86
+
87
+    @FXML
88
+    void logOut(Event event) {
89
+        try {
90
+            TimeUnit.MILLISECONDS.sleep(50);
91
+        } catch (InterruptedException e) {
92
+            e.printStackTrace();
93
+        }
94
+        CashMachine.INSTANCE.logOut();
95
+        SceneSwitcher.loadVista(SceneSwitcher.VISTA_1);
96
+    }
97
+
98
+}

+ 19
- 3
src/main/java/rocks/zipcode/atm/CashMachine.java Voir le fichier

@@ -18,6 +18,8 @@ public class CashMachine {
18 18
         this.bank = bank;
19 19
     }
20 20
 
21
+    public final static CashMachine INSTANCE = new CashMachine(new Bank());
22
+
21 23
     private Consumer<AccountData> update = data -> {
22 24
         accountData = data;
23 25
     };
@@ -25,9 +27,23 @@ public class CashMachine {
25 27
     private boolean errorExists = false;
26 28
     private String errorMessage = null;
27 29
 
28
-    public void login(int id) {
30
+//    public void login(String email) {
31
+//        tryCall(
32
+//                () -> bank.getAccountByEmail(email),
33
+//                update
34
+//        );
35
+//    }
36
+
37
+    public void login(int pin) {
38
+        tryCall(
39
+                () -> bank.getAccountByPIN(pin),
40
+                update
41
+        );
42
+    }
43
+
44
+    public void login(String email, int pin) {
29 45
         tryCall(
30
-                () -> bank.getAccountById(id),
46
+                () -> bank.getAccountByEmailAndPIN(email,pin),
31 47
                 update
32 48
         );
33 49
     }
@@ -62,7 +78,7 @@ public class CashMachine {
62 78
         if (errorExists) {
63 79
             displayString = errorMessage;
64 80
         } else {
65
-            displayString = accountData != null ? accountData.toString() : "Try account 1000 or 2000 and click submit.";
81
+            displayString = accountData != null ? accountData.toString() : "Login failed. Please confirm your credentials and try again.";
66 82
         }
67 83
         return displayString;
68 84
     }

+ 0
- 106
src/main/java/rocks/zipcode/atm/CashMachineApp.java Voir le fichier

@@ -1,106 +0,0 @@
1
-package rocks.zipcode.atm;
2
-
3
-import com.jfoenix.controls.JFXButton;
4
-import javafx.fxml.FXML;
5
-import javafx.fxml.FXMLLoader;
6
-import rocks.zipcode.atm.bank.Bank;
7
-import javafx.application.Application;
8
-import javafx.scene.Parent;
9
-import javafx.scene.Scene;
10
-import javafx.scene.control.Button;
11
-import javafx.scene.control.TextArea;
12
-import javafx.scene.control.TextField;
13
-import javafx.scene.layout.VBox;
14
-import javafx.stage.Stage;
15
-import javafx.scene.layout.FlowPane;
16
-
17
-import java.io.IOException;
18
-
19
-/**
20
- * @author ZipCodeWilmington
21
- */
22
-public class CashMachineApp extends Application {
23
-
24
-    @Override
25
-    public void start(Stage stage) throws Exception {
26
-        FXMLLoader loader = new FXMLLoader();
27
-
28
-        stage.setTitle("Zip Cloud Bank");
29
-
30
-        //        Is this cheating?
31
-        Parent start = loader.load(getClass().getResource("/LoginScreen.fxml"));
32
-        Scene content = new Scene(start);
33
-        stage.setScene(content);
34
-        stage.show();
35
-
36
-
37
-//        //Log In Layout
38
-//        Label loginLabel = new Label("Welcome to Zip Cloud Bank!\nPlease log in.");
39
-//        Button btnLogIn = new Button("Log In");
40
-//        btnLogIn.setStyle("-fx-font-size: 15pt");
41
-//        btnLogIn.setOnAction(e -> {
42
-//            mainContent = new Scene(mainContent());
43
-//            window.setScene(mainContent);
44
-//        });
45
-//
46
-//        GridPane loginLayout = new GridPane();
47
-//        loginLayout.setHgap(12);
48
-//        loginLayout.setVgap(12);
49
-//        loginLayout.setAlignment(Pos.CENTER);
50
-//        loginLayout.getChildren().addAll(loginLabel, field, btnLogIn);
51
-
52
-//        loginScene = new Scene(loginLayout,600, 600);
53
-//
54
-    }
55
-
56
-//    private Parent mainContent() {
57
-//        VBox vbox = new VBox(10);
58
-//        vbox.setPrefSize(600, 600);
59
-//
60
-//        TextArea areaInfo = new TextArea();
61
-//
62
-//        Button btnSubmit = new Button("Set Account ID");
63
-//        btnSubmit.setOnAction(e -> {
64
-//            int id = Integer.parseInt(field.getText());
65
-//            cashMachine.login(id);
66
-//
67
-//            areaInfo.setText(cashMachine.toString());
68
-//        });
69
-//
70
-//        Button btnDeposit = new Button("Deposit");
71
-//        btnDeposit.setOnAction(e -> {
72
-//            int amount = Integer.parseInt(field.getText());
73
-//            cashMachine.deposit(amount);
74
-//
75
-//            areaInfo.setText(cashMachine.toString());
76
-//        });
77
-//
78
-//        Button btnWithdraw = new Button("Withdraw");
79
-//        btnWithdraw.setOnAction(e -> {
80
-//            int amount = Integer.parseInt(field.getText());
81
-//            cashMachine.withdraw(amount);
82
-//
83
-//            areaInfo.setText(cashMachine.toString());
84
-//        });
85
-//
86
-//        Button btnExit = new Button("Log Out");
87
-//        btnExit.setOnAction(e -> {
88
-//            cashMachine.logOut();
89
-//
90
-//            areaInfo.setText(cashMachine.toString());
91
-//        });
92
-//
93
-//        FlowPane flowpane = new FlowPane();
94
-//
95
-//        flowpane.getChildren().add(btnSubmit);
96
-//        flowpane.getChildren().add(btnDeposit);
97
-//        flowpane.getChildren().add(btnWithdraw);
98
-//        flowpane.getChildren().add(btnExit);
99
-//        vbox.getChildren().addAll(field, flowpane, areaInfo);
100
-//        return vbox;
101
-//    }
102
-
103
-    public static void main(String[] args) {
104
-        launch(args);
105
-    }
106
-}

+ 0
- 61
src/main/java/rocks/zipcode/atm/ControllerFXML.java Voir le fichier

@@ -1,61 +0,0 @@
1
-package rocks.zipcode.atm;
2
-
3
-import com.jfoenix.controls.JFXButton;
4
-import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
5
-import javafx.fxml.FXML;
6
-import javafx.fxml.FXMLLoader;
7
-import javafx.fxml.Initializable;
8
-import javafx.scene.Node;
9
-import javafx.scene.Parent;
10
-import javafx.scene.Scene;
11
-import javafx.scene.control.TextField;
12
-import javafx.scene.layout.VBox;
13
-import javafx.stage.Stage;
14
-import rocks.zipcode.atm.bank.Bank;
15
-
16
-import java.io.IOException;
17
-import java.net.URL;
18
-import java.util.ResourceBundle;
19
-
20
-
21
-
22
-public class ControllerFXML implements Initializable {
23
-
24
-    @FXML
25
-    Stage stage;
26
-
27
-    @FXML
28
-    private VBox content;
29
-
30
-    @FXML
31
-    private TextField field = new TextField();
32
-
33
-    @FXML
34
-    private CashMachine cashMachine = new CashMachine(new Bank());
35
-
36
-    @FXML
37
-    public JFXButton btnLogin;
38
-
39
-    @FXML void loginAction() throws IOException {
40
-        FXMLLoader loader = new FXMLLoader();
41
-
42
-//        try {
43
-//            mainContent = loader.load(getClass().getResource("/AccountScreen.fxml"));
44
-//            System.out.println("tried");
45
-//        } catch (IOException e) {
46
-//            e.printStackTrace();
47
-//            System.out.println("caught");
48
-//        }
49
-//        Scene accountView = new Scene(mainContent);
50
-
51
-        content.getChildren().setAll((Node) loader.load(getClass().getResource("/AccountScreen.fxml")));
52
-
53
-//        this.stage.setScene(accountView);
54
-//        this.stage.show();
55
-    }
56
-
57
-    @Override
58
-    public void initialize(URL location, ResourceBundle resources) {
59
-
60
-    }
61
-}

+ 36
- 0
src/main/java/rocks/zipcode/atm/LoginController.java Voir le fichier

@@ -0,0 +1,36 @@
1
+package rocks.zipcode.atm;
2
+
3
+import com.jfoenix.controls.JFXPasswordField;
4
+import com.jfoenix.controls.JFXTextField;
5
+import javafx.event.ActionEvent;
6
+import javafx.fxml.FXML;
7
+
8
+/**
9
+ * Controller class for the first vista.
10
+ */
11
+public class LoginController {
12
+
13
+    /**
14
+     * Event handler fired when the user requests a new vista.
15
+     *
16
+     * @param event the event that triggered the handler.
17
+     */
18
+
19
+    @FXML
20
+    private JFXTextField emailEntry;
21
+
22
+    @FXML
23
+    private JFXPasswordField pinEntry;
24
+
25
+    @FXML
26
+    void logIn(ActionEvent event) {
27
+        String email = emailEntry.getText();
28
+        int pin = Integer.parseInt(pinEntry.getText());
29
+
30
+        //add if statement to log in & switch scenes if email and password match
31
+        CashMachine.INSTANCE.login(email,pin);
32
+
33
+        SceneSwitcher.loadVista(SceneSwitcher.VISTA_2);
34
+    }
35
+
36
+}

+ 76
- 0
src/main/java/rocks/zipcode/atm/Main.java Voir le fichier

@@ -0,0 +1,76 @@
1
+package rocks.zipcode.atm;
2
+
3
+import javafx.application.Application;
4
+import javafx.fxml.FXMLLoader;
5
+import javafx.scene.Scene;
6
+import javafx.scene.layout.Pane;
7
+import javafx.stage.Stage;
8
+
9
+import java.io.IOException;
10
+
11
+/**
12
+ * rocks.zipcode.atm.Main application class.
13
+ */
14
+public class Main extends Application {
15
+
16
+    @Override
17
+    public void start(Stage stage) throws Exception{
18
+        stage.setTitle("Vista Viewer");
19
+
20
+        stage.setScene(
21
+            createScene(
22
+                loadMainPane()
23
+            )
24
+        );
25
+
26
+        stage.show();
27
+    }
28
+
29
+    /**
30
+     * Loads the main fxml layout.
31
+     * Sets up the vista switching rocks.zipcode.atm.SceneSwitcher.
32
+     * Loads the first vista into the fxml layout.
33
+     *
34
+     * @return the loaded pane.
35
+     * @throws IOException if the pane could not be loaded.
36
+     */
37
+    private Pane loadMainPane() throws IOException {
38
+        FXMLLoader loader = new FXMLLoader();
39
+
40
+        Pane mainPane = (Pane) loader.load(
41
+            getClass().getResourceAsStream(
42
+                SceneSwitcher.MAIN
43
+            )
44
+        );
45
+
46
+        MainController mainController = loader.getController();
47
+
48
+        SceneSwitcher.setMainController(mainController);
49
+        SceneSwitcher.loadVista(SceneSwitcher.VISTA_1);
50
+
51
+        return mainPane;
52
+    }
53
+
54
+    /**
55
+     * Creates the main application scene.
56
+     *
57
+     * @param mainPane the main application layout.
58
+     *
59
+     * @return the created scene.
60
+     */
61
+    private Scene createScene(Pane mainPane) {
62
+        Scene scene = new Scene(
63
+            mainPane
64
+        );
65
+
66
+        scene.getStylesheets().setAll(
67
+            getClass().getResource("zcb.css").toExternalForm()
68
+        );
69
+
70
+        return scene;
71
+    }
72
+
73
+    public static void main(String[] args) {
74
+        launch(args);
75
+    }
76
+}

+ 25
- 0
src/main/java/rocks/zipcode/atm/MainController.java Voir le fichier

@@ -0,0 +1,25 @@
1
+package rocks.zipcode.atm;
2
+
3
+import javafx.fxml.FXML;
4
+import javafx.scene.Node;
5
+import javafx.scene.layout.StackPane;
6
+
7
+/**
8
+ * rocks.zipcode.atm.Main controller class for the entire layout.
9
+ */
10
+public class MainController {
11
+
12
+    /** Holder of a switchable vista. */
13
+    @FXML
14
+    private StackPane vistaHolder;
15
+
16
+    /**
17
+     * Replaces the vista displayed in the vista holder with a new vista.
18
+     *
19
+     * @param node the vista node to be swapped in.
20
+     */
21
+    public void setVista(Node node) {
22
+        vistaHolder.getChildren().setAll(node);
23
+    }
24
+
25
+}

+ 66
- 0
src/main/java/rocks/zipcode/atm/SceneSwitcher.java Voir le fichier

@@ -0,0 +1,66 @@
1
+package rocks.zipcode.atm;
2
+
3
+import javafx.fxml.FXMLLoader;
4
+import javafx.scene.Node;
5
+
6
+import java.io.IOException;
7
+
8
+/**
9
+ * Utility class for controlling navigation between vistas.
10
+ *
11
+ * All methods on the navigator are static to facilitate
12
+ * simple access from anywhere in the application.
13
+ */
14
+public class SceneSwitcher {
15
+
16
+    /**
17
+     * Convenience constants for fxml layouts managed by the navigator.
18
+     */
19
+    public static final String MAIN    = "window.fxml";
20
+    public static final String VISTA_1 = "login.fxml";
21
+    public static final String VISTA_2 = "accountview.fxml";
22
+
23
+    /** The main application layout controller. */
24
+    private static MainController mainController;
25
+
26
+    /**
27
+     * Stores the main controller for later use in navigation tasks.
28
+     *
29
+     * @param mainController the main application layout controller.
30
+     */
31
+    public static void setMainController(MainController mainController) {
32
+        SceneSwitcher.mainController = mainController;
33
+    }
34
+
35
+    /**
36
+     * Loads the vista specified by the fxml file into the
37
+     * vistaHolder pane of the main application layout.
38
+     *
39
+     * Previously loaded vista for the same fxml file are not cached.
40
+     * The fxml is loaded anew and a new vista node hierarchy generated
41
+     * every time this method is invoked.
42
+     *
43
+     * A more sophisticated load function could potentially add some
44
+     * enhancements or optimizations, for example:
45
+     *   cache FXMLLoaders
46
+     *   cache loaded vista nodes, so they can be recalled or reused
47
+     *   allow a user to specify vista node reuse or new creation
48
+     *   allow back and forward history like a browser
49
+     *
50
+     * @param fxml the fxml file to be loaded.
51
+     */
52
+    public static void loadVista(String fxml) {
53
+        try {
54
+            mainController.setVista(
55
+                    (Node) FXMLLoader.load(
56
+                        SceneSwitcher.class.getResource(
57
+                            fxml
58
+                        )
59
+                    )
60
+            );
61
+        } catch (IOException e) {
62
+            e.printStackTrace();
63
+        }
64
+    }
65
+
66
+}

+ 22
- 1
src/main/java/rocks/zipcode/atm/bank/Bank.java Voir le fichier

@@ -38,7 +38,7 @@ public class Bank {
38 38
         )));
39 39
     }
40 40
 
41
-    public ActionResult<AccountData> getAccountById(int id) {
41
+    public ActionResult<AccountData> getAccountByPIN(int id) {
42 42
         Account account = accounts.get(id);
43 43
 
44 44
         if (account != null) {
@@ -48,6 +48,27 @@ public class Bank {
48 48
         }
49 49
     }
50 50
 
51
+//    public ActionResult<AccountData> getAccountByEmail(String email) {
52
+//        Account account = accounts.get(email);
53
+//
54
+//        if (account != null) {
55
+//            return ActionResult.success(account.getAccountData());
56
+//        } else {
57
+//            return ActionResult.fail("No account with email: " + email);
58
+//        }
59
+//    }
60
+
61
+    public ActionResult<AccountData> getAccountByEmailAndPIN(String email, int pin) {
62
+        Account account = accounts.get(pin);
63
+        String accountEmail = account.getAccountData().getEmail();
64
+
65
+        if (account != null && email.equals(accountEmail)) {
66
+            return ActionResult.success(account.getAccountData());
67
+        } else {
68
+            return ActionResult.fail("Login failed. Please confirm your credentials and try again.");
69
+        }
70
+    }
71
+
51 72
     public ActionResult<AccountData> deposit(AccountData accountData, int amount) {
52 73
         Account account = accounts.get(accountData.getId());
53 74
         account.deposit(amount);

+ 0
- 10
src/main/resources/AccountScreen.fxml Voir le fichier

@@ -1,10 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-
3
-<?import java.lang.*?>
4
-<?import java.util.*?>
5
-<?import javafx.scene.*?>
6
-<?import javafx.scene.control.*?>
7
-<?import javafx.scene.layout.*?>
8
-
9
-<VBox prefHeight="400.0" prefWidth="450.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="rocks.zipcode.atm.ControllerFXML">
10
-</VBox>

+ 0
- 74
src/main/resources/LoginScreen.fxml Voir le fichier

@@ -1,74 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-
3
-<?import javafx.scene.paint.*?>
4
-<?import javafx.geometry.*?>
5
-<?import javafx.scene.text.*?>
6
-<?import com.jfoenix.controls.*?>
7
-<?import java.lang.*?>
8
-<?import java.util.*?>
9
-<?import javafx.scene.*?>
10
-<?import javafx.scene.control.*?>
11
-<?import javafx.scene.layout.*?>
12
-
13
-<VBox fx:id="content" prefHeight="400.0" prefWidth="450.0" style="-fx-border-color: coral; -fx-border-width: 12; -fx-border-radius: 1; -fx-border-insets: 5;" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="rocks.zipcode.atm.ControllerFXML">
14
-   <children>
15
-      <FlowPane alignment="BOTTOM_CENTER" prefHeight="200.0" prefWidth="200.0">
16
-         <children>
17
-            <Label alignment="CENTER" contentDisplay="CENTER" maxWidth="1.7976931348623157E308" prefHeight="24.0" text="Welcome to Zip Cloud Bank" textAlignment="CENTER" textFill="CORAL" wrapText="true">
18
-               <font>
19
-                  <Font name="Futura Bold" size="24.0" />
20
-               </font>
21
-            </Label>
22
-         </children>
23
-      </FlowPane>
24
-      <FlowPane alignment="BOTTOM_CENTER" hgap="9.0" prefHeight="200.0" prefWidth="200.0">
25
-         <children>
26
-            <Label alignment="BOTTOM_RIGHT" contentDisplay="CENTER" maxWidth="1.7976931348623157E308" prefHeight="24.0" text="Email:" textAlignment="CENTER" wrapText="true">
27
-               <font>
28
-                  <Font name="Futura Medium" size="18.0" />
29
-               </font>
30
-            </Label>
31
-            <JFXTextField focusColor="CORAL">
32
-               <font>
33
-                  <Font name="Futura Medium" size="18.0" />
34
-               </font>
35
-            </JFXTextField>
36
-         </children>
37
-         <VBox.margin>
38
-            <Insets />
39
-         </VBox.margin>
40
-         <padding>
41
-            <Insets bottom="8.0" />
42
-         </padding>
43
-      </FlowPane>
44
-      <FlowPane alignment="TOP_CENTER" hgap="9.0" prefHeight="200.0" prefWidth="200.0">
45
-         <children>
46
-            <Label alignment="BOTTOM_RIGHT" contentDisplay="CENTER" maxWidth="1.7976931348623157E308" prefHeight="24.0" text="PIN:" textAlignment="CENTER" wrapText="true">
47
-               <font>
48
-                  <Font name="Futura Medium" size="18.0" />
49
-               </font>
50
-            </Label>
51
-            <JFXPasswordField focusColor="CORAL">
52
-               <font>
53
-                  <Font name="Futura Medium" size="18.0" />
54
-               </font>
55
-            </JFXPasswordField>
56
-         </children>
57
-         <padding>
58
-            <Insets top="8.0" />
59
-         </padding>
60
-      </FlowPane>
61
-      <FlowPane alignment="TOP_CENTER" prefHeight="200.0" prefWidth="200.0">
62
-         <children>
63
-            <JFXButton fx:id="btnLogin" alignment="CENTER" onAction="#loginAction" style="-fx-background-color: coral;" text="Log In" textFill="WHITE">
64
-               <font>
65
-                  <Font name="Futura Medium" size="18.0" />
66
-               </font>
67
-            </JFXButton>
68
-         </children>
69
-      </FlowPane>
70
-   </children>
71
-   <opaqueInsets>
72
-      <Insets />
73
-   </opaqueInsets>
74
-</VBox>

+ 77
- 0
src/main/resources/accountview.fxml Voir le fichier

@@ -0,0 +1,77 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+
3
+<?import javafx.geometry.*?>
4
+<?import javafx.scene.text.*?>
5
+<?import java.lang.*?>
6
+<?import javafx.scene.control.*?>
7
+<?import javafx.scene.layout.*?>
8
+<?scenebuilder-stylesheet vista.css?>
9
+<?import com.jfoenix.controls.*?>
10
+
11
+<!--<StackPane-->
12
+
13
+<?import javafx.scene.text.Font?>
14
+
15
+<!--<StackPane fx:id="vista2" xmlns:fx="http://javafx.com/fxml" fx:controller="rocks.zipcode.atm.AccountController">-->
16
+<!--<children>-->
17
+<!--<Button mnemonicParsing="false" onAction="#previousPane" text="Previous Pane" />-->
18
+<!--</children>-->
19
+<!--</StackPane>-->
20
+
21
+<VBox fx:id="vista2" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="rocks.zipcode.atm.AccountController">
22
+  <children>
23
+    <JFXTabPane fx:id="tabPane" prefHeight="60.0" prefWidth="466.0">
24
+      <tabs>
25
+            <Tab fx:id="tabInfo" onSelectionChanged="#displayInfo" text="Account Info">
26
+              <content>
27
+                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
28
+              </content>
29
+            </Tab>
30
+        <Tab fx:id="tabWithdraw" onSelectionChanged="#transactionTab" text="Withdraw">
31
+          <content>
32
+            <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
33
+          </content>
34
+        </Tab>
35
+        <Tab fx:id="tabDeposit" onSelectionChanged="#transactionTab" text="Deposit">
36
+          <content>
37
+            <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
38
+          </content>
39
+        </Tab>
40
+        <Tab fx:id="tabLogout" onSelectionChanged="#logOut" text="Log Out">
41
+          <content>
42
+            <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
43
+          </content>
44
+        </Tab>
45
+      </tabs>
46
+    </JFXTabPane>
47
+      <FlowPane fx:id="amountEntryPane" alignment="CENTER_LEFT" columnHalignment="CENTER" hgap="15.0" prefHeight="30.0" prefWidth="466.0" style="-fx-background-color: white;">
48
+         <children>
49
+            <TextField fx:id="amountField" disable="true" maxWidth="1.7976931348623157E308" prefHeight="36.0" prefWidth="121.0" text="Amount">
50
+               <font>
51
+                  <Font name="Futura Medium" size="18.0" />
52
+               </font>
53
+            </TextField>
54
+            <JFXButton fx:id="amountSubmit" disable="true" onAction="#submit" maxWidth="1.7976931348623157E308" ripplerFill="CORAL" text="Submit" style="-fx-background-color: coral;" textFill="WHITE">
55
+               <font>
56
+                  <Font name="Futura Bold" size="18.0" />
57
+               </font>
58
+            </JFXButton>
59
+         </children>
60
+         <padding>
61
+            <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
62
+         </padding>
63
+      </FlowPane>
64
+    <JFXTextArea fx:id="textArea" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="180.0" prefWidth="450.0" text="TESTTESTESTTESTTESTTESTTESTTESTTESTTESTTESTTTESTTESTTESTTESTTESTTESTTESTTESTTESTTEST">
65
+         <font>
66
+            <Font name="Futura Medium" size="14.0" />
67
+         </font>
68
+         <opaqueInsets>
69
+            <Insets />
70
+         </opaqueInsets>
71
+         <VBox.margin>
72
+            <Insets left="8.0" right="8.0" />
73
+         </VBox.margin>
74
+      </JFXTextArea>
75
+    <JFXTreeTableView fx:id="transactionsView" prefHeight="120.0" prefWidth="466.0" />
76
+  </children>
77
+</VBox>

+ 67
- 0
src/main/resources/login.fxml Voir le fichier

@@ -0,0 +1,67 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+
3
+<?import java.lang.*?>
4
+<?import javafx.scene.text.*?>
5
+<?import javafx.scene.control.*?>
6
+<?import javafx.scene.layout.*?>
7
+<?scenebuilder-stylesheet vista.css?>
8
+<?import com.jfoenix.controls.*?>
9
+
10
+<!--<StackPane-->
11
+
12
+<?import javafx.scene.text.Font?>
13
+
14
+<VBox fx:id="vista1" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="rocks.zipcode.atm.LoginController">
15
+  <!--<children>-->
16
+    <!--<Button mnemonicParsing="false" onAction="#nextPane" text="Next Pane" />-->
17
+  <!--</children>-->
18
+<!--</StackPane>-->
19
+  <children>
20
+    <FlowPane alignment="BOTTOM_CENTER" prefHeight="200.0" prefWidth="200.0">
21
+      <children>
22
+        <Label alignment="CENTER" contentDisplay="CENTER" maxWidth="1.7976931348623157E308" prefHeight="24.0" text="Welcome to Zip Cloud Bank" textAlignment="CENTER" textFill="CORAL" wrapText="true">
23
+          <font>
24
+            <Font name="Futura Bold" size="24.0" />
25
+          </font>
26
+        </Label>
27
+      </children>
28
+    </FlowPane>
29
+    <FlowPane alignment="BOTTOM_CENTER" hgap="9.0" prefHeight="200.0" prefWidth="200.0">
30
+      <children>
31
+        <Label alignment="BOTTOM_RIGHT" contentDisplay="CENTER" maxWidth="1.7976931348623157E308" prefHeight="24.0" text="Email:" textAlignment="CENTER" wrapText="true">
32
+          <font>
33
+            <Font name="Futura Medium" size="18.0" />
34
+          </font>
35
+        </Label>
36
+        <JFXTextField fx:id="emailEntry" focusColor="CORAL">
37
+          <font>
38
+            <Font name="Futura Medium" size="18.0" />
39
+          </font>
40
+        </JFXTextField>
41
+      </children>
42
+    </FlowPane>
43
+    <FlowPane alignment="TOP_CENTER" hgap="9.0" prefHeight="200.0" prefWidth="200.0">
44
+      <children>
45
+        <Label alignment="BOTTOM_RIGHT" contentDisplay="CENTER" maxWidth="1.7976931348623157E308" prefHeight="24.0" text="PIN:" textAlignment="CENTER" wrapText="true">
46
+          <font>
47
+            <Font name="Futura Medium" size="18.0" />
48
+          </font>
49
+        </Label>
50
+        <JFXPasswordField fx:id="pinEntry" focusColor="CORAL">
51
+          <font>
52
+            <Font name="Futura Medium" size="18.0" />
53
+          </font>
54
+        </JFXPasswordField>
55
+      </children>
56
+    </FlowPane>
57
+    <FlowPane alignment="TOP_CENTER" prefHeight="200.0" prefWidth="200.0">
58
+      <children>
59
+        <JFXButton fx:id="btnLogin" alignment="CENTER" onAction="#logIn" style="-fx-background-color: coral;" text="Log In" textFill="WHITE">
60
+          <font>
61
+            <Font name="Futura Medium" size="18.0" />
62
+          </font>
63
+        </JFXButton>
64
+      </children>
65
+    </FlowPane>
66
+  </children>
67
+</VBox>

+ 13
- 0
src/main/resources/window.fxml Voir le fichier

@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+
3
+<?import javafx.scene.control.*?>
4
+<?import javafx.scene.layout.*?>
5
+<?scenebuilder-stylesheet vista.css?>
6
+
7
+<!--<VBox prefHeight="200.0" prefWidth="300.0" xmlns:fx="http://javafx.com/fxml" fx:controller="rocks.zipcode.atm.MainController">-->
8
+<VBox prefHeight="400.0" prefWidth="450.0" style="-fx-border-color: coral; -fx-border-width: 12; -fx-border-radius: 1; -fx-border-insets: 5;" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml" fx:controller="rocks.zipcode.atm.MainController">
9
+  <children>
10
+    <!--<Label fx:id="headerLabel" maxWidth="1.7976931348623157E308" text="Header" VBox.vgrow="NEVER" />-->
11
+    <StackPane fx:id="vistaHolder" VBox.vgrow="ALWAYS" />
12
+  </children>
13
+</VBox>

+ 7
- 0
src/main/resources/zcb.css Voir le fichier

@@ -0,0 +1,7 @@
1
+.jfx-tab-pane .depth-container .tab-header-area .tab-header-background {
2
+    -fx-background-color: coral;
3
+}
4
+
5
+.jfx-tab-pane:top .depth-container .tab-header-area .headers-region .tab .jfx-rippler .tab-container .tab-label .text {
6
+    -fx-font: 18 Futura;
7
+}