KickJava   Java API By Example, From Geeks To Geeks.

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


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.awt.font.TextAttribute JavaDoc;
32 import java.text.AttributedString JavaDoc;
33 import java.util.HashMap JavaDoc;
34 import java.util.Map JavaDoc;
35
36 import net.sf.jasperreports.engine.JRBox;
37 import net.sf.jasperreports.engine.JRElement;
38 import net.sf.jasperreports.engine.JRFont;
39 import net.sf.jasperreports.engine.JRPrintText;
40 import net.sf.jasperreports.engine.JRReportFont;
41 import net.sf.jasperreports.engine.JRStyle;
42 import net.sf.jasperreports.engine.JRTextElement;
43 import net.sf.jasperreports.engine.util.JRFontUtil;
44 import net.sf.jasperreports.engine.util.JRStyleResolver;
45 import net.sf.jasperreports.engine.util.JRStyledText;
46
47 import org.apache.commons.logging.Log;
48 import org.apache.commons.logging.LogFactory;
49 import org.xml.sax.SAXException JavaDoc;
50
51
52 /**
53  * @author Teodor Danciu (teodord@users.sourceforge.net)
54  * @version $Id: JRFillTextElement.java 1308 2006-06-21 14:06:21 +0300 (Wed, 21 Jun 2006) teodord $
55  */

56 public abstract class JRFillTextElement extends JRFillElement implements JRTextElement
57 {
58
59
60     /**
61      *
62      */

63     private static final Log log = LogFactory.getLog(JRFillTextElement.class);
64
65     /**
66      *
67      */

68     private boolean isLeftToRight = true;
69     private TextMeasurer textMeasurer = null;
70     private float lineSpacingFactor = 0;
71     private float leadingOffset = 0;
72     private float textHeight = 0;
73     private int textStart = 0;
74     private int textEnd = 0;
75     private String JavaDoc rawText = null;
76     private JRStyledText styledText = null;
77     private Map JavaDoc styledTextAttributesMap = new HashMap JavaDoc();
78
79     protected TextChopper textChopper = null;
80     
81     protected final JRReportFont reportFont;
82
83     /**
84      *
85      */

86     protected JRFillTextElement(
87         JRBaseFiller filler,
88         JRTextElement textElement,
89         JRFillObjectFactory factory
90         )
91     {
92         super(filler, textElement, factory);
93
94         reportFont = factory.getReportFont(textElement.getReportFont());
95         
96         /* */
97         createTextMeasurer();
98         createTextChopper();
99     }
100     
101
102     protected JRFillTextElement(JRFillTextElement textElement, JRFillCloneFactory factory)
103     {
104         super(textElement, factory);
105         
106         reportFont = textElement.reportFont;
107
108         createTextMeasurer();
109         createTextChopper();
110     }
111
112
113     private void createTextMeasurer()
114     {
115         textMeasurer = new TextMeasurer(this);
116     }
117
118
119     private void createTextChopper()
120     {
121         textChopper = isStyledText() ? styledTextChopper : simpleTextChopper;
122     }
123
124
125     /**
126      *
127      */

128     public byte getMode()
129     {
130         return JRStyleResolver.getMode(this, JRElement.MODE_TRANSPARENT);
131     }
132
133     /**
134      * @deprecated Replaced by {@link #getHorizontalAlignment()}.
135      */

136     public byte getTextAlignment()
137     {
138         return JRStyleResolver.getHorizontalAlignment(this);
139     }
140
141     /**
142      * @deprecated Replaced by {@link #setHorizontalAlignment(byte)}.
143      */

144     public void setTextAlignment(byte horizontalAlignment)
145     {
146     }
147         
148     /**
149      *
150      */

151     public byte getHorizontalAlignment()
152     {
153         return JRStyleResolver.getHorizontalAlignment(this);
154     }
155         
156     public Byte JavaDoc getOwnHorizontalAlignment()
157     {
158         return ((JRTextElement)parent).getOwnHorizontalAlignment();
159     }
160
161     /**
162      *
163      */

164     public void setHorizontalAlignment(byte horizontalAlignment)
165     {
166     }
167         
168     /**
169      *
170      */

171     public void setHorizontalAlignment(Byte JavaDoc horizontalAlignment)
172     {
173     }
174         
175     /**
176      *
177      */

178     public byte getVerticalAlignment()
179     {
180         return JRStyleResolver.getVerticalAlignment(this);
181     }
182         
183     public Byte JavaDoc getOwnVerticalAlignment()
184     {
185         return ((JRTextElement)parent).getOwnVerticalAlignment();
186     }
187
188     /**
189      *
190      */

191     public void setVerticalAlignment(byte verticalAlignment)
192     {
193     }
194         
195     /**
196      *
197      */

198     public void setVerticalAlignment(Byte JavaDoc verticalAlignment)
199     {
200     }
201         
202     /**
203      *
204      */

205     public byte getRotation()
206     {
207         return JRStyleResolver.getRotation(this);
208     }
209         
210     public Byte JavaDoc getOwnRotation()
211     {
212         return ((JRTextElement)parent).getOwnRotation();
213     }
214
215     /**
216      *
217      */

218     public void setRotation(byte rotation)
219     {
220     }
221         
222     /**
223      *
224      */

225     public void setRotation(Byte JavaDoc rotation)
226     {
227     }
228         
229     /**
230      *
231      */

232     public byte getLineSpacing()
233     {
234         return JRStyleResolver.getLineSpacing(this);
235     }
236         
237     public Byte JavaDoc getOwnLineSpacing()
238     {
239         return ((JRTextElement)parent).getOwnLineSpacing();
240     }
241
242     /**
243      *
244      */

245     public void setLineSpacing(byte lineSpacing)
246     {
247     }
248         
249     /**
250      *
251      */

252     public void setLineSpacing(Byte JavaDoc lineSpacing)
253     {
254     }
255         
256     /**
257      *
258      */

259     public boolean isStyledText()
260     {
261         return JRStyleResolver.isStyledText(this);
262     }
263         
264     public Boolean JavaDoc isOwnStyledText()
265     {
266         return ((JRTextElement)parent).isOwnStyledText();
267     }
268
269     /**
270      *
271      */

272     public void setStyledText(boolean isStyledText)
273     {
274     }
275         
276     /**
277      *
278      */

279     public void setStyledText(Boolean JavaDoc isStyledText)
280     {
281     }
282         
283     /**
284      * @deprecated
285      */

286     public JRBox getBox()
287     {
288         return this;
289     }
290
291     /**
292      * @deprecated
293      */

294     public JRFont getFont()
295     {
296         return this;
297     }
298
299     
300     /**
301      *
302      */

303     protected Map JavaDoc getStyledTextAttributes()
304     {
305         JRStyle style = getStyle();
306         Map JavaDoc styledTextAttributes = (Map JavaDoc)styledTextAttributesMap.get(style);
307         if (styledTextAttributes == null)
308         {
309             styledTextAttributes = new HashMap JavaDoc();
310             JRFontUtil.setAttributes(styledTextAttributes, this);
311             styledTextAttributes.put(TextAttribute.FOREGROUND, getForecolor());
312             if (getMode() == JRElement.MODE_OPAQUE)
313             {
314                 styledTextAttributes.put(TextAttribute.BACKGROUND, getBackcolor());
315             }
316             styledTextAttributesMap.put(style, styledTextAttributes);
317         }
318         
319         return styledTextAttributes;
320     }
321
322     /**
323      *
324      */

325     protected float getLineSpacingFactor()
326     {
327         return lineSpacingFactor;
328     }
329         
330     /**
331      *
332      */

333     protected void setLineSpacingFactor(float lineSpacingFactor)
334     {
335         this.lineSpacingFactor = lineSpacingFactor;
336     }
337
338     /**
339      *
340      */

341     protected float getLeadingOffset()
342     {
343         return leadingOffset;
344     }
345         
346     /**
347      *
348      */

349     protected void setLeadingOffset(float leadingOffset)
350     {
351         this.leadingOffset = leadingOffset;
352     }
353
354     /**
355      *
356      */

357     protected byte getRunDirection()
358     {
359         return isLeftToRight ? JRPrintText.RUN_DIRECTION_LTR : JRPrintText.RUN_DIRECTION_RTL;
360     }
361         
362     /**
363      *
364      */

365     protected float getTextHeight()
366     {
367         return textHeight;
368     }
369         
370     /**
371      *
372      */

373     protected void setTextHeight(float textHeight)
374     {
375         this.textHeight = textHeight;
376     }
377
378     /**
379      *
380      */

381     protected int getTextStart()
382     {
383         return textStart;
384     }
385         
386     /**
387      *
388      */

389     protected void setTextStart(int textStart)
390     {
391         this.textStart = textStart;
392     }
393
394     /**
395      *
396      */

397     protected int getTextEnd()
398     {
399         return textEnd;
400     }
401         
402     /**
403      *
404      */

405     protected void setTextEnd(int textEnd)
406     {
407         this.textEnd = textEnd;
408     }
409
410     /**
411      *
412      */

413     protected String JavaDoc getRawText()
414     {
415         return rawText;
416     }
417
418     /**
419      *
420      */

421     protected void setRawText(String JavaDoc rawText)
422     {
423         this.rawText = rawText;
424         styledText = null;
425     }
426
427
428     /**
429      *
430      */

431     protected void reset()
432     {
433         super.reset();
434         
435         isLeftToRight = true;
436         lineSpacingFactor = 0;
437         leadingOffset = 0;
438         textHeight = 0;
439     }
440
441
442     /**
443      *
444      */

445     protected void rewind()
446     {
447         textStart = 0;
448         textEnd = 0;
449     }
450
451
452     /**
453      *
454      */

455     protected JRStyledText getStyledText()
456     {
457         if (styledText == null)
458         {
459             String JavaDoc text = getRawText();
460             if (text != null)
461             {
462                 if (isStyledText())
463                 {
464                     try
465                     {
466                         styledText = filler.getStyledTextParser().parse(getStyledTextAttributes(), text);
467                     }
468                     catch (SAXException JavaDoc e)
469                     {
470                         if (log.isWarnEnabled())
471                             log.warn("Invalid styled text.", e);
472                     }
473                 }
474         
475                 if (styledText == null)
476                 {
477                     styledText = new JRStyledText();
478                     styledText.append(text);
479                     styledText.addRun(new JRStyledText.Run(getStyledTextAttributes(), 0, text.length()));
480                 }
481             }
482         }
483         
484         return styledText;
485     }
486
487     /**
488      *
489      */

490     public String JavaDoc getText()
491     {
492         JRStyledText tmpStyledText = getStyledText();
493
494         if (tmpStyledText == null)
495         {
496             return null;
497         }
498
499         return tmpStyledText.getText();
500     }
501     
502
503     /**
504      *
505      */

506     protected void chopTextElement(
507         int availableStretchHeight
508         )
509     {
510         JRStyledText tmpStyledText = getStyledText();
511
512         if (tmpStyledText == null)
513         {
514             return;
515         }
516
517         String JavaDoc remainingText =
518             getText().substring(
519                 getTextEnd()
520                 );
521
522         if (remainingText.length() == 0)
523         {
524             return;
525         }
526
527         /* */
528         textMeasurer.measure(
529             tmpStyledText,
530             remainingText,
531             getTextEnd(),
532             availableStretchHeight
533             );
534         
535         isLeftToRight = textMeasurer.isLeftToRight();
536         setTextHeight(textMeasurer.getTextHeight());
537         if (getRotation() == ROTATION_NONE)
538         {
539             setStretchHeight((int)getTextHeight() + getTopPadding() + getBottomPadding());
540         }
541         else
542         {
543             setStretchHeight(getHeight());
544         }
545         setTextStart(getTextEnd());
546         setTextEnd(textMeasurer.getTextOffset());
547         setLineSpacingFactor(textMeasurer.getLineSpacingFactor());
548         setLeadingOffset(textMeasurer.getLeadingOffset());
549     }
550     
551     
552     /**
553      *
554      */

555     protected static interface TextChopper
556     {
557         /**
558          *
559          */

560         public String JavaDoc chop(JRFillTextElement textElement, int startIndex, int endIndex);
561     }
562
563
564     /**
565      *
566      */

567     private static TextChopper simpleTextChopper =
568         new TextChopper()
569         {
570             public String JavaDoc chop(JRFillTextElement textElement, int startIndex, int endIndex)
571             {
572                 return textElement.getStyledText().getText().substring(startIndex, endIndex);
573             }
574         };
575
576     /**
577      *
578      */

579     private static TextChopper styledTextChopper =
580         new TextChopper()
581         {
582             public String JavaDoc chop(JRFillTextElement textElement, int startIndex, int endIndex)
583             {
584                 return
585                     textElement.filler.getStyledTextParser().write(
586                         textElement.getStyledTextAttributes(),
587                         new AttributedString JavaDoc(
588                             textElement.getStyledText().getAttributedString().getIterator(),
589                             startIndex,
590                             endIndex
591                             ).getIterator(),
592                         textElement.getText().substring(startIndex, endIndex)
593                         );
594             }
595         };
596
597     /**
598      *
599      */

600     public byte getBorder()
601     {
602         return JRStyleResolver.getBorder(this);
603     }
604
605     public Byte JavaDoc getOwnBorder()
606     {
607         return ((JRBox)parent).getOwnBorder();
608     }
609
610     /**
611      *
612      */

613     public void setBorder(byte border)
614     {
615     }
616
617     /**
618      *
619      */

620     public Color JavaDoc getBorderColor()
621     {
622         return JRStyleResolver.getBorderColor(this, getForecolor());
623     }
624
625     public Color JavaDoc getOwnBorderColor()
626     {
627         return ((JRBox)parent).getOwnBorderColor();
628     }
629
630     /**
631      *
632      */

633     public void setBorderColor(Color JavaDoc borderColor)
634     {
635     }
636
637     /**
638      *
639      */

640     public int getPadding()
641     {
642         return JRStyleResolver.getPadding(this);
643     }
644
645     public Integer JavaDoc getOwnPadding()
646     {
647         return ((JRBox)parent).getOwnPadding();
648     }
649
650     /**
651      *
652      */

653     public void setPadding(int padding)
654     {
655     }
656
657     /**
658      *
659      */

660     public byte getTopBorder()
661     {
662         return JRStyleResolver.getTopBorder(this);
663     }
664
665     /**
666      *
667      */

668     public Byte JavaDoc getOwnTopBorder()
669     {
670         return ((JRBox)parent).getOwnTopBorder();
671     }
672
673     /**
674      *
675      */

676     public void setTopBorder(byte topBorder)
677     {
678     }
679
680     /**
681      *
682      */

683     public Color JavaDoc getTopBorderColor()
684     {
685         return JRStyleResolver.getTopBorderColor(this, getForecolor());
686     }
687
688     /**
689      *
690      */

691     public Color JavaDoc getOwnTopBorderColor()
692     {
693         return ((JRBox)parent).getOwnTopBorderColor();
694     }
695
696     /**
697      *
698      */

699     public void setTopBorderColor(Color JavaDoc topBorderColor)
700     {
701     }
702
703     /**
704      *
705      */

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

714     public Integer JavaDoc getOwnTopPadding()
715     {
716         return ((JRBox)parent).getOwnTopPadding();
717     }
718
719     /**
720      *
721      */

722     public void setTopPadding(int topPadding)
723     {
724     }
725
726     /**
727      *
728      */

729     public byte getLeftBorder()
730     {
731         return JRStyleResolver.getLeftBorder(this);
732     }
733
734     /**
735      *
736      */

737     public Byte JavaDoc getOwnLeftBorder()
738     {
739         return ((JRBox)parent).getOwnLeftBorder();
740     }
741
742     /**
743      *
744      */

745     public void setLeftBorder(byte leftBorder)
746     {
747     }
748
749     /**
750      *
751      */

752     public Color JavaDoc getLeftBorderColor()
753     {
754         return JRStyleResolver.getLeftBorderColor(this, getForecolor());
755     }
756
757     /**
758      *
759      */

760     public Color JavaDoc getOwnLeftBorderColor()
761     {
762         return ((JRBox)parent).getOwnLeftBorderColor();
763     }
764
765     /**
766      *
767      */

768     public void setLeftBorderColor(Color JavaDoc leftBorderColor)
769     {
770     }
771
772     /**
773      *
774      */

775     public int getLeftPadding()
776     {
777         return JRStyleResolver.getLeftPadding(this);
778     }
779
780     /**
781      *
782      */

783     public Integer JavaDoc getOwnLeftPadding()
784     {
785         return ((JRBox)parent).getOwnLeftPadding();
786     }
787
788     /**
789      *
790      */

791     public void setLeftPadding(int leftPadding)
792     {
793     }
794
795     /**
796      *
797      */

798     public byte getBottomBorder()
799     {
800         return JRStyleResolver.getBottomBorder(this);
801     }
802
803     /**
804      *
805      */

806     public Byte JavaDoc getOwnBottomBorder()
807     {
808         return ((JRBox)parent).getOwnBottomBorder();
809     }
810
811     /**
812      *
813      */

814     public void setBottomBorder(byte bottomBorder)
815     {
816     }
817
818     /**
819      *
820      */

821     public Color JavaDoc getBottomBorderColor()
822     {
823         return JRStyleResolver.getBottomBorderColor(this, getForecolor());
824     }
825
826     /**
827      *
828      */

829     public Color JavaDoc getOwnBottomBorderColor()
830     {
831         return ((JRBox)parent).getOwnBottomBorderColor();
832     }
833
834     /**
835      *
836      */

837     public void setBottomBorderColor(Color JavaDoc bottomBorderColor)
838     {
839     }
840
841     /**
842      *
843      */

844     public int getBottomPadding()
845     {
846         return JRStyleResolver.getBottomPadding(this);
847     }
848
849     /**
850      *
851      */

852     public Integer JavaDoc getOwnBottomPadding()
853     {
854         return ((JRBox)parent).getOwnBottomPadding();
855     }
856
857     /**
858      *
859      */

860     public void setBottomPadding(int bottomPadding)
861     {
862     }
863
864     /**
865      *
866      */

867     public byte getRightBorder()
868     {
869         return JRStyleResolver.getRightBorder(this);
870     }
871
872     /**
873      *
874      */

875     public Byte JavaDoc getOwnRightBorder()
876     {
877         return ((JRBox)parent).getOwnRightBorder();
878     }
879
880     /**
881      *
882      */

883     public void setRightBorder(byte rightBorder)
884     {
885     }
886
887     /**
888      *
889      */

890     public Color JavaDoc getRightBorderColor()
891     {
892         return JRStyleResolver.getRightBorderColor(this, getForecolor());
893     }
894
895     /**
896      *
897      */

898     public Color JavaDoc getOwnRightBorderColor()
899     {
900         return ((JRBox)parent).getOwnRightBorderColor();
901     }
902
903     /**
904      *
905      */

906     public void setRightBorderColor(Color JavaDoc rightBorderColor)
907     {
908     }
909
910     /**
911      *
912      */

913     public int getRightPadding()
914     {
915         return JRStyleResolver.getRightPadding(this);
916     }
917
918     /**
919      *
920      */

921     public Integer JavaDoc getOwnRightPadding()
922     {
923         return ((JRBox)parent).getOwnRightPadding();
924     }
925
926     /**
927      *
928      */

929     public void setRightPadding(int rightPadding)
930     {
931     }
932
933
934     /**
935      *
936      */

937     public JRReportFont getReportFont()
938     {
939         return reportFont;
940     }
941
942     public void setReportFont(JRReportFont reportFont)
943     {
944     }
945     
946     /**
947      *
948      */

949     public String JavaDoc getFontName()
950     {
951         return JRStyleResolver.getFontName(this);
952     }
953
954     /**
955      *
956      */

957     public String JavaDoc getOwnFontName()
958     {
959         return ((JRFont)parent).getOwnFontName();
960     }
961
962     /**
963      *
964      */

965     public void setFontName(String JavaDoc fontName)
966     {
967     }
968
969
970     /**
971      *
972      */

973     public boolean isBold()
974     {
975         return JRStyleResolver.isBold(this);
976     }
977
978     /**
979      *
980      */

981     public Boolean JavaDoc isOwnBold()
982     {
983         return ((JRFont)parent).isOwnBold();
984     }
985
986     /**
987      *
988      */

989     public void setBold(boolean isBold)
990     {
991     }
992
993     /**
994      * Alternative setBold method which allows also to reset
995      * the "own" isBold property.
996      */

997     public void setBold(Boolean JavaDoc isBold)
998     {
999     }
1000
1001
1002    /**
1003     *
1004     */

1005    public boolean isItalic()
1006    {
1007        return JRStyleResolver.isItalic(this);
1008    }
1009
1010    /**
1011     *
1012     */

1013    public Boolean JavaDoc isOwnItalic()
1014    {
1015        return ((JRFont)parent).isOwnItalic();
1016    }
1017
1018    /**
1019     *
1020     */

1021    public void setItalic(boolean isItalic)
1022    {
1023    }
1024
1025    /**
1026     * Alternative setItalic method which allows also to reset
1027     * the "own" isItalic property.
1028     */

1029    public void setItalic(Boolean JavaDoc isItalic)
1030    {
1031    }
1032
1033    /**
1034     *
1035     */

1036    public boolean isUnderline()
1037    {
1038        return JRStyleResolver.isUnderline(this);
1039    }
1040
1041    /**
1042     *
1043     */

1044    public Boolean JavaDoc isOwnUnderline()
1045    {
1046        return ((JRFont)parent).isOwnUnderline();
1047    }
1048
1049    /**
1050     *
1051     */

1052    public void setUnderline(boolean isUnderline)
1053    {
1054    }
1055
1056    /**
1057     * Alternative setUnderline method which allows also to reset
1058     * the "own" isUnderline property.
1059     */

1060    public void setUnderline(Boolean JavaDoc isUnderline)
1061    {
1062    }
1063
1064    /**
1065     *
1066     */

1067    public boolean isStrikeThrough()
1068    {
1069        return JRStyleResolver.isStrikeThrough(this);
1070    }
1071
1072    /**
1073     *
1074     */

1075    public Boolean JavaDoc isOwnStrikeThrough()
1076    {
1077        return ((JRFont)parent).isOwnStrikeThrough();
1078    }
1079
1080    /**
1081     *
1082     */

1083    public void setStrikeThrough(boolean isStrikeThrough)
1084    {
1085    }
1086
1087    /**
1088     * Alternative setStrikeThrough method which allows also to reset
1089     * the "own" isStrikeThrough property.
1090     */

1091    public void setStrikeThrough(Boolean JavaDoc isStrikeThrough)
1092    {
1093    }
1094
1095    /**
1096     *
1097     */

1098    public int getFontSize()
1099    {
1100        return JRStyleResolver.getFontSize(this);
1101    }
1102
1103    /**
1104     *
1105     */

1106    public Integer JavaDoc getOwnFontSize()
1107    {
1108        return ((JRFont)parent).getOwnFontSize();
1109    }
1110
1111    /**
1112     *
1113     */

1114    public void setFontSize(int size)
1115    {
1116    }
1117
1118    /**
1119     * Alternative setSize method which allows also to reset
1120     * the "own" size property.
1121     */

1122    public void setFontSize(Integer JavaDoc size)
1123    {
1124    }
1125
1126    /**
1127     * @deprecated Replaced by {@link #getFontSize()}.
1128     */

1129    public int getSize()
1130    {
1131        return getFontSize();
1132    }
1133
1134    /**
1135     * @deprecated Replaced by {@link #getOwnFontSize()}.
1136     */

1137    public Integer JavaDoc getOwnSize()
1138    {
1139        return getOwnFontSize();
1140    }
1141
1142    /**
1143     * @deprecated Replaced by {@link #setFontSize(int)}.
1144     */

1145    public void setSize(int size)
1146    {
1147    }
1148
1149    /**
1150     * @deprecated Replaced by {@link #setFontSize(Integer)}.
1151     */

1152    public void setSize(Integer JavaDoc size)
1153    {
1154    }
1155
1156    /**
1157     *
1158     */

1159    public String JavaDoc getPdfFontName()
1160    {
1161        return JRStyleResolver.getPdfFontName(this);
1162    }
1163
1164    /**
1165     *
1166     */

1167    public String JavaDoc getOwnPdfFontName()
1168    {
1169        return ((JRFont)parent).getOwnPdfFontName();
1170    }
1171
1172    /**
1173     *
1174     */

1175    public void setPdfFontName(String JavaDoc pdfFontName)
1176    {
1177    }
1178
1179
1180    /**
1181     *
1182     */

1183    public String JavaDoc getPdfEncoding()
1184    {
1185        return JRStyleResolver.getPdfEncoding(this);
1186    }
1187
1188    /**
1189     *
1190     */

1191    public String JavaDoc getOwnPdfEncoding()
1192    {
1193        return ((JRFont)parent).getOwnPdfEncoding();
1194    }
1195
1196    /**
1197     *
1198     */

1199    public void setPdfEncoding(String JavaDoc pdfEncoding)
1200    {
1201    }
1202
1203
1204    /**
1205     *
1206     */

1207    public boolean isPdfEmbedded()
1208    {
1209        return JRStyleResolver.isPdfEmbedded(this);
1210    }
1211
1212    /**
1213     *
1214     */

1215    public Boolean JavaDoc isOwnPdfEmbedded()
1216    {
1217        return ((JRFont)parent).isOwnPdfEmbedded();
1218    }
1219
1220    /**
1221     *
1222     */

1223    public void setPdfEmbedded(boolean isPdfEmbedded)
1224    {
1225        setPdfEmbedded(isPdfEmbedded ? Boolean.TRUE : Boolean.FALSE);
1226    }
1227
1228    /**
1229     * Alternative setPdfEmbedded method which allows also to reset
1230     * the "own" isPdfEmbedded property.
1231     */

1232    public void setPdfEmbedded(Boolean JavaDoc isPdfEmbedded)
1233    {
1234    }
1235
1236    /**
1237     *
1238     */

1239    public void setBorder(Byte JavaDoc border)
1240    {
1241    }
1242
1243    /**
1244     *
1245     */

1246    public void setPadding(Integer JavaDoc padding)
1247    {
1248    }
1249
1250    /**
1251     *
1252     */

1253    public void setTopBorder(Byte JavaDoc topBorder)
1254    {
1255    }
1256
1257    /**
1258     *
1259     */

1260    public void setTopPadding(Integer JavaDoc topPadding)
1261    {
1262    }
1263
1264    /**
1265     *
1266     */

1267    public void setLeftBorder(Byte JavaDoc leftBorder)
1268    {
1269    }
1270
1271    /**
1272     *
1273     */

1274    public void setLeftPadding(Integer JavaDoc leftPadding)
1275    {
1276    }
1277
1278    /**
1279     *
1280     */

1281    public void setBottomBorder(Byte JavaDoc bottomBorder)
1282    {
1283    }
1284
1285    /**
1286     *
1287     */

1288    public void setBottomPadding(Integer JavaDoc bottomPadding)
1289    {
1290    }
1291
1292    /**
1293     *
1294     */

1295    public void setRightBorder(Byte JavaDoc rightBorder)
1296    {
1297    }
1298
1299    /**
1300     *
1301     */

1302    public void setRightPadding(Integer JavaDoc rightPadding)
1303    {
1304    }
1305
1306    /**
1307     *
1308     */

1309    public void setHeight(int height)
1310    {
1311        super.setHeight(height);
1312        
1313        createTextMeasurer();
1314    }
1315
1316
1317    public void setWidth(int width)
1318    {
1319        super.setWidth(width);
1320        
1321        createTextMeasurer();
1322    }
1323
1324}
1325
Popular Tags