Package com.projity.pm.task

Examples of com.projity.pm.task.Project$Workspace


          writable = verifyOpenWritable(projectId);
        if (writable == null)
          return;
        gm.loadDocument(projectId, true,!writable,new Closure(){
          public void execute(Object arg0) {
            Project project=(Project)arg0;
            DocumentFrame frame=gm.getCurrentFrame();
            if (frame!=null&&frame.getProject().getUniqueId() != projectId) {
              gm.switchToProject(projectId);
            }
          }
View Full Code Here


    assignmentDuration = assignment.getDurationMillis();
    assignmentActualDuration = assignment.getActualDuration();
    long assignmentStart = assignment.getStart();
    end = assignmentStart; // treat 0th bucket as all time before contour begins
   
    Project project = assignment.getTask().getProject();
    if (project != null && !project.isForward()) //TODO need to figure out what to do if completion in reverse scheduled...
      return;
   
    if (assignment.getDependencyStart() > assignmentStart && assignment.getPercentComplete() > 0.0D) { // if a split caused by remaining work being pushed out by a dependency
      durationLeftUntilRemainingStartDependency = workCalendar.compare(assignment.getDependencyStart(),assignmentStart,false);
      if (durationLeftUntilRemainingStartDependency > 0) {
View Full Code Here

            ResourcePool resourcePool=null;
            if (MICROSOFT_PROJECT_IMPORTER.equals(opt.getImporter())){
              DataFactoryUndoController undoController=new DataFactoryUndoController();
              resourcePool = ResourcePoolFactory.getInstance().createResourcePool("",undoController);
              resourcePool.setLocal(importer.getResourceMapping()==null);
              Project project = Project.createProject(resourcePool,undoController);
             
              ((DefaultNodeModel)project.getTaskOutline()).setDataFactory(project);   
              importer.setProject(project);
            }
             setProgress(1.0f);
                  return null;
          }
          });
        job.addJob(importer.getImportFileJob());
          job.addRunnable(new JobRunnable("LocalAccess: loadProject.end",1.0f){
          public Object run() throws Exception{
              Project project=importer.getProject();
              project.setFileName(opt.getFileName()); //overrides project name
            if (MICROSOFT_PROJECT_IMPORTER.equals(opt.getImporter()))
              project.getResourcePool().setName(project.getName());
            if (Environment.getStandAlone()){ //force local in this case
              project.setMaster(true); //local project is always master
              project.setLocal(true);
            }
             setProgress(1.0f);
                  return project;
        
          }
View Full Code Here

 
 
  public void newAssignments(Collection tasks, Collection resources, double units, long delay, Object eventSource,boolean undo) {
    if (tasks.size()==0||resources.size()==0) return;
    int transactionId = 0;
    Project transactionProject = null;
    for (Iterator i=tasks.iterator();i.hasNext();){
      NormalTask task = (NormalTask)i.next();
//      if (!task.isAssignable())
//        continue;
      if (transactionId == 0) {
        transactionProject = task.getProject();
        transactionProject.beginUndoUpdate();
        transactionId = transactionProject.fireMultipleTransaction(0,true);
       
        //backup before any assignment operation
        transactionProject.getUndoController().getEditSupport().postEdit(new ScheduleBackupEdit(tasks,this));
      }
      // if task currently has no assignments, then we should not change duration if adding several at once
      boolean taskHasNoAssignments = !task.hasRealAssignments() || !task.hasLaborAssignment();
      int oldSchedulingType = task.getSchedulingType();
      boolean oldEffortDriven = task.isEffortDriven();
      if (taskHasNoAssignments) {// if adding for first time
        task.setSchedulingType(SchedulingType.FIXED_DURATION);
        task.setEffortDriven(false);
      }

      Iterator r = resources.iterator();
      while (r.hasNext()) {
        Resource resource = (Resource) r.next();
        if (null == task.findAssignment(resource)) {
//          double units = 1.0D;
//TODO Bug 330: this is slow and uses tons of memory when assigning many at once. optimizing by doing just one update
//The result is that AssignmentNodeModel.objectChanged(ObjectEvent objectEvent) is called for each assignment
//This needs to be batched as its current memory usage is unacceptable and it takes very long
//Perhaps one solution would be to replace hierarchy search() with a hash table for mapping impls to nodes

//TODO It throws an event for assignment. A service for updating all the assignments at once should be added.
          Assignment assignment = newAssignment(task,resource,units,0,eventSource,true);
          if (!resource.isLabor()) // for assigning non temporal resources, use the value of 1
            assignment.setRateUnit(TimeUnit.NON_TEMPORAL);
        }
      }
      if (taskHasNoAssignments) {// if adding for first time, put back effort driven value
        task.setSchedulingType(oldSchedulingType);
        task.setEffortDriven(oldEffortDriven);
      }
    }
    if (transactionId != 0) {
      transactionProject.fireMultipleTransaction(transactionId,false);
      transactionProject.endUndoUpdate();
    }

  }
View Full Code Here

  }
  public void setDirty(boolean dirty) {
    //System.out.println("Dependency _setDirty("+dirty+"): "+getName());
    this.dirty = dirty;
    if (dirty&&predecessor!=null){
      Project project=((HasProject)predecessor).getProject();
      if (project!=null) project.setGroupDirty(true);
    }
  }
View Full Code Here

              ResourceMappingForm form=getResourceMapping();
//              project=serializer.deserializeProject(projectData,false,true,resourceMap);
              //DEF165936:  Projity: .pod file import fails mapped to resource with modified calendar
              //pass the map into the serializer so it can grab the original impls
//              serializer.SetStuffForPODDeserialization(form.getExistingProject(), _localResourceMap); //claur
              Project project=serializer.deserializeProject(projectData,false,null,null,null,false);
              if (project!=null&&!Environment.getStandAlone()) project.setAllDirty();
              importer.setProject(project);
              long t2=System.currentTimeMillis();
              System.out.println("Deserializing...Done in "+(t2-t1)+" ms"); //$NON-NLS-1$ //$NON-NLS-2$

              //project.setDistributionMap(null);
              project.setGroupDirty(!Environment.getStandAlone());
          /*if (!Environment.isNoPodServer())*/ project.setTemporaryLocal(true);

          project.setAccessControlPolicy(form.getAccessControlType());
          project.resetRoles(form.getAccessControlType()==0);
          if (form.isLocal()) project.setLocal(true);
//          project.setWasImported(true);

              setProgress(1.0f);
                return null;
        }
View Full Code Here

    }
    protected boolean allowed(boolean enable) {
      if (enable==false) return true;
      NamedFrame frame=getCurrentFrame();
      if (frame==null) return false;
      Project project=getCurrentFrame().getProject();
      if (project==null) return false;
      return Environment.isOpenProj() || (!project.isLocal()&&project.needsSaving());
    }
View Full Code Here

      setMeAsLastGraphicManager();
      if (Environment.getStandAlone()) saveLocalProject(true);
      else{
        if (isDocumentActive()) {
          final DocumentFrame frame=getCurrentFrame();
          final Project project = frame.getProject();
          SaveOptions opt=new SaveOptions();
          opt.setPostSaving(new Closure(){
            public void execute(Object arg0) {
              frame.setId(project.getUniqueId()+""); //$NON-NLS-1$
              refreshSaveStatus(true);
            }
          });
          opt.setSaveAs(true);
          opt.setPreSaving(getSavingClosure());
View Full Code Here

    }
    protected boolean allowed(boolean enable) {
      if (enable==false) return true;
      NamedFrame frame=getCurrentFrame();
      if (frame==null) return false;
      Project project=getCurrentFrame().getProject();
      if (project==null) return false;
      if (project.isMaster() && !Environment.getStandAlone() && !Environment.isOpenProj())
        return false;

      return (project.isSavable());
//      return true;//!project.isLocal()&&!project.isMaster();
    }
View Full Code Here

  protected void initControls() {
        GraphicManager mf = documentFrame.getGraphicManager();
        spreadSheetPane = new AssignmentEntryPane(this,documentFrame.getProject(),this,false,mf.setAssignmentDialogTransformerInitializationClosure());
//        projectName = new JLabel();
        taskNames = new JLabel();
        Project project=documentFrame.getProject();
    spreadSheetPane.setProject(project); //init content of spreadsheet
    setSelectedTasks(mf.getCurrentFrame().getTopSpreadSheet().getSelectedNodes()); //update
       
//        projectName.setAlignmentX(JLabel.LEFT_ALIGNMENT);
//        projectName.setText(project == null ? "" : "Resources from: " + project.getName());
View Full Code Here

TOP

Related Classes of com.projity.pm.task.Project$Workspace

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.