001: /*
002: * ============================================================================
003: * GNU Lesser General Public License
004: * ============================================================================
005: *
006: * JasperReports - Free Java report-generating library.
007: * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
022: *
023: * JasperSoft Corporation
024: * 303 Second Street, Suite 450 North
025: * San Francisco, CA 94107
026: * http://www.jaspersoft.com
027: */
028: package net.sf.jasperreports.engine.base;
029:
030: import java.awt.Color;
031: import java.util.ArrayList;
032: import java.util.List;
033:
034: import net.sf.jasperreports.engine.JRBox;
035: import net.sf.jasperreports.engine.JRConstants;
036: import net.sf.jasperreports.engine.JRDefaultStyleProvider;
037: import net.sf.jasperreports.engine.JRElement;
038: import net.sf.jasperreports.engine.JRPrintElement;
039: import net.sf.jasperreports.engine.JRPrintFrame;
040: import net.sf.jasperreports.engine.util.JRStyleResolver;
041:
042: /**
043: * Base implementation of {@link net.sf.jasperreports.engine.JRPrintFrame JRPrintFrame}.
044: *
045: * @author Lucian Chirita (lucianc@users.sourceforge.net)
046: * @version $Id: JRBasePrintFrame.java 1280 2006-06-07 12:21:28Z teodord $
047: */
048: public class JRBasePrintFrame extends JRBasePrintElement implements
049: JRPrintFrame {
050: private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
051:
052: private List elements;
053: private JRBox box;
054:
055: public JRBasePrintFrame(JRDefaultStyleProvider defaultStyleProvider) {
056: super (defaultStyleProvider);
057:
058: elements = new ArrayList();
059: }
060:
061: /**
062: *
063: */
064: public byte getMode() {
065: return JRStyleResolver
066: .getMode(this , JRElement.MODE_TRANSPARENT);
067: }
068:
069: public void setBox(JRBox box) {
070: this .box = box;
071: }
072:
073: public JRBox getBox() {
074: return box;
075: }
076:
077: public void addElement(JRPrintElement element) {
078: elements.add(element);
079: }
080:
081: public List getElements() {
082: return elements;
083: }
084:
085: //box
086: protected Byte border;
087: protected Byte topBorder = null;
088: protected Byte leftBorder = null;
089: protected Byte bottomBorder = null;
090: protected Byte rightBorder = null;
091: protected Color borderColor = null;
092: protected Color topBorderColor = null;
093: protected Color leftBorderColor = null;
094: protected Color bottomBorderColor = null;
095: protected Color rightBorderColor = null;
096: protected Integer padding;
097: protected Integer topPadding = null;
098: protected Integer leftPadding = null;
099: protected Integer bottomPadding = null;
100: protected Integer rightPadding = null;
101:
102: /**
103: *
104: */
105: public byte getBorder() {
106: return JRStyleResolver.getBorder(this );
107: }
108:
109: public Byte getOwnBorder() {
110: return border;
111: }
112:
113: /**
114: *
115: */
116: public void setBorder(byte border) {
117: this .border = new Byte(border);
118: }
119:
120: /**
121: *
122: */
123: public Color getBorderColor() {
124: return JRStyleResolver.getBorderColor(this , getForecolor());
125: }
126:
127: public Color getOwnBorderColor() {
128: return borderColor;
129: }
130:
131: /**
132: *
133: */
134: public void setBorderColor(Color borderColor) {
135: this .borderColor = borderColor;
136: }
137:
138: /**
139: *
140: */
141: public int getPadding() {
142: return JRStyleResolver.getPadding(this );
143: }
144:
145: public Integer getOwnPadding() {
146: return padding;
147: }
148:
149: /**
150: *
151: */
152: public void setPadding(int padding) {
153: this .padding = new Integer(padding);
154: }
155:
156: /**
157: *
158: */
159: public byte getTopBorder() {
160: return JRStyleResolver.getTopBorder(this );
161: }
162:
163: /**
164: *
165: */
166: public Byte getOwnTopBorder() {
167: return topBorder;
168: }
169:
170: /**
171: *
172: */
173: public void setTopBorder(byte topBorder) {
174: this .topBorder = new Byte(topBorder);
175: }
176:
177: /**
178: *
179: */
180: public Color getTopBorderColor() {
181: return JRStyleResolver.getTopBorderColor(this , getForecolor());
182: }
183:
184: /**
185: *
186: */
187: public Color getOwnTopBorderColor() {
188: return topBorderColor;
189: }
190:
191: /**
192: *
193: */
194: public void setTopBorderColor(Color topBorderColor) {
195: this .topBorderColor = topBorderColor;
196: }
197:
198: /**
199: *
200: */
201: public int getTopPadding() {
202: return JRStyleResolver.getTopPadding(this );
203: }
204:
205: /**
206: *
207: */
208: public Integer getOwnTopPadding() {
209: return topPadding;
210: }
211:
212: /**
213: *
214: */
215: public void setTopPadding(int topPadding) {
216: this .topPadding = new Integer(topPadding);
217: }
218:
219: /**
220: *
221: */
222: public byte getLeftBorder() {
223: return JRStyleResolver.getLeftBorder(this );
224: }
225:
226: /**
227: *
228: */
229: public Byte getOwnLeftBorder() {
230: return leftBorder;
231: }
232:
233: /**
234: *
235: */
236: public void setLeftBorder(byte leftBorder) {
237: this .leftBorder = new Byte(leftBorder);
238: }
239:
240: /**
241: *
242: */
243: public Color getLeftBorderColor() {
244: return JRStyleResolver.getLeftBorderColor(this , getForecolor());
245: }
246:
247: /**
248: *
249: */
250: public Color getOwnLeftBorderColor() {
251: return leftBorderColor;
252: }
253:
254: /**
255: *
256: */
257: public void setLeftBorderColor(Color leftBorderColor) {
258: this .leftBorderColor = leftBorderColor;
259: }
260:
261: /**
262: *
263: */
264: public int getLeftPadding() {
265: return JRStyleResolver.getLeftPadding(this );
266: }
267:
268: /**
269: *
270: */
271: public Integer getOwnLeftPadding() {
272: return leftPadding;
273: }
274:
275: /**
276: *
277: */
278: public void setLeftPadding(int leftPadding) {
279: this .leftPadding = new Integer(leftPadding);
280: }
281:
282: /**
283: *
284: */
285: public byte getBottomBorder() {
286: return JRStyleResolver.getBottomBorder(this );
287: }
288:
289: /**
290: *
291: */
292: public Byte getOwnBottomBorder() {
293: return bottomBorder;
294: }
295:
296: /**
297: *
298: */
299: public void setBottomBorder(byte bottomBorder) {
300: this .bottomBorder = new Byte(bottomBorder);
301: }
302:
303: /**
304: *
305: */
306: public Color getBottomBorderColor() {
307: return JRStyleResolver.getBottomBorderColor(this ,
308: getForecolor());
309: }
310:
311: /**
312: *
313: */
314: public Color getOwnBottomBorderColor() {
315: return bottomBorderColor;
316: }
317:
318: /**
319: *
320: */
321: public void setBottomBorderColor(Color bottomBorderColor) {
322: this .bottomBorderColor = bottomBorderColor;
323: }
324:
325: /**
326: *
327: */
328: public int getBottomPadding() {
329: return JRStyleResolver.getBottomPadding(this );
330: }
331:
332: /**
333: *
334: */
335: public Integer getOwnBottomPadding() {
336: return bottomPadding;
337: }
338:
339: /**
340: *
341: */
342: public void setBottomPadding(int bottomPadding) {
343: this .bottomPadding = new Integer(bottomPadding);
344: }
345:
346: /**
347: *
348: */
349: public byte getRightBorder() {
350: return JRStyleResolver.getRightBorder(this );
351: }
352:
353: /**
354: *
355: */
356: public Byte getOwnRightBorder() {
357: return rightBorder;
358: }
359:
360: /**
361: *
362: */
363: public void setRightBorder(byte rightBorder) {
364: this .rightBorder = new Byte(rightBorder);
365: }
366:
367: /**
368: *
369: */
370: public Color getRightBorderColor() {
371: return JRStyleResolver
372: .getRightBorderColor(this , getForecolor());
373: }
374:
375: /**
376: *
377: */
378: public Color getOwnRightBorderColor() {
379: return rightBorderColor;
380: }
381:
382: /**
383: *
384: */
385: public void setRightBorderColor(Color rightBorderColor) {
386: this .rightBorderColor = rightBorderColor;
387: }
388:
389: /**
390: *
391: */
392: public int getRightPadding() {
393: return JRStyleResolver.getRightPadding(this );
394: }
395:
396: /**
397: *
398: */
399: public Integer getOwnRightPadding() {
400: return rightPadding;
401: }
402:
403: /**
404: *
405: */
406: public void setRightPadding(int rightPadding) {
407: this .rightPadding = new Integer(rightPadding);
408: }
409:
410: /**
411: *
412: */
413: public void setBorder(Byte border) {
414: this .border = border;
415: }
416:
417: /**
418: *
419: */
420: public void setPadding(Integer padding) {
421: this .padding = padding;
422: }
423:
424: /**
425: *
426: */
427: public void setTopBorder(Byte topBorder) {
428: this .topBorder = topBorder;
429: }
430:
431: /**
432: *
433: */
434: public void setTopPadding(Integer topPadding) {
435: this .topPadding = topPadding;
436: }
437:
438: /**
439: *
440: */
441: public void setLeftBorder(Byte leftBorder) {
442: this .leftBorder = leftBorder;
443: }
444:
445: /**
446: *
447: */
448: public void setLeftPadding(Integer leftPadding) {
449: this .leftPadding = leftPadding;
450: }
451:
452: /**
453: *
454: */
455: public void setBottomBorder(Byte bottomBorder) {
456: this .bottomBorder = bottomBorder;
457: }
458:
459: /**
460: *
461: */
462: public void setBottomPadding(Integer bottomPadding) {
463: this .bottomPadding = bottomPadding;
464: }
465:
466: /**
467: *
468: */
469: public void setRightBorder(Byte rightBorder) {
470: this .rightBorder = rightBorder;
471: }
472:
473: /**
474: *
475: */
476: public void setRightPadding(Integer rightPadding) {
477: this.rightPadding = rightPadding;
478: }
479:
480: }
|