Examples of FontDefinition


Examples of org.jfree.report.style.FontDefinition

   */
  private FontDefinition changeFontDef(FontDefinition fd) {
    if (fd.getFontName().equals(nameOfFont)) {
      return fd;
    } else {
      return new FontDefinition(nameOfFont, fd.getFontSize(), fd.isBold(), fd.isItalic(),
          fd.isUnderline(), fd.isStrikeThrough(), fd.getFontEncoding(null), fd.isEmbeddedFont());
    }
  }//}}}
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.style.FontDefinition

    Element label1 = LabelElementFactory.createLabelElement("Label1",
        new Rectangle2D.Double(0, 0, 200, 100),
        Color.RED,
        ElementAlignment.LEFT,
        new FontDefinition("Arial", 12),
        "Label1");

    report.getReportHeader().addElement(label1);

    label1.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(255, 127, 127, 120));

    Element label2 = LabelElementFactory.createLabelElement("Label2",
        new Rectangle2D.Double(0, 110, 200, 100),
        Color.RED,
        ElementAlignment.LEFT,
        new FontDefinition("Arial", 12),
        "Label2");

    report.getReportHeader().addElement(label2);

    label2.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(255, 127, 127, 120));
    label2.getStyle().setStyleProperty(ElementStyleKeys.PADDING_TOP, new Float(10));
    label2.getStyle().setStyleProperty(ElementStyleKeys.PADDING_LEFT, new Float(10));
    label2.getStyle().setStyleProperty(ElementStyleKeys.PADDING_RIGHT, new Float(10));
    label2.getStyle().setStyleProperty(ElementStyleKeys.PADDING_BOTTOM, new Float(10));


    Element label3 = LabelElementFactory.createLabelElement("Label3",
        new Rectangle2D.Double(210, 0, 200, 100),
        Color.RED,
        ElementAlignment.LEFT,
        new FontDefinition("Arial", 12),
        "Label3");

    report.getReportHeader().addElement(label3);

    label3.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(255, 127, 127, 120));
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.style.FontDefinition

    // This font is a chinese font ... if you dont have this font, replace
    // it with another font, which is able to display chinese characters ...
    report.getReportHeader().addElement(LabelElementFactory.createLabelElement
        (null, new Rectangle2D.Float(0, 12, -100, 48),
            null, ElementAlignment.LEFT,
            new FontDefinition("mhya9gjp", 10), new String(text)));

    // Embedding the fonts increases the size of the PDF file, but makes
    // sure, that everbody can read the file. If all users have all the fonts
    // installed, which were used to create the report, then you can remove
    // the font-embedding flag.
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.style.FontDefinition

    report.getItemBand().addElement(TextFieldElementFactory.createStringElement("tf1",
        new Rectangle2D.Double(20, 0, 100, 18),
        Color.BLACK,
        ElementAlignment.LEFT,
        ElementAlignment.MIDDLE,//change to ElementAlignment.TOP
        new FontDefinition("dialog", 12),
        "-",
        "column"));

    RowBandingFunction switchFunction = new RowBandingFunction();
    switchFunction.setInitialState(true);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.style.FontDefinition

    final Element e = LabelElementFactory.createLabelElement(null,
        new Rectangle2D.Float(10, 10, 250, 50),
        null,
        ElementAlignment.CENTER,
        new FontDefinition("Serif", 14),
        test);
    final MasterReport report = new MasterReport();
    report.getReportHeader().addElement(e);
    return report;
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.style.FontDefinition

    Element labelElement = LabelElementFactory.createLabelElement("Label1",
        new Rectangle2D.Double(0, 10, -100, 104),
        Color.BLACK,
        ElementAlignment.LEFT,
        new FontDefinition("Arial", 40),
        "ppp Title ");
    labelElement.getStyle().setStyleProperty(TextStyleKeys.UNDERLINED, Boolean.TRUE);
    labelElement.getStyle().setStyleProperty(TextStyleKeys.STRIKETHROUGH, Boolean.TRUE);

View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.style.FontDefinition

    final MasterReport report = new MasterReport();
    final StaticDataFactory staticDataFactory = new StaticDataFactory();
    report.setDataFactory(staticDataFactory);
    report.setQuery("org.pentaho.reporting.engine.classic.testcases.base.functionality.demohandler.SubReportProcessingCrashTestHandler#createMainTableModel()");

    final Element textElement = TextFieldElementFactory.createStringElement("reportField1", new Rectangle(0, 0, 100, 20), Color.BLACK, ElementAlignment.LEFT, ElementAlignment.TOP, new FontDefinition("Arial", 12), "-", "c1");
    report.getItemBand().addElement(textElement);

    final SubReport subReport = new SubReport();
    subReport.addInputParameter("c1", "c1");

    subReport.setQuery("org.pentaho.reporting.engine.classic.testcases.base.functionality.demohandler.SubReportProcessingCrashTestHandler#createSubReportTableModel(c1)");
    final Element subReportTextElement = TextFieldElementFactory.createStringElement("subreportField1", new Rectangle(20, 0, 100, 20), Color.RED, ElementAlignment.LEFT, ElementAlignment.TOP, new FontDefinition("Arial", 12), "-", "t1");
    subReport.getItemBand().addElement(subReportTextElement);
    report.getItemBand().addSubReport(subReport);

    final Element textElementT1 = TextFieldElementFactory.createStringElement("reportFieldT1", new Rectangle(0, 20, 100, 20), Color.BLACK, ElementAlignment.LEFT, ElementAlignment.TOP, new FontDefinition("Arial", 12), "-", "t2");
    report.getItemBand().addElement(textElementT1);

    final ParameterMapping[] parameterMappings = subReport.getExportMappings();

    for (int i = 0; i < parameterMappings.length; i++)
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.style.FontDefinition

      final boolean bold = getBooleanParameter(FontDefinitionObjectDescription.BOLD);
      final boolean embedded = getBooleanParameter(FontDefinitionObjectDescription.EMBEDDED_FONT);
      final boolean italic = getBooleanParameter(FontDefinitionObjectDescription.ITALIC);
      final boolean strike = getBooleanParameter(FontDefinitionObjectDescription.STRIKETHROUGH);
      final boolean underline = getBooleanParameter(FontDefinitionObjectDescription.UNDERLINE);
      return new FontDefinition(fontName, fontSize, bold, italic, underline, strike,
          fontEncoding, embedded);
    }
    catch (Exception e)
    {
      FontDefinitionObjectDescription.logger.info("Failed to create FontDefinition: ", e);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.style.FontDefinition

    if ((o instanceof FontDefinition) == false)
    {
      throw new ObjectFactoryException("The given object is no FontDefinition.");
    }

    final FontDefinition fdef = (FontDefinition) o;
    setParameter(FontDefinitionObjectDescription.FONT_ENCODING, fdef.getFontEncoding(null));
    setParameter(FontDefinitionObjectDescription.FONT_NAME, fdef.getFontName());
    setParameter(FontDefinitionObjectDescription.FONT_SIZE, new Integer(fdef.getFontSize()));
    setParameter(FontDefinitionObjectDescription.BOLD, getBoolean(fdef.isBold()));
    setParameter(FontDefinitionObjectDescription.EMBEDDED_FONT, getBoolean(fdef.isEmbeddedFont()));
    setParameter(FontDefinitionObjectDescription.ITALIC, getBoolean(fdef.isItalic()));
    setParameter(FontDefinitionObjectDescription.STRIKETHROUGH, getBoolean(fdef.isStrikeThrough()));
    setParameter(FontDefinitionObjectDescription.UNDERLINE, getBoolean(fdef.isUnderline()));
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.style.FontDefinition

    Element textElement =
        TextFieldElementFactory.createStringElement
            ("reportField1", new Rectangle(0, 0, 100, 20), Color.BLACK,
                ElementAlignment.LEFT, ElementAlignment.TOP,
                new FontDefinition("Arial", 12), "-", "c1");
    report.getItemBand().addElement(textElement);

    SubReport subReport = new SubReport();
    subReport.addInputParameter("c1", "c1");
    subReport.setQuery("org.pentaho.reporting.engine.classic.testcases.base.basic.SubReportParameterPassingTest#createSubReportTableModel(c1)");
    Element subReportTextElement =
        TextFieldElementFactory.createStringElement
            ("subreportField1", new Rectangle(20, 0, 100, 20),
                Color.RED, ElementAlignment.LEFT,
                ElementAlignment.TOP, new FontDefinition("Arial", 12), "-", "t1");
    subReport.getItemBand().addElement(subReportTextElement);

    report.getItemBand().addSubReport(subReport);

    FunctionalityTestLib.execGraphics2D(report);
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.