本文整理汇总了Java中net.sf.memoranda.date.CalendarDate类的典型用法代码示例。如果您正苦于以下问题:Java CalendarDate类的具体用法?Java CalendarDate怎么用?Java CalendarDate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CalendarDate类属于net.sf.memoranda.date包,在下文中一共展示了CalendarDate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateIndicators
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
public void updateIndicators(CalendarDate date, TaskList tl) {
indicatorsPanel.removeAll();
if (date.equals(CalendarDate.today())) {
if (tl.getActiveSubTasks(null,date).size() > 0)
indicatorsPanel.add(taskB, null);
if (EventsScheduler.isEventScheduled()) {
/*String evlist = "";
for (Iterator it = EventsScheduler.getScheduledEvents().iterator(); it.hasNext();) {
net.sf.memoranda.Event ev = (net.sf.memoranda.Event)it.next();
evlist += ev.getTimeString()+" - "+ev.getText()+"\n";
} */
net.sf.memoranda.Event ev = EventsScheduler.getFirstScheduledEvent();
alarmB.setToolTipText(ev.getTimeString() + " - " + ev.getText());
indicatorsPanel.add(alarmB, null);
}
}
indicatorsPanel.updateUI();
}
示例2: getStatus
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
/**s
* @see net.sf.memoranda.Task#getStatus()
*/
public int getStatus(CalendarDate date) {
CalendarDate start = getStartDate();
CalendarDate end = getEndDate();
if (isFrozen())
return Task.FROZEN;
if (isCompleted())
return Task.COMPLETED;
if (date.inPeriod(start, end)) {
if (date.equals(end))
return Task.DEADLINE;
else
return Task.ACTIVE;
}
else if(date.before(start)) {
return Task.SCHEDULED;
}
if(start.after(end)) {
return Task.ACTIVE;
}
return Task.FAILED;
}
示例3: refresh
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
public void refresh(CalendarDate date) {
viewer.setText(AgendaGenerator.getAgenda(date, expandedTasks));
SwingUtilities.invokeLater(new Runnable() {
public void run() {
if (gotoTask != null) {
viewer.scrollToReference(gotoTask);
scrollPane.setViewportView(viewer);
Util.debug("Set view port to " + gotoTask);
}
}
});
Util.debug("Summary updated.");
}
示例4: createEvent
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
public static Event createEvent(
CalendarDate date,
int hh,
int mm,
String text) {
Element el = new Element("event");
el.addAttribute(new Attribute("id", Util.generateId()));
el.addAttribute(new Attribute("hour", String.valueOf(hh)));
el.addAttribute(new Attribute("min", String.valueOf(mm)));
el.appendChild(text);
Day d = getDay(date);
if (d == null)
d = createDay(date);
d.getElement().appendChild(el);
return new EventImpl(el);
}
示例5: expandRecursively
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
/**
* @param t
* @param expandedTasks
*/
private static String expandRecursively(Project p,CalendarDate date, TaskList tl,Task t, Collection expandedTasks, int level) {
Util.debug("Expanding task " + t.getText() + " level " + level);
Collection st = tl.getActiveSubTasks(t.getID(),date);
Util.debug("number of subtasks " + st.size());
String s = "\n<ul>\n";
for (Iterator iter = st.iterator(); iter.hasNext();) {
Task subTask = (Task) iter.next();
// if(Context.get("SHOW_ACTIVE_TASKS_ONLY").equals(new Boolean(true))) {
// if (!((subTask.getStatus() == Task.ACTIVE) || (subTask.getStatus() == Task.DEADLINE) || (subTask.getStatus() == Task.FAILED))) {
// continue;
// }
// }
s = s + renderTask(p,date,tl,subTask,level,expandedTasks);
if (expandedTasks.contains(subTask.getID())) {
s = s + expandRecursively(p,date,tl,subTask,expandedTasks,level + 1);
}
}
s += "\n</ul>\n";
return s;
}
示例6: generateToc
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
private static void generateToc(Writer w, Vector notes) {
write(w, "<div class=\"toc\"><ul>\n");
for (Iterator i = notes.iterator(); i.hasNext(); ) {
Note note = (Note) i.next();
String link = "";
CalendarDate d = note.getDate();
String id = note.getId();
if (!_chunked)
link = "#" + id;
else
link = id + ".html";
write(w, "<li><a href=\"" + link + "\">"
+ note.getDate().getMediumDateString() + " "
+ note.getTitle() + "</a></li>\n");
}
write(w, "</ul></div>\n");
}
示例7: setUp
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
CalendarDate calendarDate1 = new CalendarDate(1, 1, 1970);
Element root1 = new Element("root");
root1.addAttribute(new Attribute("id", "1"));
Project project1 = new ProjectImpl(root1);
histItem1 = new HistoryItem(calendarDate1, project1);
histItem2 = new HistoryItem(calendarDate1, project1);
Element root2 = new Element("root");
root2.addAttribute(new Attribute("id", "2"));
Project project2 = new ProjectImpl(root2);
histItem3 = new HistoryItem(calendarDate1, project2);
CalendarDate calendarDate2 = new CalendarDate(4, 28, 2017);
histItem4 = new HistoryItem(calendarDate2, project1);
}
示例8: getEarliestStartDateFromSubTasks
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
/**
* Looks through the entire sub task tree and corrects any inconsistencies in start dates
*
* @param t
* @return
*/
public CalendarDate getEarliestStartDateFromSubTasks(Task t) {
CalendarDate d = t.getStartDate();
if (hasSubTasks(t.getID())) {
Collection subTasks = getAllSubTasks(t.getID());
for (Iterator iter = subTasks.iterator(); iter.hasNext();) {
Task e = (Task) iter.next();
CalendarDate dd = getEarliestStartDateFromSubTasks(e);
if(dd.before(d)) {
d = dd;
}
}
t.setStartDate(d);
return d;
}
else {
return t.getStartDate();
}
}
示例9: getLatestEndDateFromSubTasks
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
/**
* Looks through the entire sub task tree and corrects any inconsistencies in start dates
*
* @param t
* @return
*/
public CalendarDate getLatestEndDateFromSubTasks(Task t) {
CalendarDate d = t.getEndDate();
if (hasSubTasks(t.getID())) {
Collection subTasks = getAllSubTasks(t.getID());
for (Iterator iter = subTasks.iterator(); iter.hasNext();) {
Task e = (Task) iter.next();
CalendarDate dd = getLatestEndDateFromSubTasks(e);
if(dd.after(d)) {
d = dd;
}
}
t.setEndDate(d);
return d;
}
else {
return t.getEndDate();
}
}
示例10: getDay
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
public Element getDay(CalendarDate date, Element month) {
Element day = null;
Elements days = month.getChildElements("day");
if (days.size() == 0) {
return null;
}
else {
for (int i = 0; i < days.size(); i++) {
if (Integer.parseInt(days.get(i).getAttributeValue("day").toString()) == date.getDay()) {
day = days.get(i);
break;
}
}
}
return day;
}
示例11: initTable
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
public void initTable(CalendarDate d) {
defectlogs = (Vector)DefectLogManager.getDefectLogsForDate(d);
getColumnModel().getColumn(0).setPreferredWidth(80);
getColumnModel().getColumn(0).setMaxWidth(80);
getColumnModel().getColumn(1).setPreferredWidth(60);
getColumnModel().getColumn(1).setMaxWidth(60);
getColumnModel().getColumn(2).setPreferredWidth(100);
getColumnModel().getColumn(2).setMaxWidth(100);
getColumnModel().getColumn(3).setPreferredWidth(100);
getColumnModel().getColumn(3).setMaxWidth(100);
getColumnModel().getColumn(4).setPreferredWidth(100);
getColumnModel().getColumn(4).setMaxWidth(100);
getColumnModel().getColumn(5).setPreferredWidth(60);
getColumnModel().getColumn(5).setMaxWidth(60);
getColumnModel().getColumn(6).setPreferredWidth(60);
getColumnModel().getColumn(6).setMaxWidth(60);
clearSelection();
updateUI();
}
示例12: TaskTable
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
public TaskTable() {
super();
initTable();
// Force the JTable and JTree to share their row selection models.
ListToTreeSelectionModelWrapper selectionWrapper = new ListToTreeSelectionModelWrapper();
tree.setSelectionModel(selectionWrapper);
setSelectionModel(selectionWrapper.getListSelectionModel());
CurrentDate.addDateListener(new DateListener() {
public void dateChange(CalendarDate d) {
//updateUI();
tableChanged();
}
});
CurrentProject.addProjectListener(new ProjectListener() {
public void projectChange(Project p, NoteList nl, TaskList tl,
ResourcesList rl) {
}
public void projectWasChanged() {
//initTable();
tableChanged();
}
});
}
示例13: createDay
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
private Day createDay(int d) {
Element el = new Element("day");
el.addAttribute(new Attribute("day", new Integer(d).toString()));
el.addAttribute(
new Attribute(
"date",
new CalendarDate(
d,
getValue(),
new Integer(
((Element) mElement.getParent())
.getAttribute("year")
.getValue())
.intValue())
.toString()));
mElement.appendChild(el);
return new Day(el);
}
示例14: currentDateChanged
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
void currentDateChanged(CalendarDate newdate) {
Cursor cur = App.getFrame().getCursor();
App.getFrame().setCursor(waitCursor);
if (!changedByHistory) {
History.add(new HistoryItem(newdate, CurrentProject.get()));
}
if (!dateChangedByCalendar) {
calendarIgnoreChange = true;
calendar.set(newdate);
calendarIgnoreChange = false;
}
/*if ((currentNote != null) && !changedByHistory && !addedToHistory)
History.add(new HistoryItem(currentNote));*/
currentNoteChanged(currentNote,true);
currentNote = CurrentProject.getNoteList().getNoteForDate(newdate);
CurrentNote.set(currentNote,true);
currentDate = CurrentDate.get();
/*addedToHistory = false;
if (!changedByHistory) {
if (currentNote != null) {
History.add(new HistoryItem(currentNote));
addedToHistory = true;
}
}*/
currentDateLabel.setText(newdate.getFullDateString());
if ((currentNote != null) && (currentNote.isMarked())) {
currentDateLabel.setIcon(bookmarkIcon);
currentDateLabel.setHorizontalTextPosition(SwingConstants.LEFT);
}
else {
currentDateLabel.setIcon(null);
}
updateIndicators(newdate, CurrentProject.getTaskList());
App.getFrame().setCursor(cur);
}
示例15: testEventsTableWeekly
import net.sf.memoranda.date.CalendarDate; //导入依赖的package包/类
@Test
public void testEventsTableWeekly() {
CalendarDate td1 = new CalendarDate(13,2,2017);
CalendarDate td2 = new CalendarDate(2,2,2017);
CurrentDate.set(td2);
EventsTableWeekly testPan1 = new EventsTableWeekly();
assertTrue(testPan1.getEventAt(0, 4).equals(tev1));
assertTrue(testPan1.getEventAt(0, 5).equals(tev2));
CurrentDate.set(td1);
testPan1.refresh();
assertTrue(testPan1.getEventAt(0, 1).equals(tev2));
assertTrue(testPan1.getEventAt(1, 1).equals(tev3));
}