本文整理汇总了Java中net.sf.memoranda.date.CalendarDate.today方法的典型用法代码示例。如果您正苦于以下问题:Java CalendarDate.today方法的具体用法?Java CalendarDate.today怎么用?Java CalendarDate.today使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.memoranda.date.CalendarDate
的用法示例。
在下文中一共展示了CalendarDate.today方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEvent
import net.sf.memoranda.date.CalendarDate; //导入方法依赖的package包/类
public DTDEvent createEvent(CalendarDate date, int hour, int minute, String message, boolean reminder, String emailAddress) {
DTDEvent event = new DTDEvent(date, hour, minute, message, reminder, emailAddress);
Element year = getYear(date);
if (year == null) {
year = createYear(date);
_root.appendChild(year);
}
Element month = getMonth(date, year);
if (month == null) {
month = createMonth(date);
year.appendChild(month);
}
Element day = getDay(date, month);
if (day == null) {
day = createDay(date);
month.appendChild(day);
}
Element evnt = createEvent(event);
day.appendChild(evnt);
System.out.println(event.toString());
if (date == CalendarDate.today()) {
updateScheduledEvents();
}
return event;
}
示例2: todayB_actionPerformed
import net.sf.memoranda.date.CalendarDate; //导入方法依赖的package包/类
void todayB_actionPerformed(ActionEvent e) {
_date = CalendarDate.today();
refreshView();
notifyListeners();
}
示例3: removeEvent
import net.sf.memoranda.date.CalendarDate; //导入方法依赖的package包/类
public boolean removeEvent(CalendarDate date, int hour, int minute, String message) {
boolean success = false;
System.out.println("attempting to remove event: " + "hour: " + hour + " minute: " + minute);
Element year;
Element month;
Element day;
year = getYear(date);
if (year == null) {
return false;
}
month = getMonth(date, year);
if(month == null) {
return false;
}
day = getDay(date, month);
if (day == null) {
return false;
}
Elements tmps = day.getChildElements();
System.out.println("events: " + tmps.size());
boolean delete[] = new boolean[tmps.size()];
try {
for (int i = 0; i < tmps.size(); i ++) {
System.out.println(tmps.get(i).getAttributeValue("hour") + " : " + tmps.get(i).getAttributeValue("minute"));
System.out.println(tmps.get(i).getAttributeValue("message"));
if (hour == Integer.parseInt(tmps.get(i).getAttributeValue("hour")) && minute == Integer.parseInt(tmps.get(i).getAttributeValue("minute"))) {
delete[i] = true;
success = true;
}
else {
delete[i] = false;
}
}
} catch (Exception e) {
e.printStackTrace();
}
/*
* Remove in reverse order
*/
for (int i = delete.length-1; i >= 0 ; i--) {
System.out.println(delete[i]);
if (delete[i]) {
day.removeChild(i);
}
}
if (success) {
updateDateEvents(date);
if (CalendarDate.today() == date) {
updateScheduledEvents();
}
}
return success;
}