-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: made PaymentCompletePageView and its controllers
- Loading branch information
MatheaGjerde
committed
Mar 14, 2026
1 parent
73df8e6
commit e6a2d09
Showing
6 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/edu/group5/app/control/donationpage/PaymentCompleteController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,15 @@ | ||
| package edu.group5.app.control.donationpage; | ||
|
|
||
| import edu.group5.app.control.MainController; | ||
|
|
||
| public class PaymentCompleteController { | ||
| private final MainController controller; | ||
|
|
||
| public PaymentCompleteController(MainController controller) { | ||
| this.controller = controller; | ||
| } | ||
| public void handleHomeBtn() { | ||
| System.out.println("Home button pressed"); | ||
| controller.showHomePage(); | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 45 additions & 1 deletion
46
src/main/java/edu/group5/app/view/donationpage/PaymentCompletePageView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,48 @@ | ||
| package edu.group5.app.view.donationpage; | ||
|
|
||
| public class PaymentCompletePageView { | ||
| import edu.group5.app.control.donationpage.PaymentCompleteController; | ||
| import javafx.geometry.Insets; | ||
| import javafx.geometry.Pos; | ||
| import javafx.scene.control.Button; | ||
| import javafx.scene.image.Image; | ||
| import javafx.scene.image.ImageView; | ||
| import javafx.scene.layout.BorderPane; | ||
| import javafx.scene.layout.VBox; | ||
|
|
||
| import java.awt.*; | ||
| import java.util.Objects; | ||
|
|
||
| public class PaymentCompletePageView extends BorderPane { | ||
| private final PaymentCompleteController controller; | ||
|
|
||
| public PaymentCompletePageView(PaymentCompleteController paymentCompleteController) { | ||
| this.controller = paymentCompleteController; | ||
| getStylesheets().add(getClass().getResource("/donationpage/paymentcomplete.css").toExternalForm()); | ||
|
|
||
| VBox content = new VBox(20); | ||
| content.setAlignment(Pos.CENTER); | ||
| content.setPadding(new Insets(40)); | ||
| content.getChildren().addAll(getImageSection(), getHomeBtn()); | ||
| setCenter(content); | ||
| } | ||
| public VBox getImageSection() { | ||
| Image image = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/donationpage/Payment Complete.png"))); | ||
| ImageView imageView = new ImageView(image); | ||
| imageView.setPreserveRatio(true); | ||
|
|
||
| imageView.fitWidthProperty().bind(widthProperty()); | ||
| imageView.setFitHeight(500); | ||
|
|
||
| VBox imageSection = new VBox(imageView); | ||
| imageSection.setAlignment(Pos.CENTER); | ||
| return imageSection; | ||
| } | ||
|
|
||
| public Button getHomeBtn() { | ||
| Button home = new Button("Home"); | ||
| home.setOnAction(e -> controller.handleHomeBtn()); | ||
| home.setId("home-button"); | ||
| return home; | ||
| } | ||
|
|
||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #home-button { | ||
| -fx-background-color: #4caf50; | ||
| -fx-text-fill: white; | ||
| -fx-font-size: 18px; | ||
| -fx-font-weight: bold; | ||
| -fx-pref-width: 200px; | ||
| -fx-pref-height: 50px; | ||
| -fx-background-radius: 8; | ||
| -fx-cursor: hand; | ||
| } | ||
|
|
||
| #home-button:hover { | ||
| -fx-background-color: #388e3c; | ||
| } |