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


Java CurrentProject.getTaskList方法代码示例

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


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

示例1: calcTask_actionPerformed

import net.sf.memoranda.CurrentProject; //导入方法依赖的package包/类
void calcTask_actionPerformed(ActionEvent e) {
    TaskCalcDialog dlg = new TaskCalcDialog(App.getFrame());
    dlg.pack();
    Task t = CurrentProject.getTaskList().getTask(taskTable.getModel().getValueAt(taskTable.getSelectedRow(), TaskTable.TASK_ID).toString());
    
    Dimension frmSize = App.getFrame().getSize();
    Point loc = App.getFrame().getLocation();
    
    dlg.setLocation((frmSize.width - dlg.getSize().width) / 2 + loc.x, (frmSize.height - dlg.getSize().height) / 2 + loc.y);
    dlg.setVisible(true);
    if (dlg.CANCELLED) {
        return;            
    }
    
    TaskList tl = CurrentProject.getTaskList();
    if(dlg.calcEffortChB.isSelected()) {
        t.setEffort(tl.calculateTotalEffortFromSubTasks(t));
    }
    
    if(dlg.calcActualChB.isSelected()) {
        t.setActual(tl.calculateTotalActualFromSubTasks(t));
    }
    
    if(dlg.compactDatesChB.isSelected()) {
        t.setStartDate(tl.getEarliestStartDateFromSubTasks(t));
        t.setEndDate(tl.getLatestEndDateFromSubTasks(t));
    }
    
    if(dlg.calcCompletionChB.isSelected()) {
        long[] res = tl.calculateCompletionFromSubTasks(t);
        int thisProgress = (int) Math.round((((double)res[0] / (double)res[1]) * 100));
        t.setProgress(thisProgress);
    }
    
    CurrentStorage.get().storeTaskList(CurrentProject.getTaskList(), CurrentProject.get());
    taskTable.tableChanged();
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:38,代码来源:TaskPanel.java

示例2: calcTask_actionPerformed

import net.sf.memoranda.CurrentProject; //导入方法依赖的package包/类
void calcTask_actionPerformed(ActionEvent e) {
        TaskCalcDialog dlg = new TaskCalcDialog(App.getFrame());
        dlg.pack();
        Task t = CurrentProject.getTaskList().getTask(taskTable.getModel().getValueAt(taskTable.getSelectedRow(), TaskTable.TASK_ID).toString());
        
        Dimension frmSize = App.getFrame().getSize();
        Point loc = App.getFrame().getLocation();
        
        dlg.setLocation((frmSize.width - dlg.getSize().width) / 2 + loc.x, (frmSize.height - dlg.getSize().height) / 2 + loc.y);
        dlg.setVisible(true);
        if (dlg.CANCELLED) {
            return;            
        }
        
        TaskList tl = CurrentProject.getTaskList();
        if(dlg.calcEffortChB.isSelected()) {
            t.setEffort(tl.calculateTotalEffortFromSubTasks(t));
        }
        if(dlg.compactDatesChB.isSelected()) {
            t.setStartDate(tl.getEarliestStartDateFromSubTasks(t));
            t.setEndDate(tl.getLatestEndDateFromSubTasks(t));
        }
        
        if(dlg.calcCompletionChB.isSelected()) {
            long[] res = tl.calculateCompletionFromSubTasks(t);
            int thisProgress = (int) Math.round((((double)res[0] / (double)res[1]) * 100));
            t.setProgress(thisProgress);
        }
        
//        CalendarDate sd = new CalendarDate((Date) dlg.startDate.getModel().getValue());
////        CalendarDate ed = new CalendarDate((Date) dlg.endDate.getModel().getValue());
//          CalendarDate ed;
// 		if(dlg.chkEndDate.isSelected())
// 			ed = new CalendarDate((Date) dlg.endDate.getModel().getValue());
// 		else
// 			ed = new CalendarDate(0,0,0);
//        long effort = Util.getMillisFromHours(dlg.effortField.getText());
//		Task newTask = CurrentProject.getTaskList().createTask(sd, ed, dlg.todoField.getText(), dlg.priorityCB.getSelectedIndex(),effort, dlg.descriptionField.getText(),parentTaskId);
//		
		
        CurrentStorage.get().storeTaskList(CurrentProject.getTaskList(), CurrentProject.get());
        taskTable.tableChanged();
//        parentPanel.updateIndicators();
        //taskTable.updateUI();
    }
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:46,代码来源:TaskPanel.java

示例3: generateTasksInfo

import net.sf.memoranda.CurrentProject; //导入方法依赖的package包/类
static String generateTasksInfo(Project p, CalendarDate date, Collection expandedTasks) {
	TaskList tl;
	if (p.getID().equals(CurrentProject.get().getID())) {
		tl = CurrentProject.getTaskList();
	} else {
		tl = CurrentStorage.get().openTaskList(p);
	}
	String s = "";
	int k = getProgress(tl);
	if (k > -1) {
		s += "<br>" + Local.getString("Total progress") + ": " + k + "%";
	}
	s += "</td></tr></table>\n";

	Vector tasks = (Vector) tl.getActiveSubTasks(null, date);
	if (tasks.size() == 0) {
		s += "<p>" + Local.getString("No actual tasks") + ".</p>\n";
	} else {
		s += Local.getString("Actual tasks") + ":<br>\n<ul>\n";

		// TaskSorter.sort(tasks, date, TaskSorter.BY_IMP_RATE); // TODO:
		// configurable method
		Collections.sort(tasks);
		for (Iterator i = tasks.iterator(); i.hasNext();) {
			Task t = (Task) i.next();
			// Always show active tasks only on agenda page from now on.
			// If it's not active, then it's probably "not on the agenda"
			// isn't it?
			// if(Context.get("SHOW_ACTIVE_TASKS_ONLY").equals(new
			// Boolean(true))) {
			// if (!((t.getStatus() == Task.ACTIVE) || (t.getStatus() ==
			// Task.DEADLINE) || (t.getStatus() == Task.FAILED))) {
			// continue;
			// }
			// }
			// ignore if it's a sub-task, iterate over ROOT tasks here only
			if (tl.hasParentTask(t.getID())) {
				continue;
			}
			s = s + renderTask(p, date, tl, t, 0, expandedTasks);
			if (expandedTasks.contains(t.getID())) {
				s = s + expandRecursively(p, date, tl, t, expandedTasks, 1);
			}
		}
		s += "\n</ul>\n";
	}

	// Util.debug("html for project " + p.getTitle() + " is\n" + s);
	return s;
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:51,代码来源:AgendaGenerator.java

示例4: calcTask_actionPerformed

import net.sf.memoranda.CurrentProject; //导入方法依赖的package包/类
void calcTask_actionPerformed(ActionEvent e) {
        TaskCalcDialog dlg = new TaskCalcDialog(App.getFrame());
        dlg.pack();
        Task t = CurrentProject.getTaskList().getTask(taskTable.getModel().getValueAt(taskTable.getSelectedRow(), TaskTable.TASK_ID).toString());
        
        Dimension frmSize = App.getFrame().getSize();
        Point loc = App.getFrame().getLocation();
        
        dlg.setLocation((frmSize.width - dlg.getSize().width) / 2 + loc.x, (frmSize.height - dlg.getSize().height) / 2 + loc.y);
        dlg.setVisible(true);
        if (dlg.CANCELLED) {
            return;            
        }
        
        TaskList tl = CurrentProject.getTaskList();
        if(dlg.calcEffortChB.isSelected()) {
            t.setEffort(tl.calculateTotalEffortFromSubTasks(t));
        }
        
        if(dlg.compactDatesChB.isSelected()) {
            t.setStartDate(tl.getEarliestStartDateFromSubTasks(t));
            t.setEndDate(tl.getLatestEndDateFromSubTasks(t));
        }
        
        if(dlg.calcCompletionChB.isSelected()) {
            long[] res = tl.calculateCompletionFromSubTasks(t);
            int thisProgress = (int) Math.round((((double)res[0] / (double)res[1]) * 100));
            t.setProgress(thisProgress);
        }
        
//        CalendarDate sd = new CalendarDate((Date) dlg.startDate.getModel().getValue());
////        CalendarDate ed = new CalendarDate((Date) dlg.endDate.getModel().getValue());
//          CalendarDate ed;
//         if(dlg.chkEndDate.isSelected())
//             ed = new CalendarDate((Date) dlg.endDate.getModel().getValue());
//         else
//             ed = new CalendarDate(0,0,0);
//        long effort = HtmlUtil.getMillisFromHours(dlg.effortField.getText());
//        Task newTask = CurrentProject.getTaskList().createTask(sd, ed, dlg.todoField.getText(), dlg.priorityCB.getSelectedIndex(),effort, dlg.descriptionField.getText(),parentTaskId);
//        
        
        CurrentStorage.get().storeTaskList(CurrentProject.getTaskList(), CurrentProject.get());
        taskTable.tableChanged();
//        parentPanel.updateIndicators();
        //taskTable.updateUI();
    }
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:47,代码来源:TaskPanel.java

示例5: calcTask_actionPerformed

import net.sf.memoranda.CurrentProject; //导入方法依赖的package包/类
void calcTask_actionPerformed(ActionEvent e) {
        TaskCalcDialog dlg = new TaskCalcDialog(App.getFrame());
        dlg.pack();
        Task t = CurrentProject.getTaskList().getTask(taskTable.getModel().getValueAt(taskTable.getSelectedRow(), TaskTable.TASK_ID).toString());
        
        Dimension frmSize = App.getFrame().getSize();
        Point loc = App.getFrame().getLocation();
        
        dlg.setLocation((frmSize.width - dlg.getSize().width) / 2 + loc.x, (frmSize.height - dlg.getSize().height) / 2 + loc.y);
        dlg.setVisible(true);
        if (dlg.CANCELLED) {
            return;            
        }
        
        TaskList tl = CurrentProject.getTaskList();
        if(dlg.calcEffortChB.isSelected()) {
            t.setEffort(tl.calculateTotalEffortFromSubTasks(t));
        }
        
        if(dlg.compactDatesChB.isSelected()) {
            t.setStartDate(tl.getEarliestStartDateFromSubTasks(t));
            t.setEndDate(tl.getLatestEndDateFromSubTasks(t));
        }
        
        if(dlg.calcCompletionChB.isSelected()) {
            long[] res = tl.calculateCompletionFromSubTasks(t);
            int thisProgress = (int) Math.round((((double)res[0] / (double)res[1]) * 100));
            t.setProgress(thisProgress);
        }
        
//        CalendarDate sd = new CalendarDate((Date) dlg.startDate.getModel().getValue());
////        CalendarDate ed = new CalendarDate((Date) dlg.endDate.getModel().getValue());
//          CalendarDate ed;
// 		if(dlg.chkEndDate.isSelected())
// 			ed = new CalendarDate((Date) dlg.endDate.getModel().getValue());
// 		else
// 			ed = new CalendarDate(0,0,0);
//        long effort = Util.getMillisFromHours(dlg.effortField.getText());
//		Task newTask = CurrentProject.getTaskList().createTask(sd, ed, dlg.todoField.getText(), dlg.priorityCB.getSelectedIndex(),effort, dlg.descriptionField.getText(),parentTaskId);
//		
		
        CurrentStorage.get().storeTaskList(CurrentProject.getTaskList(), CurrentProject.get());
        taskTable.tableChanged();
//        parentPanel.updateIndicators();
        //taskTable.updateUI();
    }
 
开发者ID:ser316asu,项目名称:SER316-Munich,代码行数:47,代码来源:TaskPanel.java

示例6: generateTasksInfo

import net.sf.memoranda.CurrentProject; //导入方法依赖的package包/类
static String generateTasksInfo(Project p, CalendarDate date, Collection expandedTasks) {    	    	
	TaskList tl;
	if (p.getID().equals(CurrentProject.get().getID())) {
		tl = CurrentProject.getTaskList();        	
	}
	else {
		tl = CurrentStorage.get().openTaskList(p);        	
	}
	String s = "";
	int k = getProgress(tl);
	if (k > -1) {
		s += "<br>" + Local.getString("Total progress") + ": " + k + "%";        	
	}
	s += "</td></tr></table>\n";

	Vector tasks = (Vector) tl.getActiveSubTasks(null,date);        
	if (tasks.size() == 0) {
		s += "<p>" + Local.getString("No actual tasks") + ".</p>\n";        	
	}
	else {
		s += Local.getString("Actual tasks") + ":<br>\n<ul>\n";            

		//            TaskSorter.sort(tasks, date, TaskSorter.BY_IMP_RATE); // TODO: configurable method
		Collections.sort(tasks);
		for (Iterator i = tasks.iterator(); i.hasNext();) {
			Task t = (Task) i.next();
			// Always show active tasks only on agenda page from now on.
			// If it's not active, then it's probably "not on the agenda" isn't it?
			//        		if(Context.get("SHOW_ACTIVE_TASKS_ONLY").equals(new Boolean(true))) {
			//                    if (!((t.getStatus() == Task.ACTIVE) || (t.getStatus() == Task.DEADLINE) || (t.getStatus() == Task.FAILED))) {
			//                    	continue;
			//                	}	
			//        		}
			// ignore if it's a sub-task, iterate over ROOT tasks here only
			if (tl.hasParentTask(t.getID())) {
				continue;
			}

			s = s + renderTask(p, date, tl, t, 0,expandedTasks);
			if(expandedTasks.contains(t.getID())) {
				s = s + expandRecursively(p,date,tl,t,expandedTasks,1);
			}        		
		}
		s += "\n</ul>\n";
	}

	//        Util.debug("html for project " + p.getTitle() + " is\n" + s); 
	return s;
}
 
开发者ID:ser316asu,项目名称:SER316-Munich,代码行数:50,代码来源:AgendaGenerator.java


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