KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > it > businesslogic > ireport > Band


1 /*
2  * Copyright (C) 2005 - 2006 JasperSoft Corporation. All rights reserved.
3  * http://www.jaspersoft.com.
4  *
5  * Unless you have purchased a commercial license agreement from JasperSoft,
6  * the following license terms apply:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as published by
10  * the Free Software Foundation.
11  *
12  * This program is distributed WITHOUT ANY WARRANTY; and without the
13  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
18  * or write to:
19  *
20  * Free Software Foundation, Inc.,
21  * 59 Temple Place - Suite 330,
22  * Boston, MA USA 02111-1307
23  *
24  *
25  *
26  *
27  * Band.java
28  *
29  * Created on 12 febbraio 2003, 20.26
30  *
31  */

32
33 package it.businesslogic.ireport;
34
35 public class Band
36 {
37
38     private Report parent;
39     private String JavaDoc name = "";
40     private String JavaDoc printWhenExpression = "";
41     private int height = 0;
42     private boolean splitAllowed = true;
43
44     /**
45      * Creates a new Band object.
46      *
47      * @param parent DOCUMENT ME!
48      * @param name DOCUMENT ME!
49      * @param height DOCUMENT ME!
50      */

51     public Band(Report parent, String JavaDoc name, int height)
52     {
53         this.parent = parent;
54         this.name = name;
55         this.height = height;
56         this.splitAllowed = true;
57     }
58
59     /**
60      * DOCUMENT ME!
61      *
62      * @return DOCUMENT ME!
63      */

64     public String JavaDoc toString()
65     {
66
67         return this.name;
68     }
69
70     /**
71      * DOCUMENT ME!
72      *
73      * @return DOCUMENT ME!
74      */

75     public int getBandYLocation()
76     {
77
78         return parent.getBandYLocation(this);
79     }
80
81     /**
82      * DOCUMENT ME!
83      *
84      * @return DOCUMENT ME!
85      */

86     public int getUsableWidth()
87     {
88
89         return parent.getWidth() - parent.getLeftMargin() -
90                parent.getRightMargin();
91     }
92
93     /**
94      * Getter for property height.
95      *
96      * @return Value of property height.
97      */

98     public int getHeight()
99     {
100
101         return height;
102     }
103
104     /**
105      * Setter for property height.
106      *
107      * @param height New value of property height.
108      */

109     public void setHeight(int height)
110     {
111         this.height = height;
112     }
113
114     /**
115      * Getter for property name.
116      *
117      * @return Value of property name.
118      */

119     public java.lang.String JavaDoc getName()
120     {
121
122         return name;
123     }
124
125     /**
126      * Setter for property name.
127      *
128      * @param name New value of property name.
129      */

130     public void setName(java.lang.String JavaDoc name)
131     {
132         this.name = name;
133     }
134
135     /**
136      * Getter for property parent.
137      *
138      * @return Value of property parent.
139      */

140     public it.businesslogic.ireport.Report getParent()
141     {
142
143         return parent;
144     }
145
146     /**
147      * Setter for property parent.
148      *
149      * @param parent New value of property parent.
150      */

151     public void setParent(it.businesslogic.ireport.Report parent)
152     {
153         this.parent = parent;
154     }
155
156     /**
157      * Getter for property printWhenExpression.
158      *
159      * @return Value of property printWhenExpression.
160      */

161     public java.lang.String JavaDoc getPrintWhenExpression()
162     {
163
164         return printWhenExpression;
165     }
166
167     /**
168      * Setter for property printWhenExpression.
169      *
170      * @param printWhenExpression New value of property printWhenExpression.
171      */

172     public void setPrintWhenExpression(java.lang.String JavaDoc printWhenExpression)
173     {
174         this.printWhenExpression = printWhenExpression;
175     }
176
177     /**
178      * Getter for property splitAllowed.
179      *
180      * @return Value of property splitAllowed.
181      */

182     public boolean isSplitAllowed()
183     {
184
185         return splitAllowed;
186     }
187
188     /**
189      * Setter for property splitAllowed.
190      *
191      * @param splitAllowed New value of property splitAllowed.
192      */

193     public void setSplitAllowed(boolean splitAllowed)
194     {
195         this.splitAllowed = splitAllowed;
196     }
197 }
198
Popular Tags