-
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.
- Loading branch information
Showing
10 changed files
with
175 additions
and
6 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
13 changes: 13 additions & 0 deletions
13
src/main/java/edu/group5/app/control/OrganizationPageController.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,13 @@ | ||
| package edu.group5.app.control; | ||
|
|
||
| public class OrganizationPageController { | ||
| private final MainController controller; | ||
|
|
||
| public OrganizationPageController(MainController controller) { | ||
| this.controller = controller; | ||
| } | ||
|
|
||
| public void handleDonateClick() { | ||
| controller.showDonationPage(); | ||
| } | ||
| } |
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
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
94 changes: 94 additions & 0 deletions
94
src/main/java/edu/group5/app/view/organizationpage/OrganizationPageView.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,94 @@ | ||
| package edu.group5.app.view.organizationpage; | ||
|
|
||
| import edu.group5.app.control.HeaderController; | ||
| import edu.group5.app.control.OrganizationPageController; | ||
| import edu.group5.app.view.Header; | ||
| import javafx.geometry.Pos; | ||
| import javafx.scene.control.Button; | ||
| import javafx.scene.control.Label; | ||
| import javafx.scene.control.ScrollPane; | ||
| import javafx.scene.image.Image; | ||
| import javafx.scene.image.ImageView; | ||
| import javafx.scene.layout.BorderPane; | ||
| import javafx.scene.layout.HBox; | ||
| import javafx.scene.layout.StackPane; | ||
| import javafx.scene.layout.VBox; | ||
| import javafx.scene.text.Text; | ||
|
|
||
| public class OrganizationPageView extends BorderPane { | ||
| private final OrganizationPageController controller; | ||
|
|
||
| public OrganizationPageView(OrganizationPageController controller, HeaderController headerController) { | ||
| this.controller = controller; | ||
| getStylesheets().add(getClass().getResource("/organizationpage/organizationpage.css").toExternalForm()); | ||
| Header headerView = new Header(headerController); | ||
| setTop(headerView); | ||
| setCenter(createBody()); | ||
| } | ||
|
|
||
| private ScrollPane createBody() { | ||
| ScrollPane body = new ScrollPane(); | ||
| body.setFitToWidth(true); | ||
| body.setFitToHeight(true) | ||
| ; | ||
| VBox vBox = new VBox(); | ||
| vBox.setId("main-container"); | ||
|
|
||
| vBox.getChildren().addAll( | ||
| createOrgSection() | ||
| ); | ||
| body.setContent(vBox); | ||
| return body; | ||
| } | ||
|
|
||
| private HBox createOrgSection() { | ||
| HBox orgSection = new HBox(); | ||
| orgSection.setId("org-section"); | ||
| orgSection.setAlignment(Pos.CENTER); | ||
| orgSection.setSpacing(40); | ||
|
|
||
| orgSection.getChildren().addAll(createImageContainer(), createOrgInfoSection()); | ||
| return orgSection; | ||
| } | ||
|
|
||
| private StackPane createImageContainer() { | ||
| StackPane imageContainer = new StackPane(); | ||
| imageContainer.setId("imageContainer"); | ||
| imageContainer.setPrefHeight(120); | ||
| imageContainer.setPrefWidth(120); | ||
| imageContainer.setMaxWidth(Double.MAX_VALUE); | ||
|
|
||
| ImageView logo = new ImageView( | ||
| new Image(getClass().getResource("/browsepage/images/children_of_shambala.png").toExternalForm()) | ||
| ); | ||
|
|
||
| logo.setId("logo"); | ||
| logo.setSmooth(true); | ||
| logo.setPreserveRatio(true); | ||
|
|
||
| imageContainer.getChildren().add(logo); | ||
| return imageContainer; | ||
| } | ||
|
|
||
| private VBox createOrgInfoSection() { | ||
| VBox orgInfoSection = new VBox(); | ||
| orgInfoSection.setSpacing(50); | ||
|
|
||
| VBox orgNameAndDescription = new VBox(); | ||
|
|
||
| Label orgName = new Label("Shambala Foundation"); | ||
| orgName.setId("orgName"); | ||
|
|
||
| Text description = new Text("Descriptive text"); | ||
| description.setId("description"); | ||
|
|
||
| orgNameAndDescription.getChildren().addAll(orgName, description); | ||
|
|
||
| Button donateBtn = new Button("Donate"); | ||
| donateBtn.setId("donate-button"); | ||
| donateBtn.setOnAction(e -> controller.handleDonateClick()); | ||
|
|
||
| orgInfoSection.getChildren().addAll(orgNameAndDescription, donateBtn); | ||
| return orgInfoSection; | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| #body { | ||
| -fx-padding: 20px; | ||
| } | ||
|
|
||
| #card-grid { | ||
| } |
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,31 @@ | ||
| #main-container { | ||
| -fx-padding: 50px | ||
| } | ||
|
|
||
| #logo { | ||
| -fx-min-height: 50%; | ||
| } | ||
|
|
||
| #orgName { | ||
| -fx-font-weight: bold; | ||
| -fx-font-size: 20pt; | ||
| } | ||
|
|
||
| #description { | ||
| -fx-font-size: 10pt; | ||
| } | ||
|
|
||
| #donate-button { | ||
| -fx-pref-height: 55px; | ||
| -fx-background-color: #e03030; | ||
| -fx-text-fill: white; | ||
| -fx-font-size: 22px; | ||
| -fx-font-weight: bold; | ||
| -fx-background-radius: 8; | ||
| -fx-cursor: hand; | ||
| -fx-padding: 0 40 0 40; | ||
| } | ||
|
|
||
| #donate-button:hover { | ||
| -fx-background-color: #c02020; | ||
| } |