KickJava   Java API By Example, From Geeks To Geeks.

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


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.charts.JRAreaPlot;
35 import net.sf.jasperreports.charts.JRBar3DPlot;
36 import net.sf.jasperreports.charts.JRBarPlot;
37 import net.sf.jasperreports.charts.JRBubblePlot;
38 import net.sf.jasperreports.charts.JRCandlestickPlot;
39 import net.sf.jasperreports.charts.JRCategoryDataset;
40 import net.sf.jasperreports.charts.JRHighLowDataset;
41 import net.sf.jasperreports.charts.JRHighLowPlot;
42 import net.sf.jasperreports.charts.JRLinePlot;
43 import net.sf.jasperreports.charts.JRMeterPlot;
44 import net.sf.jasperreports.charts.JRMultiAxisPlot;
45 import net.sf.jasperreports.charts.JRPie3DPlot;
46 import net.sf.jasperreports.charts.JRPieDataset;
47 import net.sf.jasperreports.charts.JRPiePlot;
48 import net.sf.jasperreports.charts.JRScatterPlot;
49 import net.sf.jasperreports.charts.JRThermometerPlot;
50 import net.sf.jasperreports.charts.JRTimePeriodDataset;
51 import net.sf.jasperreports.charts.JRTimeSeriesDataset;
52 import net.sf.jasperreports.charts.JRTimeSeriesPlot;
53 import net.sf.jasperreports.charts.JRValueDataset;
54 import net.sf.jasperreports.charts.JRXyDataset;
55 import net.sf.jasperreports.charts.JRXyzDataset;
56 import net.sf.jasperreports.engine.JRAbstractObjectFactory;
57 import net.sf.jasperreports.engine.JRAnchor;
58 import net.sf.jasperreports.engine.JRBox;
59 import net.sf.jasperreports.engine.JRChart;
60 import net.sf.jasperreports.engine.JRChartDataset;
61 import net.sf.jasperreports.engine.JRChartPlot;
62 import net.sf.jasperreports.engine.JRChild;
63 import net.sf.jasperreports.engine.JRConstants;
64 import net.sf.jasperreports.engine.JRExpression;
65 import net.sf.jasperreports.engine.JRExpressionCollector;
66 import net.sf.jasperreports.engine.JRFont;
67 import net.sf.jasperreports.engine.JRGroup;
68 import net.sf.jasperreports.engine.JRHyperlink;
69 import net.sf.jasperreports.engine.JRHyperlinkHelper;
70 import net.sf.jasperreports.engine.JRHyperlinkParameter;
71 import net.sf.jasperreports.engine.JRRuntimeException;
72 import net.sf.jasperreports.engine.util.JRStyleResolver;
73 import net.sf.jasperreports.engine.xml.JRXmlWriter;
74
75
76 /**
77  * @author Teodor Danciu (teodord@users.sourceforge.net)
78  * @version $Id: JRBaseChart.java 1389 2006-09-06 00:36:07 +0300 (Wed, 06 Sep 2006) bklawans $
79  */

80 public class JRBaseChart extends JRBaseElement implements JRChart
81 {
82
83
84     /**
85      *
86      */

87     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
88
89     /**
90      *
91      */

92     protected byte chartType = 0;
93
94     /**
95      *
96      */

97     protected boolean isShowLegend = false;
98     protected byte evaluationTime = JRExpression.EVALUATION_TIME_NOW;
99     protected byte hyperlinkType = JRHyperlink.HYPERLINK_TYPE_NULL;
100     protected String JavaDoc linkType;
101     protected byte hyperlinkTarget = JRHyperlink.HYPERLINK_TARGET_SELF;
102     private JRHyperlinkParameter[] hyperlinkParameters;
103     
104     protected byte titlePosition = JRChart.TITLE_POSITION_TOP;
105     protected Color JavaDoc titleColor = Color.black;
106     protected Color JavaDoc subtitleColor = Color.black;
107     protected Color JavaDoc legendColor = null;
108     protected Color JavaDoc legendBackgroundColor = null;
109
110     /**
111      *
112      */

113     protected JRBox box = null;
114     protected JRFont titleFont = null;
115     protected JRFont subtitleFont = null;
116     protected JRFont legendFont = null;
117
118     protected String JavaDoc customizerClass;
119
120     /**
121      *
122      */

123     protected JRGroup evaluationGroup = null;
124     protected JRExpression titleExpression = null;
125     protected JRExpression subtitleExpression = null;
126     protected JRExpression anchorNameExpression = null;
127     protected JRExpression hyperlinkReferenceExpression = null;
128     protected JRExpression hyperlinkAnchorExpression = null;
129     protected JRExpression hyperlinkPageExpression = null;
130     private JRExpression hyperlinkTooltipExpression;
131
132     protected JRChartDataset dataset = null;
133     protected JRChartPlot plot = null;
134
135
136     /**
137      *
138      */

139     protected Byte JavaDoc border;
140     protected Byte JavaDoc topBorder = null;
141     protected Byte JavaDoc leftBorder = null;
142     protected Byte JavaDoc bottomBorder = null;
143     protected Byte JavaDoc rightBorder = null;
144     protected Color JavaDoc borderColor = null;
145     protected Color JavaDoc topBorderColor = null;
146     protected Color JavaDoc leftBorderColor = null;
147     protected Color JavaDoc bottomBorderColor = null;
148     protected Color JavaDoc rightBorderColor = null;
149     protected Integer JavaDoc padding;
150     protected Integer JavaDoc topPadding = null;
151     protected Integer JavaDoc leftPadding = null;
152     protected Integer JavaDoc bottomPadding = null;
153     protected Integer JavaDoc rightPadding = null;
154
155
156     /**
157      * The bookmark level for the anchor associated with this chart.
158      * @see JRAnchor#getBookmarkLevel()
159      */

160     protected int bookmarkLevel = JRAnchor.NO_BOOKMARK;
161     
162     /**
163      *
164      */

165     protected JRBaseChart(JRChart chart, JRBaseObjectFactory factory)
166     {
167         super(chart, factory);
168
169         chartType = chart.getChartType();
170
171         switch(chartType) {
172             case CHART_TYPE_AREA:
173                 dataset = factory.getCategoryDataset((JRCategoryDataset) chart.getDataset());
174                 plot = factory.getAreaPlot((JRAreaPlot) chart.getPlot());
175                 break;
176             case CHART_TYPE_BAR:
177                 dataset = factory.getCategoryDataset((JRCategoryDataset) chart.getDataset());
178                 plot = factory.getBarPlot((JRBarPlot) chart.getPlot());
179                 break;
180             case CHART_TYPE_BAR3D:
181                 dataset = factory.getCategoryDataset((JRCategoryDataset) chart.getDataset());
182                 plot = factory.getBar3DPlot((JRBar3DPlot) chart.getPlot());
183                 break;
184             case CHART_TYPE_BUBBLE:
185                 dataset = factory.getXyzDataset((JRXyzDataset) chart.getDataset());
186                 plot = factory.getBubblePlot((JRBubblePlot) chart.getPlot());
187                 break;
188             case CHART_TYPE_CANDLESTICK:
189                 dataset = factory.getHighLowDataset((JRHighLowDataset) chart.getDataset());
190                 plot = factory.getCandlestickPlot((JRCandlestickPlot) chart.getPlot());
191                 break;
192             case CHART_TYPE_HIGHLOW:
193                 dataset = factory.getHighLowDataset((JRHighLowDataset) chart.getDataset());
194                 plot = factory.getHighLowPlot((JRHighLowPlot) chart.getPlot());
195                 break;
196             case CHART_TYPE_LINE:
197                 dataset = factory.getCategoryDataset((JRCategoryDataset) chart.getDataset());
198                 plot = factory.getLinePlot((JRLinePlot) chart.getPlot());
199                 break;
200             case CHART_TYPE_METER:
201                 dataset = factory.getValueDataset((JRValueDataset) chart.getDataset());
202                 plot = factory.getMeterPlot((JRMeterPlot) chart.getPlot());
203                 break;
204             case CHART_TYPE_MULTI_AXIS:
205                 dataset = null;
206                 plot = factory.getMultiAxisPlot((JRMultiAxisPlot) chart.getPlot());
207                 break;
208             case CHART_TYPE_PIE:
209                 dataset = factory.getPieDataset((JRPieDataset) chart.getDataset());
210                 plot = factory.getPiePlot((JRPiePlot) chart.getPlot());
211                 break;
212             case CHART_TYPE_PIE3D:
213                 dataset = factory.getPieDataset((JRPieDataset) chart.getDataset());
214                 plot = factory.getPie3DPlot((JRPie3DPlot) chart.getPlot());
215                 break;
216             case CHART_TYPE_SCATTER:
217                 dataset = factory.getXyDataset((JRXyDataset) chart.getDataset());
218                 plot = factory.getScatterPlot((JRScatterPlot) chart.getPlot());
219                 break;
220             case CHART_TYPE_STACKEDBAR:
221                 dataset = factory.getCategoryDataset((JRCategoryDataset) chart.getDataset());
222                 plot = factory.getBarPlot((JRBarPlot) chart.getPlot());
223                 break;
224             case CHART_TYPE_STACKEDBAR3D:
225                 dataset = factory.getCategoryDataset((JRCategoryDataset) chart.getDataset());
226                 plot = factory.getBar3DPlot((JRBar3DPlot) chart.getPlot());
227                 break;
228             case CHART_TYPE_THERMOMETER:
229                 dataset = factory.getValueDataset((JRValueDataset) chart.getDataset());
230                 plot = factory.getThermometerPlot((JRThermometerPlot) chart.getPlot());
231                 break;
232             case CHART_TYPE_TIMESERIES:
233                 dataset = factory.getTimeSeriesDataset((JRTimeSeriesDataset)chart.getDataset());
234                 plot = factory.getTimeSeriesPlot( (JRTimeSeriesPlot)chart.getPlot() );
235                 break;
236             case CHART_TYPE_XYAREA:
237                 dataset = factory.getXyDataset((JRXyDataset) chart.getDataset());
238                 plot = factory.getAreaPlot((JRAreaPlot) chart.getPlot());
239                 break;
240             case CHART_TYPE_XYBAR:
241                 
242                 switch (chart.getDataset().getDatasetType()){
243                     case JRChartDataset.TIMESERIES_DATASET:
244                         dataset = factory.getTimeSeriesDataset((JRTimeSeriesDataset) chart.getDataset());
245                         break;
246                     case JRChartDataset.TIMEPERIOD_DATASET:
247                         dataset = factory.getTimePeriodDataset((JRTimePeriodDataset) chart.getDataset() );
248                         break;
249                     case JRChartDataset.XY_DATASET:
250                         dataset = factory.getXyDataset( (JRXyDataset)chart.getDataset() );
251                         break;
252                 }
253                 plot = factory.getBarPlot((JRBarPlot)chart.getPlot());
254                 break;
255             case CHART_TYPE_XYLINE:
256                 dataset = factory.getXyDataset((JRXyDataset) chart.getDataset());
257                 plot = factory.getLinePlot((JRLinePlot) chart.getPlot());
258                 break;
259             default:
260                 throw new JRRuntimeException("Chart type not supported.");
261         }
262
263         isShowLegend = chart.isShowLegend();
264         evaluationTime = chart.getEvaluationTime();
265         linkType = chart.getLinkType();
266         hyperlinkTarget = chart.getHyperlinkTarget();
267         titlePosition = chart.getTitlePosition();
268         titleColor = chart.getTitleColor();
269         subtitleColor = chart.getSubtitleColor();
270         legendColor = chart.getLegendColor();
271         legendBackgroundColor = chart.getLegendBackgroundColor();
272
273         titleFont = factory.getFont(chart.getTitleFont());
274         subtitleFont = factory.getFont(chart.getSubtitleFont());
275         legendFont = factory.getFont(chart.getLegendFont());
276
277         evaluationGroup = factory.getGroup(chart.getEvaluationGroup());
278         titleExpression = factory.getExpression(chart.getTitleExpression());
279         subtitleExpression = factory.getExpression(chart.getSubtitleExpression());
280         anchorNameExpression = factory.getExpression(chart.getAnchorNameExpression());
281         hyperlinkReferenceExpression = factory.getExpression(chart.getHyperlinkReferenceExpression());
282         hyperlinkAnchorExpression = factory.getExpression(chart.getHyperlinkAnchorExpression());
283         hyperlinkPageExpression = factory.getExpression(chart.getHyperlinkPageExpression());
284         hyperlinkTooltipExpression = factory.getExpression(chart.getHyperlinkTooltipExpression());
285         bookmarkLevel = chart.getBookmarkLevel();
286         hyperlinkParameters = JRBaseHyperlink.copyHyperlinkParameters(chart, factory);
287
288         customizerClass = chart.getCustomizerClass();
289
290         border = chart.getOwnBorder();
291         topBorder = chart.getOwnTopBorder();
292         leftBorder = chart.getOwnLeftBorder();
293         bottomBorder = chart.getOwnBottomBorder();
294         rightBorder = chart.getOwnRightBorder();
295         borderColor = chart.getOwnBorderColor();
296         topBorderColor = chart.getOwnTopBorderColor();
297         leftBorderColor = chart.getOwnLeftBorderColor();
298         bottomBorderColor = chart.getOwnBottomBorderColor();
299         rightBorderColor = chart.getOwnRightBorderColor();
300         padding = chart.getOwnPadding();
301         topPadding = chart.getOwnTopPadding();
302         leftPadding = chart.getOwnLeftPadding();
303         bottomPadding = chart.getOwnBottomPadding();
304         rightPadding = chart.getOwnRightPadding();
305
306     }
307         
308
309     /**
310      *
311      */

312     public boolean isShowLegend()
313     {
314         return this.isShowLegend;
315     }
316
317     /**
318      *
319      */

320     public void setShowLegend(boolean isShowLegend)
321     {
322         this.isShowLegend = isShowLegend;
323     }
324
325     /**
326      *
327      */

328     public byte getEvaluationTime()
329     {
330         return evaluationTime;
331     }
332         
333     /**
334      *
335      */

336     public JRGroup getEvaluationGroup()
337     {
338         return evaluationGroup;
339     }
340         
341     /**
342      * @deprecated
343      */

344     public JRBox getBox()
345     {
346         return this;
347     }
348
349     /**
350      *
351      */

352     public JRFont getTitleFont()
353     {
354         return titleFont;
355     }
356
357     /**
358      *
359      */

360     public byte getTitlePosition()
361     {
362         return titlePosition;
363     }
364
365     /**
366      *
367      */

368     public void setTitlePosition(byte titlePosition)
369     {
370         this.titlePosition = titlePosition;
371     }
372
373     /**
374      *
375      */

376     public Color JavaDoc getTitleColor()
377     {
378         return titleColor;
379     }
380
381     /**
382      *
383      */

384     public void setTitleColor(Color JavaDoc titleColor)
385     {
386         this.titleColor = titleColor;
387     }
388
389     /**
390      *
391      */

392     public JRFont getSubtitleFont()
393     {
394         return subtitleFont;
395     }
396
397     /**
398      *
399      */

400     public Color JavaDoc getSubtitleColor()
401     {
402         return subtitleColor;
403     }
404
405     /**
406      *
407      */

408     public void setSubtitleColor(Color JavaDoc subtitleColor)
409     {
410         this.subtitleColor = subtitleColor;
411     }
412
413
414     public Color JavaDoc getLegendBackgroundColor() {
415         return legendBackgroundColor;
416     }
417
418
419     public Color JavaDoc getLegendColor() {
420         return legendColor;
421     }
422
423
424     public JRFont getLegendFont() {
425         return legendFont;
426     }
427
428
429     public void setLegendBackgroundColor(Color JavaDoc legendBackgroundColor) {
430         this.legendBackgroundColor = legendBackgroundColor;
431     }
432
433
434     public void setLegendColor(Color JavaDoc legendColor) {
435         this.legendColor = legendColor;
436     }
437     
438     /**
439      *
440      */

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

449     public byte getHyperlinkTarget()
450     {
451         return hyperlinkTarget;
452     }
453         
454     /**
455      *
456      */

457     public JRExpression getTitleExpression()
458     {
459         return titleExpression;
460     }
461
462     /**
463      *
464      */

465     public JRExpression getSubtitleExpression()
466     {
467         return subtitleExpression;
468     }
469
470     /**
471      *
472      */

473     public JRExpression getAnchorNameExpression()
474     {
475         return anchorNameExpression;
476     }
477
478     /**
479      *
480      */

481     public JRExpression getHyperlinkReferenceExpression()
482     {
483         return hyperlinkReferenceExpression;
484     }
485
486     /**
487      *
488      */

489     public JRExpression getHyperlinkAnchorExpression()
490     {
491         return hyperlinkAnchorExpression;
492     }
493
494     /**
495      *
496      */

497     public JRExpression getHyperlinkPageExpression()
498     {
499         return hyperlinkPageExpression;
500     }
501     
502     /**
503      *
504      */

505     public JRChartDataset getDataset()
506     {
507         return dataset;
508     }
509
510     /**
511      *
512      */

513     public JRChartPlot getPlot()
514     {
515         return plot;
516     }
517
518     public byte getChartType()
519     {
520         return chartType;
521     }
522
523
524     public JRChild getCopy(JRAbstractObjectFactory factory)
525     {
526         return factory.getChart(this);
527     }
528
529
530     public void collectExpressions(JRExpressionCollector collector)
531     {
532         collector.collect(this);
533     }
534
535
536     public void writeXml(JRXmlWriter xmlWriter) throws IOException JavaDoc
537     {
538         xmlWriter.writeChartTag(this);
539     }
540
541
542     public int getBookmarkLevel()
543     {
544         return bookmarkLevel;
545     }
546
547
548     /**
549      *
550      */

551     public String JavaDoc getCustomizerClass()
552     {
553         return customizerClass;
554     }
555
556     /**
557      *
558      */

559     public byte getMode()
560     {
561         return JRStyleResolver.getMode(this, MODE_TRANSPARENT);
562     }
563
564     /**
565      *
566      */

567     public byte getBorder()
568     {
569         return JRStyleResolver.getBorder(this);
570     }
571
572     public Byte JavaDoc getOwnBorder()
573     {
574         return border;
575     }
576
577     /**
578      *
579      */

580     public void setBorder(byte border)
581     {
582         this.border = new Byte JavaDoc(border);
583     }
584
585     /**
586      *
587      */

588     public void setBorder(Byte JavaDoc border)
589     {
590         this.border = border;
591     }
592
593     /**
594      *
595      */

596     public Color JavaDoc getBorderColor()
597     {
598         return JRStyleResolver.getBorderColor(this, getForecolor());
599     }
600
601     public Color JavaDoc getOwnBorderColor()
602     {
603         return borderColor;
604     }
605
606     /**
607      *
608      */

609     public void setBorderColor(Color JavaDoc borderColor)
610     {
611         this.borderColor = borderColor;
612     }
613
614     /**
615      *
616      */

617     public int getPadding()
618     {
619         return JRStyleResolver.getPadding(this);
620     }
621
622     public Integer JavaDoc getOwnPadding()
623     {
624         return padding;
625     }
626
627     /**
628      *
629      */

630     public void setPadding(int padding)
631     {
632         this.padding = new Integer JavaDoc(padding);
633     }
634
635     /**
636      *
637      */

638     public void setPadding(Integer JavaDoc padding)
639     {
640         this.padding = padding;
641     }
642
643     /**
644      *
645      */

646     public byte getTopBorder()
647     {
648         return JRStyleResolver.getTopBorder(this);
649     }
650
651     /**
652      *
653      */

654     public Byte JavaDoc getOwnTopBorder()
655     {
656         return topBorder;
657     }
658
659     /**
660      *
661      */

662     public void setTopBorder(byte topBorder)
663     {
664         this.topBorder = new Byte JavaDoc(topBorder);
665     }
666
667     /**
668      *
669      */

670     public void setTopBorder(Byte JavaDoc topBorder)
671     {
672         this.topBorder = topBorder;
673     }
674
675     /**
676      *
677      */

678     public Color JavaDoc getTopBorderColor()
679     {
680         return JRStyleResolver.getTopBorderColor(this, getForecolor());
681     }
682
683     /**
684      *
685      */

686     public Color JavaDoc getOwnTopBorderColor()
687     {
688         return topBorderColor;
689     }
690
691     /**
692      *
693      */

694     public void setTopBorderColor(Color JavaDoc topBorderColor)
695     {
696         this.topBorderColor = topBorderColor;
697     }
698
699     /**
700      *
701      */

702     public int getTopPadding()
703     {
704         return JRStyleResolver.getTopPadding(this);
705     }
706
707     /**
708      *
709      */

710     public Integer JavaDoc getOwnTopPadding()
711     {
712         return topPadding;
713     }
714
715     /**
716      *
717      */

718     public void setTopPadding(int topPadding)
719     {
720         this.topPadding = new Integer JavaDoc(topPadding);
721     }
722
723     /**
724      *
725      */

726     public void setTopPadding(Integer JavaDoc topPadding)
727     {
728         this.topPadding = topPadding;
729     }
730
731     /**
732      *
733      */

734     public byte getLeftBorder()
735     {
736         return JRStyleResolver.getLeftBorder(this);
737     }
738
739     /**
740      *
741      */

742     public Byte JavaDoc getOwnLeftBorder()
743     {
744         return leftBorder;
745     }
746
747     /**
748      *
749      */

750     public void setLeftBorder(byte leftBorder)
751     {
752         this.leftBorder = new Byte JavaDoc(leftBorder);
753     }
754
755     /**
756      *
757      */

758     public void setLeftBorder(Byte JavaDoc leftBorder)
759     {
760         this.leftBorder = leftBorder;
761     }
762
763     /**
764      *
765      */

766     public Color JavaDoc getLeftBorderColor()
767     {
768         return JRStyleResolver.getLeftBorderColor(this, getForecolor());
769     }
770
771     /**
772      *
773      */

774     public Color JavaDoc getOwnLeftBorderColor()
775     {
776         return leftBorderColor;
777     }
778
779     /**
780      *
781      */

782     public void setLeftBorderColor(Color JavaDoc leftBorderColor)
783     {
784         this.leftBorderColor = leftBorderColor;
785     }
786
787     /**
788      *
789      */

790     public int getLeftPadding()
791     {
792         return JRStyleResolver.getLeftPadding(this);
793     }
794
795     /**
796      *
797      */

798     public Integer JavaDoc getOwnLeftPadding()
799     {
800         return leftPadding;
801     }
802
803     /**
804      *
805      */

806     public void setLeftPadding(int leftPadding)
807     {
808         this.leftPadding = new Integer JavaDoc(leftPadding);
809     }
810
811     /**
812      *
813      */

814     public void setLeftPadding(Integer JavaDoc leftPadding)
815     {
816         this.leftPadding = leftPadding;
817     }
818
819     /**
820      *
821      */

822     public byte getBottomBorder()
823     {
824         return JRStyleResolver.getBottomBorder(this);
825     }
826
827     /**
828      *
829      */

830     public Byte JavaDoc getOwnBottomBorder()
831     {
832         return bottomBorder;
833     }
834
835     /**
836      *
837      */

838     public void setBottomBorder(byte bottomBorder)
839     {
840         this.bottomBorder = new Byte JavaDoc(bottomBorder);
841     }
842
843     /**
844      *
845      */

846     public void setBottomBorder(Byte JavaDoc bottomBorder)
847     {
848         this.bottomBorder = bottomBorder;
849     }
850
851     /**
852      *
853      */

854     public Color JavaDoc getBottomBorderColor()
855     {
856         return JRStyleResolver.getBottomBorderColor(this, getForecolor());
857     }
858
859     /**
860      *
861      */

862     public Color JavaDoc getOwnBottomBorderColor()
863     {
864         return bottomBorderColor;
865     }
866
867     /**
868      *
869      */

870     public void setBottomBorderColor(Color JavaDoc bottomBorderColor)
871     {
872         this.bottomBorderColor = bottomBorderColor;
873     }
874
875     /**
876      *
877      */

878     public int getBottomPadding()
879     {
880         return JRStyleResolver.getBottomPadding(this);
881     }
882
883     /**
884      *
885      */

886     public Integer JavaDoc getOwnBottomPadding()
887     {
888         return bottomPadding;
889     }
890
891     /**
892      *
893      */

894     public void setBottomPadding(int bottomPadding)
895     {
896         this.bottomPadding = new Integer JavaDoc(bottomPadding);
897     }
898
899     /**
900      *
901      */

902     public void setBottomPadding(Integer JavaDoc bottomPadding)
903     {
904         this.bottomPadding = bottomPadding;
905     }
906
907     /**
908      *
909      */

910     public byte getRightBorder()
911     {
912         return JRStyleResolver.getRightBorder(this);
913     }
914
915     /**
916      *
917      */

918     public Byte JavaDoc getOwnRightBorder()
919     {
920         return rightBorder;
921     }
922
923     /**
924      *
925      */

926     public void setRightBorder(byte rightBorder)
927     {
928         this.rightBorder = new Byte JavaDoc(rightBorder);
929     }
930
931     /**
932      *
933      */

934     public void setRightBorder(Byte JavaDoc rightBorder)
935     {
936         this.rightBorder = rightBorder;
937     }
938
939     /**
940      *
941      */

942     public Color JavaDoc getRightBorderColor()
943     {
944         return JRStyleResolver.getRightBorderColor(this, getForecolor());
945     }
946
947     /**
948      *
949      */

950     public Color JavaDoc getOwnRightBorderColor()
951     {
952         return rightBorderColor;
953     }
954
955     /**
956      *
957      */

958     public void setRightBorderColor(Color JavaDoc rightBorderColor)
959     {
960         this.rightBorderColor = rightBorderColor;
961     }
962
963     /**
964      *
965      */

966     public int getRightPadding()
967     {
968         return JRStyleResolver.getRightPadding(this);
969     }
970
971     /**
972      *
973      */

974     public Integer JavaDoc getOwnRightPadding()
975     {
976         return rightPadding;
977     }
978
979     /**
980      *
981      */

982     public void setRightPadding(int rightPadding)
983     {
984         this.rightPadding = new Integer JavaDoc(rightPadding);
985     }
986
987     /**
988      *
989      */

990     public void setRightPadding(Integer JavaDoc rightPadding)
991     {
992         this.rightPadding = rightPadding;
993     }
994
995
996     public String JavaDoc getLinkType()
997     {
998         return linkType;
999     }
1000
1001
1002    public JRHyperlinkParameter[] getHyperlinkParameters()
1003    {
1004        return hyperlinkParameters;
1005    }
1006    
1007    
1008    private void readObject(ObjectInputStream JavaDoc in) throws IOException JavaDoc, ClassNotFoundException JavaDoc
1009    {
1010        in.defaultReadObject();
1011        normalizeLinkType();
1012    }
1013
1014
1015    protected void normalizeLinkType()
1016    {
1017        if (linkType == null)
1018        {
1019             linkType = JRHyperlinkHelper.getLinkType(hyperlinkType);
1020        }
1021        hyperlinkType = JRHyperlink.HYPERLINK_TYPE_NULL;
1022    }
1023
1024    
1025    public JRExpression getHyperlinkTooltipExpression()
1026    {
1027        return hyperlinkTooltipExpression;
1028    }
1029
1030}
1031
Popular Tags