Package org.pentaho.reporting.libraries.base.util

Examples of org.pentaho.reporting.libraries.base.util.FloatDimension


    factory2.setBold(Boolean.FALSE);

    final NumberFieldElementFactory nf = new NumberFieldElementFactory();
    nf.setName("ItemNumberTextField");
    nf.setAbsolutePosition(new Point2D.Double(X1, 7.0));
    nf.setMinimumSize(new FloatDimension(25.0f, 16.0f));
    nf.setVerticalAlignment(ElementAlignment.TOP);
    nf.setFieldname("ITEM_COUNT");
    nf.setFormatString("#0'.'");
    band.addElement(nf.createElement());

    factory2.setName("ItemField");
    factory2.setAbsolutePosition(new Point2D.Double(X1 + 25.0, 7.0));
    factory2.setMinimumSize(new FloatDimension(C1_WIDTH - 25.0f, 16.0f));
    factory2.setDynamicHeight(Boolean.TRUE);
    factory2.setTrimTextContent(Boolean.TRUE);
    factory2.setFieldname("Item");
    band.addElement(factory2.createElement());

    final SurveyScaleExpression iaf1 = new SurveyScaleExpression(1, 5);
    iaf1.setName("Survey Response");
    iaf1.setField(0, "Your Response");
    iaf1.setField(1, "Average Response");

    report.addExpression(iaf1);

    final ContentFieldElementFactory f = new ContentFieldElementFactory();
    f.setFieldname("Survey Response");
    f.setMinimumSize(new FloatDimension(C2_WIDTH, 15.0f));
    f.setAbsolutePosition(new Point2D.Double(X2, 6.0));
    band.addElement(f.createElement());

    final NumberFieldElementFactory nfef = new NumberFieldElementFactory();
    nfef.setFontName("Serif");
    nfef.setFontSize(new Integer(11));
    nfef.setName("F1");
    nfef.setAbsolutePosition(new Point2D.Double(X3, 7.0));
    nfef.setMinimumSize(new FloatDimension(C3_WIDTH, 16.0f));
    nfef.setFieldname("Your Response");
    nfef.setFormatString("0.00");
    nfef.setHorizontalAlignment(ElementAlignment.CENTER);
    band.addElement(nfef.createElement());
View Full Code Here


    gh.getStyle().setStyleProperty(ElementStyleKeys.MIN_HEIGHT, new Float(26));

    final TextFieldElementFactory factory1 = new TextFieldElementFactory();
    factory1.setName("CategoryTextField");
    factory1.setAbsolutePosition(new Point2D.Double(X1, 10.0));
    factory1.setMinimumSize(new FloatDimension(C1_WIDTH + C2_WIDTH + C3_WIDTH, 16.0f));
    factory1.setVerticalAlignment(ElementAlignment.TOP);
    factory1.setFieldname("Category");
    factory1.setFontName("SansSerif");
    factory1.setFontSize(new Integer(12));
    factory1.setBold(Boolean.TRUE);
View Full Code Here

    labelFactory.setText("Free / Open Source Software Survey");
    labelFactory.setFontName("SansSerif");
    labelFactory.setFontSize(new Integer(18));
    labelFactory.setBold(Boolean.TRUE);
    labelFactory.setAbsolutePosition(new Point2D.Double(X1, 10.0));
    labelFactory.setMinimumSize(new FloatDimension(C1_WIDTH + C2_WIDTH + C3_WIDTH + C4_WIDTH, 28.0f));
    labelFactory.setHorizontalAlignment(ElementAlignment.CENTER);
    pageHeader.addElement(labelFactory.createElement());

    // the following expression is used to format the manager name into a message string
    // that says 'Respondent:  <name>'.  The whole string can be centered on the page that way.
    // This expression expects to find a marked report property called 'MANAGER_NAME', look
    // in the attemptPreview() method to see how this is set up.

    // here is the element that displays the string calculated in the expression above.
    final MessageFieldElementFactory tfef = new MessageFieldElementFactory();
    tfef.setFormatString("Respondent: $(RESPONDENT_NAME)");
    tfef.setFontName("SansSerif");
    tfef.setFontSize(new Integer(12));
    tfef.setBold(Boolean.TRUE);
    tfef.setAbsolutePosition(new Point2D.Double(0.0, 38.0));
    tfef.setMinimumSize(new FloatDimension(PRINT_WIDTH, 14.0f));
    tfef.setHorizontalAlignment(ElementAlignment.CENTER);
    pageHeader.addElement(tfef.createElement());

    labelFactory.setAbsolutePosition(new Point2D.Double(X1, 58.0));
    labelFactory.setText(
        "Please note that the questions AND responses presented below were INVENTED for the the purpose of this demo report.  They are NOT real.");
    labelFactory.setFontName("Serif");
    labelFactory.setFontSize(new Integer(11));
    labelFactory.setBold(Boolean.FALSE);
    labelFactory.setItalic(Boolean.TRUE);
    pageHeader.addElement(labelFactory.createElement());

    // labels
    labelFactory.setFontName("SansSerif");
    labelFactory.setFontSize(new Integer(7));
    labelFactory.setItalic(Boolean.FALSE);
    labelFactory.setBold(Boolean.FALSE);
    labelFactory.setVerticalAlignment(ElementAlignment.BOTTOM);

    final float delta = C2_WIDTH / 5.0f;
    labelFactory.setText("Not Important");
    labelFactory.setAbsolutePosition(new Point2D.Double(X2, 70.0));
    labelFactory.setMinimumSize(new FloatDimension(delta, 30.0f));
    pageHeader.addElement(labelFactory.createElement());

    labelFactory.setText("Very Important");
    labelFactory.setAbsolutePosition(new Point2D.Double(X2 + 4 * delta, 70.0));
    labelFactory.setMinimumSize(new FloatDimension(delta, 30.0f));
    pageHeader.addElement(labelFactory.createElement());

    addBoxedLabelToBand(pageHeader, null, X1, BOX_TOP, C1_WIDTH, COLUMN_HEADER_BOX_HEIGHT,
        "SansSerif", 10, true, Color.black, new Color(220, 255, 220));
    addBoxedLabelToBand(pageHeader, null, X2, BOX_TOP, C2_WIDTH, COLUMN_HEADER_BOX_HEIGHT,
        "SansSerif", 10, true, Color.black, new Color(220, 255, 220));

    final SurveyScale scaleHeader = new SurveyScale(1, 5, null);
    scaleHeader.setDrawScaleValues(true);
    scaleHeader.setDrawTickMarks(false);
    scaleHeader.setScaleValueFont(new Font("SansSerif", Font.PLAIN, 9));
    report.getParameterValues().put("SCALE_HEADER", scaleHeader);

    final ContentFieldElementFactory dfef = new ContentFieldElementFactory();
    dfef.setName("ScaleHeaderElement");
    dfef.setAbsolutePosition(new Point2D.Double(X2, BOX_TOP));
    dfef.setFieldname("SCALE_HEADER");
    dfef.setMinimumSize(new FloatDimension(C2_WIDTH, COLUMN_HEADER_BOX_HEIGHT));
    pageHeader.addElement(dfef.createElement());

    addBoxedLabelToBand(pageHeader, "Your Response", X3, BOX_TOP, C3_WIDTH, COLUMN_HEADER_BOX_HEIGHT,
        "SansSerif", 8, false, Color.black, new Color(220, 255, 220));

View Full Code Here

  private void setupWatermark(final MasterReport report)
  {
    // use a watermark to draw a frame around the page...
    final Band watermarkBand = report.getWatermark();
    final RectangleElementFactory sef = new RectangleElementFactory();
    sef.setMinimumSize(new FloatDimension(-100.0f, -100));
    sef.setColor(Color.black);
    sef.setStroke(new BasicStroke(1.0f));
    sef.setShouldDraw(Boolean.TRUE);
    sef.setScale(Boolean.TRUE);
    sef.setKeepAspectRatio(Boolean.FALSE);
View Full Code Here

                                          final Color backgroundColor)
  {
    // field text
    final LabelElementFactory f2 = new LabelElementFactory();
    f2.setAbsolutePosition(new Point2D.Double(x, y));
    f2.setMinimumSize(new FloatDimension(w, h));
    f2.setText(label);
    f2.setFontName(fontName);
    f2.setFontSize(new Integer(fontSize));
    f2.setBold((bold) ? Boolean.TRUE : Boolean.FALSE);
    f2.setHorizontalAlignment(ElementAlignment.CENTER);
View Full Code Here

    b.getStyle().setStyleProperty(TextStyleKeys.FONT, "SansSerif");
    b.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(12));

    LabelElementFactory labelFactory = new LabelElementFactory();
    labelFactory.setAbsolutePosition(new Point2D.Float(0, 0));
    labelFactory.setMinimumSize(new FloatDimension(200, 15));
    labelFactory.setText("People in the same office:");
    b.addElement(labelFactory.createElement());

    labelFactory = new LabelElementFactory();
    labelFactory.setAbsolutePosition(new Point2D.Float(200, 0));
    labelFactory.setMinimumSize(new FloatDimension(-100, 15));
    labelFactory.setText("Notes:");
    b.addElement(labelFactory.createElement());

    final Element line = HorizontalLineElementFactory.createHorizontalLine(15);
    line.getStyle().setStyleProperty(ElementStyleKeys.STROKE, new BasicStroke(1));
View Full Code Here

    b.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(10));

    TextFieldElementFactory textFieldFactory = new TextFieldElementFactory();
    textFieldFactory.setFieldname("office.Name");
    textFieldFactory.setAbsolutePosition(new Point2D.Float(0, 0));
    textFieldFactory.setMinimumSize(new FloatDimension(200, 12));
    b.addElement(textFieldFactory.createElement());

    textFieldFactory = new TextFieldElementFactory();
    textFieldFactory.setFieldname("office.Annotations");
    textFieldFactory.setAbsolutePosition(new Point2D.Float(200, 0));
    textFieldFactory.setMinimumSize(new FloatDimension(-100, 12));
    textFieldFactory.setDynamicHeight(Boolean.TRUE);
    b.addElement(textFieldFactory.createElement());

    report.getItemBand().addElement(b);
View Full Code Here

    report.setName(getDescription());

    TextFieldElementFactory factory = new TextFieldElementFactory();
    factory.setName("T1");
    factory.setAbsolutePosition(new Point2D.Float(0, 0));
    factory.setMinimumSize(new FloatDimension(150, 12));
    factory.setColor(Color.black);
    factory.setHorizontalAlignment(ElementAlignment.RIGHT);
    factory.setVerticalAlignment(ElementAlignment.MIDDLE);
    factory.setNullString("-");
    factory.setFieldname("Column1");
    report.getItemBand().addElement(factory.createElement());

    factory = new TextFieldElementFactory();
    factory.setName("T2");
    factory.setAbsolutePosition(new Point2D.Float(200, 0));
    factory.setMinimumSize(new FloatDimension(150, 12));
    factory.setColor(Color.black);
    factory.setHorizontalAlignment(ElementAlignment.LEFT);
    factory.setVerticalAlignment(ElementAlignment.MIDDLE);
    factory.setNullString("-");
    factory.setFieldname("Column2");
View Full Code Here

    b.getStyle().setStyleProperty(TextStyleKeys.FONT, "SansSerif");
    b.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(12));

    LabelElementFactory labelFactory = new LabelElementFactory();
    labelFactory.setAbsolutePosition(new Point2D.Float(0, 0));
    labelFactory.setMinimumSize(new FloatDimension(200, 15));
    labelFactory.setText("Preferred Lunch Meals");
    b.addElement(labelFactory.createElement());

    labelFactory = new LabelElementFactory();
    labelFactory.setAbsolutePosition(new Point2D.Float(200, 0));
    labelFactory.setMinimumSize(new FloatDimension(-100, 15));
    labelFactory.setText("Rating");
    b.addElement(labelFactory.createElement());

    b.addElement(HorizontalLineElementFactory.createHorizontalLine
        (15, null, new BasicStroke(1)));
View Full Code Here

    b.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(10));

    TextFieldElementFactory textFieldFactory = new TextFieldElementFactory();
    textFieldFactory.setFieldname("lunch.Meal");
    textFieldFactory.setAbsolutePosition(new Point2D.Float(0, 0));
    textFieldFactory.setMinimumSize(new FloatDimension(200, 12));
    b.addElement(textFieldFactory.createElement());

    textFieldFactory = new TextFieldElementFactory();
    textFieldFactory.setFieldname("lunch.Rating");
    textFieldFactory.setAbsolutePosition(new Point2D.Float(200, 0));
    textFieldFactory.setMinimumSize(new FloatDimension(-100, 12));
    textFieldFactory.setDynamicHeight(Boolean.TRUE);
    b.addElement(textFieldFactory.createElement());

    report.getItemBand().addElement(b);
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.base.util.FloatDimension

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.