-
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.
refactor: changed file names and changed MainController to Navigation…
…Controller and combined all other controllers in to User-, Donation-, and OrganizationController
- Loading branch information
Showing
24 changed files
with
670 additions
and
348 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| package edu.group5.app.control; | ||
|
|
||
| public class DonationController { | ||
| } |
This file was deleted.
Oops, something went wrong.
99 changes: 99 additions & 0 deletions
99
src/main/java/edu/group5/app/control/NavigationController.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,99 @@ | ||
| package edu.group5.app.control; | ||
|
|
||
| import edu.group5.app.model.donation.DonationService; | ||
| import edu.group5.app.model.organization.Organization; | ||
| import edu.group5.app.model.organization.OrganizationService; | ||
| import edu.group5.app.model.user.User; | ||
| import edu.group5.app.model.user.UserService; | ||
| import edu.group5.app.view.ViewManager; | ||
|
|
||
| import java.math.BigDecimal; | ||
|
|
||
| public class MainController { | ||
| private final ViewManager view; | ||
|
|
||
| private final UserService userService; | ||
| private final DonationService donationService; | ||
| private final OrganizationService organizationService; | ||
|
|
||
| private final UserController userController; | ||
|
|
||
| private User currentUser; | ||
| private Organization currentOrganization; | ||
| private BigDecimal currentDonationAmount; | ||
|
|
||
| public MainController(UserService userService, DonationService donationService, | ||
| OrganizationService organizationService) { | ||
| this.userService = userService; | ||
| this.donationService = donationService; | ||
| this.organizationService = organizationService; | ||
|
|
||
| this.userController = new UserController(this, userService, donationService, organizationService); | ||
|
|
||
| this.view = new ViewManager(this); | ||
| } | ||
|
|
||
| public ViewManager getMainView() { | ||
| return this.view; | ||
| } | ||
|
|
||
| public User getCurrentUser() { | ||
| return this.currentUser; | ||
| } | ||
|
|
||
| public void setCurrentUser(User user) { | ||
| this.currentUser = user; | ||
| } | ||
|
|
||
| public Organization getCurrentOrganization() { | ||
| return this.currentOrganization; | ||
| } | ||
|
|
||
| public void setCurrentOrganization(Organization organization) { | ||
| this.currentOrganization = organization; | ||
| } | ||
|
|
||
| public BigDecimal getCurrentDonationAmount() { | ||
| return this.currentDonationAmount; | ||
| } | ||
|
|
||
| public void setCurrentDonationAmount(BigDecimal amount) { | ||
| this.currentDonationAmount = amount; | ||
| } | ||
|
|
||
| public void showHomePage() { | ||
| view.showHomePage(); | ||
| } | ||
|
|
||
| public void showLoginPage() { | ||
| view.showLoginPage(); | ||
| } | ||
|
|
||
| public void showSignInPage() { | ||
| view.showSignInPage(); | ||
| } | ||
|
|
||
| public void showPaymentCompletePage() { | ||
| view.showPaymentCompletePage(); | ||
| } | ||
|
|
||
| public void showCausesPage() { | ||
| view.showCausesPage(); | ||
| } | ||
|
|
||
| public void showOrganizationPage() { | ||
| view.showOrganizationPage(); | ||
| } | ||
|
|
||
| public void showDonationPage() { | ||
| view.showDonationPage(); | ||
| } | ||
|
|
||
| public void showAboutUsPage() { | ||
| view.showAboutUsPage(); | ||
| } | ||
|
|
||
| public void showUserPage() { | ||
| view.showUserPage(); | ||
| } | ||
| } |
4 changes: 4 additions & 0 deletions
4
src/main/java/edu/group5/app/control/OrganizationController.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,4 @@ | ||
| package edu.group5.app.control; | ||
|
|
||
| public class OrganizationController { | ||
| } |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
| package edu.group5.app.control; | ||
|
|
||
| public class UserController { | ||
| } |
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 |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| package edu.group5.app.model; | ||
|
|
||
| public class AppState { | ||
| } |
Oops, something went wrong.