Package ar.com.fdvs.dj.domain

Examples of ar.com.fdvs.dj.domain.Style


   */
  protected void ensureDJStyles()  {

    //first of all, register all parent styles if any
    for (Iterator iterator = getReport().getStyles().values().iterator(); iterator.hasNext();) {
      Style style = (Style) iterator.next();
      addStyleToDesign(style);
    }

    Style defaultDetailStyle = getReport().getOptions().getDefaultDetailStyle();

      Style defaultHeaderStyle = getReport().getOptions().getDefaultHeaderStyle();
  //    Style defaultFooterStyle = getReport().getOptions().getDefaultFooterStyle();
      for (Iterator iter = report.getColumns().iterator(); iter.hasNext();) {
        AbstractColumn column = (AbstractColumn) iter.next();
        if (column.getStyle() == null)
          column.setStyle(defaultDetailStyle);
View Full Code Here


    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

      textField.setWidth(col.getWidth().intValue());

      textField.setPrintWhenDetailOverflows(true);
      textField.setBlankWhenNull(true);

      Style headerStyle = col.getHeaderStyle();
      if (headerStyle == null)
        headerStyle = report.getOptions().getDefaultHeaderStyle();

      applyStyleToElement(headerStyle, textField);
View Full Code Here

    textField.setPrintRepeatedValues(col.getPrintRepeatedValues().booleanValue());

        textField.setPrintWhenDetailOverflows(true);

        Style columnStyle = col.getStyle();
        if (columnStyle == null)
          columnStyle = report.getOptions().getDefaultDetailStyle();

    applyStyleToElement(columnStyle, textField);
View Full Code Here

   * Creates the graphic element to be shown when the datasource is empty
   */
  protected void setWhenNoDataBand() {
    log.debug("setting up WHEN NO DATA band");
    String whenNoDataText = getReport().getWhenNoDataText();
    Style style = getReport().getWhenNoDataStyle();
    if (whenNoDataText == null || "".equals(whenNoDataText))
      return;
    JRDesignBand band = new JRDesignBand();
    getDesign().setNoData(band);

View Full Code Here

   * @throws JRException
   */
  protected void ensureDJStyles()  {
    //first of all, register all parent styles if any
    for (Iterator iterator = getReport().getStyles().values().iterator(); iterator.hasNext();) {
      Style style = (Style) iterator.next();
      addStyleToDesign(style);
    }

    Style defaultDetailStyle = getReport().getOptions().getDefaultDetailStyle();

      Style defaultHeaderStyle = getReport().getOptions().getDefaultHeaderStyle();
      for (Iterator iter = report.getColumns().iterator(); iter.hasNext();) {
        AbstractColumn column = (AbstractColumn) iter.next();
        if (column.getStyle() == null)
          column.setStyle(defaultDetailStyle);
        if (column.getHeaderStyle() == null)
View Full Code Here

      textField.setWidth(col.getWidth().intValue());

      textField.setPrintWhenDetailOverflows(true);
      textField.setBlankWhenNull(true);

      Style headerStyle = col.getHeaderStyle();
      if (headerStyle == null)
        headerStyle = report.getOptions().getDefaultHeaderStyle();

      applyStyleToElement(headerStyle, textField);
View Full Code Here

    textField.setPrintRepeatedValues(col.getPrintRepeatedValues().booleanValue());

        textField.setPrintWhenDetailOverflows(true);

        Style columnStyle = col.getStyle();
        if (columnStyle == null)
          columnStyle = report.getOptions().getDefaultDetailStyle();

        applyStyleToElement(columnStyle, textField);
        JRDesignStyle jrstyle = (JRDesignStyle) textField.getStyle();
View Full Code Here

    if (getReport().getOptions().isPrintBackgroundOnOddRows() && Utils.isEmpty(column.getConditionalStyles())){
        JRDesignExpression expression = new JRDesignExpression();
        expression.setValueClass(Boolean.class);
        expression.setText(EXPRESSION_TRUE_WHEN_ODD);

        Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();

        JRDesignConditionalStyle condStyle = new JRDesignConditionalStyle();
        condStyle.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
        condStyle.setMode(JRDesignElement.MODE_OPAQUE);

        condStyle.setConditionExpression(expression);
        jrstyle.addConditionalStyle(condStyle);
       
        return;
    }
     
    if (Utils.isEmpty(column.getConditionalStyles()))
      return;
   
    for (Iterator iterator = column.getConditionalStyles().iterator(); iterator.hasNext();) {
      ConditionalStyle condition = (ConditionalStyle) iterator.next();
     
      if (getReport().getOptions().isPrintBackgroundOnOddRows()
          && Transparency.TRANSPARENT == condition.getStyle().getTransparency() ){ //condition style + odd row (only if conditional style's background is transparent)
       
        JRDesignExpression expressionForConditionalStyle = getExpressionForConditionalStyle(condition, column);
        String expStr = JRExpressionUtil.getExpressionText(expressionForConditionalStyle);
       
        //ODD
        JRDesignExpression expressionOdd = new JRDesignExpression();
        expressionOdd.setValueClass(Boolean.class);
        expressionOdd.setText("new java.lang.Boolean(" +EXPRESSION_TRUE_WHEN_ODD+".booleanValue() && ((java.lang.Boolean)" + expStr + ").booleanValue() )");

        Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();

        JRDesignConditionalStyle condStyleOdd = makeConditionalStyle( condition.getStyle());     
//        Utils.copyProperties(condStyleOdd, condition.getStyle().transform());
        condStyleOdd.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
        condStyleOdd.setMode(JRDesignElement.MODE_OPAQUE);
        condStyleOdd.setConditionExpression(expressionOdd);
        jrstyle.addConditionalStyle(condStyleOdd)
       
        //EVEN
        JRDesignExpression expressionEven = new JRDesignExpression();
        expressionEven.setValueClass(Boolean.class);
        expressionEven.setText("new java.lang.Boolean(" +EXPRESSION_TRUE_WHEN_EVEN+".booleanValue() && ((java.lang.Boolean)" + expStr + ").booleanValue() )");

        JRDesignConditionalStyle condStyleEven = makeConditionalStyle( condition.getStyle());     
        condStyleEven.setConditionExpression(expressionEven);
        jrstyle.addConditionalStyle(condStyleEven);       
             
      } else { //No odd row, just the conditional style
        JRDesignExpression expression = getExpressionForConditionalStyle(condition, column);
        JRDesignConditionalStyle condStyle = makeConditionalStyle( condition.getStyle());
        condStyle.setConditionExpression(expression);
        jrstyle.addConditionalStyle(condStyle);           
      }   
    }
   
    //The last condition is the basic one
    //ODD
    if (getReport().getOptions().isPrintBackgroundOnOddRows() ){
     
      JRDesignExpression expressionOdd = new JRDesignExpression();
      expressionOdd.setValueClass(Boolean.class);
      expressionOdd.setText(EXPRESSION_TRUE_WHEN_ODD);
 
      Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();
 
      JRDesignConditionalStyle condStyleOdd = new JRDesignConditionalStyle();
      condStyleOdd.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
      condStyleOdd.setMode(JRDesignElement.MODE_OPAQUE);
      condStyleOdd.setConditionExpression(expressionOdd);
     
      jrstyle.addConditionalStyle(condStyleOdd)
     
View Full Code Here

      //The width can be the sum of the with of all the rows starting from the current one, up to the inner most one.
      int auxHeight = getRowHeaderMaxHeight(crosstabRow);
//      int auxHeight = crosstabRow.getHeight(); //FIXME getRowHeaderMaxHeight() must be FIXED because it breaks when 1rs row shows total and 2nd doesn't
      rowTitle.setHeight(auxHeight);

      Style headerstyle = crosstabRow.getHeaderStyle() == null ? this.djcross.getRowHeaderStyle(): crosstabRow.getHeaderStyle();

      if (headerstyle != null){
        layoutManager.applyStyleToElement(headerstyle, rowTitle);
        rowHeaderContents.setBackcolor(headerstyle.getBackgroundColor());
      }

      rowHeaderContents.addElement(rowTitle);
      rowHeaderContents.setMode(new Byte(Transparency.OPAQUE.getValue()));
      applyCellBorder(rowHeaderContents);
View Full Code Here

TOP

Related Classes of ar.com.fdvs.dj.domain.Style

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.