src/main/java/seedu/address/ui/MainWindow.java
/**
     * Updates the calorie panels when a day is deleted.
     *
     * @param indexOfDayDeleted the index (zeroBased) of the day that is deleted.
     */
Updates the calorie panels when a day is deleted.
@param indexOfDayDeleted the index (zeroBased) of the day that is deleted.
Updates the calorie panels when a day is deleted . @param indexOfDayDeleted the index ( zeroBased ) of the day that is deleted .
void updateCaloriePanelsWhenDeleted(int indexOfDayDeleted) {
        boolean isCurrDayShowingDeleted = indexOfDayDeleted == indexOfDayCurrentlyShowingCalories;
        boolean isDayDeletedAboveCurrDayShowing = indexOfDayDeleted < indexOfDayCurrentlyShowingCalories;
        if (isCurrDayShowingDeleted) {
            boolean isLastDayBeingDeleted = indexOfDayDeleted == logic.getFilteredDayList().size();
            if (isLastDayBeingDeleted) {
                clearCaloriePanels();
            } else {
                calorieInputListPanel.update(logic.getFilteredDayList().get(indexOfDayDeleted).getCalorieManager()
                        .getCalorieInputList());
                calorieOutputListPanel.update(logic.getFilteredDayList().get(indexOfDayDeleted).getCalorieManager()
                        .getCalorieOutputList());
            }
        } else if (isDayDeletedAboveCurrDayShowing) {
            indexOfDayCurrentlyShowingCalories--;
        }
    }
void updateCaloriePanelsWhenDeleted ( int indexOfDayDeleted ) { boolean isCurrDayShowingDeleted = indexOfDayDeleted == indexOfDayCurrentlyShowingCalories ; boolean isDayDeletedAboveCurrDayShowing = indexOfDayDeleted < indexOfDayCurrentlyShowingCalories ; if ( isCurrDayShowingDeleted ) { boolean isLastDayBeingDeleted = indexOfDayDeleted == logic . getFilteredDayList ( ) . size ( ) ; if ( isLastDayBeingDeleted ) { clearCaloriePanels ( ) ; } else { calorieInputListPanel . update ( logic . getFilteredDayList ( ) . get ( indexOfDayDeleted ) . getCalorieManager ( ) . getCalorieInputList ( ) ) ; calorieOutputListPanel . update ( logic . getFilteredDayList ( ) . get ( indexOfDayDeleted ) . getCalorieManager ( ) . getCalorieOutputList ( ) ) ; } } else if ( isDayDeletedAboveCurrDayShowing ) { indexOfDayCurrentlyShowingCalories -- ; } }
Updates the calorie panels when a day is deleted.
Updates the calorie panels when a day is deleted .