src/main/java/seedu/address/ui/MainWindow.java
/**
     * Opens the calorie stats window or focuses on it if it's already opened.
     */
Opens the calorie stats window or focuses on it if it's already opened.
Opens the calorie stats window or focuses on it if it ' s already opened .
@FXML
    public void handleCalorieStats() {
        if (!calorieStatsWindow.isShowing() && !weightStatsWindow.isShowing()) {
            calorieStatsWindow.show();
        } else if (!calorieStatsWindow.isShowing() && weightStatsWindow.isShowing()) {
            calorieStatsWindow.show();
            calorieStatsWindow.getRoot().setY(weightStatsWindow.getRoot().getY() + 100);
        } else {
            calorieStatsWindow.focus();
        }
    }
@ FXML public void handleCalorieStats ( ) { if ( ! calorieStatsWindow . isShowing ( ) && ! weightStatsWindow . isShowing ( ) ) { calorieStatsWindow . show ( ) ; } else if ( ! calorieStatsWindow . isShowing ( ) && weightStatsWindow . isShowing ( ) ) { calorieStatsWindow . show ( ) ; calorieStatsWindow . getRoot ( ) . setY ( weightStatsWindow . getRoot ( ) . getY ( ) + 100 ) ; } else { calorieStatsWindow . focus ( ) ; } }
Opens the calorie stats window or focuses on it if it's already opened.
Opens the calorie stats window or focuses on it if it ' s already opened .
//prevent both windows stacking over each other when opened at the same time