KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > design > JRDesignImage


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.design;
29
30 import java.awt.Color JavaDoc;
31 import java.io.IOException JavaDoc;
32 import java.io.ObjectInputStream JavaDoc;
33 import java.util.ArrayList JavaDoc;
34 import java.util.Iterator JavaDoc;
35 import java.util.List JavaDoc;
36
37 import net.sf.jasperreports.engine.JRAbstractObjectFactory;
38 import net.sf.jasperreports.engine.JRAnchor;
39 import net.sf.jasperreports.engine.JRBox;
40 import net.sf.jasperreports.engine.JRChild;
41 import net.sf.jasperreports.engine.JRConstants;
42 import net.sf.jasperreports.engine.JRDefaultStyleProvider;
43 import net.sf.jasperreports.engine.JRExpression;
44 import net.sf.jasperreports.engine.JRExpressionCollector;
45 import net.sf.jasperreports.engine.JRGroup;
46 import net.sf.jasperreports.engine.JRHyperlink;
47 import net.sf.jasperreports.engine.JRHyperlinkHelper;
48 import net.sf.jasperreports.engine.JRHyperlinkParameter;
49 import net.sf.jasperreports.engine.JRImage;
50 import net.sf.jasperreports.engine.util.JRStyleResolver;
51 import net.sf.jasperreports.engine.xml.JRXmlWriter;
52
53
54 /**
55  * The actual implementation of a graphic element representing an image, used at design time.
56  * @author Teodor Danciu (teodord@users.sourceforge.net)
57  * @version $Id: JRDesignImage.java 1364 2006-08-31 18:13:20 +0300 (Thu, 31 Aug 2006) lucianc $
58  */

59 public class JRDesignImage extends JRDesignGraphicElement implements JRImage
60 {
61
62
63     /**
64      *
65      */

66     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
67
68     /**
69      *
70      */

71     protected Byte JavaDoc scaleImage;
72     protected Byte JavaDoc horizontalAlignment;
73     protected Byte JavaDoc verticalAlignment;
74     protected Boolean JavaDoc isUsingCache = null;
75     protected boolean isLazy = false;
76     protected byte onErrorType = ON_ERROR_TYPE_ERROR;
77     protected byte evaluationTime = JRExpression.EVALUATION_TIME_NOW;
78     protected byte hyperlinkType = JRHyperlink.HYPERLINK_TYPE_NULL;
79     protected String JavaDoc linkType;
80     protected byte hyperlinkTarget = JRHyperlink.HYPERLINK_TARGET_SELF;
81     private List JavaDoc hyperlinkParameters;
82
83     /**
84      *
85      */

86     protected Byte JavaDoc border;
87     protected Byte JavaDoc topBorder = null;
88     protected Byte JavaDoc leftBorder = null;
89     protected Byte JavaDoc bottomBorder = null;
90     protected Byte JavaDoc rightBorder = null;
91     protected Color JavaDoc borderColor = null;
92     protected Color JavaDoc topBorderColor = null;
93     protected Color JavaDoc leftBorderColor = null;
94     protected Color JavaDoc bottomBorderColor = null;
95     protected Color JavaDoc rightBorderColor = null;
96     protected Integer JavaDoc padding;
97     protected Integer JavaDoc topPadding = null;
98     protected Integer JavaDoc leftPadding = null;
99     protected Integer JavaDoc bottomPadding = null;
100     protected Integer JavaDoc rightPadding = null;
101
102     
103     /**
104      *
105      */

106 // protected JRBox box = null;
107

108     /**
109      *
110      */

111     protected JRGroup evaluationGroup = null;
112     protected JRExpression expression = null;
113     protected JRExpression anchorNameExpression = null;
114     protected JRExpression hyperlinkReferenceExpression = null;
115     protected JRExpression hyperlinkAnchorExpression = null;
116     protected JRExpression hyperlinkPageExpression = null;
117     private JRExpression hyperlinkTooltipExpression;
118
119     /**
120      * The bookmark level for the anchor associated with this image.
121      * @see JRAnchor#getBookmarkLevel()
122      */

123     protected int bookmarkLevel = JRAnchor.NO_BOOKMARK;
124
125
126     /**
127      *
128      */

129     public JRDesignImage(JRDefaultStyleProvider defaultStyleProvider)
130     {
131         super(defaultStyleProvider);
132         
133         hyperlinkParameters = new ArrayList JavaDoc();
134     }
135         
136
137     /**
138      *
139      */

140     public byte getPen()
141     {
142         return JRStyleResolver.getPen(this, PEN_NONE);
143     }
144
145     /**
146      *
147      */

148     public byte getMode()
149     {
150         return JRStyleResolver.getMode(this, MODE_TRANSPARENT);
151     }
152
153
154     /**
155      *
156      */

157     public byte getScaleImage()
158     {
159         return JRStyleResolver.getScaleImage(this);
160     }
161
162     public Byte JavaDoc getOwnScaleImage()
163     {
164         return scaleImage;
165     }
166
167     /**
168      *
169      */

170     public void setScaleImage(byte scaleImage)
171     {
172         this.scaleImage = new Byte JavaDoc(scaleImage);
173     }
174
175     /**
176      *
177      */

178     public void setScaleImage(Byte JavaDoc scaleImage)
179     {
180         this.scaleImage = scaleImage;
181     }
182
183     /**
184      *
185      */

186     public byte getHorizontalAlignment()
187     {
188         return JRStyleResolver.getHorizontalAlignment(this);
189     }
190
191     public Byte JavaDoc getOwnHorizontalAlignment()
192     {
193         return horizontalAlignment;
194     }
195
196     /**
197      *
198      */

199     public void setHorizontalAlignment(byte horizontalAlignment)
200     {
201         this.horizontalAlignment = new Byte JavaDoc(horizontalAlignment);
202     }
203
204     /**
205      *
206      */

207     public void setHorizontalAlignment(Byte JavaDoc horizontalAlignment)
208     {
209         this.horizontalAlignment = horizontalAlignment;
210     }
211
212     /**
213      *
214      */

215     public byte getVerticalAlignment()
216     {
217         return JRStyleResolver.getVerticalAlignment(this);
218     }
219
220     public Byte JavaDoc getOwnVerticalAlignment()
221     {
222         return verticalAlignment;
223     }
224
225     /**
226      *
227      */

228     public void setVerticalAlignment(byte verticalAlignment)
229     {
230         this.verticalAlignment = new Byte JavaDoc(verticalAlignment);
231     }
232
233     /**
234      *
235      */

236     public void setVerticalAlignment(Byte JavaDoc verticalAlignment)
237     {
238         this.verticalAlignment = verticalAlignment;
239     }
240
241     /**
242      *
243      */

244     public boolean isUsingCache()
245     {
246         if (isUsingCache == null)
247         {
248             if (getExpression() != null)
249             {
250                 return String JavaDoc.class.getName().equals(getExpression().getValueClassName());
251             }
252             return true;
253         }
254         return isUsingCache.booleanValue();
255     }
256
257     /**
258      *
259      */

260     public Boolean JavaDoc isOwnUsingCache()
261     {
262         return isUsingCache;
263     }
264
265     /**
266      *
267      */

268     public byte getEvaluationTime()
269     {
270         return evaluationTime;
271     }
272         
273     /**
274      * @deprecated
275      */

276     public JRBox getBox()
277     {
278         return this;
279     }
280
281     /**
282      *
283      */

284     public byte getHyperlinkType()
285     {
286         return JRHyperlinkHelper.getHyperlinkType(this);
287     }
288         
289     /**
290      *
291      */

292     public byte getHyperlinkTarget()
293     {
294         return hyperlinkTarget;
295     }
296         
297     /**
298      *
299      */

300     public JRGroup getEvaluationGroup()
301     {
302         return evaluationGroup;
303     }
304         
305     /**
306      *
307      */

308     public JRExpression getExpression()
309     {
310         return expression;
311     }
312
313     /**
314      *
315      */

316     public JRExpression getAnchorNameExpression()
317     {
318         return anchorNameExpression;
319     }
320
321     /**
322      *
323      */

324     public JRExpression getHyperlinkReferenceExpression()
325     {
326         return hyperlinkReferenceExpression;
327     }
328
329     /**
330      *
331      */

332     public JRExpression getHyperlinkAnchorExpression()
333     {
334         return hyperlinkAnchorExpression;
335     }
336
337     /**
338      *
339      */

340     public JRExpression getHyperlinkPageExpression()
341     {
342         return hyperlinkPageExpression;
343     }
344
345
346     /**
347      *
348      */

349     public void setUsingCache(boolean isUsingCache)
350     {
351         setUsingCache(isUsingCache ? Boolean.TRUE : Boolean.FALSE);
352     }
353
354     /**
355      *
356      */

357     public void setUsingCache(Boolean JavaDoc isUsingCache)
358     {
359         this.isUsingCache = isUsingCache;
360     }
361
362     /**
363      *
364      */

365     public boolean isLazy()
366     {
367         return isLazy;
368     }
369
370     /**
371      *
372      */

373     public void setLazy(boolean isLazy)
374     {
375         this.isLazy = isLazy;
376     }
377
378     /**
379      *
380      */

381     public byte getOnErrorType()
382     {
383         return onErrorType;
384     }
385
386     /**
387      *
388      */

389     public void setOnErrorType(byte onErrorType)
390     {
391         this.onErrorType = onErrorType;
392     }
393
394     /**
395      * Sets the evaluation time for this image.
396      *
397      */

398     public void setEvaluationTime(byte evaluationTime)
399     {
400         this.evaluationTime = evaluationTime;
401     }
402         
403     /**
404      * @deprecated
405      */

406     public void setBox(JRBox box)
407     {
408         border = box.getOwnBorder();
409         topBorder = box.getOwnTopBorder();
410         leftBorder = box.getOwnLeftBorder();
411         bottomBorder = box.getOwnBottomBorder();
412         rightBorder = box.getOwnRightBorder();
413         borderColor = box.getOwnBorderColor();
414         topBorderColor = box.getOwnTopBorderColor();
415         leftBorderColor = box.getOwnLeftBorderColor();
416         bottomBorderColor = box.getOwnBottomBorderColor();
417         rightBorderColor = box.getOwnRightBorderColor();
418         padding = box.getOwnPadding();
419         topPadding = box.getOwnTopPadding();
420         leftPadding = box.getOwnLeftPadding();
421         bottomPadding = box.getOwnBottomPadding();
422         rightPadding = box.getOwnRightPadding();
423     }
424
425     
426     /**
427      * Sets the link type as a built-in hyperlink type.
428      *
429      * @param hyperlinkType the built-in hyperlink type
430      * @see #getLinkType()
431      */

432     public void setHyperlinkType(byte hyperlinkType)
433     {
434         setLinkType(JRHyperlinkHelper.getLinkType(hyperlinkType));
435     }
436         
437     /**
438      *
439      */

440     public void setHyperlinkTarget(byte hyperlinkTarget)
441     {
442         this.hyperlinkTarget = hyperlinkTarget;
443     }
444         
445     /**
446      *
447      */

448     public void setEvaluationGroup(JRGroup evaluationGroup)
449     {
450         this.evaluationGroup = evaluationGroup;
451     }
452         
453     /**
454      *
455      */

456     public void setExpression(JRExpression expression)
457     {
458         this.expression = expression;
459     }
460
461     /**
462      *
463      */

464     public void setAnchorNameExpression(JRExpression anchorNameExpression)
465     {
466         this.anchorNameExpression = anchorNameExpression;
467     }
468
469     /**
470      *
471      */

472     public void setHyperlinkReferenceExpression(JRExpression hyperlinkReferenceExpression)
473     {
474         this.hyperlinkReferenceExpression = hyperlinkReferenceExpression;
475     }
476
477     /**
478      *
479      */

480     public void setHyperlinkAnchorExpression(JRExpression hyperlinkAnchorExpression)
481     {
482         this.hyperlinkAnchorExpression = hyperlinkAnchorExpression;
483     }
484
485     /**
486      *
487      */

488     public void setHyperlinkPageExpression(JRExpression hyperlinkPageExpression)
489     {
490         this.hyperlinkPageExpression = hyperlinkPageExpression;
491     }
492     
493     /**
494      *
495      */

496     public JRChild getCopy(JRAbstractObjectFactory factory)
497     {
498         return factory.getImage(this);
499     }
500
501     /**
502      *
503      */

504     public void collectExpressions(JRExpressionCollector collector)
505     {
506         collector.collect(this);
507     }
508
509     /**
510      *
511      */

512     public void writeXml(JRXmlWriter xmlWriter) throws IOException JavaDoc
513     {
514         xmlWriter.writeImage(this);
515     }
516
517
518     public int getBookmarkLevel()
519     {
520         return bookmarkLevel;
521     }
522
523
524     /**
525      * Sets the boomark level for the anchor associated with this image.
526      *
527      * @param bookmarkLevel the bookmark level (starting from 1)
528      * or {@link JRAnchor#NO_BOOKMARK NO_BOOKMARK} if no bookmark should be created
529      */

530     public void setBookmarkLevel(int bookmarkLevel)
531     {
532         this.bookmarkLevel = bookmarkLevel;
533     }
534
535     /**
536      *
537      */

538     public byte getBorder()
539     {
540         return JRStyleResolver.getBorder(this);
541     }
542
543     public Byte JavaDoc getOwnBorder()
544     {
545         return border;
546     }
547
548     /**
549      *
550      */

551     public void setBorder(byte border)
552     {
553         this.border = new Byte JavaDoc(border);
554     }
555
556     /**
557      *
558      */

559     public Color JavaDoc getBorderColor()
560     {
561         return JRStyleResolver.getBorderColor(this, getForecolor());
562     }
563
564     public Color JavaDoc getOwnBorderColor()
565     {
566         return borderColor;
567     }
568
569     /**
570      *
571      */

572     public void setBorderColor(Color JavaDoc borderColor)
573     {
574         this.borderColor = borderColor;
575     }
576
577     /**
578      *
579      */

580     public int getPadding()
581     {
582         return JRStyleResolver.getPadding(this);
583     }
584
585     public Integer JavaDoc getOwnPadding()
586     {
587         return padding;
588     }
589
590     /**
591      *
592      */

593     public void setPadding(int padding)
594     {
595         this.padding = new Integer JavaDoc(padding);
596     }
597
598     /**
599      *
600      */

601     public byte getTopBorder()
602     {
603         return JRStyleResolver.getTopBorder(this);
604     }
605
606     /**
607      *
608      */

609     public Byte JavaDoc getOwnTopBorder()
610     {
611         return topBorder;
612     }
613
614     /**
615      *
616      */

617     public void setTopBorder(byte topBorder)
618     {
619         this.topBorder = new Byte JavaDoc(topBorder);
620     }
621
622     /**
623      *
624      */

625     public Color JavaDoc getTopBorderColor()
626     {
627         return JRStyleResolver.getTopBorderColor(this, getForecolor());
628     }
629
630     /**
631      *
632      */

633     public Color JavaDoc getOwnTopBorderColor()
634     {
635         return topBorderColor;
636     }
637
638     /**
639      *
640      */

641     public void setTopBorderColor(Color JavaDoc topBorderColor)
642     {
643         this.topBorderColor = topBorderColor;
644     }
645
646     /**
647      *
648      */

649     public int getTopPadding()
650     {
651         return JRStyleResolver.getTopPadding(this);
652     }
653
654     /**
655      *
656      */

657     public Integer JavaDoc getOwnTopPadding()
658     {
659         return topPadding;
660     }
661
662     /**
663      *
664      */

665     public void setTopPadding(int topPadding)
666     {
667         this.topPadding = new Integer JavaDoc(topPadding);
668     }
669
670     /**
671      *
672      */

673     public byte getLeftBorder()
674     {
675         return JRStyleResolver.getLeftBorder(this);
676     }
677
678     /**
679      *
680      */

681     public Byte JavaDoc getOwnLeftBorder()
682     {
683         return leftBorder;
684     }
685
686     /**
687      *
688      */

689     public void setLeftBorder(byte leftBorder)
690     {
691         this.leftBorder = new Byte JavaDoc(leftBorder);
692     }
693
694     /**
695      *
696      */

697     public Color JavaDoc getLeftBorderColor()
698     {
699         return JRStyleResolver.getLeftBorderColor(this, getForecolor());
700     }
701
702     /**
703      *
704      */

705     public Color JavaDoc getOwnLeftBorderColor()
706     {
707         return leftBorderColor;
708     }
709
710     /**
711      *
712      */

713     public void setLeftBorderColor(Color JavaDoc leftBorderColor)
714     {
715         this.leftBorderColor = leftBorderColor;
716     }
717
718     /**
719      *
720      */

721     public int getLeftPadding()
722     {
723         return JRStyleResolver.getLeftPadding(this);
724     }
725
726     /**
727      *
728      */

729     public Integer JavaDoc getOwnLeftPadding()
730     {
731         return leftPadding;
732     }
733
734     /**
735      *
736      */

737     public void setLeftPadding(int leftPadding)
738     {
739         this.leftPadding = new Integer JavaDoc(leftPadding);
740     }
741
742     /**
743      *
744      */

745     public byte getBottomBorder()
746     {
747         return JRStyleResolver.getBottomBorder(this);
748     }
749
750     /**
751      *
752      */

753     public Byte JavaDoc getOwnBottomBorder()
754     {
755         return bottomBorder;
756     }
757
758     /**
759      *
760      */

761     public void setBottomBorder(byte bottomBorder)
762     {
763         this.bottomBorder = new Byte JavaDoc(bottomBorder);
764     }
765
766     /**
767      *
768      */

769     public Color JavaDoc getBottomBorderColor()
770     {
771         return JRStyleResolver.getBottomBorderColor(this, getForecolor());
772     }
773
774     /**
775      *
776      */

777     public Color JavaDoc getOwnBottomBorderColor()
778     {
779         return bottomBorderColor;
780     }
781
782     /**
783      *
784      */

785     public void setBottomBorderColor(Color JavaDoc bottomBorderColor)
786     {
787         this.bottomBorderColor = bottomBorderColor;
788     }
789
790     /**
791      *
792      */

793     public int getBottomPadding()
794     {
795         return JRStyleResolver.getBottomPadding(this);
796     }
797
798     /**
799      *
800      */

801     public Integer JavaDoc getOwnBottomPadding()
802     {
803         return bottomPadding;
804     }
805
806     /**
807      *
808      */

809     public void setBottomPadding(int bottomPadding)
810     {
811         this.bottomPadding = new Integer JavaDoc(bottomPadding);
812     }
813
814     /**
815      *
816      */

817     public byte getRightBorder()
818     {
819         return JRStyleResolver.getRightBorder(this);
820     }
821
822     /**
823      *
824      */

825     public Byte JavaDoc getOwnRightBorder()
826     {
827         return rightBorder;
828     }
829
830     /**
831      *
832      */

833     public void setRightBorder(byte rightBorder)
834     {
835         this.rightBorder = new Byte JavaDoc(rightBorder);
836     }
837
838     /**
839      *
840      */

841     public Color JavaDoc getRightBorderColor()
842     {
843         return JRStyleResolver.getRightBorderColor(this, getForecolor());
844     }
845
846     /**
847      *
848      */

849     public Color JavaDoc getOwnRightBorderColor()
850     {
851         return rightBorderColor;
852     }
853
854     /**
855      *
856      */

857     public void setRightBorderColor(Color JavaDoc rightBorderColor)
858     {
859         this.rightBorderColor = rightBorderColor;
860     }
861
862     /**
863      *
864      */

865     public int getRightPadding()
866     {
867         return JRStyleResolver.getRightPadding(this);
868     }
869
870     /**
871      *
872      */

873     public Integer JavaDoc getOwnRightPadding()
874     {
875         return rightPadding;
876     }
877
878     /**
879      *
880      */

881     public void setRightPadding(int rightPadding)
882     {
883         this.rightPadding = new Integer JavaDoc(rightPadding);
884     }
885     
886
887     /**
888      *
889      */

890     public void setBorder(Byte JavaDoc border)
891     {
892         this.border = border;
893     }
894
895     /**
896      *
897      */

898     public void setPadding(Integer JavaDoc padding)
899     {
900         this.padding = padding;
901     }
902
903     /**
904      *
905      */

906     public void setTopBorder(Byte JavaDoc topBorder)
907     {
908         this.topBorder = topBorder;
909     }
910
911     /**
912      *
913      */

914     public void setTopPadding(Integer JavaDoc topPadding)
915     {
916         this.topPadding = topPadding;
917     }
918
919     /**
920      *
921      */

922     public void setLeftBorder(Byte JavaDoc leftBorder)
923     {
924         this.leftBorder = leftBorder;
925     }
926
927     /**
928      *
929      */

930     public void setLeftPadding(Integer JavaDoc leftPadding)
931     {
932         this.leftPadding = leftPadding;
933     }
934
935     /**
936      *
937      */

938     public void setBottomBorder(Byte JavaDoc bottomBorder)
939     {
940         this.bottomBorder = bottomBorder;
941     }
942
943     /**
944      *
945      */

946     public void setBottomPadding(Integer JavaDoc bottomPadding)
947     {
948         this.bottomPadding = bottomPadding;
949     }
950
951     /**
952      *
953      */

954     public void setRightBorder(Byte JavaDoc rightBorder)
955     {
956         this.rightBorder = rightBorder;
957     }
958
959     /**
960      *
961      */

962     public void setRightPadding(Integer JavaDoc rightPadding)
963     {
964         this.rightPadding = rightPadding;
965     }
966
967
968     public String JavaDoc getLinkType()
969     {
970         return linkType;
971     }
972
973
974     /**
975      * Sets the hyperlink type.
976      * <p>
977      * The type can be one of the built-in types
978      * (Reference, LocalAnchor, LocalPage, RemoteAnchor, RemotePage),
979      * or can be an arbitrary type.
980      * </p>
981      * @param type the hyperlink type
982      */

983     public void setLinkType(String JavaDoc type)
984     {
985         this.linkType = type;
986     }
987
988
989     public JRHyperlinkParameter[] getHyperlinkParameters()
990     {
991         JRHyperlinkParameter[] parameters;
992         if (hyperlinkParameters.isEmpty())
993         {
994             parameters = null;
995         }
996         else
997         {
998             parameters = new JRHyperlinkParameter[hyperlinkParameters.size()];
999             hyperlinkParameters.toArray(parameters);
1000        }
1001        return parameters;
1002    }
1003    
1004    
1005    /**
1006     * Returns the list of custom hyperlink parameters.
1007     *
1008     * @return the list of custom hyperlink parameters
1009     */

1010    public List JavaDoc getHyperlinkParametersList()
1011    {
1012        return hyperlinkParameters;
1013    }
1014    
1015    
1016    /**
1017     * Adds a custom hyperlink parameter.
1018     *
1019     * @param parameter the parameter to add
1020     */

1021    public void addHyperlinkParameter(JRHyperlinkParameter parameter)
1022    {
1023        hyperlinkParameters.add(parameter);
1024    }
1025    
1026
1027    /**
1028     * Removes a custom hyperlink parameter.
1029     *
1030     * @param parameter the parameter to remove
1031     */

1032    public void removeHyperlinkParameter(JRHyperlinkParameter parameter)
1033    {
1034        hyperlinkParameters.remove(parameter);
1035    }
1036    
1037    
1038    /**
1039     * Removes a custom hyperlink parameter.
1040     * <p>
1041     * If multiple parameters having the specified name exist, all of them
1042     * will be removed
1043     * </p>
1044     *
1045     * @param parameterName the parameter name
1046     */

1047    public void removeHyperlinkParameter(String JavaDoc parameterName)
1048    {
1049        for (Iterator JavaDoc it = hyperlinkParameters.iterator(); it.hasNext();)
1050        {
1051            JRHyperlinkParameter parameter = (JRHyperlinkParameter) it.next();
1052            if (parameter.getName() != null && parameter.getName().equals(parameterName))
1053            {
1054                it.remove();
1055            }
1056        }
1057    }
1058    
1059    
1060    private void readObject(ObjectInputStream JavaDoc in) throws IOException JavaDoc, ClassNotFoundException JavaDoc
1061    {
1062        in.defaultReadObject();
1063        normalizeLinkType();
1064    }
1065
1066
1067    protected void normalizeLinkType()
1068    {
1069        if (linkType == null)
1070        {
1071             linkType = JRHyperlinkHelper.getLinkType(hyperlinkType);
1072        }
1073        hyperlinkType = JRHyperlink.HYPERLINK_TYPE_NULL;
1074    }
1075
1076    
1077    public JRExpression getHyperlinkTooltipExpression()
1078    {
1079        return hyperlinkTooltipExpression;
1080    }
1081
1082    
1083    /**
1084     * Sets the expression which will be used to generate the hyperlink tooltip.
1085     *
1086     * @param hyperlinkTooltipExpression the expression which will be used to generate the hyperlink tooltip
1087     * @see #getHyperlinkTooltipExpression()
1088     */

1089    public void setHyperlinkTooltipExpression(JRExpression hyperlinkTooltipExpression)
1090    {
1091        this.hyperlinkTooltipExpression = hyperlinkTooltipExpression;
1092    }
1093
1094}
1095
Popular Tags