Package com.projity.job

Examples of com.projity.job.Job.addRunnable()


        //update();


        final JobQueue jobQueue=SessionFactory.getInstance().getJobQueue();
        Job j=new Job(jobQueue,"Printing","Printing...",true,getPrintPreviewFrame());
        j.addRunnable(new JobRunnable("Printing",1.0f){
          public Object run() throws Exception{
            try {
              ViewPrintable vp=getSafePrintable();
              vp.setJr(this);
              vp.setPrinterJob(printerJob);
View Full Code Here


public class PDFExport {
  public static void export(final GraphPageable pageable,Component parentComponent) throws IOException{
    final File file=chooseFile(pageable.getRenderer().getProject().getName(),parentComponent);
    final JobQueue jobQueue=SessionFactory.getInstance().getJobQueue();
    Job job=new Job(jobQueue,"PDF Export","Exporting PDF...",true,parentComponent);
    job.addRunnable(new JobRunnable("PDF Export",1.0f){
      public Object run() throws Exception{
        Document document = new Document();
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
        pageable.update();
        int pageCount = pageable.getNumberOfPages();
View Full Code Here

      return getSaveProjectJob(projects,opt);
    }

    public Job getEmptyJob(String name,final Object result){
      Job job=new Job(jobQueue,name,"Job...",false);
      job.addRunnable(new JobRunnable(name,0.0f){
        public Object run() throws Exception{
          return result;
        }
      });
      return job;
View Full Code Here

    return getImportFileJob(this);
  }

    public static Job getImportFileJob(final FileImporter importer){
      final Job job=new Job(importer.getJobQueue(),"importFile",Messages.getString("LocalFileImporter.Importing"),true); //$NON-NLS-1$ //$NON-NLS-2$
        job.addRunnable(new JobRunnable("Import",1.0f){ //$NON-NLS-1$
        public Object run() throws Exception{
              DataUtil serializer=new DataUtil();
              System.out.println("Loading "+importer.getFileName()+"..."); //$NON-NLS-1$ //$NON-NLS-2$

              long t1=System.currentTimeMillis();
View Full Code Here

    public Job getExportFileJob(){
      return getExportFileJob(this);
    }
    public static Job getExportFileJob(final FileImporter importer){
      final Job job=new Job(importer.getJobQueue(),"exportFile",Messages.getString("LocalFileImporter.Exporting"),true); //$NON-NLS-1$ //$NON-NLS-2$
        job.addRunnable(new JobRunnable("Export",1.0f){ //$NON-NLS-1$
        public Object run() throws Exception{
              DataUtil serializer=new DataUtil();
              System.out.println("Serialization..."); //$NON-NLS-1$
              long t1=System.currentTimeMillis();
              DocumentData projectData=serializer.serializeDocument(importer.getProject());
View Full Code Here

  public synchronized long getId(){
    return localSeed++;
  }
    public Job getCloseProjectsJob(final Collection projects){
      Job job=new Job(jobQueue,"closeProjects","Closing...",false);
      job.addRunnable(new JobRunnable("LocalAccess: closeProjects",0.1f){
        public Object run() throws Exception{
        setProgress(1.0f);
          return null;
        }
      });
View Full Code Here

             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());
View Full Code Here

      importer.setProject(project);
      if (opt.getPreSaving() != null)
        opt.getPreSaving().execute(project);

      job.addJob(importer.getExportFileJob());
      job.addRunnable(new JobRunnable("Local: saveProject end"){
        public Object run() throws Exception{
          project.setFileName(fileName);
            project.setGroupDirty(false);
          if (opt.getPostSaving()!=null) opt.getPostSaving().execute(project);
              return null;
View Full Code Here

      subprojects = new ArrayList();
      errorDescription = null;
      lastException = null;
      Session session=SessionFactory.getInstance().getSession(resourceMapping==null);
    Job job=new Job(session.getJobQueue(),"importFile",Messages.getString("MicrosoftImporter.Importing"),true); //$NON-NLS-1$ //$NON-NLS-2$
      job.addRunnable(new JobRunnable(Messages.getString("MicrosoftImporter.PrepareResources"),1.0f){ //$NON-NLS-1$

      public Object run() throws Exception{
        log.info("BEGIN: MicrosoftImporter.PrepareResources");
        MicrosoftImporter.this.jobRunnable = this;
        parse();
View Full Code Here

        setProgress(1f);
        log.info("END: Import resources");
        return null;
        }
      });
      job.addRunnable(new JobRunnable("Finish import",1.0f){ //$NON-NLS-1$
      public Object run() throws Exception{
        log.info("BEGIN: Finish import");
        Object r=convertToProjity();
        log.info("END: Finish import");
        return r;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.