コード例 #1
0
ファイル: CakeGUI.java プロジェクト: rm5248/cake
  /**
   * A method to update the current month. Sets the variable that controls the month and updates the
   * text.
   *
   * @param newMonth an integer value between 0 and 11.
   */
  public void updateMonth(int newMonth) {
    pastMonthOffset = currentMonthOffset;
    currentMonthOffset = CakeCal.getDayOfWeek(new SimpleDate((newMonth), 1, currentYear));
    miniDays[(currentDay - 1) + pastMonthOffset].setForeground(Color.black);
    currentMonth = newMonth;
    miniCalTitle.setText(curMonths[currentMonth - 1] + ", " + currentYear);
    events =
        calendar.getEvents(
            Period.parse(
                currentYear
                    + "."
                    + currentMonth
                    + ".1:00.00-"
                    + currentYear
                    + "."
                    + currentMonth
                    + "."
                    + curMonths[currentMonth - 1]
                    + ":24.00"));
    panelEvent.update();

    if (currentDay > (CakeCal.getMonths(currentYear))[currentMonth - 1]) {
      currentDay = (CakeCal.getMonths(currentYear))[currentMonth - 1];
    }
    updateDays();
    mview.updateMonth();
    dayView.updateDay();
    weekView.updateWeek();
    this.updateDays();
  }
コード例 #2
0
ファイル: CakeGUI.java プロジェクト: rm5248/cake
 /** Updates the current events */
 public void updateCurrentEvents() {
   events =
       calendar.getEvents(
           Period.parse(
               currentYear
                   + "."
                   + currentMonth
                   + ".1:00.00-"
                   + currentYear
                   + "."
                   + currentMonth
                   + "."
                   + curMonths[currentMonth - 1]
                   + ":24.00"));
 }