Package net.sf.jasperreports.components.table

Examples of net.sf.jasperreports.components.table.Cell


      this.level = level;
    }

    public Void visitColumn(Column column)
    {
      Cell cell = columnCell(column);
     
      if (cell != null)
      {
        JRDesignFrame cellFrame = createCellFrame(cell,
            column.getWidth(), fillColumn.getWidth(),
            xOffset, yOffset);
        int rowSpan = cell.getRowSpan() == null ? 1 : cell.getRowSpan();
        bandInfo.addElement(level + rowSpan - 1, cellFrame);
       
        yOffset += cell.getHeight();
      }
     
      xOffset += column.getWidth();
     
      return null;
View Full Code Here


    protected abstract Cell columnCell(Column column);
   
    public Void visitColumnGroup(ColumnGroup columnGroup)
    {
      Cell cell = columnGroupCell(columnGroup);
      int cellHeight = 0;
      int sublevel = level;
      if (cell != null)
      {
        int rowSpan = cell.getRowSpan() == null ? 1 : cell.getRowSpan();
        JRDesignFrame cellFrame = createCellFrame(cell,
            columnGroup.getWidth(), fillColumn.getWidth(),
            xOffset, yOffset);
        bandInfo.addElement(level + rowSpan - 1, cellFrame);
        cellHeight = cell.getHeight();
        sublevel += rowSpan;
      }
     
      for (FillColumn subcolumn : fillColumn.getSubcolumns())
      {
View Full Code Here

    }

    @Override
    public Void visitColumnGroup(ColumnGroup columnGroup)
    {
      Cell cell = columnGroupCell(columnGroup);
      int rowSpan;
      if (cell == null)
      {
        rowSpan = 0;
      }
      else if (cell.getRowSpan() == null)
      {
        rowSpan = 1;
      }
      else
      {
        rowSpan = cell.getRowSpan();
      }
     
      int origXOffset = xOffset;
      int origYOffset = yOffset;
     
      for (FillColumn subcolumn : fillColumn.getSubcolumns())
      {
        ReportBandCreator subVisitor = createSubVisitor(subcolumn,
            xOffset, origYOffset, level + rowSpan);
        subVisitor.visit();
        xOffset = subVisitor.xOffset;
        if (subVisitor.yOffset > yOffset)
        {
          yOffset = subVisitor.yOffset;
        }
      }
     
      if (cell != null)
      {
        JRDesignFrame cellFrame = createCellFrame(cell,
            columnGroup.getWidth(), fillColumn.getWidth(),
            origXOffset, yOffset);
        bandInfo.addElement(level + rowSpan - 1, cellFrame);
        yOffset += cell.getHeight();
      }
     
      return null;
    }
View Full Code Here

  private Rectangle initDetail(Rectangle p, BaseColumn bc) {
    int h = 0;
    int w = 0;
    if (bc != null && bc instanceof Column) {
      Cell c = ((Column) bc).getDetailCell();
      w = bc.getWidth();
      if (c != null)
        h = c.getHeight();
      boundsMap.put(c, new Rectangle(p.x, p.y, w, h));
    }
    return new Rectangle(p.x + w, p.y, w, h);
  }
View Full Code Here

  private Rectangle initHeader(Rectangle p, BaseColumn bc, int type, String grName) {
    int y = p.y;
    int h = 0;
    int w = bc.getWidth();
    Cell c = getCell(bc, type, grName);
    if (c != null) {
      y = p.y + c.getHeight();
      h = c.getHeight();
      boundsMap.put(c, new Rectangle(p.x, p.y, w, h));
    }
    if (bc instanceof ColumnGroup) {
      Rectangle pi = new Rectangle(p.x, y, w, h);
      int hi = 0;
View Full Code Here

  private Rectangle initFooter(Rectangle p, BaseColumn bc, int type, String grName) {
    int y = p.y;
    int h = 0;
    int w = bc.getWidth();
    Cell c = getCell(bc, type, grName);
    if (bc instanceof ColumnGroup) {
      Rectangle pi = new Rectangle(p.x, y, w, h);
      int hi = 0;
      for (BaseColumn bcg : ((ColumnGroup) bc).getColumns()) {
        pi = initFooter(pi, bcg, type, grName);
        pi.setLocation(pi.x, y);
        if (hi < pi.height)
          hi = pi.height;
      }
      h += hi;
    }
    if (c != null) {
      y = p.y + h;
      h = c.getHeight();
      boundsMap.put(c, new Rectangle(p.x, y, w, h));
    }
    return new Rectangle(p.x + w, y, w, h);
  }
View Full Code Here

    }
    return groupsList;
  }

  public static Cell getCell(BaseColumn bc, int type, String grName) {
    Cell cell = null;
    switch (type) {
    case TABLE_HEADER:
      cell = bc.getTableHeader();
      break;
    case TABLE_FOOTER:
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.components.table.Cell

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.