Incorporated latest scene router version.

This commit is contained in:
Andrew Lalis 2023-12-25 18:31:01 -05:00
parent b1043c1624
commit 30df89d5b7
8 changed files with 21 additions and 13 deletions

View File

@ -29,7 +29,7 @@
<dependency>
<groupId>com.andrewlalis</groupId>
<artifactId>javafx-scene-router</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
</dependency>
<dependency>

View File

@ -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);

View File

@ -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));
});
}
}

View File

@ -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 {

View File

@ -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(),

View File

@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.layout.*?>
<BorderPane
xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="com.andrewlalis.perfin.control.AccountViewController"
stylesheets="@style/account-view.css"
styleClass="main-container"
style="-fx-border-color: green;"
>
<top>
<Label fx:id="titleLabel"/>
</top>
<center>
<VBox>
<VBox style="-fx-border-color: blue;" >
<VBox styleClass="account-property-box">
<Label text="Name"/>
<TextField fx:id="accountNameField" editable="false"/>
@ -33,4 +33,10 @@
</VBox>
</VBox>
</center>
<right>
<VBox style="-fx-border-color: red;">
<Button text="Edit"/>
<Button text="Delete"/>
</VBox>
</right>
</BorderPane>

View File

@ -8,6 +8,7 @@
fx:id="mainContainer"
fx:controller="com.andrewlalis.perfin.control.MainViewController"
stylesheets="@style/main-view.css"
style="-fx-border-color: purple;"
>
<top>
<VBox>
@ -19,7 +20,6 @@
<HBox fx:id="breadcrumbHBox"/>
<Separator/>
</VBox>
</top>
<bottom>
<HBox fx:id="mainFooter" spacing="5">

View File

@ -17,7 +17,8 @@
}
.account-property-box > TextField {
-fx-min-width: 200px;
-fx-min-width: 100px;
-fx-max-width: 300px;
}
#accountNumberField {