本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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);
}
示例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());
}
示例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);
}
示例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());
}
示例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());
}