Package com.projity.pm.task

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


  }
  public void objectChanged(ObjectEvent objectEvent) {
    if (!isVisible())
      return;
    Object obj = objectEvent.getObject();
    Project project = (Project)getObject();
    boolean update = false;
    if (obj == getObject()) {
      update = true;
    } else if (obj instanceof Task) {
      if (((Task)obj).getProject() == project)
        update = true;
       
    } else if (obj instanceof Resource) {
      if (((Resource)obj).getDocument() == project.getResourcePool())
        update = true;
    }
    if (update)
      updateAll();
  }
View Full Code Here


    if (fileName!=null) loadLocalDocument(fileName,!Environment.getStandAlone());
  }

  public void saveLocalProject(boolean saveAs){
    String fileName=null;
    Project project=getCurrentFrame().getProject();
    if (!saveAs){
      fileName=project.getFileName();
    }
    if (fileName==null) fileName=SessionFactory.getInstance().getLocalSession().chooseFileName(true,project.getGuessedFileName());
    if (fileName!=null) saveLocalDocument(fileName,saveAs);
  }
View Full Code Here

   * @see com.projity.document.ObjectEvent.Listener#objectChanged(com.projity.document.ObjectEvent)
   */
  public void objectChanged(ObjectEvent objectEvent) {

    if (objectEvent.getObject() instanceof Project) {
      Project project = (Project)objectEvent.getObject();
      if (objectEvent.isCreate()) {
        if (project.isOpenedAsSubproject())
          closeProjectFrame(project); // because it's now in a project
        else {
          DocumentFrame f = addProjectFrame(project);
        }

View Full Code Here

  public void setStartupFactory(StartupFactory startupFactory) {
    this.startupFactory = startupFactory;
  }

  public boolean isEditingMasterProject() {
    Project currentProject=currentFrame.getProject();
    if (currentProject == null)
      return false;
    return currentProject.isMaster() && !currentProject.isReadOnly();

  }
View Full Code Here

        return;
//      if (((NormalTask)task).isEffortDriven())
      calculate(true,task);
    } else if (changedObject instanceof BelongsToDocument){ // for other things, such as assignment entry
      if (((BelongsToDocument)changedObject).getDocument() instanceof Project) {
        Project proj = (Project)((BelongsToDocument)changedObject).getDocument();
        if (proj.getSchedulingAlgorithm() != this)
          return;
      }
      Field field = objectEvent.getField();
      if (field != null && fieldUpdater.inputContains(field))
        calculate(true,null);
View Full Code Here

      setMeAsLastGraphicManager();
      if (Environment.getStandAlone()) saveLocalProject(false);
      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) {
              refreshSaveStatus(true);
            }
          });
          opt.setPreSaving(getSavingClosure());
          addHistory("saveProject", new Object[]{project.getName(),project.getUniqueId()});
          projectFactory.saveProject(project,opt);
        }
      }

    }
View Full Code Here

    workspace = ws;
    Iterator i = ws.list.iterator();
    while (i.hasNext()) {
      DocumentFrame.Workspace documentFrameWorkspace = (DocumentFrame.Workspace) i.next();
      long projectId = documentFrameWorkspace.getProjectId();
      Project project = ProjectFactory.getInstance().findFromId(projectId);
      if (project == null){
        LoadOptions opt=new LoadOptions();
        opt.setId(projectId);
        opt.setSync(true);
        ProjectFactory.getInstance().openProject(opt);
View Full Code Here

    if (calFormat==null) return;
    //non working days
      Color oldColor=g2.getColor();
      Paint oldPaint=g2.getPaint();
      CoordinatesConverter coord=((GanttParams)graphInfo).getCoord();
      Project project=coord.getProject();
      WorkingCalendar wc=(WorkingCalendar)project.getWorkCalendar();

      if (coord.getTimescaleManager().isShowWholeDays()){
        boolean useScale2=coord.getTimescaleManager().getCurrentScaleIndex()==0; //valid only for current time scales
        TimeIterator i=coord.getTimeIterator(bounds.getX(), bounds.getMaxX(),useScale2);
        long startNonworking=-1L,endNonWorking=-1L;
        Calendar cal=DateTime.calendarInstance();

        PredefinedPaint paint=(PredefinedPaint)calFormat.getMiddle().getPaint();//new PredefinedPaint(PredefinedPaint.DOT_LINE,Colors.VERY_LIGHT_GRAY,Color.WHITE);
        paint.applyPaint(g2, useTextures());
        while (i.hasNext()){
          TimeInterval interval=i.next();
          long s=interval.getStart();
          if (CalendarService.getInstance().getDay(wc, s).isWorking()){
            if (startNonworking!=-1L){
              drawNonWorking(g2, startNonworking, endNonWorking, cal, coord, bounds,useScale2);
              startNonworking=endNonWorking=-1L;
            }
          }else{
            if (startNonworking==-1L) startNonworking=s;
            endNonWorking=s;

          }
        }
        if (startNonworking!=-1L){
          drawNonWorking(g2, startNonworking, endNonWorking, cal, coord, bounds,useScale2);
          startNonworking=endNonWorking=-1L;
        }
      }

    if (container!=null){
      //scale2 separation lines
      TimeIterator i=coord.getTimeIterator(bounds.getX(), bounds.getMaxX(),true);
      g2.setPaint(new PredefinedPaint(PredefinedPaint.DOT_LINE2,Color.GRAY,g2.getBackground()));
      while (i.hasNext()){
        TimeInterval interval=i.next();
        int startX=(int)Math.round(coord.toX(interval.getStart()));
        g2.drawLine(startX,bounds.y,startX,bounds.y+bounds.height);
      }

      //project start
      int projectStartX=(int)Math.round(coord.toX(project.getStart()));
      if (projectStartX>=bounds.getX()&&projectStartX<=bounds.getMaxX()){
        g2.setPaint(new PredefinedPaint(PredefinedPaint.DASH_LINE,Color.GRAY,g2.getBackground()));
        g2.drawLine(projectStartX,bounds.y,projectStartX,bounds.y+bounds.height);
      }

      //project start
      long statusDate = project.getStatusDate();
      if (statusDate != 0) {
        int statusDateX=(int)Math.round(coord.toX(statusDate));
        if (statusDateX>=bounds.getX()&&statusDateX<=bounds.getMaxX()){
          g2.setPaint(new PredefinedPaint(PredefinedPaint.DOT_LINE2,Color.GREEN,g2.getBackground()));
          g2.drawLine(statusDateX,bounds.y,statusDateX,bounds.y+bounds.height);
View Full Code Here

            IOUtils.closeQuietly(writer);
        }
    }

    static SessionLockManager getSessionLockManager(SessionImpl session) throws RepositoryException {
        Workspace wsp = (Workspace) session.getWorkspace();
        return (SessionLockManager) wsp.getLockManager();
    }
View Full Code Here

            IOUtils.closeQuietly(writer);
        }
    }

    static SessionLockManager getSessionLockManager(SessionImpl session) throws RepositoryException {
        Workspace wsp = (Workspace) session.getWorkspace();
        return (SessionLockManager) wsp.getLockManager();
    }
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.