Package org.pentaho.reporting.engine.classic.core.modules.output.table.html

Examples of org.pentaho.reporting.engine.classic.core.modules.output.table.html.HtmlRowBackgroundStruct


      {
        AttributeList rowAttributes = styleCache.getRowAttributes(row);
        if (rowAttributes == null)
        {
          final int rowHeight = (int) StrictGeomUtility.toExternalValue(gridLayout.getCellHeights().get(row));
          final HtmlRowBackgroundStruct struct = getCommonBackground(gridLayout, colCount, row);
          rowAttributes = getTagHelper().createRowAttributes(rowHeight, struct);
          styleCache.putRowAttributes(row, rowAttributes);
        }

        xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, "tr", rowAttributes, XmlWriterSupport.OPEN);
View Full Code Here


  private HtmlRowBackgroundStruct getCommonBackground(final FastGridLayout gridLayout,
                                                      final int columnCount,
                                                      final int row)
  {
    final HtmlRowBackgroundStruct bg = new HtmlRowBackgroundStruct();
    BorderEdge topEdge = BorderEdge.EMPTY;
    BorderEdge bottomEdge = BorderEdge.EMPTY;
    Color color = null;
    for (int col = 0; col < columnCount; col += 1)
    {
      FastGridLayout.GridCell gridCell = gridLayout.get(col, row);
      if (gridCell == null)
      {
        // spanned cell
        continue;
      }

      CellBackground backgroundAt = gridCell.getLayoutInfo().getBackground();
      if (backgroundAt == null)
      {
        bg.fail();
        return bg;
      }

      boolean fail = false;
      if (col == 0)
      {
        color = backgroundAt.getBackgroundColor();
        topEdge = backgroundAt.getTop();
        bottomEdge = backgroundAt.getBottom();
      }
      else
      {
        if (ObjectUtilities.equal(color, backgroundAt.getBackgroundColor()) == false)
        {
          fail = true;
        }
        if (ObjectUtilities.equal(topEdge, backgroundAt.getTop()) == false)
        {
          fail = true;
        }
        if (ObjectUtilities.equal(bottomEdge, backgroundAt.getBottom()) == false)
        {
          fail = true;
        }
      }

      if (BorderCorner.EMPTY.equals(backgroundAt.getBottomLeft()) == false)
      {
        fail = true;
      }
      if (BorderCorner.EMPTY.equals(backgroundAt.getBottomRight()) == false)
      {
        fail = true;
      }
      if (BorderCorner.EMPTY.equals(backgroundAt.getTopLeft()) == false)
      {
        fail = true;
      }
      if (BorderCorner.EMPTY.equals(backgroundAt.getTopRight()) == false)
      {
        fail = true;
      }
      if (fail)
      {
        bg.fail();
        break;
      }

    }
    bg.set(color, topEdge, bottomEdge);
    return bg;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.modules.output.table.html.HtmlRowBackgroundStruct

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.