当前位置: 首页>>代码示例>>Java>>正文


Java EventsManager.createRepeatableEvent方法代码示例

本文整理汇总了Java中net.sf.memoranda.EventsManager.createRepeatableEvent方法的典型用法代码示例。如果您正苦于以下问题:Java EventsManager.createRepeatableEvent方法的具体用法?Java EventsManager.createRepeatableEvent怎么用?Java EventsManager.createRepeatableEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.memoranda.EventsManager的用法示例。


在下文中一共展示了EventsManager.createRepeatableEvent方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateEvents

import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
private void updateEvents(EventDialog dlg, int hh, int mm, String text) {
    int rtype;
    int period;
    CalendarDate sd = new CalendarDate((Date) dlg.startDate.getModel().getValue());
    CalendarDate ed = null;
    if (dlg.enableEndDateCB.isSelected())
        ed = new CalendarDate((Date) dlg.endDate.getModel().getValue());
    if (dlg.dailyRepeatRB.isSelected()) {
        rtype = EventsManager.REPEAT_DAILY;
        period = (Integer) dlg.daySpin.getModel().getValue();
    } else if (dlg.weeklyRepeatRB.isSelected()) {
        rtype = EventsManager.REPEAT_WEEKLY;
        period = dlg.weekdaysCB.getSelectedIndex() + 1;
        if (Configuration.get("FIRST_DAY_OF_WEEK").equals("mon")) {
            if (period == 7) period = 1;
            else period++;
        }
    } else if (dlg.yearlyRepeatRB.isSelected()) {
        rtype = EventsManager.REPEAT_YEARLY;
        period = sd.getCalendar().get(Calendar.DAY_OF_YEAR);
        if ((sd.getYear() % 4) == 0 && sd.getCalendar().get(Calendar.DAY_OF_YEAR) > 60) period--;
    } else {
        rtype = EventsManager.REPEAT_MONTHLY;
        period = (Integer) dlg.dayOfMonthSpin.getModel().getValue();
    }
    EventsManager.createRepeatableEvent(rtype, sd, ed, period, hh, mm, text, dlg.workingDaysOnlyCB.isSelected());
}
 
开发者ID:cst316,项目名称:spring16project-Team-Laredo,代码行数:28,代码来源:EventsPanel.java

示例2: updateEvents

import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
private void updateEvents(EventDialog dlg, int hh, int mm, String text) {
	int rtype;
	int period;
	CalendarDate sd = new CalendarDate((Date) dlg.startDate.getModel().getValue());
	CalendarDate ed = null;
	if (dlg.enableEndDateCB.isSelected()) {
		ed = new CalendarDate((Date) dlg.endDate.getModel().getValue());
	}
	if (dlg.dailyRepeatRB.isSelected()) {
		rtype = EventsManager.REPEAT_DAILY;
		period = ((Integer) dlg.daySpin.getModel().getValue()).intValue();
	} else if (dlg.weeklyRepeatRB.isSelected()) {
		rtype = EventsManager.REPEAT_WEEKLY;
		period = dlg.weekdaysCB.getSelectedIndex() + 1;
		if (Configuration.get("FIRST_DAY_OF_WEEK").equals("mon")) {
			if (period == 7) {
				period = 1;
			} else {
				period++;
			}
		}
	} else if (dlg.yearlyRepeatRB.isSelected()) {
		rtype = EventsManager.REPEAT_YEARLY;
		period = sd.getCalendar().get(Calendar.DAY_OF_YEAR);
		if ((sd.getYear() % 4) == 0 && sd.getCalendar().get(Calendar.DAY_OF_YEAR) > 60) {
			period--;
		}
	} else {
		rtype = EventsManager.REPEAT_MONTHLY;
		period = ((Integer) dlg.dayOfMonthSpin.getModel().getValue()).intValue();
	}
	EventsManager.createRepeatableEvent(rtype, sd, ed, period, hh, mm, text, dlg.workingDaysOnlyCB.isSelected());
}
 
开发者ID:cst316,项目名称:spring16project-Fortran,代码行数:34,代码来源:EventsPanel.java

示例3: testEventHourPeriod

import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
@Test
  public void testEventHourPeriod() {
      EventsManager.createRepeatableEvent(repeatType, startDate, endDate, period, hour, minute, text, workDays);
      //all current events
      Vector events= (Vector)EventsManager.getActiveEvents();
      //gets the new event that was just created
      Event event= (Event) events.get(events.size() - 1);
   // sends to eventMinute and gets the current time and checks when the next notify pop will pop up.
      EventsScheduler.eventHour(event);
System.out.println("[DEBUG] " + period +" = "+event.getPeriod());
      // ensures time we set to timer is the same
      assertEquals(period, event.getPeriod());
  }
 
开发者ID:cst316,项目名称:spring16project-Korn,代码行数:14,代码来源:HourlyEventTest.java

示例4: testEventHourExists

import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
@Test
  public void testEventHourExists() {
      int beforeAdded = EventsScheduler.counter();
      EventsManager.createRepeatableEvent(repeatType, startDate, endDate, period, hour+1, minute+1, text, workDays);
      Vector events= (Vector)EventsManager.getActiveEvents();
      Event event= (Event) events.get(events.size() - 1);
      EventsScheduler.eventHour(event);
      int afterAdded = 0;
      afterAdded = EventsScheduler.counter();
System.out.println("[DEBUG] " + beforeAdded +" != "+afterAdded);
// ensures that event was added to the timer vector
      assertFalse(beforeAdded == afterAdded);
  }
 
开发者ID:cst316,项目名称:spring16project-Korn,代码行数:14,代码来源:HourlyEventTest.java

示例5: testEventMinutePeriod

import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
@Test
public void testEventMinutePeriod() {
	EventsManager.createRepeatableEvent(repeatType, startDate, endDate, period, hour, minute, text, workDays);
	// all current events
	Vector events= (Vector)EventsManager.getActiveEvents();
	//gets the event we created
	Event event= (Event) events.get(events.size() - 1);
	// sends to eventMinute and gets the current time and checks when the next notify pop will pop up.
	EventsScheduler.eventMinute(event);
	System.out.println("[DEBUG] " + period +" = "+event.getPeriod());
	// ensures time we set to timer is the same
	assertEquals(period, event.getPeriod());
}
 
开发者ID:cst316,项目名称:spring16project-Korn,代码行数:14,代码来源:MinutleyEventTest.java

示例6: testEventMinuteExists

import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
@Test
public void testEventMinuteExists() {
	int beforeAdded = EventsScheduler.counter();
	EventsManager.createRepeatableEvent(repeatType, startDate, endDate, period, hour+1, minute+1, text, workDays);
	Vector events= (Vector)EventsManager.getActiveEvents();
	Event event= (Event) events.get(events.size() - 1);
	EventsScheduler.eventMinute(event);
	int afterAdded = EventsScheduler.counter();
	System.out.println("[DEBUG] " + beforeAdded +" != "+afterAdded);
	// ensures that event was added to the timer vector
	assertFalse(beforeAdded == afterAdded);
}
 
开发者ID:cst316,项目名称:spring16project-Korn,代码行数:13,代码来源:MinutleyEventTest.java

示例7: updateEvents

import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
private void updateEvents(EventDialog dlg, int hh, int mm, String text) {
int rtype;
       int period;
       CalendarDate sd = new CalendarDate((Date) dlg.startDate.getModel().getValue());
       CalendarDate ed = null;
       if (dlg.enableEndDateCB.isSelected())
           ed = new CalendarDate((Date) dlg.endDate.getModel().getValue());
       if (dlg.dailyRepeatRB.isSelected()) {
           rtype = EventsManager.REPEAT_DAILY;
           period = ((Integer) dlg.daySpin.getModel().getValue()).intValue();
       }
       else if (dlg.weeklyRepeatRB.isSelected()) {
           rtype = EventsManager.REPEAT_WEEKLY;
           period = dlg.weekdaysCB.getSelectedIndex() + 1;
    if (Configuration.get("FIRST_DAY_OF_WEEK").equals("mon")) {
	if(period==7) period=1;
	else period++;
    }
       }
else if (dlg.yearlyRepeatRB.isSelected()) {
    rtype = EventsManager.REPEAT_YEARLY;
    period = sd.getCalendar().get(Calendar.DAY_OF_YEAR);
    if((sd.getYear() % 4) == 0 && sd.getCalendar().get(Calendar.DAY_OF_YEAR) > 60) period--;
}
       else {
           rtype = EventsManager.REPEAT_MONTHLY;
           period = ((Integer) dlg.dayOfMonthSpin.getModel().getValue()).intValue();
       }
       EventsManager.createRepeatableEvent(rtype, sd, ed, period, hh, mm, text, dlg.workingDaysOnlyCB.isSelected());
   }
 
开发者ID:lgsilvestre,项目名称:Memoranda,代码行数:31,代码来源:EventsPanel.java

示例8: updateEvents

import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
private void updateEvents(EventDialog dialog, int hour, int minute, String text) {
    int repeatType;
    int period;

    CalendarDate startDate = new CalendarDate((Date) dialog.startDate.getModel().getValue());
    CalendarDate endDate = null;

    if (dialog.enableEndDateCB.isSelected())
        endDate = new CalendarDate((Date) dialog.endDate.getModel().getValue());

    if (dialog.minutelyRepeatRB.isSelected()) {
        repeatType = EventsManager.REPEAT_MINUTELY;
        period = (Integer) dialog.minuteSpin.getModel().getValue();
    } else if (dialog.hourlyRepeatRB.isSelected()) {
        repeatType = EventsManager.REPEAT_HOURLY;
        period = (Integer) dialog.hourSpin.getModel().getValue();
    } else if (dialog.dailyRepeatRB.isSelected()) {
        repeatType = EventsManager.REPEAT_DAILY;
        period = (Integer) dialog.daySpin.getModel().getValue();
    } else if (dialog.weeklyRepeatRB.isSelected()) {
        repeatType = EventsManager.REPEAT_WEEKLY;
        period = dialog.weekdaysCB.getSelectedIndex() + 1;

        if (Configuration.get("FIRST_DAY_OF_WEEK").equals("mon")) {
            if (period == 7)
                period = 1;
            else
                period++;
        }

    } else if (dialog.yearlyRepeatRB.isSelected()) {
        repeatType = EventsManager.REPEAT_YEARLY;
        period = startDate.getCalendar().get(Calendar.DAY_OF_YEAR);

        if ((startDate.getYear() % 4) == 0 && startDate.getCalendar().get(Calendar.DAY_OF_YEAR) > 60)
            period--;

    } else {
        repeatType = EventsManager.REPEAT_MONTHLY;
        period = (Integer) dialog.dayOfMonthSpin.getModel().getValue();
    }

    EventsManager.createRepeatableEvent(repeatType, startDate, endDate, period, hour, minute, text, dialog.workingDaysOnlyCB.isSelected());
}
 
开发者ID:cst316,项目名称:spring16project-Korn,代码行数:45,代码来源:EventsPanel.java


注:本文中的net.sf.memoranda.EventsManager.createRepeatableEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。