PdfTableTemplate.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. *
  3. * Copyright (c) behosoft Co.,Ltd.
  4. * All Rights Reserved.
  5. *
  6. * This software is the confidential and proprietary information of behosoft.
  7. * (Social Security Department). You shall not disclose such
  8. * Confidential Information and shall use it only in accordance with
  9. * the terms of the license agreement you entered into with behosoft.
  10. *
  11. * Distributable under GNU LGPL license by gnu.org
  12. */
  13. package com.behosoft.util.pdfutil;
  14. import java.util.ArrayList;
  15. import java.util.List;
  16. /**
  17. * Title: Wms_common_utils_pdfUtils
  18. * <p>
  19. * Description: 定义pdf表格模板
  20. * </p>
  21. *
  22. * @author daijiashun
  23. * @version $Revision$ 2009-8-17
  24. * @author (lastest modification by $Author$)
  25. * @since 1.0
  26. */
  27. public class PdfTableTemplate implements IsPdfContent {
  28. private List<PdfTableRow> rows = new ArrayList<PdfTableRow>();
  29. private int colNum = 0;
  30. private int rowNum = 0;
  31. public int getRowNum() {
  32. return rowNum;
  33. }
  34. public int getColNum() {
  35. return colNum;
  36. }
  37. public List<PdfTableRow> getRows() {
  38. return rows;
  39. }
  40. public void setRows(List<PdfTableRow> rows) {
  41. this.rows = rows;
  42. this.rowNum = rows.size();
  43. for (PdfTableRow row : rows) {
  44. if (row.count() > colNum) {
  45. colNum = row.count();
  46. }
  47. }
  48. }
  49. public PdfTableTemplate() {
  50. }
  51. public void add(PdfTableRow row) {
  52. this.rows.add(row);
  53. if (row.count() > colNum) {
  54. colNum = row.count();
  55. }
  56. rowNum++;
  57. }
  58. }