Skip to content

Commit

Permalink
Merge f77095f into 97da87b
Browse files Browse the repository at this point in the history
  • Loading branch information
kwekke committed Nov 5, 2019
2 parents 97da87b + f77095f commit 627ad35
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/seedu/exercise/ui/InfoDisplayPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ public void update(Resource resource) {
}
}

/**
* Updates the information displayed in the center panel of application to show the default message.
*/
public void showDefaultMessage() {
infoPanelPlaceholder.getChildren().clear();
infoPanelPlaceholder.getChildren().add(new Label(DEFAULT_MESSAGE));
}
}
30 changes: 29 additions & 1 deletion src/main/java/seedu/exercise/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public void handleHelp() {
}

/**
* Opens the resolve window and blocks all events until closed
* Opens the resolve window and blocks all events until closed.
*/
@FXML
private void handleResolve() {
Expand Down Expand Up @@ -343,19 +343,47 @@ private void changeTab(Tab tab) {
resourceListPanelPlaceholder.getSelectionModel().select(tab);
}

/**
* Updates the GUI to show the exercise list tab and refresh info display panel if the tab did change.
*/
private void handleShowExerciseList() {
if (!(isResourceListPanelShown(exerciseListTabPlaceholder))) {
infoDisplayPanel.showDefaultMessage();
}
resourceListPanelPlaceholder.getSelectionModel().select(exerciseListTabPlaceholder);
}

/**
* Updates the GUI to show the regime list tab and refresh info display panel if the tab did change.
*/
private void handleShowRegimeList() {
if (!(isResourceListPanelShown(regimeListTabPlaceholder))) {
infoDisplayPanel.showDefaultMessage();
}
resourceListPanelPlaceholder.getSelectionModel().select(regimeListTabPlaceholder);
}

/**
* Updates the GUI to show the schedule list tab and refresh info display panel if the tab did change.
*/
private void handleShowScheduleList() {
if (!(isResourceListPanelShown(scheduleListTabPlaceholder))) {
infoDisplayPanel.showDefaultMessage();
}
resourceListPanelPlaceholder.getSelectionModel().select(scheduleListTabPlaceholder);
}

/**
* Updates the GUI to show the suggestion list tab and refresh info display panel if the tab did change.
*/
private void handleShowSuggestionList() {
if (!(isResourceListPanelShown(suggestionListTabPlaceholder))) {
infoDisplayPanel.showDefaultMessage();
}
resourceListPanelPlaceholder.getSelectionModel().select(suggestionListTabPlaceholder);
}

private boolean isResourceListPanelShown(Tab resourceListPlaceholder) {
return resourceListPanelPlaceholder.getSelectionModel().getSelectedItem().equals(resourceListPlaceholder);
}
}

0 comments on commit 627ad35

Please sign in to comment.