Package ar.com.fdvs.dj.domain

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


    designStaticText.setHeight(columnsGroup.getHeaderHeight().intValue());
    designStaticText.setWidth(col.getWidth().intValue());
    designStaticText.setX(col.getPosX().intValue());
    designStaticText.setY(col.getPosY().intValue());

    Style headerStyle = columnsGroup.getColumnHeaderStyle(col);
    if (headerStyle == null)
      headerStyle = columnsGroup.getDefaultColumnHeaederStyle();
    if (headerStyle == null)
      headerStyle = col.getHeaderStyle();
View Full Code Here


        textField.setEvaluationGroup(jgroup);
        //Assign the style to the element.
        //First we look for the specific element style, then the default style for the group variables
        //and finally the column style.
        Style defStyle = DJConstants.HEADER.equals(type)?columnsGroup.getDefaulHeaderVariableStyle():columnsGroup.getDefaulFooterVariableStyle();

        if (var.getStyle() != null)
          applyStyleToElement(var.getStyle(), textField);
        else if (defStyle != null)
          applyStyleToElement(defStyle, textField);
        else {
          //Last resource is tu use the column style, but a copy of it because
          //the one in the internal cache can get modified by the layout manager (like in the odd row case)
          Style style = col.getStyle();
          try {
            style = (Style) BeanUtils.cloneBean(style);
            style.setName(null); //set to null to make applyStyleToElement(...) assign a name
          } catch (Exception e) {  }
          applyStyleToElement(style, textField);
        }

View Full Code Here

//  protected Map headerGroupVariables = new TreeMap();
//  protected Map footerGroupVariables = new TreeMap();

  public FastReportBuilder(){
    currencyStyle = new Style("currencyStyle");
    currencyStyle.setHorizontalAlign(HorizontalAlign.RIGHT);

    numberStyle = new Style("numberStyle");
    numberStyle.setHorizontalAlign(HorizontalAlign.RIGHT);

    Style defaultHeaderStyle = options.getDefaultHeaderStyle();
    defaultHeaderStyle.setFont(Font.ARIAL_MEDIUM_BOLD);
    defaultHeaderStyle.setHorizontalAlign(HorizontalAlign.CENTER);
    defaultHeaderStyle.setBorderBottom(Border.THIN);
    defaultHeaderStyle.setVerticalAlign(VerticalAlign.MIDDLE);
    defaultHeaderStyle.setBackgroundColor(Color.LIGHT_GRAY);
    defaultHeaderStyle.setTransparency(Transparency.OPAQUE);

    Style titleStyle2 = report.getTitleStyle();
    titleStyle2.setFont(Font.ARIAL_BIG_BOLD);
    titleStyle2.setHorizontalAlign(HorizontalAlign.CENTER);
    titleStyle2.setVerticalAlign(VerticalAlign.TOP);
  }
View Full Code Here

    super();

    if (blank)
      style = Style.createBlankStyle(null);
    else
      style = new Style();

  }
View Full Code Here

    super();

    if (blank)
      style = Style.createBlankStyle(null);
    else
      style = new Style();

    style.setName(name);
  }
View Full Code Here

    super();

    if (blank)
      style = Style.createBlankStyle(null);
    else
      style = new Style();

    style.setName(name);
    style.setParentStyleName(parentName);
  }
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();

        if (group != null) {
          int index = getReport().getColumnsGroups().indexOf(group);
//            JRDesignGroup previousGroup = (JRDesignGroup) getDesign().getGroupsList().get(index);
            JRDesignGroup previousGroup = getJRGroupFromDJGroup(group);
            textField.setPrintWhenGroupChanges(previousGroup);

            /**
             * Since a group column can share the style with non group columns, if oddRow coloring is enabled,
             * we modified this shared style to have a colored background on odd rows. We dont want that for group
             * columns, that's why we create our own style from the existing one, and remove proper odd-row conditional
             * style if present
             */
            JRDesignStyle groupStyle = new JRDesignStyle();
            try {
              if (jrstyle != null)
                BeanUtils.copyProperties(groupStyle, jrstyle);
      } catch (Exception e) {
        throw new DJException("Could not copy properties for shared group style: " + e.getMessage(),e);
      }

      groupStyle.setName(groupStyle.getFontName() +"_for_group_"+index);
      textField.setStyle(groupStyle);
      try {
        design.addStyle(groupStyle);
      } catch (JRException e) { /**e.printStackTrace(); //Already there, nothing to do **/}

        } else {
          if (getReport().getOptions().isPrintBackgroundOnOddRows() &&
              (jrstyle.getConditionalStyles() == null || jrstyle.getConditionalStyles().length == 0)) {
            // No group column so this is a detail text field
          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);
          }
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.