-
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.
Update[AboutUsPage]: Update AboutUs page by moving the construction o…
…f the pop-up into a new class, increassing Seperation of concern
- Loading branch information
Fredrik Marjoni
committed
Apr 20, 2026
1 parent
3b3376f
commit df0905e
Showing
3 changed files
with
65 additions
and
28 deletions.
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
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
55 changes: 55 additions & 0 deletions
55
src/main/java/edu/group5/app/view/aboutuspage/AboutUsView.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 |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| package edu.group5.app.view.aboutuspage; | ||
|
|
||
| import edu.group5.app.utils.ParameterValidator; | ||
| import javafx.application.HostServices; | ||
| import javafx.scene.control.Alert; | ||
| import javafx.scene.control.ButtonType; | ||
| import javafx.scene.control.Hyperlink; | ||
| import javafx.scene.control.Label; | ||
| import javafx.scene.layout.VBox; | ||
|
|
||
| /** | ||
| * A view for displaying information about the "Help Me Help" application and its creators. | ||
| * The view is presented as an informational dialog that includes a description of the app's mission | ||
| * and a hyperlink to the project's GitHub repository for more details. This page serves to provide | ||
| * users with background information about the application and its development team. | ||
| */ | ||
| public class AboutUsView { | ||
| private HostServices hostServices; | ||
|
|
||
| public AboutUsView(HostServices hostServices) { | ||
| ParameterValidator.objectChecker(hostServices, "HostServices"); | ||
| this.hostServices = hostServices; | ||
| } | ||
|
|
||
| /** | ||
| * Displays the "About Us" information in an alert dialog. | ||
| */ | ||
| public void displayAboutUs() { | ||
| Alert aboutUs = new Alert(Alert.AlertType.INFORMATION); | ||
| aboutUs.setTitle("About us"); | ||
| aboutUs.setHeaderText("Help Me Help - About Us"); | ||
|
|
||
| Label description = new Label( | ||
| "Help Me Help is a charity donation application designed to connect donors with organizations in need. " + | ||
| "Our mission is to make it easy for people to support causes they care about and make a positive impact in the world.\n\n" + | ||
| "This application was developed by Team 5 as part of a IDATT1005 course project at NTNU spring 2026." | ||
| ); | ||
| description.setWrapText(true); | ||
| description.maxWidthProperty().bind(aboutUs.getDialogPane().widthProperty().subtract(40)); | ||
|
|
||
| Hyperlink websiteLink = new Hyperlink("For more information about the project, visit our GitHub repository"); | ||
| websiteLink.setOnAction(e -> hostServices.showDocument("https://git.ntnu.no/Group-5/Help-Me-Help")); | ||
|
|
||
| VBox content = new VBox(10, description, websiteLink); | ||
| content.setPrefWidth(420); | ||
|
|
||
| aboutUs.getDialogPane().setContentText(null); | ||
| aboutUs.getDialogPane().setContent(content); | ||
|
|
||
| // Optional: single Close button instead of OK | ||
| aboutUs.getButtonTypes().setAll(ButtonType.CLOSE); | ||
|
|
||
| aboutUs.showAndWait(); | ||
| } | ||
| } |