Package net.sourceforge.ganttproject.task

Examples of net.sourceforge.ganttproject.task.TaskNode


    case 9:
      return String.class;
    case 10:
      return Integer.class;
    default: {
      TaskNode tn = (TaskNode) this.getRoot();
      // tn = (TaskNode)tn.children().nextElement();
      Object o = this.getValueAt(tn, column);
      if (o == null) {
        o = "erreur";
        System.err.println("!!!!!!!!!!!!!!!!!");
View Full Code Here


   */
  public Object getValueAt(Object node, int column) {
    Object res = null;
    if (!(node instanceof TaskNode))
      return null;
    TaskNode tn = (TaskNode) node;
    Task t = (Task) tn.getUserObject();
    // if(tn.getParent()!=null){
    switch (column) {
    case 0:
      if (((Task) tn.getUserObject()).isProjectTask()) {
        res = new ImageIcon(getClass().getResource(
            "/icons/mproject.gif"));
      } else if (!tn.isLeaf())
        res = new ImageIcon(getClass().getResource("/icons/mtask.gif"));
      else if (t.isMilestone())
        res = new ImageIcon(getClass()
            .getResource("/icons/meeting.gif"));
      else
        res = new ImageIcon(getClass().getResource("/icons/tasks2.png"));
      break;
    case 1:
      Task task = (Task) tn.getUserObject();
      String path = (task.getPriority() == 0 ? "/icons/task1.gif" : task
          .getPriority() == 1 ? "/icons/task.gif"
          : "/icons/task2.gif");
      res = new ImageIcon(getClass().getResource(path));
      break;
    case 2: // info
      TaskInfo info = t.getTaskInfo();
      if (info != null) {
        if (info instanceof Delay) {
          int type = ((Delay) info).getType();
          if (type == Delay.NORMAL)
            res = new ImageIcon(getClass().getResource(
                "/icons/alert1_16.gif"));
          else if (type == Delay.CRITICAL)
            res = new ImageIcon(getClass().getResource(
                "/icons/alert2_16.gif"));
        }
      }
      break;
    case 3:
      res = tn.getName();
      break;
    case 4:
      res = tn.getStart();
      break;
    case 5:
      res = tn.getEnd();
      break;
    case 6:
      res = new Integer(tn.getDuration());
      break;
    case 7:
      res = new Integer(tn.getCompletionPercentage());
      break;
    case 8: {
      ResourceAssignment[] tAssign = t.getAssignments();
      StringBuffer sb = new StringBuffer();
      int nb = 0;
View Full Code Here

  /**
   * @inheritDoc
   */
  public Task[] getNestedTasks(Task container) {
    TaskNode r = (TaskNode) root;
    Enumeration e = r.children();

    Vector v = new Vector();
    while (e.hasMoreElements())
      v.add((TaskNode) e.nextElement());
    Task[] res = new Task[v.size()];
View Full Code Here

  /**
   * Purpose: Should return true if this Tasks has any nested subtasks.
   */
  public boolean hasNestedTasks(Task container) {
    TaskNode r = (TaskNode) root;
    if (r.getChildCount() > 0) {
      return true;
    } else {
      return false;
    }
  }
View Full Code Here

    Enumeration enumeration = ((TaskNode) getRoot()).preorderEnumeration();
    while (enumeration.hasMoreElements()) {
      Object next = enumeration.nextElement();
      if (!(next instanceof TaskNode))
        continue;
      TaskNode tn = (TaskNode) next;
      Task t = (Task) tn.getUserObject();
      if (t.equals(task))
        return tn;
    }
    return null;
  }
View Full Code Here

    protected String getIconFilePrefix() {
        return isOn() ? ICON_PREFIX_ON : ICON_PREFIX_OFF;
    }

    public void actionPerformed(ActionEvent e) {
        TaskNode root = (TaskNode) tree.getRoot();
        setOn(!isOn());
        putValue(Action.SMALL_ICON, createIcon(myOptions.getIconSize()));
        if (isOn()) {
      taskManager.processCriticalPath(root);
      ArrayList projectTasks = ((GanttTree2)tree).getProjectTasks();
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.task.TaskNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.