Package net.sf.jasperreports.engine.design

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


      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);
        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);
        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);
        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);
        LayoutUtils.moveBandsElemnts(rect.getHeight(), band);
        band.addElement(rect);
      }
     
      LayoutUtils.moveBandsElemnts(crosst.getHeight(), band);
      band.addElement(crosst);
      DJLabel caption = djcross.getCaption();
      if (caption!=null){
        JRDesignExpression captExp = null;
        if (caption.isJasperExpression()) //a text with things like "$F{myField}"
          captExp = ExpressionUtils.createStringExpression(caption.getText());
        else if (caption.getLabelExpression() != null){
          String name = "expression_for_label_at_header_of_group[" + getReport().getColumnsGroups().indexOf(columnsGroup)+"]_crosstab["+columnsGroup.getHeaderCrosstabs().indexOf(djcross)+"]";
          LayoutUtils.registerCustomExpressionParameter((DynamicJasperDesign) getDesign(), name , caption.getLabelExpression());
          captExp =   ExpressionUtils.createExpression(ExpressionUtils.createCustomExpressionInvocationText(name), caption.getLabelExpression().getClassName()) ;
          log.debug(ExpressionUtils.createCustomExpressionInvocationText(name));
        } else //a simple text
          captExp = ExpressionUtils.createStringExpression("\""+ Utils.escapeTextForExpression(caption.getText())+ "\"");
       
        JRDesignTextField captTf = new JRDesignTextField();
        captTf.setExpression(captExp );
        captTf.setHeight(caption.getHeight());
        captTf.setWidth(getReport().getOptions().getPrintableWidth());
        LayoutUtils.moveBandsElemnts(caption.getHeight(), band);
        band.addElement(captTf);
      }

      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

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.