View Javadoc

1   /*
2    * DynamicJasper: A library for creating reports dynamically by specifying
3    * columns, groups, styles, etc. at runtime. It also saves a lot of development
4    * time in many cases! (http://sourceforge.net/projects/dynamicjasper)
5    *
6    * Copyright (C) 2008  FDV Solutions (http://www.fdvsolutions.com)
7    *
8    * This library is free software; you can redistribute it and/or
9    * modify it under the terms of the GNU Lesser General Public
10   *
11   * License as published by the Free Software Foundation; either
12   *
13   * version 2.1 of the License, or (at your option) any later version.
14   *
15   * This library is distributed in the hope that it will be useful,
16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
17   *
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19   *
20   * Lesser General Public License for more details.
21   *
22   * You should have received a copy of the GNU Lesser General Public
23   * License along with this library; if not, write to the Free Software
24   *
25   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26   *
27   */
28  
29  package ar.com.fdvs.dj.domain.entities;
30  
31  import ar.com.fdvs.dj.domain.Style;
32  import ar.com.fdvs.dj.domain.entities.columns.AbstractColumn;
33  
34  import java.util.List;
35  
36  public class DJColSpan  {
37  
38      private String title;
39      private String count;
40      private int width;
41      private Style colspanHeaderStyle;
42      private List<AbstractColumn> columns;
43  
44      public String getTitle() {
45          return title;
46      }
47  
48      public void setTitle(String title) {
49          this.title = title;
50      }
51  
52      public String getCount() {
53          return count;
54      }
55  
56      public void setCount(String count) {
57          this.count = count;
58      }
59  
60      /**
61       * The total width is the sum of the width of eache column
62       * @return a colspan width
63       */
64      public int getWidth() {
65          if(width == 0) {
66              for (AbstractColumn col : columns) {
67                  width += col.getWidth();
68              }
69          }
70  
71          return width;
72      }
73  
74      public void setColumns(List<AbstractColumn> columns) {
75          this.columns = columns;
76      }
77  
78      public List<AbstractColumn> getColumns(){
79          return  columns;
80      }
81  
82      public Style getColspanHeaderStyle() {
83          return colspanHeaderStyle;
84      }
85  
86      public void setColspanHeaderStyle(Style colspanHeaderStyle) {
87          this.colspanHeaderStyle = colspanHeaderStyle;
88      }
89  
90      public boolean isFirstColum(AbstractColumn col) {
91          return this.getColumns().get(0).equals(col);
92      }
93  
94      public int getHeight() {
95          return 0;
96      }
97  
98      public void setHeight(){
99  
100     }
101 }