Package jimm.datavision.gui

Examples of jimm.datavision.gui.StatusDialog


    PageFormat format = report.getPaperFormat().getPageFormat();
    SwingPrintBook book = new SwingPrintBook(pageContents, format);
    printJob.setPageable(book);

    if (printJob.printDialog()) {
  final StatusDialog statusDialog =
      new StatusDialog(frame,
           I18N.get("SwingLE.print_report_title"),
           true,
           I18N.get("SwingLE.print_report_status"));
  book.setStatusDialog(statusDialog);

  new Thread(new Runnable() {
      public void run() {
    try {
        printJob.print();
    }
    catch (UserCancellationException uce) {
        printJob.cancel();
    }
    catch (Exception e) {
        ErrorHandler.error(e);
    }
    finally {
        if (statusDialog != null)
      statusDialog.dispose();
    }
      }
      }).start();
    }
}
View Full Code Here


    for (Iterator iter = formulas(); iter.hasNext(); )
  ((Formula)iter.next()).useCache();
    resetCachedValues();

    rset = null;
    StatusDialog statusDialog = null;

    try {
  if (ErrorHandler.usingGUI()) {
      statusDialog = new StatusDialog(getDesignFrame(),
              I18N.get("Report.status_title"),
              true,
              I18N.get("Report.status_running"));
  }

  if (!layoutEngine.wantsMoreData())
      return;

  rset = dataSource.execute();

  boolean layoutStarted = false;
  while (layoutEngine.wantsMoreData() && rset.next()) {
      if (statusDialog != null) {
    if (statusDialog.isCancelled())
        throw new UserCancellationException();
    statusDialog.update(I18N.get("Report.processing_row") + ' '
            + rowNumber());
      }

      if (!layoutStarted) {
    layoutEngine.start();
    layoutStarted = true;
      }
      processResultRow();
  }

  rset.last();    // Recall last row so we can access the data
  if (!layoutStarted) {  // No rows in report
      layoutEngine.start();
      layoutEngine.end();
  }
  else {      // Output group footers and end of report
      layoutEngine.groupFooters(true);
      layoutEngine.end();
  }
    }
    catch (UserCancellationException uce) {
  layoutEngine.cancel();
    }
    catch (SQLException sqle) {
  layoutEngine.cancel();
  ErrorHandler.error(dataSource.getQuery().toString(), sqle);
    }
    catch (Exception e) {
  e.printStackTrace();
  layoutEngine.cancel();
  ErrorHandler.error(e);
    }
    finally {
  if (rset != null) rset.close();

  aggregateFields = null;
  for (Iterator iter = groups.iterator(); iter.hasNext(); )
    ((Group)iter.next()).reset();
  resetCachedValues();

  if (statusDialog != null)
      statusDialog.dispose();
    }
}
View Full Code Here

TOP

Related Classes of jimm.datavision.gui.StatusDialog

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.