Package com.projity.job

Examples of com.projity.job.JobRunnable


    final ArrayList descriptors=new ArrayList();

      Session session=SessionFactory.getInstance().getSession(false);
    Job job=(Job)SessionFactory.callNoEx(session,"getLoadProjectDescriptorsJob",new Class[]{boolean.class,java.util.List.class,boolean.class},new Object[]{true,descriptors,!Environment.isAdministrator()});
      job.addSwingRunnable(new JobRunnable("Local: loadDocument"){ //$NON-NLS-1$
        public Object run() throws Exception{
                 final Closure setter=new Closure(){
                    public void execute(Object obj){

                    }
View Full Code Here


    final ArrayList descriptors=new ArrayList();

      Session session=SessionFactory.getInstance().getSession(false);
    Job job=(Job)SessionFactory.callNoEx(session,"getLoadProjectDescriptorsJob",new Class[]{boolean.class,java.util.List.class,boolean.class},new Object[]{true,descriptors,true});
      job.addSwingRunnable(new JobRunnable("Local: add"){ //$NON-NLS-1$
        public Object run() throws Exception{
            Closure setter=new Closure(){
                public void execute(Object obj){

                }
View Full Code Here

//      return;
//    }

    (new Thread(){
      public void run(){
        JobRunnable exitRunnable=new JobRunnable("Local: closeProjects"){
          public Object run() throws Exception{
            Frame frame=getFrame();
            if (frame!=null) frame.dispose();
            System.exit(0);
                return null; //return not used anyway
View Full Code Here

  }

  public boolean quitApplication() throws Exception{
    final boolean[] lock=new boolean[]{false};

    JobRunnable exitRunnable=new JobRunnable("Local: closeProjects"){
      public Object run() throws Exception{
        synchronized (lock) {
          lock[0]=true;
          lock.notifyAll();
        }
View Full Code Here

        //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;
        }
      });
      job.addExceptionRunnable(new JobRunnable("Local: exception"){
        public Object run() throws Exception{
          Alert.error(Messages.getString("Message.serverError"));
          return null;
        }
      });
View Full Code Here

TOP

Related Classes of com.projity.job.JobRunnable

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.