Package net.sf.jasperreports.engine.design

Examples of net.sf.jasperreports.engine.design.JRDesignRectangle


    return (JRTemplateRectangle) getElementTemplate();
  }

  protected JRTemplateElement createElementTemplate()
  {
    JRDesignRectangle rectangle = new JRDesignRectangle();

    rectangle.setKey(getKey());
    rectangle.setPositionType(getPositionTypeValue());
    // rectangle.setPrintRepeatedValues(isPrintRepeatedValues());
    rectangle.setMode(getModeValue());
    rectangle.setX(getX());
    rectangle.setY(getY());
    rectangle.setWidth(getWidth());
    rectangle.setHeight(getHeight());
    rectangle.setRemoveLineWhenBlank(isRemoveLineWhenBlank());
    rectangle.setPrintInFirstWholeBand(isPrintInFirstWholeBand());
    rectangle.setPrintWhenDetailOverflows(isPrintWhenDetailOverflows());
    rectangle.setPrintWhenGroupChanges(getPrintWhenGroupChanges());
    rectangle.setForecolor(getForecolor());
    rectangle.setBackcolor(getBackcolor());
    rectangle.getLinePen().setLineWidth(0f);

    return new JRTemplateRectangle(getElementOrigin(),
        filler.getJasperPrint().getDefaultStyleProvider(), rectangle);
  }
View Full Code Here


   */
  public Object createObject(Attributes atts)
  {
    JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);

    JRDesignRectangle rectangle = new JRDesignRectangle(jasperDesign);
   
    String radius = atts.getValue(JRXmlConstants.ATTRIBUTE_radius);
    if (radius != null && radius.length() > 0)
    {
      rectangle.setRadius(Integer.parseInt(radius));
    }

    return rectangle;
  }
View Full Code Here

      Dj2JrCrosstabBuilder djcb = new Dj2JrCrosstabBuilder();

      JRDesignCrosstab crosst = djcb.createCrosstab(djcross,this);
      JRDesignBand band = (JRDesignBand) jgroup.getGroupHeader();
      if (djcross.getBottomSpace() != 0){
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), 0);
        LayoutUtils.moveBandsElemnts(rect.getHeight(), band);
        band.addElement(rect);
      }
      LayoutUtils.moveBandsElemnts(crosst.getHeight(), band);
      band.addElement(crosst);
      if (djcross.getTopSpace() != 0){
        LayoutUtils.moveBandsElemnts(djcross.getTopSpace(), band);
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), 0);
        band.addElement(rect);
      }

    }

    for (Iterator iterator = columnsGroup.getFooterCrosstabs().iterator(); iterator.hasNext();) {
      DJCrosstab djcross = (DJCrosstab) iterator.next();

      Dj2JrCrosstabBuilder djcb = new Dj2JrCrosstabBuilder();

      JRDesignCrosstab crosst = djcb.createCrosstab(djcross,this);
      JRDesignBand band = (JRDesignBand) jgroup.getGroupFooter();
      int yOffset = LayoutUtils.findVerticalOffset(band);
      if (djcross.getTopSpace() != 0){
//        moveBandsElemnts(djcross.getTopSpace(), band);
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), yOffset);
        rect.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);
        band.addElement(rect);
        crosst.setY(rect.getY() + rect.getHeight());
      }

      band.addElement(crosst);


      if (djcross.getBottomSpace() != 0){
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), crosst.getY() + crosst.getHeight());
        band.addElement(rect);
      }
    }

View Full Code Here

   * @param djcross
   * @param crosst
   * @return
   */
  protected JRDesignRectangle createBlankRectableCrosstab(int amount,int yOffset) {
    JRDesignRectangle rect = new JRDesignRectangle();
    rect.setPen(Border.NO_BORDER.getValue());
    rect.setMode(Transparency.TRANSPARENT.getValue());
//    rect.setMode(Transparency.OPAQUE.getValue());
//    rect.setBackcolor(Color.RED);
    rect.setWidth(getReport().getOptions().getPrintableWidth());
    rect.setHeight(amount);
    rect.setY(yOffset);
    rect.setPositionType(JRDesignElement.POSITION_TYPE_FLOAT);
    return rect;
  }
View Full Code Here

      Dj2JrCrosstabBuilder djcb = new Dj2JrCrosstabBuilder();

      JRDesignCrosstab crosst = djcb.createCrosstab(djcross,this);
      JRDesignBand band = (JRDesignBand) jgroup.getGroupHeader();
      if (djcross.getBottomSpace() != 0){
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), 0);
        moveBandsElemnts(rect.getHeight(), band);
        band.addElement(rect);
      }
      moveBandsElemnts(crosst.getHeight(), band);
      band.addElement(crosst);
      if (djcross.getTopSpace() != 0){
        moveBandsElemnts(djcross.getTopSpace(), band);
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), 0);
        band.addElement(rect);
      }

    }

    for (Iterator iterator = columnsGroup.getFooterCrosstabs().iterator(); iterator.hasNext();) {
      DJCrosstab djcross = (DJCrosstab) iterator.next();

      Dj2JrCrosstabBuilder djcb = new Dj2JrCrosstabBuilder();

      JRDesignCrosstab crosst = djcb.createCrosstab(djcross,this);
      JRDesignBand band = (JRDesignBand) jgroup.getGroupFooter();
      int yOffset = findVerticalOffset(band);
      if (djcross.getTopSpace() != 0){
//        moveBandsElemnts(djcross.getTopSpace(), band);
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), yOffset);
        rect.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);
        band.addElement(rect);
        crosst.setY(rect.getY() + rect.getHeight());
      }

      band.addElement(crosst);


      if (djcross.getBottomSpace() != 0){
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), crosst.getY() + crosst.getHeight());
        band.addElement(rect);
      }
    }

View Full Code Here

   * @param djcross
   * @param crosst
   * @return
   */
  private JRDesignRectangle createBlankRectableCrosstab(int amount,int yOffset) {
    JRDesignRectangle rect = new JRDesignRectangle();
    rect.setPen(Border.NO_BORDER.getValue());
    rect.setMode(Transparency.TRANSPARENT.getValue());
//    rect.setMode(Transparency.OPAQUE.getValue());
//    rect.setBackcolor(Color.RED);
    rect.setWidth(getReport().getOptions().getPrintableWidth());
    rect.setHeight(amount);
    rect.setY(yOffset);
    rect.setPositionType(JRDesignElement.POSITION_TYPE_FLOAT);
    return rect;
  }
View Full Code Here

  private void decorateOddRows(JRDesignBand detail) {
    JRDesignExpression expression = new JRDesignExpression();
    expression.setValueClass(Boolean.class);
    expression.setText(EXPRESSION_TRUE_WHEN_ODD);

    JRDesignRectangle rectangle = new JRDesignRectangle();
    rectangle.setPrintWhenExpression(expression);
    DynamicReportOptions options = getReport().getOptions();
    rectangle.setHeight(options.getDetailHeight().intValue());
    rectangle.setWidth(options.getColumnWidth());
    rectangle.setStretchType(JRDesignRectangle.STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT);
    Style oddRowBackgroundStyle = options.getOddRowBackgroundStyle();

    addStyleToDesign(oddRowBackgroundStyle);//register this style in the jasperDesign

    JRDesignStyle style = oddRowBackgroundStyle.transform();
    style.setForecolor(oddRowBackgroundStyle.getBackgroundColor());

    applyStyleToElement(oddRowBackgroundStyle, rectangle);
//    rectangle.setStyle(style);
    rectangle.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
    rectangle.setForecolor(oddRowBackgroundStyle.getBorderColor());
    rectangle.setPen(oddRowBackgroundStyle.getBorder().getValue());
    rectangle.setMode(JRDesignElement.MODE_OPAQUE);
    detail.addElement(rectangle);
  }
View Full Code Here

      Dj2JrCrosstabBuilder djcb = new Dj2JrCrosstabBuilder();

      JRDesignCrosstab crosst = djcb.createCrosstab(djcross,this);
      JRDesignBand band = (JRDesignBand) jgroup.getGroupHeader();
      if (djcross.getBottomSpace() != 0){
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), 0);
        moveBandsElemnts(rect.getHeight(), band);
        band.addElement(rect);
      }
      moveBandsElemnts(crosst.getHeight(), band);
      band.addElement(crosst);
      if (djcross.getTopSpace() != 0){
        moveBandsElemnts(djcross.getTopSpace(), band);
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), 0);
        band.addElement(rect);
      }

    }

    for (Iterator iterator = columnsGroup.getFooterCrosstabs().iterator(); iterator.hasNext();) {
      DJCrosstab djcross = (DJCrosstab) iterator.next();

      Dj2JrCrosstabBuilder djcb = new Dj2JrCrosstabBuilder();

      JRDesignCrosstab crosst = djcb.createCrosstab(djcross,this);
      JRDesignBand band = (JRDesignBand) jgroup.getGroupFooter();
      int yOffset = findVerticalOffset(band);
      if (djcross.getTopSpace() != 0){
//        moveBandsElemnts(djcross.getTopSpace(), band);
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), yOffset);
        rect.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);
        band.addElement(rect);
        crosst.setY(rect.getY() + rect.getHeight());
      }

      band.addElement(crosst);


      if (djcross.getBottomSpace() != 0){
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), crosst.getY() + crosst.getHeight());
        band.addElement(rect);
      }
    }

View Full Code Here

   * @param djcross
   * @param crosst
   * @return
   */
  private JRDesignRectangle createBlankRectableCrosstab(int amount,int yOffset) {
    JRDesignRectangle rect = new JRDesignRectangle();
    rect.setPen(Border.NO_BORDER.getValue());
    rect.setMode(Transparency.TRANSPARENT.getValue());
//    rect.setMode(Transparency.OPAQUE.getValue());
//    rect.setBackcolor(Color.RED);
    rect.setWidth(getReport().getOptions().getPrintableWidth());
    rect.setHeight(amount);
    rect.setY(yOffset);
    rect.setPositionType(JRDesignElement.POSITION_TYPE_FLOAT);
    return rect;
  }
View Full Code Here

  private void decorateOddRows(JRDesignBand detail) {
    JRDesignExpression expression = new JRDesignExpression();
    expression.setValueClass(Boolean.class);
    expression.setText(EXPRESSION_TRUE_WHEN_ODD);

    JRDesignRectangle rectangle = new JRDesignRectangle();
    rectangle.setPrintWhenExpression(expression);
    DynamicReportOptions options = getReport().getOptions();
    rectangle.setHeight(options.getDetailHeight().intValue());
    rectangle.setWidth(options.getColumnWidth());
    rectangle.setStretchType(JRDesignRectangle.STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT);
    Style oddRowBackgroundStyle = options.getOddRowBackgroundStyle();

    addStyleToDesign(oddRowBackgroundStyle);//register this style in the jasperDesign

    JRDesignStyle style = oddRowBackgroundStyle.transform();
    style.setForecolor(oddRowBackgroundStyle.getBackgroundColor());

    applyStyleToElement(oddRowBackgroundStyle, rectangle);
//    rectangle.setStyle(style);
    rectangle.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
    rectangle.setForecolor(oddRowBackgroundStyle.getBorderColor());
    rectangle.setPen(oddRowBackgroundStyle.getBorder().getValue());
    rectangle.setMode(JRDesignElement.MODE_OPAQUE);
    detail.addElement(rectangle);
  }
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.design.JRDesignRectangle

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.