Package java.awt.print

Examples of java.awt.print.PageFormat


  }

  public void testNestedRows() throws Exception
  {
    final MasterReport basereport = new MasterReport();
    basereport.setPageDefinition(new SimplePageDefinition(new PageFormat()));
    basereport.setCompatibilityLevel(null);
    basereport.getReportConfiguration().setConfigProperty(ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "false");

    final URL target = LayoutTest.class.getResource("nested-bands.xml");
    final ResourceManager rm = new ResourceManager();
View Full Code Here


      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

  }

  public void testMinChunkWidthLegacyMode() throws Exception
  {
    final MasterReport basereport = new MasterReport();
    basereport.setPageDefinition(new SimplePageDefinition(new PageFormat()));
    basereport.setCompatibilityLevel(ClassicEngineBoot.computeVersionId(3, 8, 0));
    basereport.getReportConfiguration().setConfigProperty(ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "false");

    final URL target = LayoutTest.class.getResource("min-chunkwidth.xml");
    final ResourceManager rm = new ResourceManager();
View Full Code Here

  }

  public void testMinChunkWidthSimpleText() throws Exception
  {
    final MasterReport basereport = new MasterReport();
    basereport.setPageDefinition(new SimplePageDefinition(new PageFormat()));
    basereport.setCompatibilityLevel(null);
    basereport.getReportConfiguration().setConfigProperty(ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "false");

    final URL target = LayoutTest.class.getResource("min-chunkwidth.xml");
    final ResourceManager rm = new ResourceManager();
View Full Code Here

    {
      return;
    }

    final MasterReport basereport = new MasterReport();
    basereport.setPageDefinition(new SimplePageDefinition(new PageFormat()));
    basereport.setCompatibilityLevel(null);
    basereport.getReportConfiguration().setConfigProperty(ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "true");

    final URL target = LayoutTest.class.getResource("min-chunkwidth.xml");
    final ResourceManager rm = new ResourceManager();
View Full Code Here

  }

  public void testReplacedContent() throws Exception
  {
    final MasterReport basereport = new MasterReport();
    basereport.setPageDefinition(new SimplePageDefinition(new PageFormat()));

    final URL target = LayoutTest.class.getResource("replaced-content.xml");
    final ResourceManager rm = new ResourceManager();
    rm.registerDefaults();
    final Resource directly = rm.createDirectly(target, MasterReport.class);
View Full Code Here


  public void testReplacedContentRel() throws Exception
  {
    final MasterReport basereport = new MasterReport();
    basereport.setPageDefinition(new SimplePageDefinition(new PageFormat()));

    final URL target = LayoutTest.class.getResource("replaced-content-relative.xml");
    final ResourceManager rm = new ResourceManager();
    rm.registerDefaults();
    final Resource directly = rm.createDirectly(target, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();
    PageFormat pageFormat = report.getPageDefinition().getPageFormat(0);
    DebugLog.log(PageFormatFactory.printPageFormat(pageFormat));
    final Band containerBand = report.getReportHeader();

    // Each character (regarless of font or font-size) will be 8pt high and 4pt wide.
    // this makes this test independent of the fonts installed on the system we run on.
View Full Code Here

  }

  public void testLayout() throws ResourceException, ContentProcessingException, ReportProcessingException
  {
    final MasterReport basereport = new MasterReport();
    basereport.setPageDefinition(new SimplePageDefinition(new PageFormat()));

    final URL target = WeirdLayoutTest.class.getResource("weird-layouting.xml");
    final ResourceManager rm = new ResourceManager();
    rm.registerDefaults();
    final Resource directly = rm.createDirectly(target, MasterReport.class);
View Full Code Here

  }

  public void testNestedRows() throws Exception
  {
    final MasterReport basereport = new MasterReport();
    basereport.setPageDefinition(new SimplePageDefinition(new PageFormat()));

    final URL target = LayoutTest.class.getResource("watermark-size.xml");
    final ResourceManager rm = new ResourceManager();
    rm.registerDefaults();
    final Resource directly = rm.createDirectly(target, MasterReport.class);
View Full Code Here

  }

  public void testNestedRows() throws Exception
  {
    final MasterReport basereport = new MasterReport();
    basereport.setPageDefinition(new SimplePageDefinition(new PageFormat()));
    basereport.getReportConfiguration().setConfigProperty(ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "false");

    final URL target = LayoutTest.class.getResource("layout-matrix.xml");
    final ResourceManager rm = new ResourceManager();
    rm.registerDefaults();
View Full Code Here

TOP

Related Classes of java.awt.print.PageFormat

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.