Package ro.fortsoft.wicket.pivot.tree

Examples of ro.fortsoft.wicket.pivot.tree.Node


  }
   
  @Override
  public Tree getColumnsHeaderTree() {
    if (columnsHeaderTree == null) {
      Node root = new Node();
      insertChildren(root, getFields(PivotField.Area.COLUMN));
      columnsHeaderTree = new Tree(root);
    }

    return columnsHeaderTree;
View Full Code Here


  }

  @Override
  public Tree getRowsHeaderTree() {
    if (rowsHeaderTree == null) {
      Node root = new Node();
      insertChildren(root, getFields(PivotField.Area.ROW));
      rowsHeaderTree = new Tree(root);
    }

    return rowsHeaderTree;
View Full Code Here

          tr.rowHeader.add(new HeaderRenderCell(rowFields.get(j)));
        }
      }

      // rendering column keys
      Node columnsRoot = pivotModel.getColumnsHeaderTree().getRoot();
      List<List<Object>> pathRenderedCache = new ArrayList<List<Object>>();
      for (List<Object> columnKey : columnKeys) {
        if (i < columnFieldsSize) {
          PivotField columnField = columnFields.get(i);
          List<Object> path = new ArrayList<Object>(columnKey.subList(0, i + 1));
          int colspan = getSpan(columnsRoot, path);
          colspan = colspan * dataFieldsSize;

          HeaderValueRenderCell valueRenderCell = new HeaderValueRenderCell(columnKey.get(i), columnField);
          valueRenderCell.colspan = colspan;

          if (pathRenderedCache.contains(path)) {
            /*
             * Was: setVisible(false). We just dont add the field
             * here.
             */
          } else {
            tr.value.add(valueRenderCell);
            pathRenderedCache.add(path);
          }
        } else {
          for (PivotField dataField : dataFields) {
            tr.value.add(new HeaderRenderCell(dataField));
          }
        }
      }

      if (!columnFields.isEmpty() && pivotModel.isShowGrandTotalForRow()) {
        // rendering grand total column
        if (i == 0) {
          GrandTotalHeaderRenderCell cell = new GrandTotalHeaderRenderCell("Grand Total");
          cell.colspan = dataFieldsSize;
          tr.grandTotalColumn.add(cell);
        } else if (i < columnFieldsSize) {
          GrandTotalHeaderRenderCell cell = new GrandTotalHeaderRenderCell(null);
          cell.colspan = dataFieldsSize;
          tr.grandTotalColumn.add(cell);
        } else {
          for (PivotField dataField : dataFields) {
            HeaderRenderCell cell = new HeaderRenderCell(dataField);
            tr.grandTotalColumn.add(cell);
          }
        }
      }
    }

    // rendering rows
    Node rowsRoot = pivotModel.getRowsHeaderTree().getRoot();
    List<List<Object>> pathRenderedCache = new ArrayList<List<Object>>();
    for (List<Object> rowKey : rowKeys) {
      DataRenderRow tr = new DataRenderRow();
      row.add(tr);

View Full Code Here

    if (spanCache.containsKey(path)) {
      return spanCache.get(path);
    }

    // quick and dirty
    Node node = TreeHelper.getNode(root, path);

    int span = 1;
    if (!node.isLeaf()) {
      span = TreeHelper.getLeafs(node).size();
    }

    return span;
  }
View Full Code Here

TOP

Related Classes of ro.fortsoft.wicket.pivot.tree.Node

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.