KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > xml > JRXmlConstants


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.xml;
29
30 import java.awt.Color JavaDoc;
31 import java.util.HashMap JavaDoc;
32 import java.util.Map JavaDoc;
33
34 import net.sf.jasperreports.charts.JRChartAxis;
35 import net.sf.jasperreports.charts.JRMeterPlot;
36 import net.sf.jasperreports.charts.JRThermometerPlot;
37 import net.sf.jasperreports.crosstabs.JRCellContents;
38 import net.sf.jasperreports.crosstabs.JRCrosstabMeasure;
39 import net.sf.jasperreports.crosstabs.fill.calculation.BucketDefinition;
40 import net.sf.jasperreports.engine.JRAlignment;
41 import net.sf.jasperreports.engine.JRBreak;
42 import net.sf.jasperreports.engine.JRChart;
43 import net.sf.jasperreports.engine.JRElement;
44 import net.sf.jasperreports.engine.JRExpression;
45 import net.sf.jasperreports.engine.JRGraphicElement;
46 import net.sf.jasperreports.engine.JRHyperlink;
47 import net.sf.jasperreports.engine.JRHyperlinkHelper;
48 import net.sf.jasperreports.engine.JRImage;
49 import net.sf.jasperreports.engine.JRLine;
50 import net.sf.jasperreports.engine.JRPrintText;
51 import net.sf.jasperreports.engine.JRReport;
52 import net.sf.jasperreports.engine.JRSortField;
53 import net.sf.jasperreports.engine.JRTextElement;
54 import net.sf.jasperreports.engine.JRVariable;
55
56 import org.jfree.chart.plot.PlotOrientation;
57 import org.jfree.chart.renderer.xy.XYBubbleRenderer;
58 import org.jfree.data.time.Day;
59 import org.jfree.data.time.Hour;
60 import org.jfree.data.time.Millisecond;
61 import org.jfree.data.time.Minute;
62 import org.jfree.data.time.Month;
63 import org.jfree.data.time.Quarter;
64 import org.jfree.data.time.Second;
65 import org.jfree.data.time.Week;
66 import org.jfree.data.time.Year;
67
68
69
70 /**
71  * @author Teodor Danciu (teodord@users.sourceforge.net)
72  * @version $Id: JRXmlConstants.java 1502 2006-11-21 18:14:56 +0200 (Tue, 21 Nov 2006) teodord $
73  */

74 public class JRXmlConstants
75 {
76
77
78     /**
79      *
80      */

81     private static final String JavaDoc POSITION_TYPE_FLOAT = "Float";
82     private static final String JavaDoc POSITION_TYPE_FIX_RELATIVE_TO_TOP = "FixRelativeToTop";
83     private static final String JavaDoc POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM = "FixRelativeToBottom";
84
85     private static Map JavaDoc positionTypeMap = null;
86
87     public static Map JavaDoc getPositionTypeMap()
88     {
89         if (positionTypeMap == null)
90         {
91             positionTypeMap = new HashMap JavaDoc(6);
92             positionTypeMap.put(POSITION_TYPE_FLOAT, new Byte JavaDoc(JRElement.POSITION_TYPE_FLOAT));
93             positionTypeMap.put(POSITION_TYPE_FIX_RELATIVE_TO_TOP, new Byte JavaDoc(JRElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP));
94             positionTypeMap.put(POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM, new Byte JavaDoc(JRElement.POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM));
95             positionTypeMap.put(new Byte JavaDoc(JRElement.POSITION_TYPE_FLOAT), POSITION_TYPE_FLOAT);
96             positionTypeMap.put(new Byte JavaDoc(JRElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP), POSITION_TYPE_FIX_RELATIVE_TO_TOP);
97             positionTypeMap.put(new Byte JavaDoc(JRElement.POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM), POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM);
98         }
99
100         return positionTypeMap;
101     }
102
103     /**
104      *
105      */

106     private static final String JavaDoc MODE_OPAQUE = "Opaque";
107     private static final String JavaDoc MODE_TRANSPARENT = "Transparent";
108
109     private static Map JavaDoc modeMap = null;
110
111     public static Map JavaDoc getModeMap()
112     {
113         if (modeMap == null)
114         {
115             modeMap = new HashMap JavaDoc(4);
116             modeMap.put(MODE_OPAQUE, new Byte JavaDoc(JRElement.MODE_OPAQUE));
117             modeMap.put(MODE_TRANSPARENT, new Byte JavaDoc(JRElement.MODE_TRANSPARENT));
118             modeMap.put(new Byte JavaDoc(JRElement.MODE_OPAQUE), MODE_OPAQUE);
119             modeMap.put(new Byte JavaDoc(JRElement.MODE_TRANSPARENT), MODE_TRANSPARENT);
120         }
121
122         return modeMap;
123     }
124
125     /**
126      *
127      */

128     private static final String JavaDoc COLOR_BLACK = "black";
129     private static final String JavaDoc COLOR_BLUE = "blue";
130     private static final String JavaDoc COLOR_CYAN = "cyan";
131     private static final String JavaDoc COLOR_DARK_GRAY = "darkGray";
132     private static final String JavaDoc COLOR_GRAY = "gray";
133     private static final String JavaDoc COLOR_GREEN = "green";
134     private static final String JavaDoc COLOR_LIGHT_GRAY = "lightGray";
135     private static final String JavaDoc COLOR_MAGENTA = "magenta";
136     private static final String JavaDoc COLOR_ORANGE = "orange";
137     private static final String JavaDoc COLOR_PINK = "pink";
138     private static final String JavaDoc COLOR_RED = "red";
139     private static final String JavaDoc COLOR_YELLOW = "yellow";
140     private static final String JavaDoc COLOR_WHITE = "white";
141
142     private static Map JavaDoc colorMap = null;
143
144     public static Map JavaDoc getColorMap()
145     {
146         if (colorMap == null)
147         {
148             colorMap = new HashMap JavaDoc(26);
149             colorMap.put(COLOR_BLACK, Color.black);
150             colorMap.put(COLOR_BLUE, Color.blue);
151             colorMap.put(COLOR_CYAN, Color.cyan);
152             colorMap.put(COLOR_DARK_GRAY, Color.darkGray);
153             colorMap.put(COLOR_GRAY, Color.gray);
154             colorMap.put(COLOR_GREEN, Color.green);
155             colorMap.put(COLOR_LIGHT_GRAY, Color.lightGray);
156             colorMap.put(COLOR_MAGENTA, Color.magenta);
157             colorMap.put(COLOR_ORANGE, Color.orange);
158             colorMap.put(COLOR_PINK, Color.pink);
159             colorMap.put(COLOR_RED, Color.red);
160             colorMap.put(COLOR_YELLOW, Color.yellow);
161             colorMap.put(COLOR_WHITE, Color.white);
162             colorMap.put(Color.black, COLOR_BLACK);
163             colorMap.put(Color.blue, COLOR_BLUE);
164             colorMap.put(Color.cyan, COLOR_CYAN);
165             colorMap.put(Color.darkGray, COLOR_DARK_GRAY);
166             colorMap.put(Color.gray, COLOR_GRAY);
167             colorMap.put(Color.green, COLOR_GREEN);
168             colorMap.put(Color.lightGray, COLOR_LIGHT_GRAY);
169             colorMap.put(Color.magenta, COLOR_MAGENTA);
170             colorMap.put(Color.orange, COLOR_ORANGE);
171             colorMap.put(Color.pink, COLOR_PINK);
172             colorMap.put(Color.red, COLOR_RED);
173             colorMap.put(Color.yellow, COLOR_YELLOW);
174             colorMap.put(Color.white, COLOR_WHITE);
175         }
176
177         return colorMap;
178     }
179
180     /**
181      *
182      */

183     private static final String JavaDoc HORIZONTAL_ALIGN_LEFT = "Left";
184     private static final String JavaDoc HORIZONTAL_ALIGN_CENTER = "Center";
185     private static final String JavaDoc HORIZONTAL_ALIGN_RIGHT = "Right";
186     private static final String JavaDoc HORIZONTAL_ALIGN_JUSTIFIED = "Justified";
187
188     private static Map JavaDoc horizontalAlignMap = null;
189
190     public static Map JavaDoc getHorizontalAlignMap()
191     {
192         if (horizontalAlignMap == null)
193         {
194             horizontalAlignMap = new HashMap JavaDoc(8);
195             horizontalAlignMap.put(HORIZONTAL_ALIGN_LEFT, new Byte JavaDoc(JRAlignment.HORIZONTAL_ALIGN_LEFT));
196             horizontalAlignMap.put(HORIZONTAL_ALIGN_CENTER, new Byte JavaDoc(JRAlignment.HORIZONTAL_ALIGN_CENTER));
197             horizontalAlignMap.put(HORIZONTAL_ALIGN_RIGHT, new Byte JavaDoc(JRAlignment.HORIZONTAL_ALIGN_RIGHT));
198             horizontalAlignMap.put(HORIZONTAL_ALIGN_JUSTIFIED, new Byte JavaDoc(JRAlignment.HORIZONTAL_ALIGN_JUSTIFIED));
199             horizontalAlignMap.put(new Byte JavaDoc(JRAlignment.HORIZONTAL_ALIGN_LEFT), HORIZONTAL_ALIGN_LEFT);
200             horizontalAlignMap.put(new Byte JavaDoc(JRAlignment.HORIZONTAL_ALIGN_CENTER), HORIZONTAL_ALIGN_CENTER);
201             horizontalAlignMap.put(new Byte JavaDoc(JRAlignment.HORIZONTAL_ALIGN_RIGHT), HORIZONTAL_ALIGN_RIGHT);
202             horizontalAlignMap.put(new Byte JavaDoc(JRAlignment.HORIZONTAL_ALIGN_JUSTIFIED), HORIZONTAL_ALIGN_JUSTIFIED);
203         }
204
205         return horizontalAlignMap;
206     }
207
208     /**
209      *
210      */

211     public static Map JavaDoc getTextAlignMap()
212     {
213         return getHorizontalAlignMap();
214     }
215
216     /**
217      *
218      */

219     private static final String JavaDoc VERTICAL_ALIGN_TOP = "Top";
220     private static final String JavaDoc VERTICAL_ALIGN_MIDDLE = "Middle";
221     private static final String JavaDoc VERTICAL_ALIGN_BOTTOM = "Bottom";
222
223     private static Map JavaDoc verticalAlignMap = null;
224
225     public static Map JavaDoc getVerticalAlignMap()
226     {
227         if (verticalAlignMap == null)
228         {
229             verticalAlignMap = new HashMap JavaDoc(6);
230             verticalAlignMap.put(VERTICAL_ALIGN_TOP, new Byte JavaDoc(JRAlignment.VERTICAL_ALIGN_TOP));
231             verticalAlignMap.put(VERTICAL_ALIGN_MIDDLE, new Byte JavaDoc(JRAlignment.VERTICAL_ALIGN_MIDDLE));
232             verticalAlignMap.put(VERTICAL_ALIGN_BOTTOM, new Byte JavaDoc(JRAlignment.VERTICAL_ALIGN_BOTTOM));
233             verticalAlignMap.put(new Byte JavaDoc(JRAlignment.VERTICAL_ALIGN_TOP), VERTICAL_ALIGN_TOP);
234             verticalAlignMap.put(new Byte JavaDoc(JRAlignment.VERTICAL_ALIGN_MIDDLE), VERTICAL_ALIGN_MIDDLE);
235             verticalAlignMap.put(new Byte JavaDoc(JRAlignment.VERTICAL_ALIGN_BOTTOM), VERTICAL_ALIGN_BOTTOM);
236         }
237
238         return verticalAlignMap;
239     }
240
241     /**
242      *
243      */

244     private static final String JavaDoc ROTATION_NONE = "None";
245     private static final String JavaDoc ROTATION_LEFT = "Left";
246     private static final String JavaDoc ROTATION_RIGHT = "Right";
247     private static final String JavaDoc ROTATION_UPSIDE_DOWN = "UpsideDown";
248
249     private static Map JavaDoc rotationMap = null;
250
251     public static Map JavaDoc getRotationMap()
252     {
253         if (rotationMap == null)
254         {
255             rotationMap = new HashMap JavaDoc(6);
256             rotationMap.put(ROTATION_NONE, new Byte JavaDoc(JRTextElement.ROTATION_NONE));
257             rotationMap.put(ROTATION_LEFT, new Byte JavaDoc(JRTextElement.ROTATION_LEFT));
258             rotationMap.put(ROTATION_RIGHT, new Byte JavaDoc(JRTextElement.ROTATION_RIGHT));
259             rotationMap.put(ROTATION_UPSIDE_DOWN, new Byte JavaDoc(JRTextElement.ROTATION_UPSIDE_DOWN));
260             rotationMap.put(new Byte JavaDoc(JRTextElement.ROTATION_NONE), ROTATION_NONE);
261             rotationMap.put(new Byte JavaDoc(JRTextElement.ROTATION_LEFT), ROTATION_LEFT);
262             rotationMap.put(new Byte JavaDoc(JRTextElement.ROTATION_RIGHT), ROTATION_RIGHT);
263             rotationMap.put(new Byte JavaDoc(JRTextElement.ROTATION_UPSIDE_DOWN), ROTATION_UPSIDE_DOWN);
264         }
265
266         return rotationMap;
267     }
268
269     /**
270      *
271      */

272     private static final String JavaDoc BREAK_TYPE_PAGE = "Page";
273     private static final String JavaDoc BREAK_TYPE_COLUMN = "Column";
274
275     private static Map JavaDoc breakTypeMap = null;
276
277     public static Map JavaDoc getBreakTypeMap()
278     {
279         if (breakTypeMap == null)
280         {
281             breakTypeMap = new HashMap JavaDoc(4);
282             breakTypeMap.put(BREAK_TYPE_PAGE, new Byte JavaDoc(JRBreak.TYPE_PAGE));
283             breakTypeMap.put(BREAK_TYPE_COLUMN, new Byte JavaDoc(JRPrintText.RUN_DIRECTION_RTL));
284             breakTypeMap.put(new Byte JavaDoc(JRBreak.TYPE_PAGE), BREAK_TYPE_PAGE);
285             breakTypeMap.put(new Byte JavaDoc(JRBreak.TYPE_COLUMN), BREAK_TYPE_COLUMN);
286         }
287
288         return breakTypeMap;
289     }
290
291     /**
292      *
293      */

294     private static final String JavaDoc RUN_DIRECTION_LTR = "LTR";
295     private static final String JavaDoc RUN_DIRECTION_RTL = "RTL";
296
297     private static Map JavaDoc runDirectionMap = null;
298
299     public static Map JavaDoc getRunDirectionMap()
300     {
301         if (runDirectionMap == null)
302         {
303             runDirectionMap = new HashMap JavaDoc(4);
304             runDirectionMap.put(RUN_DIRECTION_LTR, new Byte JavaDoc(JRPrintText.RUN_DIRECTION_LTR));
305             runDirectionMap.put(RUN_DIRECTION_RTL, new Byte JavaDoc(JRPrintText.RUN_DIRECTION_RTL));
306             runDirectionMap.put(new Byte JavaDoc(JRPrintText.RUN_DIRECTION_LTR), RUN_DIRECTION_LTR);
307             runDirectionMap.put(new Byte JavaDoc(JRPrintText.RUN_DIRECTION_RTL), RUN_DIRECTION_RTL);
308         }
309
310         return runDirectionMap;
311     }
312
313     /**
314      *
315      */

316     private static final String JavaDoc LINE_SPACING_SINGLE = "Single";
317     private static final String JavaDoc LINE_SPACING_1_1_2 = "1_1_2";
318     private static final String JavaDoc LINE_SPACING_DOUBLE = "Double";
319
320     private static Map JavaDoc lineSpacingMap = null;
321
322     public static Map JavaDoc getLineSpacingMap()
323     {
324         if (lineSpacingMap == null)
325         {
326             lineSpacingMap = new HashMap JavaDoc(6);
327             lineSpacingMap.put(LINE_SPACING_SINGLE, new Byte JavaDoc(JRTextElement.LINE_SPACING_SINGLE));
328             lineSpacingMap.put(LINE_SPACING_1_1_2, new Byte JavaDoc(JRTextElement.LINE_SPACING_1_1_2));
329             lineSpacingMap.put(LINE_SPACING_DOUBLE, new Byte JavaDoc(JRTextElement.LINE_SPACING_DOUBLE));
330             lineSpacingMap.put(new Byte JavaDoc(JRTextElement.LINE_SPACING_SINGLE), LINE_SPACING_SINGLE);
331             lineSpacingMap.put(new Byte JavaDoc(JRTextElement.LINE_SPACING_1_1_2), LINE_SPACING_1_1_2);
332             lineSpacingMap.put(new Byte JavaDoc(JRTextElement.LINE_SPACING_DOUBLE), LINE_SPACING_DOUBLE);
333         }
334
335         return lineSpacingMap;
336     }
337
338     /**
339      *
340      */

341     private static final String JavaDoc DIRECTION_TOP_DOWN = "TopDown";
342     private static final String JavaDoc DIRECTION_BOTTOM_UP = "BottomUp";
343
344     private static Map JavaDoc directionMap = null;
345
346     public static Map JavaDoc getDirectionMap()
347     {
348         if (directionMap == null)
349         {
350             directionMap = new HashMap JavaDoc(4);
351             directionMap.put(DIRECTION_TOP_DOWN, new Byte JavaDoc(JRLine.DIRECTION_TOP_DOWN));
352             directionMap.put(DIRECTION_BOTTOM_UP, new Byte JavaDoc(JRLine.DIRECTION_BOTTOM_UP));
353             directionMap.put(new Byte JavaDoc(JRLine.DIRECTION_TOP_DOWN), DIRECTION_TOP_DOWN);
354             directionMap.put(new Byte JavaDoc(JRLine.DIRECTION_BOTTOM_UP), DIRECTION_BOTTOM_UP);
355         }
356
357         return directionMap;
358     }
359
360     /**
361      *
362      */

363     private static final String JavaDoc SCALE_IMAGE_CLIP = "Clip";
364     private static final String JavaDoc SCALE_IMAGE_FILL_FRAME = "FillFrame";
365     private static final String JavaDoc SCALE_IMAGE_RETAIN_SHAPE = "RetainShape";
366
367     private static Map JavaDoc scaleImageMap = null;
368
369     public static Map JavaDoc getScaleImageMap()
370     {
371         if (scaleImageMap == null)
372         {
373             scaleImageMap = new HashMap JavaDoc(6);
374             scaleImageMap.put(SCALE_IMAGE_CLIP, new Byte JavaDoc(JRImage.SCALE_IMAGE_CLIP));
375             scaleImageMap.put(SCALE_IMAGE_FILL_FRAME, new Byte JavaDoc(JRImage.SCALE_IMAGE_FILL_FRAME));
376             scaleImageMap.put(SCALE_IMAGE_RETAIN_SHAPE, new Byte JavaDoc(JRImage.SCALE_IMAGE_RETAIN_SHAPE));
377             scaleImageMap.put(new Byte JavaDoc(JRImage.SCALE_IMAGE_CLIP), SCALE_IMAGE_CLIP);
378             scaleImageMap.put(new Byte JavaDoc(JRImage.SCALE_IMAGE_FILL_FRAME), SCALE_IMAGE_FILL_FRAME);
379             scaleImageMap.put(new Byte JavaDoc(JRImage.SCALE_IMAGE_RETAIN_SHAPE), SCALE_IMAGE_RETAIN_SHAPE);
380         }
381
382         return scaleImageMap;
383     }
384
385     /**
386      *
387      */

388     private static final String JavaDoc ON_ERROR_TYPE_ERROR = "Error";
389     private static final String JavaDoc ON_ERROR_TYPE_BLANK = "Blank";
390     private static final String JavaDoc ON_ERROR_TYPE_ICON = "Icon";
391
392     private static Map JavaDoc onErrorTypeMap = null;
393
394     public static Map JavaDoc getOnErrorTypeMap()
395     {
396         if (onErrorTypeMap == null)
397         {
398             onErrorTypeMap = new HashMap JavaDoc(6);
399             onErrorTypeMap.put(ON_ERROR_TYPE_ERROR, new Byte JavaDoc(JRImage.ON_ERROR_TYPE_ERROR));
400             onErrorTypeMap.put(ON_ERROR_TYPE_BLANK, new Byte JavaDoc(JRImage.ON_ERROR_TYPE_BLANK));
401             onErrorTypeMap.put(ON_ERROR_TYPE_ICON, new Byte JavaDoc(JRImage.ON_ERROR_TYPE_ICON));
402             onErrorTypeMap.put(new Byte JavaDoc(JRImage.ON_ERROR_TYPE_ERROR), ON_ERROR_TYPE_ERROR);
403             onErrorTypeMap.put(new Byte JavaDoc(JRImage.ON_ERROR_TYPE_BLANK), ON_ERROR_TYPE_BLANK);
404             onErrorTypeMap.put(new Byte JavaDoc(JRImage.ON_ERROR_TYPE_ICON), ON_ERROR_TYPE_ICON);
405         }
406
407         return onErrorTypeMap;
408     }
409
410     /**
411      *
412      */

413     private static final String JavaDoc STRETCH_TYPE_NO_STRETCH = "NoStretch";
414     private static final String JavaDoc STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT = "RelativeToTallestObject";
415     private static final String JavaDoc STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT = "RelativeToBandHeight";
416
417     private static Map JavaDoc stretchTypeMap = null;
418
419     public static Map JavaDoc getStretchTypeMap()
420     {
421         if (stretchTypeMap == null)
422         {
423             stretchTypeMap = new HashMap JavaDoc(6);
424             stretchTypeMap.put(STRETCH_TYPE_NO_STRETCH, new Byte JavaDoc(JRElement.STRETCH_TYPE_NO_STRETCH));
425             stretchTypeMap.put(STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT, new Byte JavaDoc(JRElement.STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT));
426             stretchTypeMap.put(STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT, new Byte JavaDoc(JRElement.STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT));
427             stretchTypeMap.put(new Byte JavaDoc(JRElement.STRETCH_TYPE_NO_STRETCH), STRETCH_TYPE_NO_STRETCH);
428             stretchTypeMap.put(new Byte JavaDoc(JRElement.STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT), STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT);
429             stretchTypeMap.put(new Byte JavaDoc(JRElement.STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT), STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT);
430         }
431
432         return stretchTypeMap;
433     }
434
435     /**
436      *
437      */

438     private static final String JavaDoc PEN_NONE = "None";
439     private static final String JavaDoc PEN_THIN = "Thin";
440     private static final String JavaDoc PEN_1_POINT = "1Point";
441     private static final String JavaDoc PEN_2_POINT = "2Point";
442     private static final String JavaDoc PEN_4_POINT = "4Point";
443     private static final String JavaDoc PEN_DOTTED = "Dotted";
444
445     private static Map JavaDoc penMap = null;
446
447     public static Map JavaDoc getPenMap()
448     {
449         if (penMap == null)
450         {
451             penMap = new HashMap JavaDoc(10);
452             penMap.put(PEN_NONE, new Byte JavaDoc(JRGraphicElement.PEN_NONE));
453             penMap.put(PEN_THIN, new Byte JavaDoc(JRGraphicElement.PEN_THIN));
454             penMap.put(PEN_1_POINT, new Byte JavaDoc(JRGraphicElement.PEN_1_POINT));
455             penMap.put(PEN_2_POINT, new Byte JavaDoc(JRGraphicElement.PEN_2_POINT));
456             penMap.put(PEN_4_POINT, new Byte JavaDoc(JRGraphicElement.PEN_4_POINT));
457             penMap.put(PEN_DOTTED, new Byte JavaDoc(JRGraphicElement.PEN_DOTTED));
458             penMap.put(new Byte JavaDoc(JRGraphicElement.PEN_NONE), PEN_NONE);
459             penMap.put(new Byte JavaDoc(JRGraphicElement.PEN_THIN), PEN_THIN);
460             penMap.put(new Byte JavaDoc(JRGraphicElement.PEN_1_POINT), PEN_1_POINT);
461             penMap.put(new Byte JavaDoc(JRGraphicElement.PEN_2_POINT), PEN_2_POINT);
462             penMap.put(new Byte JavaDoc(JRGraphicElement.PEN_4_POINT), PEN_4_POINT);
463             penMap.put(new Byte JavaDoc(JRGraphicElement.PEN_DOTTED), PEN_DOTTED);
464         }
465
466         return penMap;
467     }
468
469     /**
470      *
471      */

472     private static final String JavaDoc FILL_SOLID = "Solid";
473
474     private static Map JavaDoc fillMap = null;
475
476     public static Map JavaDoc getFillMap()
477     {
478         if (fillMap == null)
479         {
480             fillMap = new HashMap JavaDoc(2);
481             fillMap.put(FILL_SOLID, new Byte JavaDoc(JRGraphicElement.FILL_SOLID));
482             fillMap.put(new Byte JavaDoc(JRGraphicElement.FILL_SOLID), FILL_SOLID);
483         }
484
485         return fillMap;
486     }
487
488     /**
489      *
490      */

491     private static final String JavaDoc RESET_TYPE_NONE = "None";
492     private static final String JavaDoc RESET_TYPE_REPORT = "Report";
493     private static final String JavaDoc RESET_TYPE_PAGE = "Page";
494     private static final String JavaDoc RESET_TYPE_COLUMN = "Column";
495     private static final String JavaDoc RESET_TYPE_GROUP = "Group";
496
497     private static Map JavaDoc resetTypeMap = null;
498
499     public static Map JavaDoc getResetTypeMap()
500     {
501         if (resetTypeMap == null)
502         {
503             resetTypeMap = new HashMap JavaDoc(10);
504             resetTypeMap.put(RESET_TYPE_NONE, new Byte JavaDoc(JRVariable.RESET_TYPE_NONE));
505             resetTypeMap.put(RESET_TYPE_REPORT, new Byte JavaDoc(JRVariable.RESET_TYPE_REPORT));
506             resetTypeMap.put(RESET_TYPE_PAGE, new Byte JavaDoc(JRVariable.RESET_TYPE_PAGE));
507             resetTypeMap.put(RESET_TYPE_COLUMN, new Byte JavaDoc(JRVariable.RESET_TYPE_COLUMN));
508             resetTypeMap.put(RESET_TYPE_GROUP, new Byte JavaDoc(JRVariable.RESET_TYPE_GROUP));
509             resetTypeMap.put(new Byte JavaDoc(JRVariable.RESET_TYPE_NONE), RESET_TYPE_NONE);
510             resetTypeMap.put(new Byte JavaDoc(JRVariable.RESET_TYPE_REPORT), RESET_TYPE_REPORT);
511             resetTypeMap.put(new Byte JavaDoc(JRVariable.RESET_TYPE_PAGE), RESET_TYPE_PAGE);
512             resetTypeMap.put(new Byte JavaDoc(JRVariable.RESET_TYPE_COLUMN), RESET_TYPE_COLUMN);
513             resetTypeMap.put(new Byte JavaDoc(JRVariable.RESET_TYPE_GROUP), RESET_TYPE_GROUP);
514         }
515
516         return resetTypeMap;
517     }
518
519     /**
520      *
521      */

522     private static final String JavaDoc CALCULATION_NOTHING = "Nothing";
523     private static final String JavaDoc CALCULATION_COUNT = "Count";
524     private static final String JavaDoc CALCULATION_SUM = "Sum";
525     private static final String JavaDoc CALCULATION_AVERAGE = "Average";
526     private static final String JavaDoc CALCULATION_LOWEST = "Lowest";
527     private static final String JavaDoc CALCULATION_HIGHEST = "Highest";
528     private static final String JavaDoc CALCULATION_STANDARD_DEVIATION = "StandardDeviation";
529     private static final String JavaDoc CALCULATION_VARIANCE = "Variance";
530     private static final String JavaDoc CALCULATION_SYSTEM = "System";
531     private static final String JavaDoc CALCULATION_FIRST = "First";
532     private static final String JavaDoc CALCULATION_DISTINCT_COUNT = "DistinctCount";
533
534     private static Map JavaDoc calculationMap = null;
535
536     public static Map JavaDoc getCalculationMap()
537     {
538         if (calculationMap == null)
539         {
540             calculationMap = new HashMap JavaDoc(18);
541             calculationMap.put(CALCULATION_NOTHING, new Byte JavaDoc(JRVariable.CALCULATION_NOTHING));
542             calculationMap.put(CALCULATION_COUNT, new Byte JavaDoc(JRVariable.CALCULATION_COUNT));
543             calculationMap.put(CALCULATION_SUM, new Byte JavaDoc(JRVariable.CALCULATION_SUM));
544             calculationMap.put(CALCULATION_AVERAGE, new Byte JavaDoc(JRVariable.CALCULATION_AVERAGE));
545             calculationMap.put(CALCULATION_LOWEST, new Byte JavaDoc(JRVariable.CALCULATION_LOWEST));
546             calculationMap.put(CALCULATION_HIGHEST, new Byte JavaDoc(JRVariable.CALCULATION_HIGHEST));
547             calculationMap.put(CALCULATION_STANDARD_DEVIATION, new Byte JavaDoc(JRVariable.CALCULATION_STANDARD_DEVIATION));
548             calculationMap.put(CALCULATION_VARIANCE, new Byte JavaDoc(JRVariable.CALCULATION_VARIANCE));
549             calculationMap.put(CALCULATION_SYSTEM, new Byte JavaDoc(JRVariable.CALCULATION_SYSTEM));
550             calculationMap.put(CALCULATION_FIRST, new Byte JavaDoc(JRVariable.CALCULATION_FIRST));
551             calculationMap.put(CALCULATION_DISTINCT_COUNT, new Byte JavaDoc(JRVariable.CALCULATION_DISTINCT_COUNT));
552             calculationMap.put(new Byte JavaDoc(JRVariable.CALCULATION_NOTHING), CALCULATION_NOTHING);
553             calculationMap.put(new Byte JavaDoc(JRVariable.CALCULATION_COUNT), CALCULATION_COUNT);
554             calculationMap.put(new Byte JavaDoc(JRVariable.CALCULATION_SUM), CALCULATION_SUM);
555             calculationMap.put(new Byte JavaDoc(JRVariable.CALCULATION_AVERAGE), CALCULATION_AVERAGE);
556             calculationMap.put(new Byte JavaDoc(JRVariable.CALCULATION_LOWEST), CALCULATION_LOWEST);
557             calculationMap.put(new Byte JavaDoc(JRVariable.CALCULATION_HIGHEST), CALCULATION_HIGHEST);
558             calculationMap.put(new Byte JavaDoc(JRVariable.CALCULATION_STANDARD_DEVIATION), CALCULATION_STANDARD_DEVIATION);
559             calculationMap.put(new Byte JavaDoc(JRVariable.CALCULATION_VARIANCE), CALCULATION_VARIANCE);
560             calculationMap.put(new Byte JavaDoc(JRVariable.CALCULATION_SYSTEM), CALCULATION_SYSTEM);
561             calculationMap.put(new Byte JavaDoc(JRVariable.CALCULATION_FIRST), CALCULATION_FIRST);
562             calculationMap.put(new Byte JavaDoc(JRVariable.CALCULATION_DISTINCT_COUNT), CALCULATION_DISTINCT_COUNT);
563         }
564
565         return calculationMap;
566     }
567
568     /**
569      *
570      */

571     private static final String JavaDoc PRINT_ORDER_VERTICAL = "Vertical";
572     private static final String JavaDoc PRINT_ORDER_HORIZONTAL = "Horizontal";
573
574     private static Map JavaDoc printOrderMap = null;
575
576     public static Map JavaDoc getPrintOrderMap()
577     {
578         if (printOrderMap == null)
579         {
580             printOrderMap = new HashMap JavaDoc(4);
581             printOrderMap.put(PRINT_ORDER_VERTICAL, new Byte JavaDoc(JRReport.PRINT_ORDER_VERTICAL));
582             printOrderMap.put(PRINT_ORDER_HORIZONTAL, new Byte JavaDoc(JRReport.PRINT_ORDER_HORIZONTAL));
583             printOrderMap.put(new Byte JavaDoc(JRReport.PRINT_ORDER_VERTICAL), PRINT_ORDER_VERTICAL);
584             printOrderMap.put(new Byte JavaDoc(JRReport.PRINT_ORDER_HORIZONTAL), PRINT_ORDER_HORIZONTAL);
585         }
586
587         return printOrderMap;
588     }
589
590     /**
591      *
592      */

593     private static final String JavaDoc ORIENTATION_PORTRAIT = "Portrait";
594     private static final String JavaDoc ORIENTATION_LANDSCAPE = "Landscape";
595
596     private static Map JavaDoc orientationMap = null;
597
598     public static Map JavaDoc getOrientationMap()
599     {
600         if (orientationMap == null)
601         {
602             orientationMap = new HashMap JavaDoc(4);
603             orientationMap.put(ORIENTATION_PORTRAIT, new Byte JavaDoc(JRReport.ORIENTATION_PORTRAIT));
604             orientationMap.put(ORIENTATION_LANDSCAPE, new Byte JavaDoc(JRReport.ORIENTATION_LANDSCAPE));
605             orientationMap.put(new Byte JavaDoc(JRReport.ORIENTATION_PORTRAIT), ORIENTATION_PORTRAIT);
606             orientationMap.put(new Byte JavaDoc(JRReport.ORIENTATION_LANDSCAPE), ORIENTATION_LANDSCAPE);
607         }
608
609         return orientationMap;
610     }
611
612     /**
613      *
614      */

615     private static final String JavaDoc WHEN_NO_DATA_TYPE_NO_PAGES = "NoPages";
616     private static final String JavaDoc WHEN_NO_DATA_TYPE_BLANK_PAGE = "BlankPage";
617     private static final String JavaDoc WHEN_NO_DATA_TYPE_ALL_SECTIONS_NO_DETAIL = "AllSectionsNoDetail";
618
619     private static Map JavaDoc whenNoDataTypeMap = null;
620
621     public static Map JavaDoc getWhenNoDataTypeMap()
622     {
623         if (whenNoDataTypeMap == null)
624         {
625             whenNoDataTypeMap = new HashMap JavaDoc(6);
626             whenNoDataTypeMap.put(WHEN_NO_DATA_TYPE_NO_PAGES, new Byte JavaDoc(JRReport.WHEN_NO_DATA_TYPE_NO_PAGES));
627             whenNoDataTypeMap.put(WHEN_NO_DATA_TYPE_BLANK_PAGE, new Byte JavaDoc(JRReport.WHEN_NO_DATA_TYPE_BLANK_PAGE));
628             whenNoDataTypeMap.put(WHEN_NO_DATA_TYPE_ALL_SECTIONS_NO_DETAIL, new Byte JavaDoc(JRReport.WHEN_NO_DATA_TYPE_ALL_SECTIONS_NO_DETAIL));
629             whenNoDataTypeMap.put(new Byte JavaDoc(JRReport.WHEN_NO_DATA_TYPE_NO_PAGES), WHEN_NO_DATA_TYPE_NO_PAGES);
630             whenNoDataTypeMap.put(new Byte JavaDoc(JRReport.WHEN_NO_DATA_TYPE_BLANK_PAGE), WHEN_NO_DATA_TYPE_BLANK_PAGE);
631             whenNoDataTypeMap.put(new Byte JavaDoc(JRReport.WHEN_NO_DATA_TYPE_ALL_SECTIONS_NO_DETAIL), WHEN_NO_DATA_TYPE_ALL_SECTIONS_NO_DETAIL);
632         }
633
634         return whenNoDataTypeMap;
635     }
636
637     /**
638      *
639      */

640     private static final String JavaDoc EVALUATION_TIME_NOW = "Now";
641     private static final String JavaDoc EVALUATION_TIME_REPORT = "Report";
642     private static final String JavaDoc EVALUATION_TIME_PAGE = "Page";
643     private static final String JavaDoc EVALUATION_TIME_COLUMN = "Column";
644     private static final String JavaDoc EVALUATION_TIME_GROUP = "Group";
645     private static final String JavaDoc EVALUATION_TIME_BAND = "Band";
646     private static final String JavaDoc EVALUATION_TIME_AUTO = "Auto";
647
648     private static Map JavaDoc evaluationTimeMap = null;
649
650     public static Map JavaDoc getEvaluationTimeMap()
651     {
652         if (evaluationTimeMap == null)
653         {
654             evaluationTimeMap = new HashMap JavaDoc(10);
655             evaluationTimeMap.put(EVALUATION_TIME_NOW, new Byte JavaDoc(JRExpression.EVALUATION_TIME_NOW));
656             evaluationTimeMap.put(EVALUATION_TIME_REPORT, new Byte JavaDoc(JRExpression.EVALUATION_TIME_REPORT));
657             evaluationTimeMap.put(EVALUATION_TIME_PAGE, new Byte JavaDoc(JRExpression.EVALUATION_TIME_PAGE));
658             evaluationTimeMap.put(EVALUATION_TIME_COLUMN, new Byte JavaDoc(JRExpression.EVALUATION_TIME_COLUMN));
659             evaluationTimeMap.put(EVALUATION_TIME_GROUP, new Byte JavaDoc(JRExpression.EVALUATION_TIME_GROUP));
660             evaluationTimeMap.put(EVALUATION_TIME_BAND, new Byte JavaDoc(JRExpression.EVALUATION_TIME_BAND));
661             evaluationTimeMap.put(EVALUATION_TIME_AUTO, new Byte JavaDoc(JRExpression.EVALUATION_TIME_AUTO));
662             evaluationTimeMap.put(new Byte JavaDoc(JRExpression.EVALUATION_TIME_NOW), EVALUATION_TIME_NOW);
663             evaluationTimeMap.put(new Byte JavaDoc(JRExpression.EVALUATION_TIME_REPORT), EVALUATION_TIME_REPORT);
664             evaluationTimeMap.put(new Byte JavaDoc(JRExpression.EVALUATION_TIME_PAGE), EVALUATION_TIME_PAGE);
665             evaluationTimeMap.put(new Byte JavaDoc(JRExpression.EVALUATION_TIME_COLUMN), EVALUATION_TIME_COLUMN);
666             evaluationTimeMap.put(new Byte JavaDoc(JRExpression.EVALUATION_TIME_GROUP), EVALUATION_TIME_GROUP);
667             evaluationTimeMap.put(new Byte JavaDoc(JRExpression.EVALUATION_TIME_BAND), EVALUATION_TIME_BAND);
668             evaluationTimeMap.put(new Byte JavaDoc(JRExpression.EVALUATION_TIME_AUTO), EVALUATION_TIME_AUTO);
669         }
670
671         return evaluationTimeMap;
672     }
673
674     /**
675      *
676      */

677     private static final String JavaDoc HYPERLINK_TYPE_NONE = "None";
678     private static final String JavaDoc HYPERLINK_TYPE_REFERENCE = "Reference";
679     private static final String JavaDoc HYPERLINK_TYPE_LOCAL_ANCHOR = "LocalAnchor";
680     private static final String JavaDoc HYPERLINK_TYPE_LOCAL_PAGE = "LocalPage";
681     private static final String JavaDoc HYPERLINK_TYPE_REMOTE_ANCHOR = "RemoteAnchor";
682     private static final String JavaDoc HYPERLINK_TYPE_REMOTE_PAGE = "RemotePage";
683
684     private static Map JavaDoc hyperlinkTypeMap = null;
685
686     
687     /**
688      * @deprecated {@link JRHyperlinkHelper JRHyperlinkHelper} should be used instead.
689      */

690     public static Map JavaDoc getHyperlinkTypeMap()
691     {
692         if (hyperlinkTypeMap == null)
693         {
694             hyperlinkTypeMap = new HashMap JavaDoc(12);
695             hyperlinkTypeMap.put(HYPERLINK_TYPE_NONE, new Byte JavaDoc(JRHyperlink.HYPERLINK_TYPE_NONE));
696             hyperlinkTypeMap.put(HYPERLINK_TYPE_REFERENCE, new Byte JavaDoc(JRHyperlink.HYPERLINK_TYPE_REFERENCE));
697             hyperlinkTypeMap.put(HYPERLINK_TYPE_LOCAL_ANCHOR, new Byte JavaDoc(JRHyperlink.HYPERLINK_TYPE_LOCAL_ANCHOR));
698             hyperlinkTypeMap.put(HYPERLINK_TYPE_LOCAL_PAGE, new Byte JavaDoc(JRHyperlink.HYPERLINK_TYPE_LOCAL_PAGE));
699             hyperlinkTypeMap.put(HYPERLINK_TYPE_REMOTE_ANCHOR, new Byte JavaDoc(JRHyperlink.HYPERLINK_TYPE_REMOTE_ANCHOR));
700             hyperlinkTypeMap.put(HYPERLINK_TYPE_REMOTE_PAGE, new Byte JavaDoc(JRHyperlink.HYPERLINK_TYPE_REMOTE_PAGE));
701             hyperlinkTypeMap.put(new Byte JavaDoc(JRHyperlink.HYPERLINK_TYPE_NONE), HYPERLINK_TYPE_NONE);
702             hyperlinkTypeMap.put(new Byte JavaDoc(JRHyperlink.HYPERLINK_TYPE_REFERENCE), HYPERLINK_TYPE_REFERENCE);
703             hyperlinkTypeMap.put(new Byte JavaDoc(JRHyperlink.HYPERLINK_TYPE_LOCAL_ANCHOR), HYPERLINK_TYPE_LOCAL_ANCHOR);
704             hyperlinkTypeMap.put(new Byte JavaDoc(JRHyperlink.HYPERLINK_TYPE_LOCAL_PAGE), HYPERLINK_TYPE_LOCAL_PAGE);
705             hyperlinkTypeMap.put(new Byte JavaDoc(JRHyperlink.HYPERLINK_TYPE_REMOTE_ANCHOR), HYPERLINK_TYPE_REMOTE_ANCHOR);
706             hyperlinkTypeMap.put(new Byte JavaDoc(JRHyperlink.HYPERLINK_TYPE_REMOTE_PAGE), HYPERLINK_TYPE_REMOTE_PAGE);
707         }
708
709         return hyperlinkTypeMap;
710     }
711
712     /**
713      *
714      */

715     private static final String JavaDoc HYPERLINK_TARGET_SELF = "Self";
716     private static final String JavaDoc HYPERLINK_TARGET_BLANK = "Blank";
717
718     private static Map JavaDoc hyperlinkTargetMap = null;
719
720     public static Map JavaDoc getHyperlinkTargetMap()
721     {
722         if (hyperlinkTargetMap == null)
723         {
724             hyperlinkTargetMap = new HashMap JavaDoc(4);
725             hyperlinkTargetMap.put(HYPERLINK_TARGET_SELF, new Byte JavaDoc(JRHyperlink.HYPERLINK_TARGET_SELF));
726             hyperlinkTargetMap.put(HYPERLINK_TARGET_BLANK, new Byte JavaDoc(JRHyperlink.HYPERLINK_TARGET_BLANK));
727             hyperlinkTargetMap.put(new Byte JavaDoc(JRHyperlink.HYPERLINK_TARGET_SELF), HYPERLINK_TARGET_SELF);
728             hyperlinkTargetMap.put(new Byte JavaDoc(JRHyperlink.HYPERLINK_TARGET_BLANK), HYPERLINK_TARGET_BLANK);
729         }
730
731         return hyperlinkTargetMap;
732     }
733
734
735     /**
736      *
737      */

738     public static final String JavaDoc TITLE_POSITION_TOP = "Top";
739     public static final String JavaDoc TITLE_POSITION_BOTTOM = "Bottom";
740     public static final String JavaDoc TITLE_POSITION_LEFT = "Left";
741     public static final String JavaDoc TITLE_POSITION_RIGHT = "Right";
742
743     public static Map JavaDoc chartTitlePositionMap = null;
744
745     public static Map JavaDoc getChartTitlePositionMap()
746     {
747         if (chartTitlePositionMap == null)
748         {
749             chartTitlePositionMap = new HashMap JavaDoc(4);
750             chartTitlePositionMap.put(TITLE_POSITION_TOP, new Byte JavaDoc(JRChart.TITLE_POSITION_TOP));
751             chartTitlePositionMap.put(TITLE_POSITION_BOTTOM, new Byte JavaDoc(JRChart.TITLE_POSITION_BOTTOM));
752             chartTitlePositionMap.put(TITLE_POSITION_LEFT, new Byte JavaDoc(JRChart.TITLE_POSITION_LEFT));
753             chartTitlePositionMap.put(TITLE_POSITION_RIGHT, new Byte JavaDoc(JRChart.TITLE_POSITION_RIGHT));
754             chartTitlePositionMap.put(new Byte JavaDoc(JRChart.TITLE_POSITION_TOP), TITLE_POSITION_TOP);
755             chartTitlePositionMap.put(new Byte JavaDoc(JRChart.TITLE_POSITION_BOTTOM), TITLE_POSITION_BOTTOM);
756             chartTitlePositionMap.put(new Byte JavaDoc(JRChart.TITLE_POSITION_LEFT), TITLE_POSITION_LEFT);
757             chartTitlePositionMap.put(new Byte JavaDoc(JRChart.TITLE_POSITION_RIGHT), TITLE_POSITION_RIGHT);
758         }
759
760         return chartTitlePositionMap;
761     }
762
763     /**
764      *
765      */

766     private static final String JavaDoc ORIENTATION_HORIZONTAL = "Horizontal";
767     private static final String JavaDoc ORIENTATION_VERTICAL = "Vertical";
768
769     private static Map JavaDoc plotOrientationMap = null;
770
771     public static Map JavaDoc getPlotOrientationMap()
772     {
773         if (plotOrientationMap == null)
774         {
775             plotOrientationMap = new HashMap JavaDoc(4);
776             plotOrientationMap.put(ORIENTATION_HORIZONTAL, PlotOrientation.HORIZONTAL);
777             plotOrientationMap.put(ORIENTATION_VERTICAL, PlotOrientation.VERTICAL);
778             plotOrientationMap.put(PlotOrientation.HORIZONTAL, ORIENTATION_HORIZONTAL);
779             plotOrientationMap.put(PlotOrientation.VERTICAL, ORIENTATION_VERTICAL);
780         }
781
782         return plotOrientationMap;
783     }
784
785     /**
786      *
787      */

788     private static final String JavaDoc SORT_ORDER_ASCENDING = "Ascending";
789     private static final String JavaDoc SORT_ORDER_DESCENDING = "Descending";
790
791     private static Map JavaDoc sortOrderMap = null;
792
793     public static Map JavaDoc getSortOrderMap()
794     {
795         if (sortOrderMap == null)
796         {
797             sortOrderMap = new HashMap JavaDoc(4);
798             sortOrderMap.put(SORT_ORDER_ASCENDING, new Byte JavaDoc(JRSortField.SORT_ORDER_ASCENDING));
799             sortOrderMap.put(SORT_ORDER_DESCENDING, new Byte JavaDoc(JRSortField.SORT_ORDER_DESCENDING));
800             sortOrderMap.put(new Byte JavaDoc(JRSortField.SORT_ORDER_ASCENDING), SORT_ORDER_ASCENDING);
801             sortOrderMap.put(new Byte JavaDoc(JRSortField.SORT_ORDER_DESCENDING), SORT_ORDER_DESCENDING);
802         }
803
804         return sortOrderMap;
805     }
806
807
808     private static final String JavaDoc SCALE_ON_BOTH_AXES = "BothAxes";
809     private static final String JavaDoc SCALE_ON_DOMAIN_AXIS = "DomainAxis";
810     private static final String JavaDoc SCALE_ON_RANGE_AXIS = "RangeAxis";
811
812     private static Map JavaDoc scaleTypeMap = null;
813
814     public static Map JavaDoc getScaleTypeMap(){
815         if( scaleTypeMap == null ){
816             scaleTypeMap = new HashMap JavaDoc( 6 );
817             scaleTypeMap.put( SCALE_ON_BOTH_AXES, new Integer JavaDoc( XYBubbleRenderer.SCALE_ON_BOTH_AXES ));
818             scaleTypeMap.put( SCALE_ON_DOMAIN_AXIS, new Integer JavaDoc( XYBubbleRenderer.SCALE_ON_DOMAIN_AXIS ));
819             scaleTypeMap.put( SCALE_ON_RANGE_AXIS, new Integer JavaDoc( XYBubbleRenderer.SCALE_ON_RANGE_AXIS ));
820             scaleTypeMap.put( new Integer JavaDoc( XYBubbleRenderer.SCALE_ON_BOTH_AXES ), SCALE_ON_BOTH_AXES );
821             scaleTypeMap.put( new Integer JavaDoc( XYBubbleRenderer.SCALE_ON_DOMAIN_AXIS ), SCALE_ON_DOMAIN_AXIS );
822             scaleTypeMap.put( new Integer JavaDoc( XYBubbleRenderer.SCALE_ON_RANGE_AXIS ), SCALE_ON_RANGE_AXIS );
823         }
824
825         return scaleTypeMap;
826     }
827     
828     
829     
830     private static final String JavaDoc TIME_PERIOD_YEAR = "Year";
831     private static final String JavaDoc TIME_PERIOD_QUARTER = "Quarter";
832     private static final String JavaDoc TIME_PERIOD_MONTH = "Month";
833     private static final String JavaDoc TIME_PERIOD_WEEK = "Week";
834     private static final String JavaDoc TIME_PERIOD_DAY = "Day";
835     private static final String JavaDoc TIME_PERIOD_HOUR = "Hour";
836     private static final String JavaDoc TIME_PERIOD_MINUTE = "Minute";
837     private static final String JavaDoc TIME_PERIOD_SECOND = "Second";
838     private static final String JavaDoc TIME_PERIOD_MILISECOND = "Milisecond";
839     
840     
841     
842     public static Class JavaDoc getTimePeriod( String JavaDoc timePeriod ) {
843         if( timePeriod.equals( TIME_PERIOD_YEAR ) ){
844             return Year.class;
845         }
846         else if( timePeriod.equals( TIME_PERIOD_QUARTER )){
847             return Quarter.class;
848         }
849         else if( timePeriod.equals( TIME_PERIOD_MONTH )){
850             return Month.class;
851         }
852         else if( timePeriod.equals( TIME_PERIOD_WEEK )){
853             return Week.class;
854         }
855         else if( timePeriod.equals( TIME_PERIOD_DAY )) {
856             return Day.class;
857         }
858         else if( timePeriod.equals( TIME_PERIOD_HOUR )){
859             return Hour.class;
860         }
861         else if( timePeriod.equals( TIME_PERIOD_MINUTE )){
862             return Minute.class;
863         }
864         else if( timePeriod.equals( TIME_PERIOD_SECOND )){
865             return Second.class;
866         }
867         else {
868             return Millisecond.class;
869         }
870         
871     }
872     
873     
874     public static String JavaDoc getTimePeriodName( Class JavaDoc clazz ){
875         if( clazz.equals( Year.class )){
876             return TIME_PERIOD_YEAR;
877         }
878         else if ( clazz.equals( Quarter.class )){
879             return TIME_PERIOD_QUARTER;
880         }
881         else if( clazz.equals( Month.class )){
882             return TIME_PERIOD_MONTH;
883         }
884         else if( clazz.equals( Week.class )){
885             return TIME_PERIOD_WEEK;
886         }
887         else if( clazz.equals( Day.class )){
888             return TIME_PERIOD_DAY;
889         }
890         else if( clazz.equals( Hour.class )){
891             return TIME_PERIOD_HOUR;
892         }
893         else if( clazz.equals( Minute.class )){
894             return TIME_PERIOD_MINUTE;
895         }
896         else if( clazz.equals( Second.class )){
897             return TIME_PERIOD_SECOND;
898         }
899         else {
900             return TIME_PERIOD_MILISECOND;
901         }
902     }
903
904
905
906     /**
907      *
908      */

909     private static final String JavaDoc WHEN_RESOURCE_MISSING_TYPE_NULL = "Null";
910     private static final String JavaDoc WHEN_RESOURCE_MISSING_TYPE_EMPTY = "Empty";
911     private static final String JavaDoc WHEN_RESOURCE_MISSING_TYPE_KEY = "Key";
912     private static final String JavaDoc WHEN_RESOURCE_MISSING_TYPE_ERROR = "Error";
913
914     private static Map JavaDoc whenResourceMissingTypeMap = null;
915
916     public static Map JavaDoc getWhenResourceMissingTypeMap()
917     {
918         if (whenResourceMissingTypeMap == null)
919         {
920             whenResourceMissingTypeMap = new HashMap JavaDoc();
921             whenResourceMissingTypeMap.put(WHEN_RESOURCE_MISSING_TYPE_NULL, new Byte JavaDoc(JRReport.WHEN_RESOURCE_MISSING_TYPE_NULL));
922             whenResourceMissingTypeMap.put(WHEN_RESOURCE_MISSING_TYPE_EMPTY, new Byte JavaDoc(JRReport.WHEN_RESOURCE_MISSING_TYPE_EMPTY));
923             whenResourceMissingTypeMap.put(WHEN_RESOURCE_MISSING_TYPE_KEY, new Byte JavaDoc(JRReport.WHEN_RESOURCE_MISSING_TYPE_KEY));
924             whenResourceMissingTypeMap.put(WHEN_RESOURCE_MISSING_TYPE_ERROR, new Byte JavaDoc(JRReport.WHEN_RESOURCE_MISSING_TYPE_ERROR));
925             whenResourceMissingTypeMap.put(new Byte JavaDoc(JRReport.WHEN_RESOURCE_MISSING_TYPE_NULL), WHEN_RESOURCE_MISSING_TYPE_NULL);
926             whenResourceMissingTypeMap.put(new Byte JavaDoc(JRReport.WHEN_RESOURCE_MISSING_TYPE_EMPTY), WHEN_RESOURCE_MISSING_TYPE_EMPTY);
927             whenResourceMissingTypeMap.put(new Byte JavaDoc(JRReport.WHEN_RESOURCE_MISSING_TYPE_KEY), WHEN_RESOURCE_MISSING_TYPE_KEY);
928             whenResourceMissingTypeMap.put(new Byte JavaDoc(JRReport.WHEN_RESOURCE_MISSING_TYPE_ERROR), WHEN_RESOURCE_MISSING_TYPE_ERROR);
929         }
930
931         return whenResourceMissingTypeMap;
932     }
933
934     
935     /**
936      *
937      */

938     private static final String JavaDoc METER_SHAPE_CHORD = "chord";
939     private static final String JavaDoc METER_SHAPE_CIRCLE = "circle";
940     private static final String JavaDoc METER_SHAPE_PIE = "pie";
941     
942     private static Map JavaDoc meterShapeMap = null;
943     
944     public static Map JavaDoc getMeterShapeMap()
945     {
946        if (meterShapeMap == null)
947        {
948            meterShapeMap = new HashMap JavaDoc();
949            meterShapeMap.put(METER_SHAPE_CHORD, new Byte JavaDoc(JRMeterPlot.SHAPE_CHORD));
950            meterShapeMap.put(METER_SHAPE_CIRCLE, new Byte JavaDoc(JRMeterPlot.SHAPE_CIRCLE));
951            meterShapeMap.put(METER_SHAPE_PIE, new Byte JavaDoc(JRMeterPlot.SHAPE_PIE));
952            meterShapeMap.put(new Byte JavaDoc(JRMeterPlot.SHAPE_CHORD), METER_SHAPE_CHORD);
953            meterShapeMap.put(new Byte JavaDoc(JRMeterPlot.SHAPE_CIRCLE), METER_SHAPE_CIRCLE);
954            meterShapeMap.put(new Byte JavaDoc(JRMeterPlot.SHAPE_PIE), METER_SHAPE_PIE);
955        }
956        
957        return meterShapeMap;
958     }
959     
960     
961     /**
962      *
963      */

964     private static final String JavaDoc THERMOMETER_VALUE_LOCATION_NONE = "none";
965     private static final String JavaDoc THERMOMETER_VALUE_LOCATION_LEFT = "left";
966     private static final String JavaDoc THERMOMETER_VALUE_LOCATION_RIGHT = "right";
967     private static final String JavaDoc THERMOMETER_VALUE_LOCATION_BULB = "bulb";
968     
969     private static Map JavaDoc thermometerValueLocationMap = null;
970     
971     public static Map JavaDoc getThermometerValueLocationMap()
972     {
973        if (thermometerValueLocationMap == null)
974        {
975            thermometerValueLocationMap = new HashMap JavaDoc();
976            thermometerValueLocationMap.put(THERMOMETER_VALUE_LOCATION_NONE, new Byte JavaDoc(JRThermometerPlot.LOCATION_NONE));
977            thermometerValueLocationMap.put(THERMOMETER_VALUE_LOCATION_LEFT, new Byte JavaDoc(JRThermometerPlot.LOCATION_LEFT));
978            thermometerValueLocationMap.put(THERMOMETER_VALUE_LOCATION_RIGHT, new Byte JavaDoc(JRThermometerPlot.LOCATION_RIGHT));
979            thermometerValueLocationMap.put(THERMOMETER_VALUE_LOCATION_BULB, new Byte JavaDoc(JRThermometerPlot.LOCATION_BULB));
980            thermometerValueLocationMap.put(new Byte JavaDoc(JRThermometerPlot.LOCATION_NONE), THERMOMETER_VALUE_LOCATION_NONE);
981            thermometerValueLocationMap.put(new Byte JavaDoc(JRThermometerPlot.LOCATION_LEFT), THERMOMETER_VALUE_LOCATION_LEFT);
982            thermometerValueLocationMap.put(new Byte JavaDoc(JRThermometerPlot.LOCATION_RIGHT), THERMOMETER_VALUE_LOCATION_RIGHT);
983            thermometerValueLocationMap.put(new Byte JavaDoc(JRThermometerPlot.LOCATION_BULB), THERMOMETER_VALUE_LOCATION_BULB);
984        }
985        
986        return thermometerValueLocationMap;
987     }
988     
989     
990     /**
991      *
992      */

993     private static final String JavaDoc AXIS_POSITION_LEFT_OR_TOP = "leftOrTop";
994     private static final String JavaDoc AXIS_POSITION_RIGHT_OR_BOTTOM = "rightOrBottom";
995     
996     private static Map JavaDoc axisPositionMap = null;
997     
998     public static Map JavaDoc getAxisPositionMap()
999     {
1000       if (axisPositionMap == null)
1001       {
1002           axisPositionMap = new HashMap JavaDoc();
1003           axisPositionMap.put(AXIS_POSITION_LEFT_OR_TOP, new Byte JavaDoc(JRChartAxis.POSITION_LEFT_OR_TOP));
1004           axisPositionMap.put(AXIS_POSITION_RIGHT_OR_BOTTOM, new Byte JavaDoc(JRChartAxis.POSITION_RIGHT_OR_BOTTOM));
1005           axisPositionMap.put(new Byte JavaDoc(JRChartAxis.POSITION_LEFT_OR_TOP), AXIS_POSITION_LEFT_OR_TOP);
1006           axisPositionMap.put(new Byte JavaDoc(JRChartAxis.POSITION_RIGHT_OR_BOTTOM), AXIS_POSITION_RIGHT_OR_BOTTOM);
1007       }
1008       
1009       return axisPositionMap;
1010    }
1011    
1012    
1013    /**
1014     *
1015     */

1016    private static final String JavaDoc CROSSTAB_BUCKET_ORDER_ASCENDING = "Ascending";
1017    private static final String JavaDoc CROSSTAB_BUCKET_ORDER_DESCENDING = "Descending";
1018    
1019    private static Map JavaDoc crosstabBucketOrderMap = null;
1020    
1021    public static Map JavaDoc getCrosstabBucketOrderMap()
1022    {
1023        if (crosstabBucketOrderMap == null)
1024        {
1025            crosstabBucketOrderMap = new HashMap JavaDoc();
1026            crosstabBucketOrderMap.put(CROSSTAB_BUCKET_ORDER_ASCENDING, new Byte JavaDoc(BucketDefinition.ORDER_ASCENDING));
1027            crosstabBucketOrderMap.put(CROSSTAB_BUCKET_ORDER_DESCENDING, new Byte JavaDoc(BucketDefinition.ORDER_DESCENDING));
1028            crosstabBucketOrderMap.put(new Byte JavaDoc(BucketDefinition.ORDER_ASCENDING), CROSSTAB_BUCKET_ORDER_ASCENDING);
1029            crosstabBucketOrderMap.put(new Byte JavaDoc(BucketDefinition.ORDER_DESCENDING), CROSSTAB_BUCKET_ORDER_DESCENDING);
1030        }
1031        
1032        return crosstabBucketOrderMap;
1033    }
1034    
1035    
1036    private static final String JavaDoc CROSSTAB_PERCENTAGE_NONE = "None";
1037    private static final String JavaDoc CROSSTAB_PERCENTAGE_GRAND_TOTAL = "GrandTotal";
1038    
1039    private static Map JavaDoc crosstabPercentageMap = null;
1040    
1041    
1042    public static Map JavaDoc getCrosstabPercentageMap()
1043    {
1044        if (crosstabPercentageMap == null)
1045        {
1046            crosstabPercentageMap = new HashMap JavaDoc();
1047            crosstabPercentageMap.put(CROSSTAB_PERCENTAGE_NONE, new Byte JavaDoc(JRCrosstabMeasure.PERCENTAGE_TYPE_NONE));
1048            crosstabPercentageMap.put(CROSSTAB_PERCENTAGE_GRAND_TOTAL, new Byte JavaDoc(JRCrosstabMeasure.PERCENTAGE_TYPE_GRAND_TOTAL));
1049            crosstabPercentageMap.put(new Byte JavaDoc(JRCrosstabMeasure.PERCENTAGE_TYPE_NONE), CROSSTAB_PERCENTAGE_NONE);
1050            crosstabPercentageMap.put(new Byte JavaDoc(JRCrosstabMeasure.PERCENTAGE_TYPE_GRAND_TOTAL), CROSSTAB_PERCENTAGE_GRAND_TOTAL);
1051        }
1052        
1053        return crosstabPercentageMap;
1054    }
1055    
1056    
1057    private static final String JavaDoc CROSSTAB_TOTAL_POSITION_NONE = "None";
1058    private static final String JavaDoc CROSSTAB_TOTAL_POSITION_START = "Start";
1059    private static final String JavaDoc CROSSTAB_TOTAL_POSITION_END = "End";
1060    
1061    private static Map JavaDoc crosstabTotalPositionMap = null;
1062    
1063    
1064    public static Map JavaDoc getCrosstabTotalPositionMap()
1065    {
1066        if (crosstabTotalPositionMap == null)
1067        {
1068            crosstabTotalPositionMap = new HashMap JavaDoc();
1069            crosstabTotalPositionMap.put(CROSSTAB_TOTAL_POSITION_NONE, new Byte JavaDoc(BucketDefinition.TOTAL_POSITION_NONE));
1070            crosstabTotalPositionMap.put(CROSSTAB_TOTAL_POSITION_START, new Byte JavaDoc(BucketDefinition.TOTAL_POSITION_START));
1071            crosstabTotalPositionMap.put(CROSSTAB_TOTAL_POSITION_END, new Byte JavaDoc(BucketDefinition.TOTAL_POSITION_END));
1072            crosstabTotalPositionMap.put(new Byte JavaDoc(BucketDefinition.TOTAL_POSITION_NONE), CROSSTAB_TOTAL_POSITION_NONE);
1073            crosstabTotalPositionMap.put(new Byte JavaDoc(BucketDefinition.TOTAL_POSITION_START), CROSSTAB_TOTAL_POSITION_START);
1074            crosstabTotalPositionMap.put(new Byte JavaDoc(BucketDefinition.TOTAL_POSITION_END), CROSSTAB_TOTAL_POSITION_END);
1075        }
1076        
1077        return crosstabTotalPositionMap;
1078    }
1079    
1080    
1081    private static final String JavaDoc CROSSTAB_ROW_POSITION_TOP = "Top";
1082    private static final String JavaDoc CROSSTAB_ROW_POSITION_MIDDLE = "Middle";
1083    private static final String JavaDoc CROSSTAB_ROW_POSITION_BOTTOM = "Bottom";
1084    private static final String JavaDoc CROSSTAB_ROW_POSITION_STRETCH = "Stretch";
1085    
1086    private static Map JavaDoc crosstabRowPositionMap = null;
1087    
1088    
1089    public static Map JavaDoc getCrosstabRowPositionMap()
1090    {
1091        if (crosstabRowPositionMap == null)
1092        {
1093            crosstabRowPositionMap = new HashMap JavaDoc();
1094            crosstabRowPositionMap.put(CROSSTAB_ROW_POSITION_TOP, new Byte JavaDoc(JRCellContents.POSITION_Y_TOP));
1095            crosstabRowPositionMap.put(CROSSTAB_ROW_POSITION_MIDDLE, new Byte JavaDoc(JRCellContents.POSITION_Y_MIDDLE));
1096            crosstabRowPositionMap.put(CROSSTAB_ROW_POSITION_BOTTOM, new Byte JavaDoc(JRCellContents.POSITION_Y_BOTTOM));
1097            crosstabRowPositionMap.put(CROSSTAB_ROW_POSITION_STRETCH, new Byte JavaDoc(JRCellContents.POSITION_Y_STRETCH));
1098            crosstabRowPositionMap.put(new Byte JavaDoc(JRCellContents.POSITION_Y_TOP), CROSSTAB_ROW_POSITION_TOP);
1099            crosstabRowPositionMap.put(new Byte JavaDoc(JRCellContents.POSITION_Y_MIDDLE), CROSSTAB_ROW_POSITION_MIDDLE);
1100            crosstabRowPositionMap.put(new Byte JavaDoc(JRCellContents.POSITION_Y_BOTTOM), CROSSTAB_ROW_POSITION_BOTTOM);
1101            crosstabRowPositionMap.put(new Byte JavaDoc(JRCellContents.POSITION_Y_STRETCH), CROSSTAB_ROW_POSITION_STRETCH);
1102        }
1103        
1104        return crosstabRowPositionMap;
1105    }
1106    
1107    
1108    private static final String JavaDoc CROSSTAB_COLUMN_POSITION_LEFT = "Left";
1109    private static final String JavaDoc CROSSTAB_COLUMN_POSITION_CENTER = "Center";
1110    private static final String JavaDoc CROSSTAB_COLUMN_POSITION_RIGHT = "Right";
1111    private static final String JavaDoc CROSSTAB_COLUMN_POSITION_STRETCH = "Stretch";
1112    
1113    private static Map JavaDoc crosstabColumnPositionMap = null;
1114    
1115    
1116    public static Map JavaDoc getCrosstabColumnPositionMap()
1117    {
1118        if (crosstabColumnPositionMap == null)
1119        {
1120            crosstabColumnPositionMap = new HashMap JavaDoc();
1121            crosstabColumnPositionMap.put(CROSSTAB_COLUMN_POSITION_LEFT, new Byte JavaDoc(JRCellContents.POSITION_X_LEFT));
1122            crosstabColumnPositionMap.put(CROSSTAB_COLUMN_POSITION_CENTER, new Byte JavaDoc(JRCellContents.POSITION_X_CENTER));
1123            crosstabColumnPositionMap.put(CROSSTAB_COLUMN_POSITION_RIGHT, new Byte JavaDoc(JRCellContents.POSITION_X_RIGHT));
1124            crosstabColumnPositionMap.put(CROSSTAB_COLUMN_POSITION_STRETCH, new Byte JavaDoc(JRCellContents.POSITION_X_STRETCH));
1125            crosstabColumnPositionMap.put(new Byte JavaDoc(JRCellContents.POSITION_X_LEFT), CROSSTAB_COLUMN_POSITION_LEFT);
1126            crosstabColumnPositionMap.put(new Byte JavaDoc(JRCellContents.POSITION_X_CENTER), CROSSTAB_COLUMN_POSITION_CENTER);
1127            crosstabColumnPositionMap.put(new Byte JavaDoc(JRCellContents.POSITION_X_RIGHT), CROSSTAB_COLUMN_POSITION_RIGHT);
1128            crosstabColumnPositionMap.put(new Byte JavaDoc(JRCellContents.POSITION_X_STRETCH), CROSSTAB_COLUMN_POSITION_STRETCH);
1129        }
1130        
1131        return crosstabColumnPositionMap;
1132    }
1133    
1134
1135    /**
1136     *
1137     */

1138    public static Color JavaDoc getColor(String JavaDoc strColor, Color JavaDoc defaultColor)
1139    {
1140        Color JavaDoc color = null;
1141        
1142        if (strColor != null && strColor.length() > 0)
1143        {
1144            char firstChar = strColor.charAt(0);
1145            if (firstChar == '#')
1146            {
1147                color = new Color JavaDoc(Integer.parseInt(strColor.substring(1), 16));
1148            }
1149            else if ('0' <= firstChar && firstChar <= '9')
1150            {
1151                color = new Color JavaDoc(Integer.parseInt(strColor));
1152            }
1153            else
1154            {
1155                if (JRXmlConstants.getColorMap().containsKey(strColor))
1156                {
1157                    color = (Color JavaDoc)JRXmlConstants.getColorMap().get(strColor);
1158                }
1159                else
1160                {
1161                    color = defaultColor;
1162                }
1163            }
1164        }
1165        
1166        return color;
1167    }
1168    
1169
1170}
1171
Popular Tags