Package com.projity.pm.dependency

Examples of com.projity.pm.dependency.Dependency


      GraphicNode gnode=(GraphicNode)i.next();
     
      HasDependencies task=(HasDependencies)gnode.getNode().getImpl();     
      AssociationList dependencyList=task.getSuccessorList();
      for (Iterator j=dependencyList.iterator();j.hasNext();){
        Dependency dep=(Dependency)j.next();
       
        HasDependencies pre=dep.getPredecessor();
        HasDependencies suc=dep.getSuccessor();
        GraphicNode preGNode=(GraphicNode)implMap.get(pre);
        GraphicNode sucGNode=(GraphicNode)implMap.get(suc);
        if (preGNode!=null&&sucGNode!=null){
          newGraphicDependency(preGNode,sucGNode,dep);
        } else {
View Full Code Here


  public void createDependency(GraphicNode startNode,GraphicNode endNode) throws InvalidAssociationException{
    DependencyService service=DependencyService.getInstance();
    HasDependencies startObject=(HasDependencies)startNode.getNode().getImpl();
    HasDependencies endObject=(HasDependencies)endNode.getNode().getImpl();
    //try {
      Dependency dep=service.newDependency(startObject,endObject,DependencyType.FS,0L,this);
    //} catch (InvalidAssociationException e) {
    //  e.printStackTrace();
    //}
  }
View Full Code Here

  public void objectChanged(ObjectEvent objectEvent) {
    //System.out.println("ObjectEvent: type="+objectEvent.getType()+", field="+objectEvent.getField()+", object="+objectEvent.getObject());
    if (!receiveEvents) return;
    Object object=objectEvent.getObject();
    if (object instanceof Dependency) {
      Dependency dependency = ((Dependency)object);
      if (dependency.getDocument() == document || dependency.getMasterDocument() == document) { // links can come from other projects too, but successor should be in this project
        if (objectEvent.isCreate()) {
          Node preNode=(Node)model.search(dependency.getPredecessor());
          Node sucNode=(Node)model.search(dependency.getSuccessor());
          GraphicNode preGNode=(GraphicNode)nodeCache.getElement(preNode);
          GraphicNode sucGNode=(GraphicNode)nodeCache.getElement(sucNode);
          if (preGNode!=null&&sucGNode!=null){
            GraphicDependency edge=(GraphicDependency)edgeCache.getElement(dependency);
            if (edge == null) { // for external tasks in subprojects, it's possible they already were created
              edge=newGraphicDependency(preGNode,sucGNode,dependency);
              update();
            }
          }
        } else if (objectEvent.isDelete()) {
          GraphicDependency edge=(GraphicDependency)edgeCache.getElement(dependency);
          if (edge!=null){
            removeEdge(edge);
            update();
          }
          //edgeCache.fireEdgesRemoved(this,new Object[]{edge});
        } else { //update
          GraphicDependency edge=(GraphicDependency)edgeCache.getElement(dependency);
          if (edge!=null){
            modifyEdge(edge,dependency.getDependencyType());
            update();
          }
          //edgeCache.fireEdgesUpdated(this,new Object[]{edge});
        }
      }
View Full Code Here

//              task.setUniqueId(task.getId()); // set unique id and id to the same thing on export. Ensures unique id is unique
              net.sf.mpxj.Task taskData=(net.sf.mpxj.Task)taskLinker.getTransformationMap().get(task);
              projectData.putProjityTaskMap(taskData,task);
           
              for (Iterator j=task.getPredecessorList().iterator();j.hasNext();){
                Dependency dependency=(Dependency)j.next();
                Task pred=(Task)dependency.getPredecessor();
                net.sf.mpxj.Task predData=(net.sf.mpxj.Task)taskLinker.getTransformationMap().get(pred);
               
                Relation rel=taskData.addPredecessor(predData,RelationType.getInstance(dependency.getDependencyType()),MPXConverter.toMPXDuration(dependency.getLag())); //claur
              }
              taskCount++;
        }
        }
     
View Full Code Here

       
       
       
        Color oldColor=g2.getColor();
        Stroke oldStroke = g2.getStroke();
        Dependency dep = dependency.getDependency();
        if (dep != null && dep.isDisabled())
          g2.setStroke(GraphRenderer.DISABLED_LINK_STROKE);
        if (dep != null && dep.isCrossProject())
          g2.setColor(GraphRenderer.EXTERNAL_LINK_COLOR);
        else
          g2.setColor(format.getMiddle().getColor());
        g2.draw(path);
       
View Full Code Here

        HasDependencies predecessor=(Task)implMap.get(pt);
        HasDependencies successor=(Task)implMap.get(st);

        if (predecessor==null) predecessor=new TaskLinkReferenceImpl(pt.getUniqueId(),pt.getProject());
        if (successor==null) successor=new TaskLinkReferenceImpl(st.getUniqueId(),st.getProject());
        Dependency d=Dependency.getInstance(predecessor, successor, dependency.getDependencyType(), dependency.getLag());
        d.setDirty(true);
        predecessor.getDependencyList(false).add(d);
        successor.getDependencyList(true).add(d);
        predecessors.remove(d);
      }
      for (Dependency dependency : predecessors) {
        TaskLinkReference pt=(TaskLinkReference)dependency.getPredecessor();
        TaskLinkReference st=(TaskLinkReference)dependency.getSuccessor();

        TaskLinkReference predecessor=(TaskLinkReference)implMap.get(pt);
        TaskLinkReference successor=(TaskLinkReference)implMap.get(st);

        if (predecessor==null) predecessor=new TaskLinkReferenceImpl(pt.getUniqueId(),pt.getProject());
        if (successor==null) successor=new TaskLinkReferenceImpl(st.getUniqueId(),st.getProject());
        Dependency d=Dependency.getInstance(predecessor, successor, dependency.getDependencyType(), dependency.getLag());
        d.setDirty(true);
        predecessor.getDependencyList(false).add(d);
        successor.getDependencyList(true).add(d);
        //successors.remove(d);
      }

    }else{
      for (Dependency dependency : predecessors) {
        if (successors.contains(dependency)){
          Task predecessor=(Task)implMap.get(dependency.getPredecessor());
          Task successor=(Task)implMap.get(dependency.getSuccessor());
          if (predecessor!=null&&successor!=null){
            Dependency d=Dependency.getInstance(predecessor, successor, dependency.getDependencyType(), dependency.getLag());
            d.setDirty(true);
            //Serializer.connectDependency(dependency, predecessor, successor);
            predecessor.getDependencyList(false).add(d);
            successor.getDependencyList(true).add(d);
          }
        }
View Full Code Here

            Iterator j=task.getPredecessorList().iterator();
          if (j.hasNext()){
              List predecessors=new ArrayList();
              while (j.hasNext()){
                  Dependency dependency=(Dependency)j.next();
                  LinkData linkData;
                  boolean dirty=!incremental||dependency.isDirty();
                  if (dirty) {
                    linkData=(LinkData)serialize(dependency,LinkData.FACTORY,null);
                  }
                  else{
                    //linkData=new LinkData();
                    unchangedLinks.add(dependency.getPredecessorId());
                    unchangedLinks.add(dependency.getSuccessorId());
                    continue;
                  }
                  linkData.setDirty(dependency.isDirty());
                  //linkData.setExternalId(dependency.getExternalId());

                  if (flatLinks==null)
                    linkData.setSuccessor(taskData);
                  else
                    linkData.setSuccessorId(taskData.getUniqueId());

                  Task pred=(Task)dependency.getPredecessor();
                  TaskData predData=(TaskData)taskLinker.getTransformationMap().get(pred);

                  if (flatLinks==null){
                    if (predData != null && !predData.isExternal())
                      linkData.setPredecessor(predData);
View Full Code Here

//            if (initialLinkIds==null){
//            initialLinkIds=new HashSet<DependencyKey>();
//            project.setInitialLinkIds(initialLinkIds);
//            }
//            initialLinkIds.add(new DependencyKey(linkData.getPredecessorId(),linkData.getSuccessorId()/*,externalId*/));
              Dependency dependency=(Dependency)deserialize(linkData,reindex);

              if (linkData.getPredecessor() == null) {
                System.out.println("null pred - this shouldn't happen. skipping"); // todo treat it
                continue;
              }
View Full Code Here

                                  // specific
                                  // handling
                                  // at least
                                  // for undo
        // TODO this code is a hack and does not belong here.
        Dependency dependency = (Dependency) rowNode.getImpl();
        DependencyService dependencyService = DependencyService.getInstance();
        try {
          Duration duration = (Duration) ((col == 4) ? value : getValueAt(row, 4)); // TODO
                                                // can
                                                // not
View Full Code Here

              Set<Dependency> depsSet=new HashSet<Dependency>();
            List pdeps=task.getDependencyList(true);
            if (pdeps!=null&&pdeps.size()>0){
              if (Environment.isKeepExternalLinks()){
                for (Iterator k=pdeps.iterator();k.hasNext();){
                  Dependency d=(Dependency)k.next();
                  if (!(d.getPredecessor() instanceof Task)){
                    TaskLinkReference ref=(TaskLinkReference)d.getPredecessor();
                    Task t=taskMap.get(ref.getUniqueId());
                    if (t==null){
                      k.remove();
                      continue;
                    } else{
                      d.setPredecessor(t);
                      t.getSuccessorList().add(d);
                      //DependencyService.getInstance().updateSentinels(d);
                      //DependencyService.getInstance().connect(d, this);
                    }
                  }
                  depsSet.add(d);
                }
               }
            }
            List sdeps=task.getDependencyList(false);
            if (sdeps!=null&&sdeps.size()>0){
              if (Environment.isKeepExternalLinks()){
                for (Iterator k=sdeps.iterator();k.hasNext();){
                  Dependency d=(Dependency)k.next();
                  if (!(d.getSuccessor() instanceof Task)){
                    TaskLinkReference ref=(TaskLinkReference)d.getSuccessor();
                    Task t=taskMap.get(ref.getUniqueId());
                    if (t==null){
                      k.remove();
                      continue;
                    } else{
                      d.setSuccessor(t);
                      t.getPredecessorList().add(d);
                      //DependencyService.getInstance().updateSentinels(d);
                      //DependencyService.getInstance().connect(d, this);
                    }
                  }
View Full Code Here

TOP

Related Classes of com.projity.pm.dependency.Dependency

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.