-
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: made app and MainView work together
- Loading branch information
Showing
3 changed files
with
12 additions
and
5 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 |
|---|---|---|
| @@ -1,32 +1,37 @@ | ||
| package edu.group5.app.view; | ||
|
|
||
| import edu.group5.app.control.HeaderController; | ||
| import edu.group5.app.control.HomePageController; | ||
| import edu.group5.app.control.MainController; | ||
| import edu.group5.app.view.homepage.HomePageView; | ||
| import javafx.scene.Scene; | ||
| import javafx.scene.layout.BorderPane; | ||
|
|
||
| public class MainView { | ||
| private final MainController mainController; | ||
| private final HeaderController headerController; | ||
| private final HomePageController homePageController; | ||
| private final BorderPane root; | ||
|
|
||
| public MainView(MainController mainController) { | ||
| this.mainController = mainController; | ||
| this.headerController = new HeaderController(mainController); | ||
| this.homePageController = new HomePageController(mainController); | ||
| this.root = new BorderPane(); | ||
| } | ||
|
|
||
| public Scene createView() { | ||
| root.setCenter(new HomePageView(headerController)); | ||
| root.setCenter(new HomePageView(homePageController, headerController)); | ||
| return new Scene(root, 1280, 720); | ||
| } | ||
|
|
||
| public void showHomePage() { | ||
| root.setCenter(new HomePageView(headerController)); | ||
| root.setCenter(new HomePageView(homePageController, headerController)); | ||
| } | ||
|
|
||
| public void showLoginPage() { | ||
|
|
||
| } | ||
|
|
||
| public void showBrowsePage() {} | ||
|
|
||
| public void showAboutUsPage() {} | ||
| } |
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