KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > base > JRBasePrintFrame


1 /*
2  * ============================================================================
3  * GNU Lesser General Public License
4  * ============================================================================
5  *
6  * JasperReports - Free Java report-generating library.
7  * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * JasperSoft Corporation
24  * 303 Second Street, Suite 450 North
25  * San Francisco, CA 94107
26  * http://www.jaspersoft.com
27  */

28 package net.sf.jasperreports.engine.base;
29
30 import java.awt.Color JavaDoc;
31 import java.util.ArrayList JavaDoc;
32 import java.util.List JavaDoc;
33
34 import net.sf.jasperreports.engine.JRBox;
35 import net.sf.jasperreports.engine.JRConstants;
36 import net.sf.jasperreports.engine.JRDefaultStyleProvider;
37 import net.sf.jasperreports.engine.JRElement;
38 import net.sf.jasperreports.engine.JRPrintElement;
39 import net.sf.jasperreports.engine.JRPrintFrame;
40 import net.sf.jasperreports.engine.util.JRStyleResolver;
41
42 /**
43  * Base implementation of {@link net.sf.jasperreports.engine.JRPrintFrame JRPrintFrame}.
44  *
45  * @author Lucian Chirita (lucianc@users.sourceforge.net)
46  * @version $Id: JRBasePrintFrame.java 1280 2006-06-07 15:21:28 +0300 (Wed, 07 Jun 2006) teodord $
47  */

48 public class JRBasePrintFrame extends JRBasePrintElement implements JRPrintFrame
49 {
50     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
51
52     private List JavaDoc elements;
53     private JRBox box;
54     
55     public JRBasePrintFrame(JRDefaultStyleProvider defaultStyleProvider)
56     {
57         super(defaultStyleProvider);
58         
59         elements = new ArrayList JavaDoc();
60     }
61
62     /**
63      *
64      */

65     public byte getMode()
66     {
67         return JRStyleResolver.getMode(this, JRElement.MODE_TRANSPARENT);
68     }
69         
70     public void setBox(JRBox box)
71     {
72         this.box = box;
73     }
74     
75     public JRBox getBox()
76     {
77         return box;
78     }
79
80     public void addElement(JRPrintElement element)
81     {
82         elements.add(element);
83     }
84     
85     public List JavaDoc getElements()
86     {
87         return elements;
88     }
89     
90     //box
91
protected Byte JavaDoc border;
92     protected Byte JavaDoc topBorder = null;
93     protected Byte JavaDoc leftBorder = null;
94     protected Byte JavaDoc bottomBorder = null;
95     protected Byte JavaDoc rightBorder = null;
96     protected Color JavaDoc borderColor = null;
97     protected Color JavaDoc topBorderColor = null;
98     protected Color JavaDoc leftBorderColor = null;
99     protected Color JavaDoc bottomBorderColor = null;
100     protected Color JavaDoc rightBorderColor = null;
101     protected Integer JavaDoc padding;
102     protected Integer JavaDoc topPadding = null;
103     protected Integer JavaDoc leftPadding = null;
104     protected Integer JavaDoc bottomPadding = null;
105     protected Integer JavaDoc rightPadding = null;
106
107
108     /**
109      *
110      */

111     public byte getBorder()
112     {
113         return JRStyleResolver.getBorder(this);
114     }
115
116     public Byte JavaDoc getOwnBorder()
117     {
118         return border;
119     }
120
121     /**
122      *
123      */

124     public void setBorder(byte border)
125     {
126         this.border = new Byte JavaDoc(border);
127     }
128
129     /**
130      *
131      */

132     public Color JavaDoc getBorderColor()
133     {
134         return JRStyleResolver.getBorderColor(this, getForecolor());
135     }
136
137     public Color JavaDoc getOwnBorderColor()
138     {
139         return borderColor;
140     }
141
142     /**
143      *
144      */

145     public void setBorderColor(Color JavaDoc borderColor)
146     {
147         this.borderColor = borderColor;
148     }
149
150     /**
151      *
152      */

153     public int getPadding()
154     {
155         return JRStyleResolver.getPadding(this);
156     }
157
158     public Integer JavaDoc getOwnPadding()
159     {
160         return padding;
161     }
162
163     /**
164      *
165      */

166     public void setPadding(int padding)
167     {
168         this.padding = new Integer JavaDoc(padding);
169     }
170
171     /**
172      *
173      */

174     public byte getTopBorder()
175     {
176         return JRStyleResolver.getTopBorder(this);
177     }
178
179     /**
180      *
181      */

182     public Byte JavaDoc getOwnTopBorder()
183     {
184         return topBorder;
185     }
186
187     /**
188      *
189      */

190     public void setTopBorder(byte topBorder)
191     {
192         this.topBorder = new Byte JavaDoc(topBorder);
193     }
194
195     /**
196      *
197      */

198     public Color JavaDoc getTopBorderColor()
199     {
200         return JRStyleResolver.getTopBorderColor(this, getForecolor());
201     }
202
203     /**
204      *
205      */

206     public Color JavaDoc getOwnTopBorderColor()
207     {
208         return topBorderColor;
209     }
210
211     /**
212      *
213      */

214     public void setTopBorderColor(Color JavaDoc topBorderColor)
215     {
216         this.topBorderColor = topBorderColor;
217     }
218
219     /**
220      *
221      */

222     public int getTopPadding()
223     {
224         return JRStyleResolver.getTopPadding(this);
225     }
226
227     /**
228      *
229      */

230     public Integer JavaDoc getOwnTopPadding()
231     {
232         return topPadding;
233     }
234
235     /**
236      *
237      */

238     public void setTopPadding(int topPadding)
239     {
240         this.topPadding = new Integer JavaDoc(topPadding);
241     }
242
243     /**
244      *
245      */

246     public byte getLeftBorder()
247     {
248         return JRStyleResolver.getLeftBorder(this);
249     }
250
251     /**
252      *
253      */

254     public Byte JavaDoc getOwnLeftBorder()
255     {
256         return leftBorder;
257     }
258
259     /**
260      *
261      */

262     public void setLeftBorder(byte leftBorder)
263     {
264         this.leftBorder = new Byte JavaDoc(leftBorder);
265     }
266
267     /**
268      *
269      */

270     public Color JavaDoc getLeftBorderColor()
271     {
272         return JRStyleResolver.getLeftBorderColor(this, getForecolor());
273     }
274
275     /**
276      *
277      */

278     public Color JavaDoc getOwnLeftBorderColor()
279     {
280         return leftBorderColor;
281     }
282
283     /**
284      *
285      */

286     public void setLeftBorderColor(Color JavaDoc leftBorderColor)
287     {
288         this.leftBorderColor = leftBorderColor;
289     }
290
291     /**
292      *
293      */

294     public int getLeftPadding()
295     {
296         return JRStyleResolver.getLeftPadding(this);
297     }
298
299     /**
300      *
301      */

302     public Integer JavaDoc getOwnLeftPadding()
303     {
304         return leftPadding;
305     }
306
307     /**
308      *
309      */

310     public void setLeftPadding(int leftPadding)
311     {
312         this.leftPadding = new Integer JavaDoc(leftPadding);
313     }
314
315     /**
316      *
317      */

318     public byte getBottomBorder()
319     {
320         return JRStyleResolver.getBottomBorder(this);
321     }
322
323     /**
324      *
325      */

326     public Byte JavaDoc getOwnBottomBorder()
327     {
328         return bottomBorder;
329     }
330
331     /**
332      *
333      */

334     public void setBottomBorder(byte bottomBorder)
335     {
336         this.bottomBorder = new Byte JavaDoc(bottomBorder);
337     }
338
339     /**
340      *
341      */

342     public Color JavaDoc getBottomBorderColor()
343     {
344         return JRStyleResolver.getBottomBorderColor(this, getForecolor());
345     }
346
347     /**
348      *
349      */

350     public Color JavaDoc getOwnBottomBorderColor()
351     {
352         return bottomBorderColor;
353     }
354
355     /**
356      *
357      */

358     public void setBottomBorderColor(Color JavaDoc bottomBorderColor)
359     {
360         this.bottomBorderColor = bottomBorderColor;
361     }
362
363     /**
364      *
365      */

366     public int getBottomPadding()
367     {
368         return JRStyleResolver.getBottomPadding(this);
369     }
370
371     /**
372      *
373      */

374     public Integer JavaDoc getOwnBottomPadding()
375     {
376         return bottomPadding;
377     }
378
379     /**
380      *
381      */

382     public void setBottomPadding(int bottomPadding)
383     {
384         this.bottomPadding = new Integer JavaDoc(bottomPadding);
385     }
386
387     /**
388      *
389      */

390     public byte getRightBorder()
391     {
392         return JRStyleResolver.getRightBorder(this);
393     }
394
395     /**
396      *
397      */

398     public Byte JavaDoc getOwnRightBorder()
399     {
400         return rightBorder;
401     }
402
403     /**
404      *
405      */

406     public void setRightBorder(byte rightBorder)
407     {
408         this.rightBorder = new Byte JavaDoc(rightBorder);
409     }
410
411     /**
412      *
413      */

414     public Color JavaDoc getRightBorderColor()
415     {
416         return JRStyleResolver.getRightBorderColor(this, getForecolor());
417     }
418
419     /**
420      *
421      */

422     public Color JavaDoc getOwnRightBorderColor()
423     {
424         return rightBorderColor;
425     }
426
427     /**
428      *
429      */

430     public void setRightBorderColor(Color JavaDoc rightBorderColor)
431     {
432         this.rightBorderColor = rightBorderColor;
433     }
434
435     /**
436      *
437      */

438     public int getRightPadding()
439     {
440         return JRStyleResolver.getRightPadding(this);
441     }
442
443     /**
444      *
445      */

446     public Integer JavaDoc getOwnRightPadding()
447     {
448         return rightPadding;
449     }
450
451     /**
452      *
453      */

454     public void setRightPadding(int rightPadding)
455     {
456         this.rightPadding = new Integer JavaDoc(rightPadding);
457     }
458
459     /**
460      *
461      */

462     public void setBorder(Byte JavaDoc border)
463     {
464         this.border = border;
465     }
466
467     /**
468      *
469      */

470     public void setPadding(Integer JavaDoc padding)
471     {
472         this.padding = padding;
473     }
474
475     /**
476      *
477      */

478     public void setTopBorder(Byte JavaDoc topBorder)
479     {
480         this.topBorder = topBorder;
481     }
482
483     /**
484      *
485      */

486     public void setTopPadding(Integer JavaDoc topPadding)
487     {
488         this.topPadding = topPadding;
489     }
490
491     /**
492      *
493      */

494     public void setLeftBorder(Byte JavaDoc leftBorder)
495     {
496         this.leftBorder = leftBorder;
497     }
498
499     /**
500      *
501      */

502     public void setLeftPadding(Integer JavaDoc leftPadding)
503     {
504         this.leftPadding = leftPadding;
505     }
506
507     /**
508      *
509      */

510     public void setBottomBorder(Byte JavaDoc bottomBorder)
511     {
512         this.bottomBorder = bottomBorder;
513     }
514
515     /**
516      *
517      */

518     public void setBottomPadding(Integer JavaDoc bottomPadding)
519     {
520         this.bottomPadding = bottomPadding;
521     }
522
523     /**
524      *
525      */

526     public void setRightBorder(Byte JavaDoc rightBorder)
527     {
528         this.rightBorder = rightBorder;
529     }
530
531     /**
532      *
533      */

534     public void setRightPadding(Integer JavaDoc rightPadding)
535     {
536         this.rightPadding = rightPadding;
537     }
538
539 }
540
Popular Tags