-
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: Frontpage is now 100% navigiaontal on has some working buttons
- Loading branch information
AdrianBalunan
committed
Mar 13, 2026
1 parent
6b64e7f
commit 6afdd4e
Showing
3 changed files
with
50 additions
and
16 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
43 changes: 40 additions & 3 deletions
43
...ation/src/main/java/ntnu/systemutvikling/team6/controller/OrganizationCardController.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,16 +1,53 @@ | ||
| package ntnu.systemutvikling.team6.controller; | ||
|
|
||
| import javafx.event.ActionEvent; | ||
| import javafx.fxml.FXML; | ||
| import javafx.fxml.FXMLLoader; | ||
| import javafx.scene.Node; | ||
| import javafx.scene.Parent; | ||
| import javafx.scene.Scene; | ||
| import javafx.scene.control.Label; | ||
| import javafx.stage.Stage; | ||
| import ntnu.systemutvikling.team6.HmHApplication; | ||
| import ntnu.systemutvikling.team6.models.Charity; | ||
|
|
||
| import java.io.IOException; | ||
| import java.util.Objects; | ||
|
|
||
| public class OrganizationCardController { | ||
|
|
||
| @FXML private Label organizationName; | ||
|
|
||
| @FXML private Label organizationDescription; | ||
|
|
||
| public void setOrganization(String name, String description) { | ||
| organizationName.setText(name); | ||
| organizationDescription.setText(description); | ||
| private Charity charity; | ||
|
|
||
| public void setOrganization(Charity charity) { | ||
| this.charity = charity; | ||
|
|
||
| organizationName.setText(charity.getName()); | ||
| organizationDescription.setText(charity.getDescription()); | ||
| } | ||
|
|
||
| /* EVENTS */ | ||
| public void switchToCharityPage(ActionEvent event){ | ||
| try { | ||
| FXMLLoader fxmlLoader = | ||
| new FXMLLoader(HmHApplication.class.getResource("/fxml/charityPage.fxml")); | ||
| Parent root = fxmlLoader.load(); | ||
| CharityPageController controller = fxmlLoader.getController(); | ||
| controller.setCharity(charity); | ||
|
|
||
| Stage stage = (Stage) ((Node)event.getSource()).getScene().getWindow(); | ||
| Scene scene = new Scene(root); | ||
| stage.setScene(scene); | ||
| stage.setFullScreen(true); | ||
| stage.show(); | ||
| } catch (IOException e) { | ||
| throw new RuntimeException(e); | ||
| } | ||
| } | ||
| public void switchToDonationPage(ActionEvent event){ | ||
| CharityPageController.loadNewScene(event, charity); | ||
| } | ||
| } |
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