KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > fill > JRTemplateText


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.fill;
29
30 import java.awt.Color JavaDoc;
31 import java.io.IOException JavaDoc;
32 import java.io.ObjectInputStream JavaDoc;
33
34 import net.sf.jasperreports.engine.JRAlignment;
35 import net.sf.jasperreports.engine.JRBox;
36 import net.sf.jasperreports.engine.JRConstants;
37 import net.sf.jasperreports.engine.JRDefaultStyleProvider;
38 import net.sf.jasperreports.engine.JRElement;
39 import net.sf.jasperreports.engine.JRFont;
40 import net.sf.jasperreports.engine.JRHyperlink;
41 import net.sf.jasperreports.engine.JRHyperlinkHelper;
42 import net.sf.jasperreports.engine.JRReportFont;
43 import net.sf.jasperreports.engine.JRStaticText;
44 import net.sf.jasperreports.engine.JRStyle;
45 import net.sf.jasperreports.engine.JRTextElement;
46 import net.sf.jasperreports.engine.JRTextField;
47 import net.sf.jasperreports.engine.util.JRStyleResolver;
48
49
50 /**
51  * @author Teodor Danciu (teodord@users.sourceforge.net)
52  * @version $Id: JRTemplateText.java 1485 2006-11-14 20:23:17 +0200 (Tue, 14 Nov 2006) teodord $
53  */

54 public class JRTemplateText extends JRTemplateElement implements JRAlignment, JRBox, JRFont
55 {
56
57
58     /**
59      *
60      */

61     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
62
63     /**
64      *
65      */

66     private Byte JavaDoc horizontalAlignment = null;
67     private Byte JavaDoc verticalAlignment = null;
68     private Byte JavaDoc rotation = null;
69     private Byte JavaDoc lineSpacing = null;
70     private Boolean JavaDoc isStyledText = null;
71     private byte hyperlinkType = JRHyperlink.HYPERLINK_TYPE_NULL;
72     private String JavaDoc linkType;
73     private byte hyperlinkTarget = JRHyperlink.HYPERLINK_TARGET_SELF;
74
75     /**
76      *
77      */

78     protected Byte JavaDoc border;
79     protected Byte JavaDoc topBorder = null;
80     protected Byte JavaDoc leftBorder = null;
81     protected Byte JavaDoc bottomBorder = null;
82     protected Byte JavaDoc rightBorder = null;
83     protected Color JavaDoc borderColor = null;
84     protected Color JavaDoc topBorderColor = null;
85     protected Color JavaDoc leftBorderColor = null;
86     protected Color JavaDoc bottomBorderColor = null;
87     protected Color JavaDoc rightBorderColor = null;
88     protected Integer JavaDoc padding;
89     protected Integer JavaDoc topPadding = null;
90     protected Integer JavaDoc leftPadding = null;
91     protected Integer JavaDoc bottomPadding = null;
92     protected Integer JavaDoc rightPadding = null;
93
94     protected JRReportFont reportFont = null;
95     protected String JavaDoc fontName = null;
96     protected Boolean JavaDoc isBold = null;
97     protected Boolean JavaDoc isItalic = null;
98     protected Boolean JavaDoc isUnderline = null;
99     protected Boolean JavaDoc isStrikeThrough = null;
100     protected Integer JavaDoc fontSize = null;
101     protected String JavaDoc pdfFontName = null;
102     protected String JavaDoc pdfEncoding = null;
103     protected Boolean JavaDoc isPdfEmbedded = null;
104     protected String JavaDoc valueClassName;
105     protected String JavaDoc pattern;
106     protected String JavaDoc formatFactoryClass;
107     protected String JavaDoc localeCode;
108     protected String JavaDoc timeZoneId;
109     
110     
111     /**
112      *
113      */

114     protected JRTemplateText(JRDefaultStyleProvider defaultStyleProvider, JRStaticText staticText)
115     {
116         super(defaultStyleProvider);
117         
118         setStaticText(staticText);
119     }
120
121     /**
122      *
123      */

124     protected JRTemplateText(JRDefaultStyleProvider defaultStyleProvider, JRTextField textField)
125     {
126         super(defaultStyleProvider);
127         
128         setTextField(textField);
129     }
130
131
132     /**
133      *
134      */

135     protected void setStaticText(JRStaticText staticText)
136     {
137         setTextElement(staticText);
138     }
139
140     /**
141      *
142      */

143     protected void setTextField(JRTextField textField)
144     {
145         setTextElement(textField);
146
147         setLinkType(textField.getLinkType());
148         hyperlinkTarget = textField.getHyperlinkTarget();
149     }
150
151     /**
152      *
153      */

154     protected void setTextElement(JRTextElement textElement)
155     {
156         super.setElement(textElement);
157
158         border = textElement.getOwnBorder();
159         topBorder = textElement.getOwnTopBorder();
160         leftBorder = textElement.getOwnLeftBorder();
161         bottomBorder = textElement.getOwnBottomBorder();
162         rightBorder = textElement.getOwnRightBorder();
163         borderColor = textElement.getOwnBorderColor();
164         topBorderColor = textElement.getOwnTopBorderColor();
165         leftBorderColor = textElement.getOwnLeftBorderColor();
166         bottomBorderColor = textElement.getOwnBottomBorderColor();
167         rightBorderColor = textElement.getOwnRightBorderColor();
168         padding = textElement.getOwnPadding();
169         topPadding = textElement.getOwnTopPadding();
170         leftPadding = textElement.getOwnLeftPadding();
171         bottomPadding = textElement.getOwnBottomPadding();
172         rightPadding = textElement.getOwnRightPadding();
173
174         reportFont = textElement.getReportFont();
175
176         fontName = textElement.getOwnFontName();
177         isBold = textElement.isOwnBold();
178         isItalic = textElement.isOwnItalic();
179         isUnderline = textElement.isOwnUnderline();
180         isStrikeThrough = textElement.isOwnStrikeThrough();
181         fontSize = textElement.getOwnFontSize();
182         pdfFontName = textElement.getOwnPdfFontName();
183         pdfEncoding = textElement.getOwnPdfEncoding();
184         isPdfEmbedded = textElement.isOwnPdfEmbedded();
185
186         horizontalAlignment = textElement.getOwnHorizontalAlignment();
187         verticalAlignment = textElement.getOwnVerticalAlignment();
188         rotation = textElement.getOwnRotation();
189         lineSpacing = textElement.getOwnLineSpacing();
190         isStyledText = textElement.isOwnStyledText();
191     }
192
193     
194     /**
195      *
196      */

197     protected JRFont getBaseFont()
198     {
199         if (reportFont != null)
200             return reportFont;
201         if (defaultStyleProvider != null)
202             return defaultStyleProvider.getDefaultFont();
203         return null;
204     }
205     
206     /**
207      *
208      */

209     public byte getMode()
210     {
211         return JRStyleResolver.getMode(this, JRElement.MODE_TRANSPARENT);
212     }
213         
214     /**
215      * @deprecated Replaced by {@link #getHorizontalAlignment()}.
216      */

217     public byte getTextAlignment()
218     {
219         return getHorizontalAlignment();
220     }
221         
222     /**
223      *
224      */

225     public byte getHorizontalAlignment()
226     {
227         return JRStyleResolver.getHorizontalAlignment(this);
228     }
229         
230     /**
231      *
232      */

233     public Byte JavaDoc getOwnHorizontalAlignment()
234     {
235         return horizontalAlignment;
236     }
237         
238     /**
239      *
240      */

241     public void setHorizontalAlignment(byte horizontalAlignment)
242     {
243         this.horizontalAlignment = new Byte JavaDoc(horizontalAlignment);
244     }
245
246     /**
247      *
248      */

249     public void setHorizontalAlignment(Byte JavaDoc horizontalAlignment)
250     {
251         this.horizontalAlignment = horizontalAlignment;
252     }
253
254     /**
255      *
256      */

257     public byte getVerticalAlignment()
258     {
259         return JRStyleResolver.getVerticalAlignment(this);
260     }
261         
262     /**
263      *
264      */

265     public Byte JavaDoc getOwnVerticalAlignment()
266     {
267         return verticalAlignment;
268     }
269         
270     /**
271      *
272      */

273     public void setVerticalAlignment(byte verticalAlignment)
274     {
275         this.verticalAlignment = new Byte JavaDoc(verticalAlignment);
276     }
277
278     /**
279      *
280      */

281     public void setVerticalAlignment(Byte JavaDoc verticalAlignment)
282     {
283         this.verticalAlignment = verticalAlignment;
284     }
285
286     /**
287      *
288      */

289     public byte getRotation()
290     {
291         return JRStyleResolver.getRotation(this);
292     }
293         
294     /**
295      *
296      */

297     public Byte JavaDoc getOwnRotation()
298     {
299         return rotation;
300     }
301         
302     /**
303      *
304      */

305     public byte getLineSpacing()
306     {
307         return JRStyleResolver.getLineSpacing(this);
308     }
309         
310     /**
311      *
312      */

313     public Byte JavaDoc getOwnLineSpacing()
314     {
315         return lineSpacing;
316     }
317         
318     /**
319      *
320      */

321     public boolean isStyledText()
322     {
323         return JRStyleResolver.isStyledText(this);
324     }
325         
326     /**
327      *
328      */

329     public Boolean JavaDoc isOwnStyledText()
330     {
331         return isStyledText;
332     }
333         
334     /**
335      * @deprecated
336      */

337     public JRBox getBox()
338     {
339         return this;
340     }
341         
342     /**
343      * @deprecated
344      */

345     public JRFont getFont()
346     {
347         return this;
348     }
349
350     
351     /**
352      * Retrieves the hyperlink type for the element.
353      * <p>
354      * The actual hyperlink type is determined by {@link #getLinkType() getLinkType()}.
355      * This method can is used to determine whether the hyperlink type is one of the
356      * built-in types or a custom type.
357      * When hyperlink is of custom type, {@link JRHyperlink#HYPERLINK_TYPE_CUSTOM HYPERLINK_TYPE_CUSTOM} is returned.
358      * </p>
359      * @return one of the hyperlink type constants
360      * @see #getLinkType()
361      */

362     public byte getHyperlinkType()
363     {
364         return JRHyperlinkHelper.getHyperlinkType(getLinkType());
365     }
366
367     /**
368      *
369      */

370     public byte getHyperlinkTarget()
371     {
372         return hyperlinkTarget;
373     }
374
375     /**
376      *
377      */

378     public byte getBorder()
379     {
380         return JRStyleResolver.getBorder(this);
381     }
382
383     public Byte JavaDoc getOwnBorder()
384     {
385         return border;
386     }
387
388     /**
389      *
390      */

391     public void setBorder(byte border)
392     {
393         this.border = new Byte JavaDoc(border);
394     }
395
396     /**
397      *
398      */

399     public Color JavaDoc getBorderColor()
400     {
401         return JRStyleResolver.getBorderColor(this, getForecolor());
402     }
403
404     public Color JavaDoc getOwnBorderColor()
405     {
406         return borderColor;
407     }
408
409     /**
410      *
411      */

412     public void setBorderColor(Color JavaDoc borderColor)
413     {
414         this.borderColor = borderColor;
415     }
416
417     /**
418      *
419      */

420     public int getPadding()
421     {
422         return JRStyleResolver.getPadding(this);
423     }
424
425     public Integer JavaDoc getOwnPadding()
426     {
427         return padding;
428     }
429
430     /**
431      *
432      */

433     public void setPadding(int padding)
434     {
435         this.padding = new Integer JavaDoc(padding);
436     }
437
438     /**
439      *
440      */

441     public byte getTopBorder()
442     {
443         return JRStyleResolver.getTopBorder(this);
444     }
445
446     /**
447      *
448      */

449     public Byte JavaDoc getOwnTopBorder()
450     {
451         return topBorder;
452     }
453
454     /**
455      *
456      */

457     public void setTopBorder(byte topBorder)
458     {
459         this.topBorder = new Byte JavaDoc(topBorder);
460     }
461
462     /**
463      *
464      */

465     public Color JavaDoc getTopBorderColor()
466     {
467         return JRStyleResolver.getTopBorderColor(this, getForecolor());
468     }
469
470     /**
471      *
472      */

473     public Color JavaDoc getOwnTopBorderColor()
474     {
475         return topBorderColor;
476     }
477
478     /**
479      *
480      */

481     public void setTopBorderColor(Color JavaDoc topBorderColor)
482     {
483         this.topBorderColor = topBorderColor;
484     }
485
486     /**
487      *
488      */

489     public int getTopPadding()
490     {
491         return JRStyleResolver.getTopPadding(this);
492     }
493
494     /**
495      *
496      */

497     public Integer JavaDoc getOwnTopPadding()
498     {
499         return topPadding;
500     }
501
502     /**
503      *
504      */

505     public void setTopPadding(int topPadding)
506     {
507         this.topPadding = new Integer JavaDoc(topPadding);
508     }
509
510     /**
511      *
512      */

513     public byte getLeftBorder()
514     {
515         return JRStyleResolver.getLeftBorder(this);
516     }
517
518     /**
519      *
520      */

521     public Byte JavaDoc getOwnLeftBorder()
522     {
523         return leftBorder;
524     }
525
526     /**
527      *
528      */

529     public void setLeftBorder(byte leftBorder)
530     {
531         this.leftBorder = new Byte JavaDoc(leftBorder);
532     }
533
534     /**
535      *
536      */

537     public Color JavaDoc getLeftBorderColor()
538     {
539         return JRStyleResolver.getLeftBorderColor(this, getForecolor());
540     }
541
542     /**
543      *
544      */

545     public Color JavaDoc getOwnLeftBorderColor()
546     {
547         return leftBorderColor;
548     }
549
550     /**
551      *
552      */

553     public void setLeftBorderColor(Color JavaDoc leftBorderColor)
554     {
555         this.leftBorderColor = leftBorderColor;
556     }
557
558     /**
559      *
560      */

561     public int getLeftPadding()
562     {
563         return JRStyleResolver.getLeftPadding(this);
564     }
565
566     /**
567      *
568      */

569     public Integer JavaDoc getOwnLeftPadding()
570     {
571         return leftPadding;
572     }
573
574     /**
575      *
576      */

577     public void setLeftPadding(int leftPadding)
578     {
579         this.leftPadding = new Integer JavaDoc(leftPadding);
580     }
581
582     /**
583      *
584      */

585     public byte getBottomBorder()
586     {
587         return JRStyleResolver.getBottomBorder(this);
588     }
589
590     /**
591      *
592      */

593     public Byte JavaDoc getOwnBottomBorder()
594     {
595         return bottomBorder;
596     }
597
598     /**
599      *
600      */

601     public void setBottomBorder(byte bottomBorder)
602     {
603         this.bottomBorder = new Byte JavaDoc(bottomBorder);
604     }
605
606     /**
607      *
608      */

609     public Color JavaDoc getBottomBorderColor()
610     {
611         return JRStyleResolver.getBottomBorderColor(this, getForecolor());
612     }
613
614     /**
615      *
616      */

617     public Color JavaDoc getOwnBottomBorderColor()
618     {
619         return bottomBorderColor;
620     }
621
622     /**
623      *
624      */

625     public void setBottomBorderColor(Color JavaDoc bottomBorderColor)
626     {
627         this.bottomBorderColor = bottomBorderColor;
628     }
629
630     /**
631      *
632      */

633     public int getBottomPadding()
634     {
635         return JRStyleResolver.getBottomPadding(this);
636     }
637
638     /**
639      *
640      */

641     public Integer JavaDoc getOwnBottomPadding()
642     {
643         return bottomPadding;
644     }
645
646     /**
647      *
648      */

649     public void setBottomPadding(int bottomPadding)
650     {
651         this.bottomPadding = new Integer JavaDoc(bottomPadding);
652     }
653
654     /**
655      *
656      */

657     public byte getRightBorder()
658     {
659         return JRStyleResolver.getRightBorder(this);
660     }
661
662     /**
663      *
664      */

665     public Byte JavaDoc getOwnRightBorder()
666     {
667         return rightBorder;
668     }
669
670     /**
671      *
672      */

673     public void setRightBorder(byte rightBorder)
674     {
675         this.rightBorder = new Byte JavaDoc(rightBorder);
676     }
677
678     /**
679      *
680      */

681     public Color JavaDoc getRightBorderColor()
682     {
683         return JRStyleResolver.getRightBorderColor(this, getForecolor());
684     }
685
686     /**
687      *
688      */

689     public Color JavaDoc getOwnRightBorderColor()
690     {
691         return rightBorderColor;
692     }
693
694     /**
695      *
696      */

697     public void setRightBorderColor(Color JavaDoc rightBorderColor)
698     {
699         this.rightBorderColor = rightBorderColor;
700     }
701
702     /**
703      *
704      */

705     public int getRightPadding()
706     {
707         return JRStyleResolver.getRightPadding(this);
708     }
709
710     /**
711      *
712      */

713     public Integer JavaDoc getOwnRightPadding()
714     {
715         return rightPadding;
716     }
717
718     /**
719      *
720      */

721     public void setRightPadding(int rightPadding)
722     {
723         this.rightPadding = new Integer JavaDoc(rightPadding);
724     }
725
726
727     /**
728      *
729      */

730     public JRReportFont getReportFont()
731     {
732         return reportFont;
733     }
734
735     /**
736      *
737      */

738     public void setReportFont(JRReportFont reportFont)
739     {
740         this.reportFont = reportFont;
741     }
742
743     /**
744      *
745      */

746     public String JavaDoc getFontName()
747     {
748         return JRStyleResolver.getFontName(this);
749     }
750
751     /**
752      *
753      */

754     public String JavaDoc getOwnFontName()
755     {
756         return fontName;
757     }
758
759     /**
760      *
761      */

762     public void setFontName(String JavaDoc fontName)
763     {
764         this.fontName = fontName;
765     }
766
767
768     /**
769      *
770      */

771     public boolean isBold()
772     {
773         return JRStyleResolver.isBold(this);
774     }
775
776     /**
777      *
778      */

779     public Boolean JavaDoc isOwnBold()
780     {
781         return isBold;
782     }
783
784     /**
785      *
786      */

787     public void setBold(boolean isBold)
788     {
789         setBold(isBold ? Boolean.TRUE : Boolean.FALSE);
790     }
791
792     /**
793      * Alternative setBold method which allows also to reset
794      * the "own" isBold property.
795      */

796     public void setBold(Boolean JavaDoc isBold)
797     {
798         this.isBold = isBold;
799     }
800
801
802     /**
803      *
804      */

805     public boolean isItalic()
806     {
807         return JRStyleResolver.isItalic(this);
808     }
809
810     /**
811      *
812      */

813     public Boolean JavaDoc isOwnItalic()
814     {
815         return isItalic;
816     }
817
818     /**
819      *
820      */

821     public void setItalic(boolean isItalic)
822     {
823         setItalic(isItalic ? Boolean.TRUE : Boolean.FALSE);
824     }
825
826     /**
827      * Alternative setItalic method which allows also to reset
828      * the "own" isItalic property.
829      */

830     public void setItalic(Boolean JavaDoc isItalic)
831     {
832         this.isItalic = isItalic;
833     }
834
835     /**
836      *
837      */

838     public boolean isUnderline()
839     {
840         return JRStyleResolver.isUnderline(this);
841     }
842
843     /**
844      *
845      */

846     public Boolean JavaDoc isOwnUnderline()
847     {
848         return isUnderline;
849     }
850
851     /**
852      *
853      */

854     public void setUnderline(boolean isUnderline)
855     {
856         setUnderline(isUnderline ? Boolean.TRUE : Boolean.FALSE);
857     }
858
859     /**
860      * Alternative setUnderline method which allows also to reset
861      * the "own" isUnderline property.
862      */

863     public void setUnderline(Boolean JavaDoc isUnderline)
864     {
865         this.isUnderline = isUnderline;
866     }
867
868     /**
869      *
870      */

871     public boolean isStrikeThrough()
872     {
873         return JRStyleResolver.isStrikeThrough(this);
874     }
875
876     /**
877      *
878      */

879     public Boolean JavaDoc isOwnStrikeThrough()
880     {
881         return isStrikeThrough;
882     }
883
884     /**
885      *
886      */

887     public void setStrikeThrough(boolean isStrikeThrough)
888     {
889         setStrikeThrough(isStrikeThrough ? Boolean.TRUE : Boolean.FALSE);
890     }
891
892     /**
893      * Alternative setStrikeThrough method which allows also to reset
894      * the "own" isStrikeThrough property.
895      */

896     public void setStrikeThrough(Boolean JavaDoc isStrikeThrough)
897     {
898         this.isStrikeThrough = isStrikeThrough;
899     }
900
901     /**
902      *
903      */

904     public int getFontSize()
905     {
906         return JRStyleResolver.getFontSize(this);
907     }
908
909     /**
910      *
911      */

912     public Integer JavaDoc getOwnFontSize()
913     {
914         return fontSize;
915     }
916
917     /**
918      *
919      */

920     public void setFontSize(int fontSize)
921     {
922         setFontSize(new Integer JavaDoc(fontSize));
923     }
924
925     /**
926      * Alternative setSize method which allows also to reset
927      * the "own" size property.
928      */

929     public void setFontSize(Integer JavaDoc fontSize)
930     {
931         this.fontSize = fontSize;
932     }
933
934     /**
935      * @deprecated Replaced by {@link #getFontSize()}.
936      */

937     public int getSize()
938     {
939         return getFontSize();
940     }
941
942     /**
943      * @deprecated Replaced by {@link #getOwnFontSize()}.
944      */

945     public Integer JavaDoc getOwnSize()
946     {
947         return getOwnFontSize();
948     }
949
950     /**
951      * @deprecated Replaced by {@link #setFontSize(int)}.
952      */

953     public void setSize(int size)
954     {
955         setFontSize(size);
956     }
957
958     /**
959      * @deprecated Replaced by {@link #setFontSize(Integer)}.
960      */

961     public void setSize(Integer JavaDoc size)
962     {
963         setFontSize(size);
964     }
965
966     /**
967      *
968      */

969     public String JavaDoc getPdfFontName()
970     {
971         return JRStyleResolver.getPdfFontName(this);
972     }
973
974     /**
975      *
976      */

977     public String JavaDoc getOwnPdfFontName()
978     {
979         return pdfFontName;
980     }
981
982     /**
983      *
984      */

985     public void setPdfFontName(String JavaDoc pdfFontName)
986     {
987         this.pdfFontName = pdfFontName;
988     }
989
990
991     /**
992      *
993      */

994     public String JavaDoc getPdfEncoding()
995     {
996         return JRStyleResolver.getPdfEncoding(this);
997     }
998
999     /**
1000     *
1001     */

1002    public String JavaDoc getOwnPdfEncoding()
1003    {
1004        return pdfEncoding;
1005    }
1006
1007    /**
1008     *
1009     */

1010    public void setPdfEncoding(String JavaDoc pdfEncoding)
1011    {
1012        this.pdfEncoding = pdfEncoding;
1013    }
1014
1015
1016    /**
1017     *
1018     */

1019    public boolean isPdfEmbedded()
1020    {
1021        return JRStyleResolver.isPdfEmbedded(this);
1022    }
1023
1024    /**
1025     *
1026     */

1027    public Boolean JavaDoc isOwnPdfEmbedded()
1028    {
1029        return isPdfEmbedded;
1030    }
1031
1032    /**
1033     *
1034     */

1035    public void setPdfEmbedded(boolean isPdfEmbedded)
1036    {
1037        setPdfEmbedded(isPdfEmbedded ? Boolean.TRUE : Boolean.FALSE);
1038    }
1039
1040    /**
1041     * Alternative setPdfEmbedded method which allows also to reset
1042     * the "own" isPdfEmbedded property.
1043     */

1044    public void setPdfEmbedded(Boolean JavaDoc isPdfEmbedded)
1045    {
1046        this.isPdfEmbedded = isPdfEmbedded;
1047    }
1048
1049    /**
1050     *
1051     */

1052    public void setBorder(Byte JavaDoc border)
1053    {
1054        this.border = border;
1055    }
1056
1057    /**
1058     *
1059     */

1060    public void setPadding(Integer JavaDoc padding)
1061    {
1062        this.padding = padding;
1063    }
1064
1065    /**
1066     *
1067     */

1068    public void setTopBorder(Byte JavaDoc topBorder)
1069    {
1070        this.topBorder = topBorder;
1071    }
1072
1073    /**
1074     *
1075     */

1076    public void setTopPadding(Integer JavaDoc topPadding)
1077    {
1078        this.topPadding = topPadding;
1079    }
1080
1081    /**
1082     *
1083     */

1084    public void setLeftBorder(Byte JavaDoc leftBorder)
1085    {
1086        this.leftBorder = leftBorder;
1087    }
1088
1089    /**
1090     *
1091     */

1092    public void setLeftPadding(Integer JavaDoc leftPadding)
1093    {
1094        this.leftPadding = leftPadding;
1095    }
1096
1097    /**
1098     *
1099     */

1100    public void setBottomBorder(Byte JavaDoc bottomBorder)
1101    {
1102        this.bottomBorder = bottomBorder;
1103    }
1104
1105    /**
1106     *
1107     */

1108    public void setBottomPadding(Integer JavaDoc bottomPadding)
1109    {
1110        this.bottomPadding = bottomPadding;
1111    }
1112
1113    /**
1114     *
1115     */

1116    public void setRightBorder(Byte JavaDoc rightBorder)
1117    {
1118        this.rightBorder = rightBorder;
1119    }
1120
1121    /**
1122     *
1123     */

1124    public void setRightPadding(Integer JavaDoc rightPadding)
1125    {
1126        this.rightPadding = rightPadding;
1127    }
1128
1129    /**
1130     *
1131     */

1132    public JRStyle getStyle()
1133    {
1134        return parentStyle;
1135    }
1136
1137    
1138    public String JavaDoc getPattern()
1139    {
1140        return pattern;
1141    }
1142
1143    
1144    public void setPattern(String JavaDoc pattern)
1145    {
1146        this.pattern = pattern;
1147    }
1148
1149    
1150    public String JavaDoc getValueClassName()
1151    {
1152        return valueClassName;
1153    }
1154
1155    
1156    public void setValueClassName(String JavaDoc valueClassName)
1157    {
1158        this.valueClassName = valueClassName;
1159    }
1160
1161    
1162    public String JavaDoc getFormatFactoryClass()
1163    {
1164        return formatFactoryClass;
1165    }
1166
1167    
1168    public void setFormatFactoryClass(String JavaDoc formatFactoryClass)
1169    {
1170        this.formatFactoryClass = formatFactoryClass;
1171    }
1172
1173    
1174    public String JavaDoc getLocaleCode()
1175    {
1176        return localeCode;
1177    }
1178
1179    
1180    public void setLocaleCode(String JavaDoc localeCode)
1181    {
1182        this.localeCode = localeCode;
1183    }
1184
1185    
1186    public String JavaDoc getTimeZoneId()
1187    {
1188        return timeZoneId;
1189    }
1190
1191    
1192    public void setTimeZoneId(String JavaDoc timeZoneId)
1193    {
1194        this.timeZoneId = timeZoneId;
1195    }
1196
1197    
1198    /**
1199     * Returns the hyperlink type.
1200     * <p>
1201     * The type can be one of the built-in types
1202     * (Reference, LocalAnchor, LocalPage, RemoteAnchor, RemotePage),
1203     * or can be an arbitrary type.
1204     * </p>
1205     * @return the hyperlink type
1206     */

1207    public String JavaDoc getLinkType()
1208    {
1209        return linkType;
1210    }
1211
1212
1213    /**
1214     * Sets the hyperlink type.
1215     * <p>
1216     * The type can be one of the built-in types
1217     * (Reference, LocalAnchor, LocalPage, RemoteAnchor, RemotePage),
1218     * or can be an arbitrary type.
1219     * </p>
1220     * @param linkType the hyperlink type
1221     */

1222    public void setLinkType(String JavaDoc linkType)
1223    {
1224        this.linkType = linkType;
1225    }
1226    
1227    
1228    private void readObject(ObjectInputStream JavaDoc in) throws IOException JavaDoc, ClassNotFoundException JavaDoc
1229    {
1230        in.defaultReadObject();
1231        normalizeLinkType();
1232    }
1233
1234
1235    protected void normalizeLinkType()
1236    {
1237        if (linkType == null)
1238        {
1239             linkType = JRHyperlinkHelper.getLinkType(hyperlinkType);
1240        }
1241        hyperlinkType = JRHyperlink.HYPERLINK_TYPE_NULL;
1242    }
1243
1244}
1245
Popular Tags