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


Java Task类代码示例

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


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

示例1: getTreeCellRendererComponent

import net.sf.memoranda.Task; //导入依赖的package包/类
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected,
        boolean expanded, boolean leaf, int row, boolean hasFocus) {
    // if root then just return some component
    // it is not shown anyway
    super.getTreeCellRendererComponent(
            tree, value, selected,
            expanded, leaf, row,
            hasFocus);
    if (value instanceof Project)
        return empty_panel;
    if (!(value instanceof Task))
        return empty_panel;
    Task t = (Task) value; 
    setText(t.getText());
    setToolTipText(t.getDescription());
    setIcon(getStatusIcon(t));
    applyFont(t, this);
    //return getTaskTreeCellRenderer(t, selected, hasFocus);
    return this;
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:21,代码来源:TaskTreeTableCellRenderer.java

示例2: getTaskTime

import net.sf.memoranda.Task; //导入依赖的package包/类
/**
 * This method gets the task time and returns it in a string format
 * of the total minutes. 
 * @param taskID the taskID to get time from.
 * @return This is the total time of that phase. 
 */
public String getTaskTime(String taskID){
	DecimalFormat formatter = new DecimalFormat("#0.00");
	PSP cuPSP = CurrentProject.getPSP();
	String ID = cuPSP.gettipAttr(taskID);
	Task task = CurrentProject.getTaskList().getTask(ID);
	String amount = task.getTimeSpent();
	if(amount.compareTo("No time logged.")==0){
		return("0.0");
	} 
	else{
		int toFigure = task.getSpentDays();
		toFigure = toFigure*24;
		toFigure +=task.getSpentHours();
		toFigure = toFigure*60;
		toFigure +=task.getSpentMinutes();
		return(formatter.format(toFigure));
	}
	
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:26,代码来源:PSPTrackingPanel.java

示例3: getStatusIcon

import net.sf.memoranda.Task; //导入依赖的package包/类
public static ImageIcon getStatusIcon(Task t) {
    switch (t.getStatus(CurrentDate.get())) {
    case Task.ACTIVE:
        return TASK_ACTIVE_ICON;
    case Task.SCHEDULED:
        return TASK_SCHEDULED_ICON;
    case Task.DEADLINE:
        return TASK_DEADLINE_ICON;
    case Task.FAILED:
        return TASK_FAILED_ICON;
    case Task.COMPLETED:
        return TASK_COMPLETED_ICON;
    }
    System.err.println("Problem finding status icon");
    return null;
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:17,代码来源:TaskTreeTableCellRenderer.java

示例4: getPriorityIcon

import net.sf.memoranda.Task; //导入依赖的package包/类
public static ImageIcon getPriorityIcon(Task t) {
    switch (t.getPriority()) {
    case Task.PRIORITY_NORMAL:
        return PR_NORMAL_ICON;
    case Task.PRIORITY_HIGHEST:
        return PR_HIGHEST_ICON;
    case Task.PRIORITY_HIGH:
        return PR_HIGH_ICON;
    case Task.PRIORITY_LOW:
        return PR_LOW_ICON;
    case Task.PRIORITY_LOWEST:
        return PR_LOWEST_ICON;
    }
    System.err.println("Problem finding priority icon");
    return null;
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:17,代码来源:TaskTreeTableCellRenderer.java

示例5: test

import net.sf.memoranda.Task; //导入依赖的package包/类
@Test
public void test() {
	
	TaskTable taskTable = new TaskTable();
	
	int rc = taskTable.getRowCount();
	taskTable.selectAll();
	int[] list = taskTable.getSelectedRows();
	for(int i = 0; i < rc; i++){
		Task t =
				CurrentProject.getTaskList().getTask(
		                taskTable.getModel().getValueAt(list[i], TaskTable.TASK_ID).toString());
		assertFalse(t.getID() == "100");
	}
	
}
 
开发者ID:ser316asu,项目名称:SER316-Munich,代码行数:17,代码来源:TestCase.java

示例6: expandRecursively

import net.sf.memoranda.Task; //导入依赖的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,项目名称:Reinickendorf_SER316,代码行数:30,代码来源:AgendaGenerator.java

示例7: selectPanel

import net.sf.memoranda.Task; //导入依赖的package包/类
public void selectPanel(String pan) {
      if (calendar.jnCalendar.renderer.getTask() != null) {
          calendar.jnCalendar.renderer.setTask(null);
       //   calendar.jnCalendar.updateUI();
      }
      if (pan.equals("TASKS") && (tasksPanel.taskTable.getSelectedRow() > -1)) {
          Task t =
              CurrentProject.getTaskList().getTask(
                  tasksPanel
                      .taskTable
                      .getModel()
                      .getValueAt(tasksPanel.taskTable.getSelectedRow(), TaskTable.TASK_ID)
                      .toString());
          calendar.jnCalendar.renderer.setTask(t);
     //     calendar.jnCalendar.updateUI();
      }
      boolean isAg = pan.equals("AGENDA");
      agendaPanel.setActive(isAg);
      if (isAg)
      	agendaPanel.refresh(CurrentDate.get());
      cardLayout1.show(editorsPanel, pan);
      cardLayout2.show(mainTabsPanel, pan + "TAB");
calendar.jnCalendar.updateUI();
CurrentPanel=pan;
  }
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:26,代码来源:DailyItemsPanel.java

示例8: getPhaseString

import net.sf.memoranda.Task; //导入依赖的package包/类
static String getPhaseString(int p) {
    switch (p) {
    case Task.PHASE_PLANNING:
        return Local.getString("Planning");
    case Task.PHASE_DESIGN:
        return Local.getString("Design");
    case Task.PHASE_DESIGN_REVIEW:
        return Local.getString("Design Review");
    case Task.PHASE_CODE:
        return Local.getString("Code");
    case Task.PHASE_CODE_REVIEW:
        return Local.getString("Code Review");
    case Task.PHASE_COMPILE:
        return Local.getString("Compile");
    case Task.PHASE_TEST:
        return Local.getString("Test");
    case Task.PHASE_POSTMORETEM:
        return Local.getString("Postmortem");
    case Task.PHASE_OTHER:
        return Local.getString("Other");
    }
    return "";
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:24,代码来源:AgendaGenerator.java

示例9: getTaskTreeCellRenderer

import net.sf.memoranda.Task; //导入依赖的package包/类
/**
 * Component used to render tree cells in treetable
 */
private Component getTaskTreeCellRenderer(Task t, boolean selected, boolean hasFocus) {
    JLabel tree_label = new JLabel();       
    tree_label.setText(t.getText());
    // XXX [alexeya] Disabled coz a bug with tooltips in TreeTables:
    //tree_label.setToolTipText(t.getDescription());
    tree_label.setIcon(getStatusIcon(t));
    applyFont(t, tree_label);
    return tree_label;        
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:13,代码来源:TaskTreeTableCellRenderer.java

示例10: getProgressCellRenderer

import net.sf.memoranda.Task; //导入依赖的package包/类
/**
 * Component showing task progress
 */
private Component getProgressCellRenderer(Task t, boolean selected, boolean hasFocus, int column) {
    progressLabel.setTask(t);
    progressLabel.setColumn(column);
    applyFocus(hasFocus, progressLabel);
    return progressLabel;
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:10,代码来源:TaskTreeTableCellRenderer.java

示例11: applyFont

import net.sf.memoranda.Task; //导入依赖的package包/类
private void applyFont(Task t, JComponent c) {
    if ((t.getStatus(CurrentDate.get()) == Task.ACTIVE)
            || (t.getStatus(CurrentDate.get()) == Task.DEADLINE))
        c.setFont(c.getFont().deriveFont(Font.BOLD));
    else
        c.setFont(c.getFont().deriveFont(Font.PLAIN));
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:8,代码来源:TaskTreeTableCellRenderer.java

示例12: getColorForTaskStatus

import net.sf.memoranda.Task; //导入依赖的package包/类
/**
 * Color representing task status, "light" color is useful for backgrounds
 * and other for text
 */
public static Color getColorForTaskStatus(Task t, boolean light) {
    if (light) {
        switch (t.getStatus(CurrentDate.get())) {
        case Task.ACTIVE:
            return new Color(192, 255, 192);
        case Task.SCHEDULED:
            return new Color(192, 230, 255);
        case Task.DEADLINE:
            return new Color(255, 240, 160);
        case Task.FAILED:
            return new Color(255, 192, 192);
        case Task.COMPLETED:
            return new Color(230, 255, 230);
        }
    } else {
        switch (t.getStatus(CurrentDate.get())) {
        case Task.ACTIVE:
            return new Color(0, 180, 0);
        case Task.SCHEDULED:
            return new Color(0, 120, 255);
        case Task.DEADLINE:
            return new Color(160, 90, 0);
        case Task.FAILED:
            return new Color(255, 0, 0);
        case Task.COMPLETED:
            return new Color(0, 120, 0);
        }
    }
    System.err.println("Problem finding color for task status");
    return null;
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:36,代码来源:TaskTreeTableCellRenderer.java

示例13: getTableCellRendererComponent

import net.sf.memoranda.Task; //导入依赖的package包/类
/**
 * TreeCellRenderer method. Overridden to update the visible row.
 */
public Component getTableCellRendererComponent(JTable table,
		Object value, boolean isSelected, boolean hasFocus, int row,
		int column) {
	if (isSelected)
		setBackground(table.getSelectionBackground());
	else
		setBackground(table.getBackground());
	if (value instanceof Task) {
		
	}
	visibleRow = row;
	return this;
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:17,代码来源:JTreeTable.java

示例14: expandRecursively

import net.sf.memoranda.Task; //导入依赖的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,项目名称:Neukoelln_SER316,代码行数:34,代码来源:AgendaGenerator.java

示例15: getProgress

import net.sf.memoranda.Task; //导入依赖的package包/类
static int getProgress(TaskList tl) {
	Vector v = (Vector) tl.getAllSubTasks(null);
	if (v.size() == 0)
		return -1;
	int p = 0;
	for (Enumeration en = v.elements(); en.hasMoreElements();) {
		Task t = (Task) en.nextElement();
		p += t.getProgress();
	}
	return (p * 100) / (v.size() * 100);
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:12,代码来源:AgendaGenerator.java


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