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


Java CalendarDate类代码示例

本文整理汇总了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();
}
 
开发者ID:ser316asu,项目名称:SER316-Ingolstadt,代码行数:19,代码来源:DailyItemsPanel.java

示例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;
  }
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:28,代码来源:TaskImpl.java

示例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.");
}
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:17,代码来源:AgendaPanel.java

示例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);
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:17,代码来源:EventsManager.java

示例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;
}
 
开发者ID:ser316asu,项目名称:SER316-Aachen,代码行数:30,代码来源:AgendaGenerator.java

示例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");
}
 
开发者ID:ser316asu,项目名称:SER316-Aachen,代码行数:18,代码来源:ProjectExporter.java

示例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);
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:18,代码来源:HistoryItemTest.java

示例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();
    }
}
 
开发者ID:ser316asu,项目名称:SER316-Ingolstadt,代码行数:25,代码来源:TaskListImpl.java

示例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();
    }
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:25,代码来源:TaskListImpl.java

示例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;
}
 
开发者ID:ser316asu,项目名称:SER316-Aachen,代码行数:17,代码来源:DTDEventManager.java

示例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();
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:20,代码来源:DefectLogTable.java

示例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();
        }
    });
	
}
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:27,代码来源:TaskTable.java

示例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);
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:20,代码来源:TimeLogManager.java

示例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);
  }
 
开发者ID:ser316asu,项目名称:SER316-Aachen,代码行数:40,代码来源:DailyItemsPanel.java

示例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));
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:15,代码来源:EventsTableTest.java


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