diff --git a/pom.xml b/pom.xml index 13c3211..ae13057 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ com.andrewlalis javafx-scene-router - 1.3.0 + 1.4.0 diff --git a/src/main/java/com/andrewlalis/perfin/PerfinApp.java b/src/main/java/com/andrewlalis/perfin/PerfinApp.java index 474f055..a7fb689 100644 --- a/src/main/java/com/andrewlalis/perfin/PerfinApp.java +++ b/src/main/java/com/andrewlalis/perfin/PerfinApp.java @@ -1,5 +1,6 @@ package com.andrewlalis.perfin; +import com.andrewlalis.javafx_scene_router.AnchorPaneRouterView; import com.andrewlalis.javafx_scene_router.SceneRouter; import com.andrewlalis.perfin.view.SplashScreenStage; import javafx.application.Application; @@ -17,7 +18,7 @@ public class PerfinApp extends Application { /** * The router that's used for navigating between different "pages" in the application. */ - public static final SceneRouter router = new SceneRouter(); + public static final SceneRouter router = new SceneRouter(new AnchorPaneRouterView(true)); public static void main(String[] args) { launch(args); diff --git a/src/main/java/com/andrewlalis/perfin/control/AccountTileController.java b/src/main/java/com/andrewlalis/perfin/control/AccountTileController.java index 3e4cd09..d6d8f27 100644 --- a/src/main/java/com/andrewlalis/perfin/control/AccountTileController.java +++ b/src/main/java/com/andrewlalis/perfin/control/AccountTileController.java @@ -37,10 +37,7 @@ public class AccountTileController { accountNumberLabel.setText(account.getAccountNumber()); accountBalanceLabel.setText(account.getCurrency().getSymbol()); accountNameLabel.setText(account.getName()); - container.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> { - System.out.println("Clicked on " + account.getAccountNumber()); - router.navigate("account", account); - }); + container.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> router.navigate("account", account)); }); } } diff --git a/src/main/java/com/andrewlalis/perfin/control/AccountViewController.java b/src/main/java/com/andrewlalis/perfin/control/AccountViewController.java index f47b4cd..f755632 100644 --- a/src/main/java/com/andrewlalis/perfin/control/AccountViewController.java +++ b/src/main/java/com/andrewlalis/perfin/control/AccountViewController.java @@ -6,7 +6,6 @@ import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.scene.control.TextField; -import java.time.ZoneId; import java.time.format.DateTimeFormatter; public class AccountViewController implements RouteSelectionListener { diff --git a/src/main/java/com/andrewlalis/perfin/control/MainViewController.java b/src/main/java/com/andrewlalis/perfin/control/MainViewController.java index a436872..02f7045 100644 --- a/src/main/java/com/andrewlalis/perfin/control/MainViewController.java +++ b/src/main/java/com/andrewlalis/perfin/control/MainViewController.java @@ -1,5 +1,6 @@ package com.andrewlalis.perfin.control; +import com.andrewlalis.javafx_scene_router.AnchorPaneRouterView; import com.andrewlalis.perfin.view.BindingUtil; import javafx.fxml.FXML; import javafx.scene.control.Label; @@ -18,7 +19,10 @@ public class MainViewController { @FXML public void initialize() { - mainContainer.setCenter(router.getViewPane()); + AnchorPaneRouterView routerView = (AnchorPaneRouterView) router.getView(); + mainContainer.setCenter(routerView.getAnchorPane()); + routerView.getAnchorPane().setStyle("-fx-border-color: orange;"); + // Set up a simple breadcrumb display in the top bar. BindingUtil.mapContent( breadcrumbHBox.getChildren(), router.getBreadCrumbs(), diff --git a/src/main/resources/account-view.fxml b/src/main/resources/account-view.fxml index 250f23e..4a23cb0 100644 --- a/src/main/resources/account-view.fxml +++ b/src/main/resources/account-view.fxml @@ -1,20 +1,20 @@ - - +
- +
+ + +