KickJava   Java API By Example, From Geeks To Geeks.

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


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.io.IOException JavaDoc;
32 import java.io.ObjectInputStream JavaDoc;
33
34 import net.sf.jasperreports.engine.JRAnchor;
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.JRPrintHyperlinkParameter;
43 import net.sf.jasperreports.engine.JRPrintHyperlinkParameters;
44 import net.sf.jasperreports.engine.JRPrintText;
45 import net.sf.jasperreports.engine.JRReportFont;
46 import net.sf.jasperreports.engine.util.JRStyleResolver;
47
48
49 /**
50  * @author Teodor Danciu (teodord@users.sourceforge.net)
51  * @version $Id: JRBasePrintText.java 1485 2006-11-14 20:23:17 +0200 (Tue, 14 Nov 2006) teodord $
52  */

53 public class JRBasePrintText extends JRBasePrintElement implements JRPrintText
54 {
55
56
57     /**
58      *
59      */

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

65     protected String JavaDoc text = "";
66     protected float lineSpacingFactor = 0;
67     protected float leadingOffset = 0;
68     protected Byte JavaDoc horizontalAlignment = null;
69     protected Byte JavaDoc verticalAlignment = null;
70     protected Byte JavaDoc rotation = null;
71     protected byte runDirection = RUN_DIRECTION_LTR;
72     protected float textHeight = 0;
73     protected Byte JavaDoc lineSpacing = null;
74     protected Boolean JavaDoc isStyledText = null;
75     protected String JavaDoc anchorName = null;
76     protected byte hyperlinkType = JRHyperlink.HYPERLINK_TYPE_NULL;
77     private String JavaDoc linkType;
78     protected byte hyperlinkTarget = JRHyperlink.HYPERLINK_TARGET_SELF;
79     protected String JavaDoc hyperlinkReference = null;
80     protected String JavaDoc hyperlinkAnchor = null;
81     protected Integer JavaDoc hyperlinkPage = null;
82     protected String JavaDoc hyperlinkTooltip;
83     protected JRPrintHyperlinkParameters hyperlinkParameters;
84
85     /**
86      * The bookmark level for the anchor associated with this field.
87      * @see JRAnchor#getBookmarkLevel()
88      */

89     protected int bookmarkLevel = JRAnchor.NO_BOOKMARK;
90
91     /**
92      *
93      */

94     protected Byte JavaDoc border;
95     protected Byte JavaDoc topBorder = null;
96     protected Byte JavaDoc leftBorder = null;
97     protected Byte JavaDoc bottomBorder = null;
98     protected Byte JavaDoc rightBorder = null;
99     protected Color JavaDoc borderColor = null;
100     protected Color JavaDoc topBorderColor = null;
101     protected Color JavaDoc leftBorderColor = null;
102     protected Color JavaDoc bottomBorderColor = null;
103     protected Color JavaDoc rightBorderColor = null;
104     protected Integer JavaDoc padding;
105     protected Integer JavaDoc topPadding = null;
106     protected Integer JavaDoc leftPadding = null;
107     protected Integer JavaDoc bottomPadding = null;
108     protected Integer JavaDoc rightPadding = null;
109
110     protected JRReportFont reportFont = null;
111     protected String JavaDoc fontName = null;
112     protected Boolean JavaDoc isBold = null;
113     protected Boolean JavaDoc isItalic = null;
114     protected Boolean JavaDoc isUnderline = null;
115     protected Boolean JavaDoc isStrikeThrough = null;
116     protected Integer JavaDoc fontSize = null;
117     protected String JavaDoc pdfFontName = null;
118     protected String JavaDoc pdfEncoding = null;
119     protected Boolean JavaDoc isPdfEmbedded = null;
120
121     protected String JavaDoc valueClassName;
122     protected String JavaDoc pattern;
123     protected String JavaDoc formatFactoryClass;
124     protected String JavaDoc localeCode;
125     protected String JavaDoc timeZoneId;
126     
127     /**
128      *
129      */

130     public JRBasePrintText(JRDefaultStyleProvider defaultStyleProvider)
131     {
132         super(defaultStyleProvider);
133     }
134
135
136     /**
137      *
138      */

139     public byte getMode()
140     {
141         return JRStyleResolver.getMode(this, JRElement.MODE_TRANSPARENT);
142     }
143         
144     /**
145      *
146      */

147     public String JavaDoc getText()
148     {
149         return text;
150     }
151         
152     /**
153      *
154      */

155     public void setText(String JavaDoc text)
156     {
157         this.text = text;
158     }
159
160     /**
161      *
162      */

163     public float getLineSpacingFactor()
164     {
165         return lineSpacingFactor;
166     }
167         
168     /**
169      *
170      */

171     public void setLineSpacingFactor(float lineSpacingFactor)
172     {
173         this.lineSpacingFactor = lineSpacingFactor;
174     }
175
176     /**
177      *
178      */

179     public float getLeadingOffset()
180     {
181         return leadingOffset;
182     }
183         
184     /**
185      *
186      */

187     public void setLeadingOffset(float leadingOffset)
188     {
189         this.leadingOffset = leadingOffset;
190     }
191
192     /**
193      * @deprecated Replaced by {@link #getHorizontalAlignment()}.
194      */

195     public byte getTextAlignment()
196     {
197         return getHorizontalAlignment();
198     }
199         
200     /**
201      * @deprecated Replaced by {@link #setHorizontalAlignment(byte)}.
202      */

203     public void setTextAlignment(byte horizontalAlignment)
204     {
205         setHorizontalAlignment(horizontalAlignment);
206     }
207
208     /**
209      *
210      */

211     public byte getHorizontalAlignment()
212     {
213         return JRStyleResolver.getHorizontalAlignment(this);
214     }
215         
216     public Byte JavaDoc getOwnHorizontalAlignment()
217     {
218         return horizontalAlignment;
219     }
220
221     /**
222      *
223      */

224     public void setHorizontalAlignment(byte horizontalAlignment)
225     {
226         this.horizontalAlignment = new Byte JavaDoc(horizontalAlignment);
227     }
228
229     /**
230      *
231      */

232     public void setHorizontalAlignment(Byte JavaDoc horizontalAlignment)
233     {
234         this.horizontalAlignment = horizontalAlignment;
235     }
236
237     /**
238      *
239      */

240     public byte getVerticalAlignment()
241     {
242         return JRStyleResolver.getVerticalAlignment(this);
243     }
244         
245     public Byte JavaDoc getOwnVerticalAlignment()
246     {
247         return verticalAlignment;
248     }
249
250     /**
251      *
252      */

253     public void setVerticalAlignment(byte verticalAlignment)
254     {
255         this.verticalAlignment = new Byte JavaDoc(verticalAlignment);
256     }
257
258     /**
259      *
260      */

261     public void setVerticalAlignment(Byte JavaDoc verticalAlignment)
262     {
263         this.verticalAlignment = verticalAlignment;
264     }
265
266     /**
267      *
268      */

269     public byte getRotation()
270     {
271         return JRStyleResolver.getRotation(this);
272     }
273         
274     public Byte JavaDoc getOwnRotation()
275     {
276         return rotation;
277     }
278
279     /**
280      *
281      */

282     public void setRotation(byte rotation)
283     {
284         this.rotation = new Byte JavaDoc(rotation);
285     }
286
287     /**
288      *
289      */

290     public void setRotation(Byte JavaDoc rotation)
291     {
292         this.rotation = rotation;
293     }
294
295     /**
296      *
297      */

298     public byte getRunDirection()
299     {
300         return runDirection;
301     }
302         
303     /**
304      *
305      */

306     public void setRunDirection(byte runDirection)
307     {
308         this.runDirection = runDirection;
309     }
310
311     /**
312      *
313      */

314     public float getTextHeight()
315     {
316         return textHeight;
317     }
318         
319     /**
320      *
321      */

322     public void setTextHeight(float textHeight)
323     {
324         this.textHeight = textHeight;
325     }
326
327     /**
328      *
329      */

330     public byte getLineSpacing()
331     {
332         return JRStyleResolver.getLineSpacing(this);
333     }
334         
335     public Byte JavaDoc getOwnLineSpacing()
336     {
337         return lineSpacing;
338     }
339
340     /**
341      *
342      */

343     public void setLineSpacing(byte lineSpacing)
344     {
345         this.lineSpacing = new Byte JavaDoc(lineSpacing);
346     }
347
348     /**
349      *
350      */

351     public void setLineSpacing(Byte JavaDoc lineSpacing)
352     {
353         this.lineSpacing = lineSpacing;
354     }
355
356     /**
357      *
358      */

359     public boolean isStyledText()
360     {
361         return JRStyleResolver.isStyledText(this);
362     }
363         
364     public Boolean JavaDoc isOwnStyledText()
365     {
366         return isStyledText;
367     }
368
369     /**
370      *
371      */

372     public void setStyledText(boolean isStyledText)
373     {
374         setStyledText(isStyledText ? Boolean.TRUE : Boolean.FALSE);
375     }
376
377     /**
378      *
379      */

380     public void setStyledText(Boolean JavaDoc isStyledText)
381     {
382         this.isStyledText = isStyledText;
383     }
384
385     /**
386      * @deprecated
387      */

388     public JRBox getBox()
389     {
390         return this;
391     }
392
393     /**
394      * @deprecated
395      */

396     public void setBox(JRBox box)
397     {
398         border = box.getOwnBorder();
399         topBorder = box.getOwnTopBorder();
400         leftBorder = box.getOwnLeftBorder();
401         bottomBorder = box.getOwnBottomBorder();
402         rightBorder = box.getOwnRightBorder();
403         borderColor = box.getOwnBorderColor();
404         topBorderColor = box.getOwnTopBorderColor();
405         leftBorderColor = box.getOwnLeftBorderColor();
406         bottomBorderColor = box.getOwnBottomBorderColor();
407         rightBorderColor = box.getOwnRightBorderColor();
408         padding = box.getOwnPadding();
409         topPadding = box.getOwnTopPadding();
410         leftPadding = box.getOwnLeftPadding();
411         bottomPadding = box.getOwnBottomPadding();
412         rightPadding = box.getOwnRightPadding();
413     }
414
415     /**
416      * @deprecated
417      */

418     public JRFont getFont()
419     {
420         return this;
421     }
422
423     /**
424      * @deprecated
425      */

426     public void setFont(JRFont font)
427     {
428         reportFont = font.getReportFont();
429         
430         fontName = font.getOwnFontName();
431         isBold = font.isOwnBold();
432         isItalic = font.isOwnItalic();
433         isUnderline = font.isOwnUnderline();
434         isStrikeThrough = font.isOwnStrikeThrough();
435         fontSize = font.getOwnSize();
436         pdfFontName = font.getOwnPdfFontName();
437         pdfEncoding = font.getOwnPdfEncoding();
438         isPdfEmbedded = font.isOwnPdfEmbedded();
439     }
440
441     /**
442      *
443      */

444     public String JavaDoc getAnchorName()
445     {
446         return anchorName;
447     }
448         
449     /**
450      *
451      */

452     public void setAnchorName(String JavaDoc anchorName)
453     {
454         this.anchorName = anchorName;
455     }
456         
457     /**
458      *
459      */

460     public byte getHyperlinkType()
461     {
462         return JRHyperlinkHelper.getHyperlinkType(getLinkType());
463     }
464         
465     /**
466      *
467      */

468     public void setHyperlinkType(byte hyperlinkType)
469     {
470         setLinkType(JRHyperlinkHelper.getLinkType(hyperlinkType));
471     }
472
473     /**
474      *
475      */

476     public byte getHyperlinkTarget()
477     {
478         return hyperlinkTarget;
479     }
480         
481     /**
482      *
483      */

484     public void setHyperlinkTarget(byte hyperlinkTarget)
485     {
486         this.hyperlinkTarget = hyperlinkTarget;
487     }
488
489     /**
490      *
491      */

492     public String JavaDoc getHyperlinkReference()
493     {
494         return hyperlinkReference;
495     }
496         
497     /**
498      *
499      */

500     public void setHyperlinkReference(String JavaDoc hyperlinkReference)
501     {
502         this.hyperlinkReference = hyperlinkReference;
503     }
504         
505     /**
506      *
507      */

508     public String JavaDoc getHyperlinkAnchor()
509     {
510         return hyperlinkAnchor;
511     }
512         
513     /**
514      *
515      */

516     public void setHyperlinkAnchor(String JavaDoc hyperlinkAnchor)
517     {
518         this.hyperlinkAnchor = hyperlinkAnchor;
519     }
520         
521     /**
522      *
523      */

524     public Integer JavaDoc getHyperlinkPage()
525     {
526         return hyperlinkPage;
527     }
528         
529     /**
530      *
531      */

532     public void setHyperlinkPage(Integer JavaDoc hyperlinkPage)
533     {
534         this.hyperlinkPage = hyperlinkPage;
535     }
536         
537     /**
538      *
539      */

540     public void setHyperlinkPage(String JavaDoc hyperlinkPage)
541     {
542         this.hyperlinkPage = new Integer JavaDoc(hyperlinkPage);
543     }
544
545
546     public int getBookmarkLevel()
547     {
548         return bookmarkLevel;
549     }
550
551
552     public void setBookmarkLevel(int bookmarkLevel)
553     {
554         this.bookmarkLevel = bookmarkLevel;
555     }
556
557     /**
558      *
559      */

560     public byte getBorder()
561     {
562         return JRStyleResolver.getBorder(this);
563     }
564
565     public Byte JavaDoc getOwnBorder()
566     {
567         return border;
568     }
569
570     /**
571      *
572      */

573     public void setBorder(byte border)
574     {
575         this.border = new Byte JavaDoc(border);
576     }
577
578     /**
579      *
580      */

581     public Color JavaDoc getBorderColor()
582     {
583         return JRStyleResolver.getBorderColor(this, getForecolor());
584     }
585
586     public Color JavaDoc getOwnBorderColor()
587     {
588         return borderColor;
589     }
590
591     /**
592      *
593      */

594     public void setBorderColor(Color JavaDoc borderColor)
595     {
596         this.borderColor = borderColor;
597     }
598
599     /**
600      *
601      */

602     public int getPadding()
603     {
604         return JRStyleResolver.getPadding(this);
605     }
606
607     public Integer JavaDoc getOwnPadding()
608     {
609         return padding;
610     }
611
612     /**
613      *
614      */

615     public void setPadding(int padding)
616     {
617         this.padding = new Integer JavaDoc(padding);
618     }
619
620     /**
621      *
622      */

623     public byte getTopBorder()
624     {
625         return JRStyleResolver.getTopBorder(this);
626     }
627
628     /**
629      *
630      */

631     public Byte JavaDoc getOwnTopBorder()
632     {
633         return topBorder;
634     }
635
636     /**
637      *
638      */

639     public void setTopBorder(byte topBorder)
640     {
641         this.topBorder = new Byte JavaDoc(topBorder);
642     }
643
644     /**
645      *
646      */

647     public Color JavaDoc getTopBorderColor()
648     {
649         return JRStyleResolver.getTopBorderColor(this, getForecolor());
650     }
651
652     /**
653      *
654      */

655     public Color JavaDoc getOwnTopBorderColor()
656     {
657         return topBorderColor;
658     }
659
660     /**
661      *
662      */

663     public void setTopBorderColor(Color JavaDoc topBorderColor)
664     {
665         this.topBorderColor = topBorderColor;
666     }
667
668     /**
669      *
670      */

671     public int getTopPadding()
672     {
673         return JRStyleResolver.getTopPadding(this);
674     }
675
676     /**
677      *
678      */

679     public Integer JavaDoc getOwnTopPadding()
680     {
681         return topPadding;
682     }
683
684     /**
685      *
686      */

687     public void setTopPadding(int topPadding)
688     {
689         this.topPadding = new Integer JavaDoc(topPadding);
690     }
691
692     /**
693      *
694      */

695     public byte getLeftBorder()
696     {
697         return JRStyleResolver.getLeftBorder(this);
698     }
699
700     /**
701      *
702      */

703     public Byte JavaDoc getOwnLeftBorder()
704     {
705         return leftBorder;
706     }
707
708     /**
709      *
710      */

711     public void setLeftBorder(byte leftBorder)
712     {
713         this.leftBorder = new Byte JavaDoc(leftBorder);
714     }
715
716     /**
717      *
718      */

719     public Color JavaDoc getLeftBorderColor()
720     {
721         return JRStyleResolver.getLeftBorderColor(this, getForecolor());
722     }
723
724     /**
725      *
726      */

727     public Color JavaDoc getOwnLeftBorderColor()
728     {
729         return leftBorderColor;
730     }
731
732     /**
733      *
734      */

735     public void setLeftBorderColor(Color JavaDoc leftBorderColor)
736     {
737         this.leftBorderColor = leftBorderColor;
738     }
739
740     /**
741      *
742      */

743     public int getLeftPadding()
744     {
745         return JRStyleResolver.getLeftPadding(this);
746     }
747
748     /**
749      *
750      */

751     public Integer JavaDoc getOwnLeftPadding()
752     {
753         return leftPadding;
754     }
755
756     /**
757      *
758      */

759     public void setLeftPadding(int leftPadding)
760     {
761         this.leftPadding = new Integer JavaDoc(leftPadding);
762     }
763
764     /**
765      *
766      */

767     public byte getBottomBorder()
768     {
769         return JRStyleResolver.getBottomBorder(this);
770     }
771
772     /**
773      *
774      */

775     public Byte JavaDoc getOwnBottomBorder()
776     {
777         return bottomBorder;
778     }
779
780     /**
781      *
782      */

783     public void setBottomBorder(byte bottomBorder)
784     {
785         this.bottomBorder = new Byte JavaDoc(bottomBorder);
786     }
787
788     /**
789      *
790      */

791     public Color JavaDoc getBottomBorderColor()
792     {
793         return JRStyleResolver.getBottomBorderColor(this, getForecolor());
794     }
795
796     /**
797      *
798      */

799     public Color JavaDoc getOwnBottomBorderColor()
800     {
801         return bottomBorderColor;
802     }
803
804     /**
805      *
806      */

807     public void setBottomBorderColor(Color JavaDoc bottomBorderColor)
808     {
809         this.bottomBorderColor = bottomBorderColor;
810     }
811
812     /**
813      *
814      */

815     public int getBottomPadding()
816     {
817         return JRStyleResolver.getBottomPadding(this);
818     }
819
820     /**
821      *
822      */

823     public Integer JavaDoc getOwnBottomPadding()
824     {
825         return bottomPadding;
826     }
827
828     /**
829      *
830      */

831     public void setBottomPadding(int bottomPadding)
832     {
833         this.bottomPadding = new Integer JavaDoc(bottomPadding);
834     }
835
836     /**
837      *
838      */

839     public byte getRightBorder()
840     {
841         return JRStyleResolver.getRightBorder(this);
842     }
843
844     /**
845      *
846      */

847     public Byte JavaDoc getOwnRightBorder()
848     {
849         return rightBorder;
850     }
851
852     /**
853      *
854      */

855     public void setRightBorder(byte rightBorder)
856     {
857         this.rightBorder = new Byte JavaDoc(rightBorder);
858     }
859
860     /**
861      *
862      */

863     public Color JavaDoc getRightBorderColor()
864     {
865         return JRStyleResolver.getRightBorderColor(this, getForecolor());
866     }
867
868     /**
869      *
870      */

871     public Color JavaDoc getOwnRightBorderColor()
872     {
873         return rightBorderColor;
874     }
875
876     /**
877      *
878      */

879     public void setRightBorderColor(Color JavaDoc rightBorderColor)
880     {
881         this.rightBorderColor = rightBorderColor;
882     }
883
884     /**
885      *
886      */

887     public int getRightPadding()
888     {
889         return JRStyleResolver.getRightPadding(this);
890     }
891
892     /**
893      *
894      */

895     public Integer JavaDoc getOwnRightPadding()
896     {
897         return rightPadding;
898     }
899
900     /**
901      *
902      */

903     public void setRightPadding(int rightPadding)
904     {
905         this.rightPadding = new Integer JavaDoc(rightPadding);
906     }
907
908     /**
909      *
910      */

911     public JRReportFont getReportFont()
912     {
913         return reportFont;
914     }
915
916     /**
917      *
918      */

919     public void setReportFont(JRReportFont reportFont)
920     {
921         this.reportFont = reportFont;
922     }
923
924     /**
925      *
926      */

927     public String JavaDoc getFontName()
928     {
929         return JRStyleResolver.getFontName(this);
930     }
931
932     /**
933      *
934      */

935     public String JavaDoc getOwnFontName()
936     {
937         return fontName;
938     }
939
940     /**
941      *
942      */

943     public void setFontName(String JavaDoc fontName)
944     {
945         this.fontName = fontName;
946     }
947
948
949     /**
950      *
951      */

952     public boolean isBold()
953     {
954         return JRStyleResolver.isBold(this);
955     }
956
957     /**
958      *
959      */

960     public Boolean JavaDoc isOwnBold()
961     {
962         return isBold;
963     }
964
965     /**
966      *
967      */

968     public void setBold(boolean isBold)
969     {
970         setBold(isBold ? Boolean.TRUE : Boolean.FALSE);
971     }
972
973     /**
974      * Alternative setBold method which allows also to reset
975      * the "own" isBold property.
976      */

977     public void setBold(Boolean JavaDoc isBold)
978     {
979         this.isBold = isBold;
980     }
981
982
983     /**
984      *
985      */

986     public boolean isItalic()
987     {
988         return JRStyleResolver.isItalic(this);
989     }
990
991     /**
992      *
993      */

994     public Boolean JavaDoc isOwnItalic()
995     {
996         return isItalic;
997     }
998
999     /**
1000     *
1001     */

1002    public void setItalic(boolean isItalic)
1003    {
1004        setItalic(isItalic ? Boolean.TRUE : Boolean.FALSE);
1005    }
1006
1007    /**
1008     * Alternative setItalic method which allows also to reset
1009     * the "own" isItalic property.
1010     */

1011    public void setItalic(Boolean JavaDoc isItalic)
1012    {
1013        this.isItalic = isItalic;
1014    }
1015
1016    /**
1017     *
1018     */

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

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

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

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

1052    public boolean isStrikeThrough()
1053    {
1054        return JRStyleResolver.isStrikeThrough(this);
1055    }
1056
1057    /**
1058     *
1059     */

1060    public Boolean JavaDoc isOwnStrikeThrough()
1061    {
1062        return isStrikeThrough;
1063    }
1064
1065    /**
1066     *
1067     */

1068    public void setStrikeThrough(boolean isStrikeThrough)
1069    {
1070        setStrikeThrough(isStrikeThrough ? Boolean.TRUE : Boolean.FALSE);
1071    }
1072
1073    /**
1074     * Alternative setStrikeThrough method which allows also to reset
1075     * the "own" isStrikeThrough property.
1076     */

1077    public void setStrikeThrough(Boolean JavaDoc isStrikeThrough)
1078    {
1079        this.isStrikeThrough = isStrikeThrough;
1080    }
1081
1082    /**
1083     *
1084     */

1085    public int getFontSize()
1086    {
1087        return JRStyleResolver.getFontSize(this);
1088    }
1089
1090    /**
1091     *
1092     */

1093    public Integer JavaDoc getOwnFontSize()
1094    {
1095        return fontSize;
1096    }
1097
1098    /**
1099     *
1100     */

1101    public void setFontSize(int fontSize)
1102    {
1103        setFontSize(new Integer JavaDoc(fontSize));
1104    }
1105
1106    /**
1107     * Alternative setSize method which allows also to reset
1108     * the "own" size property.
1109     */

1110    public void setFontSize(Integer JavaDoc fontSize)
1111    {
1112        this.fontSize = fontSize;
1113    }
1114
1115    /**
1116     * @deprecated Replaced by {@link #getFontSize()}.
1117     */

1118    public int getSize()
1119    {
1120        return getFontSize();
1121    }
1122
1123    /**
1124     * @deprecated Replaced by {@link #getOwnFontSize()}.
1125     */

1126    public Integer JavaDoc getOwnSize()
1127    {
1128        return getOwnFontSize();
1129    }
1130
1131    /**
1132     * @deprecated Replaced by {@link #setFontSize(int)}.
1133     */

1134    public void setSize(int size)
1135    {
1136        setFontSize(size);
1137    }
1138
1139    /**
1140     * @deprecated Replaced by {@link #setFontSize(Integer)}.
1141     */

1142    public void setSize(Integer JavaDoc size)
1143    {
1144        setFontSize(size);
1145    }
1146
1147    /**
1148     *
1149     */

1150    public String JavaDoc getPdfFontName()
1151    {
1152        return JRStyleResolver.getPdfFontName(this);
1153    }
1154
1155    /**
1156     *
1157     */

1158    public String JavaDoc getOwnPdfFontName()
1159    {
1160        return pdfFontName;
1161    }
1162
1163    /**
1164     *
1165     */

1166    public void setPdfFontName(String JavaDoc pdfFontName)
1167    {
1168        this.pdfFontName = pdfFontName;
1169    }
1170
1171
1172    /**
1173     *
1174     */

1175    public String JavaDoc getPdfEncoding()
1176    {
1177        return JRStyleResolver.getPdfEncoding(this);
1178    }
1179
1180    /**
1181     *
1182     */

1183    public String JavaDoc getOwnPdfEncoding()
1184    {
1185        return pdfEncoding;
1186    }
1187
1188    /**
1189     *
1190     */

1191    public void setPdfEncoding(String JavaDoc pdfEncoding)
1192    {
1193        this.pdfEncoding = pdfEncoding;
1194    }
1195
1196
1197    /**
1198     *
1199     */

1200    public boolean isPdfEmbedded()
1201    {
1202        return JRStyleResolver.isPdfEmbedded(this);
1203    }
1204
1205    /**
1206     *
1207     */

1208    public Boolean JavaDoc isOwnPdfEmbedded()
1209    {
1210        return isPdfEmbedded;
1211    }
1212
1213    /**
1214     *
1215     */

1216    public void setPdfEmbedded(boolean isPdfEmbedded)
1217    {
1218        setPdfEmbedded(isPdfEmbedded ? Boolean.TRUE : Boolean.FALSE);
1219    }
1220
1221    /**
1222     * Alternative setPdfEmbedded method which allows also to reset
1223     * the "own" isPdfEmbedded property.
1224     */

1225    public void setPdfEmbedded(Boolean JavaDoc isPdfEmbedded)
1226    {
1227        this.isPdfEmbedded = isPdfEmbedded;
1228    }
1229
1230    /**
1231     *
1232     */

1233    public void setBorder(Byte JavaDoc border)
1234    {
1235        this.border = border;
1236    }
1237
1238    /**
1239     *
1240     */

1241    public void setPadding(Integer JavaDoc padding)
1242    {
1243        this.padding = padding;
1244    }
1245
1246    /**
1247     *
1248     */

1249    public void setTopBorder(Byte JavaDoc topBorder)
1250    {
1251        this.topBorder = topBorder;
1252    }
1253
1254    /**
1255     *
1256     */

1257    public void setTopPadding(Integer JavaDoc topPadding)
1258    {
1259        this.topPadding = topPadding;
1260    }
1261
1262    /**
1263     *
1264     */

1265    public void setLeftBorder(Byte JavaDoc leftBorder)
1266    {
1267        this.leftBorder = leftBorder;
1268    }
1269
1270    /**
1271     *
1272     */

1273    public void setLeftPadding(Integer JavaDoc leftPadding)
1274    {
1275        this.leftPadding = leftPadding;
1276    }
1277
1278    /**
1279     *
1280     */

1281    public void setBottomBorder(Byte JavaDoc bottomBorder)
1282    {
1283        this.bottomBorder = bottomBorder;
1284    }
1285
1286    /**
1287     *
1288     */

1289    public void setBottomPadding(Integer JavaDoc bottomPadding)
1290    {
1291        this.bottomPadding = bottomPadding;
1292    }
1293
1294    /**
1295     *
1296     */

1297    public void setRightBorder(Byte JavaDoc rightBorder)
1298    {
1299        this.rightBorder = rightBorder;
1300    }
1301
1302    /**
1303     *
1304     */

1305    public void setRightPadding(Integer JavaDoc rightPadding)
1306    {
1307        this.rightPadding = rightPadding;
1308    }
1309
1310    
1311    public String JavaDoc getPattern()
1312    {
1313        return pattern;
1314    }
1315
1316    
1317    public void setPattern(String JavaDoc pattern)
1318    {
1319        this.pattern = pattern;
1320    }
1321
1322    
1323    public String JavaDoc getValueClassName()
1324    {
1325        return valueClassName;
1326    }
1327
1328    
1329    public void setValueClassName(String JavaDoc valueClassName)
1330    {
1331        this.valueClassName = valueClassName;
1332    }
1333
1334    
1335    public String JavaDoc getFormatFactoryClass()
1336    {
1337        return formatFactoryClass;
1338    }
1339
1340    
1341    public void setFormatFactoryClass(String JavaDoc formatFactoryClass)
1342    {
1343        this.formatFactoryClass = formatFactoryClass;
1344    }
1345
1346    
1347    public String JavaDoc getLocaleCode()
1348    {
1349        return localeCode;
1350    }
1351
1352    
1353    public void setLocaleCode(String JavaDoc localeCode)
1354    {
1355        this.localeCode = localeCode;
1356    }
1357
1358    
1359    public String JavaDoc getTimeZoneId()
1360    {
1361        return timeZoneId;
1362    }
1363
1364    
1365    public void setTimeZoneId(String JavaDoc timeZoneId)
1366    {
1367        this.timeZoneId = timeZoneId;
1368    }
1369
1370    
1371    public JRPrintHyperlinkParameters getHyperlinkParameters()
1372    {
1373        return hyperlinkParameters;
1374    }
1375
1376    
1377    public void setHyperlinkParameters(JRPrintHyperlinkParameters hyperlinkParameters)
1378    {
1379        this.hyperlinkParameters = hyperlinkParameters;
1380    }
1381
1382    
1383    /**
1384     * Adds a custom hyperlink parameter.
1385     *
1386     * @param parameter the parameter to add
1387     * @see #getHyperlinkParameters()
1388     * @see JRPrintHyperlinkParameters#addParameter(JRPrintHyperlinkParameter)
1389     */

1390    public void addHyperlinkParameter(JRPrintHyperlinkParameter parameter)
1391    {
1392        if (hyperlinkParameters == null)
1393        {
1394            hyperlinkParameters = new JRPrintHyperlinkParameters();
1395        }
1396        hyperlinkParameters.addParameter(parameter);
1397    }
1398    
1399    
1400    public String JavaDoc getLinkType()
1401    {
1402        return linkType;
1403    }
1404
1405
1406    
1407    public void setLinkType(String JavaDoc linkType)
1408    {
1409        this.linkType = linkType;
1410    }
1411    
1412    
1413    private void readObject(ObjectInputStream JavaDoc in) throws IOException JavaDoc, ClassNotFoundException JavaDoc
1414    {
1415        in.defaultReadObject();
1416        normalizeLinkType();
1417    }
1418
1419
1420    protected void normalizeLinkType()
1421    {
1422        if (linkType == null)
1423        {
1424             linkType = JRHyperlinkHelper.getLinkType(hyperlinkType);
1425        }
1426        hyperlinkType = JRHyperlink.HYPERLINK_TYPE_NULL;
1427    }
1428
1429
1430    
1431    public String JavaDoc getHyperlinkTooltip()
1432    {
1433        return hyperlinkTooltip;
1434    }
1435
1436
1437    
1438    public void setHyperlinkTooltip(String JavaDoc hyperlinkTooltip)
1439    {
1440        this.hyperlinkTooltip = hyperlinkTooltip;
1441    }
1442
1443}
1444
Popular Tags