Examples of PageFormat


Examples of java.awt.print.PageFormat

        JOptionPane.QUESTION_MESSAGE);
    if (action != JOptionPane.OK_OPTION) return;
    List<Circuit> circuits = list.getSelectedCircuits();
    if (circuits.isEmpty()) return;
   
    PageFormat format = new PageFormat();
    Printable print = new MyPrintable(proj, circuits,
        parmsPanel.getHeader(),
        parmsPanel.getRotateToFit(),
        parmsPanel.getPrinterView());
   
View Full Code Here

Examples of java.awt.print.PageFormat

* @return a page format
* @see jimm.datavision.layout.swing.SwingLE#printReport
*/
public PageFormat getPageFormat() {
    if (pageFormat == null) {
  pageFormat = new PageFormat();
  if (orientation == PORTRAIT) {
      pageFormat.setOrientation(PageFormat.PORTRAIT);
      pageFormat.setPaper(this);
  }
  else {
View Full Code Here

Examples of java.awt.print.PageFormat

    final double rightBorder = Double.parseDouble(attrs.getValue(getUri(), "rightBorder"));

    final Paper paper = PageFormatFactory.getInstance().createPaper(pageSize.getWidth(), pageSize.getHeight());
    PageFormatFactory.getInstance().setBorders(paper, topBorder, leftBorder, bottomBorder, rightBorder);

    pageFormat = new PageFormat();
    pageFormat.setPaper(paper);

  }
View Full Code Here

Examples of java.awt.print.PageFormat

      if (imageMap == null)
      {
        continue;
      }

      final PageFormat pf = physicalPageDrawable.getPageFormat();
      final float imageMapX = (float) (x1 - pf.getImageableX() - StrictGeomUtility.toExternalValue(node.getX()));
      final float imageMapY = (float) (y1 - pf.getImageableY() - StrictGeomUtility.toExternalValue(node.getY()));

      final ImageMapEntry[] imageMapEntries = imageMap.getEntriesForPoint(imageMapX, imageMapY);
      for (int j = 0; j < imageMapEntries.length; j++)
      {
        final ImageMapEntry imageMapEntry = imageMapEntries[j];
View Full Code Here

Examples of java.awt.print.PageFormat

  }

  public void testPre276() throws ReportProcessingException, IOException, ReportDefinitionException
  {
    final MasterReport report = parseReport(getReportDefinitionSource());
    final PageFormat pageFormat = report.getPageDefinition().getPageFormat(0);
//    pageFormat.setOrientation(PageFormat.LANDSCAPE);
    report.setPageDefinition(new SimplePageDefinition(pageFormat));
    //TestSystem.showPreview(report);
    PdfReportUtil.createPDF(report, "/tmp/pre276.pdf");
View Full Code Here

Examples of java.awt.print.PageFormat

      attributes = new HashPrintRequestAttributeSet();
    }

    // for now, be lazy, assume that the first page is the reference
    final PageDefinition pdef = report.getPageDefinition();
    final PageFormat format = pdef.getPageFormat(0);
    final Paper paper = format.getPaper();

    final Media media = MediaSize.findMedia((float) (paper.getWidth() / POINTS_PER_INCH),
        (float) (paper.getHeight() / POINTS_PER_INCH), Size2DSyntax.INCH);
    attributes.add(media);

    final MediaPrintableArea printableArea = new MediaPrintableArea
        ((float) (paper.getImageableX() / POINTS_PER_INCH),
            (float) (paper.getImageableY() / POINTS_PER_INCH),
            (float) (paper.getImageableWidth() / POINTS_PER_INCH),
            (float) (paper.getImageableHeight() / POINTS_PER_INCH),
            Size2DSyntax.INCH);

    attributes.add(printableArea);
    attributes.add(mapOrientation(format.getOrientation()));

    return attributes;
  }
View Full Code Here

Examples of java.awt.print.PageFormat

    if (mediaSize == null)
    {
      logger.warn("Unknown media encountered, unable to compute page sizes.");
    }

    final PageFormat pageFormat = new PageFormat();
    pageFormat.setPaper(createPaper(mediaSize, printableArea));
    if (OrientationRequested.PORTRAIT.equals(orientationRequested))
    {
      pageFormat.setOrientation(PageFormat.PORTRAIT);
    }
    else if (OrientationRequested.LANDSCAPE.equals(orientationRequested))
    {
      pageFormat.setOrientation(PageFormat.LANDSCAPE);
    }
    else if (OrientationRequested.REVERSE_LANDSCAPE.equals
        (orientationRequested))
    {
      pageFormat.setOrientation(PageFormat.REVERSE_LANDSCAPE);
    }
    else if (OrientationRequested.REVERSE_PORTRAIT.equals(orientationRequested))
    {
      pageFormat.setOrientation(PageFormat.PORTRAIT);
    }
    return pageFormat;
  }
View Full Code Here

Examples of java.awt.print.PageFormat

    final TableDataFactory tdf = new TableDataFactory();
    tdf.addTable("default", new DefaultTableModel(10, 10));
    tdf.addTable("SubQ1", new DefaultTableModel(11, 10));
    report.setDataFactory(tdf);
   
    final PageFormat pageFormat = report.getPageDefinition().getPageFormat(0);
//    pageFormat.setOrientation(PageFormat.LANDSCAPE);
    report.setPageDefinition(new SimplePageDefinition(pageFormat));
    TestSystem.showPreview(report);
    //PdfReportUtil.createPDF(report, "/tmp/pre268.pdf");
View Full Code Here

Examples of java.awt.print.PageFormat

          ReportConfigWriter.PAGE_DEFINITION_TAG, XmlWriterSupport.OPEN);

      final int max = pageDefinition.getPageCount();
      for (int i = 0; i < max; i++)
      {
        final PageFormat fmt = pageDefinition.getPageFormat(i);

        final AttributeList attributes = buildPageFormatProperties(fmt);
        xmlWriter.writeTag(ExtParserModule.NAMESPACE, ReportConfigWriter.PAGE_TAG,
            attributes, XmlWriterSupport.CLOSE);
      }
View Full Code Here

Examples of java.awt.print.PageFormat

  public void run(final OutputProcessorMetaData metaData) throws ResourceKeyCreationException, ContentProcessingException, ReportProcessingException
  {
    // Set up the process ..
    final PageFormatFactory fmFactory = PageFormatFactory.getInstance();
    final PageFormat pageFormat = new PageFormat();
    pageFormat.setPaper(fmFactory.createPaper((double) sequence.getPageWidth(), 1000d));

    final SimplePageDefinition pageDefinition = new SimplePageDefinition(pageFormat);
    final ProcessingContext processingContext = new DefaultProcessingContext();
    final DebugExpressionRuntime runtime = new DebugExpressionRuntime(new DefaultTableModel(), 0, processingContext);
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.