Package com.projity.pm.task

Examples of com.projity.pm.task.NormalTask$ResultClosure


  }
 
  void assign(List resourceList, double units) {
    if (selectedTasks == null) // if no selection, do nothing
      return;
    NormalTask task;
    Iterator t = selectedTasks.iterator();
    Object current = null;
    List taskList=new ArrayList();
    while (t.hasNext()) { // go thru all selected tasks
      current = t.next();
      if (! (current instanceof NormalTask))
        continue;
      task = (NormalTask)current;
      if (!task.isAssignable())
        continue;
      taskList.add(task);
    }
    AssignmentService.getInstance().newAssignments(taskList,resourceList,units,0,this,true);
    spreadSheetPane.updateTable();
View Full Code Here


* Removes given resource from current task selection
* @param resource
* @param selectedTasks
*/  void remove(Resource resource) {
    Iterator t = selectedTasks.iterator();
    NormalTask task;
    Assignment assignment;
    while (t.hasNext()) {
      task = (NormalTask)t.next();
      assignment = task.findAssignment(resource);
      if (assignment != null)
        AssignmentService.getInstance().remove(assignment,this,true);
    }
  } 
View Full Code Here

    try{
      return new NodeBridge(impl);
    }catch (Exception e) {return null;}
  }
  public Node createTask(Project project){
    return new NodeBridge(new NormalTask(project));
  }
View Full Code Here

      return;
    long begin = Long.MAX_VALUE;
    long end = Long.MIN_VALUE;

    Iterator i = children.iterator();
    NormalTask child;
    Object current;
    TaskSchedule childSchedule;
    boolean estimated = false;
    int t = type;
    if (context !=  null && context.pass == 3)
      t = CURRENT;
//System.out.println("assign from children top ass" + assign + " " + this);   
    while (i.hasNext()) {
      current = ((Node) i.next()).getImpl();
      if (! (current instanceof NormalTask))
        continue;
     
      child = (NormalTask) current;
      estimated |= child.isEstimated();

       

      //      if (context !=  null && context.pass == 3 && child.isReverseScheduled()) {
//       
//        childSchedule = child.getSchedule(-type);
//        System.out.println("reverse " + child + " " + childSchedule);       
//      } else
        childSchedule = child.getSchedule(t);
//      if (assign && child.isReverseScheduled())
//        childSchedule = childSchedule.getOppositeSchedule();

      long childBegin = childSchedule.getBegin();
     
View Full Code Here

                    Node node=(Node)i.next();
                  transformSubprojectBranches(node,model.getDataFactory(),new Predicate(){
                public boolean evaluate(Object arg0) {
                  Node parent=(Node)arg0;
                  //change implementation
                  NormalTask task=new NormalTask();
                  Task source=((Task)parent.getImpl());
                  source.cloneTo(task);
                  //task.setDuration(source.getActualDuration());
                  parent.setImpl(task);
                  return true;
View Full Code Here

    project.setSchedulingAlgorithm(this);
//    project.addObjectListener(this);
//    project.getMultipleTransactionManager().addListener(this);
    fieldUpdater = CriticalPathFields.getInstance(this,project);

    startSentinel = new NormalTask(true,project); //local
    startSentinel.setDuration(0);
    startSentinel.setName("<Start>"); // name doesn't matter - useful for debugging purposes

    finishSentinel = new NormalTask(true,project); //local
    finishSentinel.setDuration(0);
    finishSentinel.setName("<End>"); // name doesn't matter - useful for debugging purposes


    setForward(isForward());
View Full Code Here

  }
  /**
   * To add a new object such as when pasting
   */
  public void addObject(Object task) {
    NormalTask newTask  = (NormalTask)task;
    if (newTask.getSuccessorList().isEmpty()) { // if pred has no successors, tell end sentinel about it
      addEndSentinelDependency(newTask);
    } else { // make sure not in sentinel's list
      removeEndSentinelDependency(newTask);
    }
    if (newTask.getPredecessorList().isEmpty()) { // if pred has no successors, tell end sentinel about it
      addStartSentinelDependency(newTask);
    } else { // make sure not in sentinel's list
      removeStartSentinelDependency(newTask);
    }
   
   
    newTask.markTaskAsNeedingRecalculation();
    predecessorTaskList.arrangeTask(newTask);
  }
View Full Code Here

          Node node=(Node)o;
          if (node.getImpl() instanceof Assignment){
            Assignment assignment=(Assignment)node.getImpl();
            Node parent=(Node)node.getParent();
            if (parent.getImpl() instanceof NormalTask){
              NormalTask task=(NormalTask)parent.getImpl();
              if (task.findAssignment(assignment.getResource())==null){
                freeAssignments.add(node);
              }
            }
          }
        }
View Full Code Here

  }
  private void writeTaskBaselinesAndTimephased(final Project.Tasks.Task xml, Task mpx){
    // baselines
    final List baselineList = xml.getBaseline();

    NormalTask projityTask = (NormalTask) projityTaskMap.get(mpx);
    if (projityTask == null)
      return;
    for (int s = 0; s < Settings.numBaselines(); s++) {
      if (s == Snapshottable.CURRENT.intValue())
        continue;
      TaskSnapshot snapshot = (TaskSnapshot) projityTask.getSnapshot(new Integer(s));
      if (snapshot == null)
        continue;
      AssociationList snapshotAssignments = snapshot.getHasAssignments().getAssignments();
      if (snapshotAssignments.size() > 0) {
        for (Iterator j = snapshotAssignments.iterator(); j.hasNext();) {
          Assignment assignment = (Assignment) j.next();
          ResourceImpl r = (ResourceImpl) assignment.getResource();
          if (r.isDefault())
            continue;

          Project.Assignments.Assignment.Baseline baseline = m_factory
              .createProjectAssignmentsAssignmentBaseline();
          // For some silly reason, the baseline fields are all
          // strings so they need to be converted

          // baseline duration is missing :(
          baseline.setNumber(s + "");
          baseline.setStart(MPXConverter.dateToXMLString(DateTime.fromGmt(projityTask.getBaselineStart(s))));
          baseline.setFinish(MPXConverter.dateToXMLString(DateTime.fromGmt(projityTask.getBaselineFinish(s))));
          baseline.setWork(DatatypeConverter.printDuration(this, MPXConverter.toMPXDuration((long) projityTask.getBaselineWork(s))));
          baselineList.add(baseline);
        }
      }

    }
View Full Code Here

TOP

Related Classes of com.projity.pm.task.NormalTask$ResultClosure

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.