Skip to content

Commit

Permalink
Changed access of closeDrawer to private to decrease coupling between…
Browse files Browse the repository at this point in the history
… MainController and DrawerContentController
  • Loading branch information
claude-peon committed Oct 29, 2016
1 parent a890f35 commit 80b97ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 0 additions & 7 deletions src/controller/DrawerContentController.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ private void hide(Node n) {
@FXML
private void handleMapPressed(ActionEvent event) {
mainController.showMap();
mainController.closeDrawer();
}

/**
Expand All @@ -68,7 +67,6 @@ private void handleMapPressed(ActionEvent event) {
@FXML
private void handleReportListPressed(ActionEvent event) {
mainController.showReportList();
mainController.closeDrawer();
}

/**
Expand All @@ -77,7 +75,6 @@ private void handleReportListPressed(ActionEvent event) {
@FXML
private void handleCreateReportPressed(ActionEvent event) {
mainController.showCreateReport();
mainController.closeDrawer();
}

/**
Expand All @@ -86,24 +83,20 @@ private void handleCreateReportPressed(ActionEvent event) {
@FXML
private void handleEditProfilePressed(ActionEvent event) {
mainController.showEditProfile();
mainController.closeDrawer();
}

@FXML
private void handlePurityReportListPressed(ActionEvent event) {
mainController.showPurityReportList();
mainController.closeDrawer();
}

@FXML
private void handleCreatePurityReportPressed(ActionEvent event) {
mainController.showCreatePurityReport();
mainController.closeDrawer();
}

@FXML
private void handleHistoricalReportPressed(ActionEvent event) {
mainController.showHistoricalReport();
mainController.closeDrawer();
}
}
10 changes: 9 additions & 1 deletion src/controller/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private void handleEditProfile(ActionEvent event) {
/**
* Slides the drawer shut.
*/
public void closeDrawer() {
private void closeDrawer() {
transition.setRate(-1);
transition.play();
drawer.close();
Expand All @@ -107,49 +107,57 @@ public void closeDrawer() {
* Shows the map screen.
*/
public void showMap() {
//closeDrawer();
showView("Map");
closeDrawer();
}

/**
* Shows the report list screen.
*/
public void showReportList() {
showView("ReportList");
closeDrawer();
}

/**
* Shows the create report screen.
*/
public void showCreateReport() {
showView("CreateReport");
closeDrawer();
}

/**
* Shows the purity report list screen.
*/
public void showPurityReportList() {
showView("PurityReportList");
closeDrawer();
}

/**
* Shows the purity report editor.
*/
public void showCreatePurityReport() {
showView("CreatePurityReport");
closeDrawer();
}

/**
* Shows the edit profile screen.
*/
public void showEditProfile() {
showView("Profile");
closeDrawer();
}

/**
* Shows the HistoricalReportView
*/
public void showHistoricalReport() {
showView("HistoricalReport");
closeDrawer();
}

/**
Expand Down

0 comments on commit 80b97ec

Please sign in to comment.