@Override
    public final void actionPerformed(final ActionEvent evt) {
        
        if (ePomodoroTime == pomodoroTime) {
            ePomodoroTime--; // To ensure progress is not 100% at start
            if (isLongBreakNow) {
                taskPanel.setStatus(CurrentTaskPanel.WORKING_THEN_LBRK);
            } else {
                taskPanel.setStatus(CurrentTaskPanel.WORKING_THEN_SBRK);
            }
        }

        if (eBreakTime == 0) {
            setString(getElapsedTime(ePomodoroTime));
            setValue((int) ePomodoroTime);
            ePomodoroTime--;
        }

        /*
         * Counts down to -1 to give an extra second so that 00:00:01 can
         * be displayed.
         */
        if (ePomodoroTime == -1) {
            setString(getElapsedTime(eBreakTime));
            setValue((int) eBreakTime);
            eBreakTime++;
        }

        if (eBreakTime == 1) {
            playSound();
            setMaximum((int) breakTime);
            if (breakTime == model.getSettings().getLongBreak() / MILLI_MULT) {
                taskPanel.setStatus(CurrentTaskPanel.LONG_BREAK);
            } else {
                taskPanel.setStatus(CurrentTaskPanel.SHORT_BREAK);
            }
        }

        if (eBreakTime > breakTime) {
            timer.stop();
            playSound();
            setString("Done!");

            // Increments the current pomodoro value
            taskPanel.incrementPomodoro();

            taskPanel.setStatus(CurrentTaskPanel.NULL);

            // Enables a long break after an interval
            if (model.getSettings().isWillLongBreak()) {
                if (currentCycle >= model.getSettings()
                        .getIncrementInterval() - 1) {
                    isLongBreakNow = true;
                    currentCycle = 0; // Reset the cycle
                } else {
                    isLongBreakNow = false;
                    currentCycle++;
                }
            }
        }
    }