1 28 package net.sf.jasperreports.engine.xml; 29 30 import java.awt.Color ; 31 import java.util.HashMap ; 32 import java.util.Map ; 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 74 public class JRXmlConstants 75 { 76 77 78 81 private static final String POSITION_TYPE_FLOAT = "Float"; 82 private static final String POSITION_TYPE_FIX_RELATIVE_TO_TOP = "FixRelativeToTop"; 83 private static final String POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM = "FixRelativeToBottom"; 84 85 private static Map positionTypeMap = null; 86 87 public static Map getPositionTypeMap() 88 { 89 if (positionTypeMap == null) 90 { 91 positionTypeMap = new HashMap (6); 92 positionTypeMap.put(POSITION_TYPE_FLOAT, new Byte (JRElement.POSITION_TYPE_FLOAT)); 93 positionTypeMap.put(POSITION_TYPE_FIX_RELATIVE_TO_TOP, new Byte (JRElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP)); 94 positionTypeMap.put(POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM, new Byte (JRElement.POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM)); 95 positionTypeMap.put(new Byte (JRElement.POSITION_TYPE_FLOAT), POSITION_TYPE_FLOAT); 96 positionTypeMap.put(new Byte (JRElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP), POSITION_TYPE_FIX_RELATIVE_TO_TOP); 97 positionTypeMap.put(new Byte (JRElement.POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM), POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM); 98 } 99 100 return positionTypeMap; 101 } 102 103 106 private static final String MODE_OPAQUE = "Opaque"; 107 private static final String MODE_TRANSPARENT = "Transparent"; 108 109 private static Map modeMap = null; 110 111 public static Map getModeMap() 112 { 113 if (modeMap == null) 114 { 115 modeMap = new HashMap (4); 116 modeMap.put(MODE_OPAQUE, new Byte (JRElement.MODE_OPAQUE)); 117 modeMap.put(MODE_TRANSPARENT, new Byte (JRElement.MODE_TRANSPARENT)); 118 modeMap.put(new Byte (JRElement.MODE_OPAQUE), MODE_OPAQUE); 119 modeMap.put(new Byte (JRElement.MODE_TRANSPARENT), MODE_TRANSPARENT); 120 } 121 122 return modeMap; 123 } 124 125 128 private static final String COLOR_BLACK = "black"; 129 private static final String COLOR_BLUE = "blue"; 130 private static final String COLOR_CYAN = "cyan"; 131 private static final String COLOR_DARK_GRAY = "darkGray"; 132 private static final String COLOR_GRAY = "gray"; 133 private static final String COLOR_GREEN = "green"; 134 private static final String COLOR_LIGHT_GRAY = "lightGray"; 135 private static final String COLOR_MAGENTA = "magenta"; 136 private static final String COLOR_ORANGE = "orange"; 137 private static final String COLOR_PINK = "pink"; 138 private static final String COLOR_RED = "red"; 139 private static final String COLOR_YELLOW = "yellow"; 140 private static final String COLOR_WHITE = "white"; 141 142 private static Map colorMap = null; 143 144 public static Map getColorMap() 145 { 146 if (colorMap == null) 147 { 148 colorMap = new HashMap (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 183 private static final String HORIZONTAL_ALIGN_LEFT = "Left"; 184 private static final String HORIZONTAL_ALIGN_CENTER = "Center"; 185 private static final String HORIZONTAL_ALIGN_RIGHT = "Right"; 186 private static final String HORIZONTAL_ALIGN_JUSTIFIED = "Justified"; 187 188 private static Map horizontalAlignMap = null; 189 190 public static Map getHorizontalAlignMap() 191 { 192 if (horizontalAlignMap == null) 193 { 194 horizontalAlignMap = new HashMap (8); 195 horizontalAlignMap.put(HORIZONTAL_ALIGN_LEFT, new Byte (JRAlignment.HORIZONTAL_ALIGN_LEFT)); 196 horizontalAlignMap.put(HORIZONTAL_ALIGN_CENTER, new Byte (JRAlignment.HORIZONTAL_ALIGN_CENTER)); 197 horizontalAlignMap.put(HORIZONTAL_ALIGN_RIGHT, new Byte (JRAlignment.HORIZONTAL_ALIGN_RIGHT)); 198 horizontalAlignMap.put(HORIZONTAL_ALIGN_JUSTIFIED, new Byte (JRAlignment.HORIZONTAL_ALIGN_JUSTIFIED)); 199 horizontalAlignMap.put(new Byte (JRAlignment.HORIZONTAL_ALIGN_LEFT), HORIZONTAL_ALIGN_LEFT); 200 horizontalAlignMap.put(new Byte (JRAlignment.HORIZONTAL_ALIGN_CENTER), HORIZONTAL_ALIGN_CENTER); 201 horizontalAlignMap.put(new Byte (JRAlignment.HORIZONTAL_ALIGN_RIGHT), HORIZONTAL_ALIGN_RIGHT); 202 horizontalAlignMap.put(new Byte (JRAlignment.HORIZONTAL_ALIGN_JUSTIFIED), HORIZONTAL_ALIGN_JUSTIFIED); 203 } 204 205 return horizontalAlignMap; 206 } 207 208 211 public static Map getTextAlignMap() 212 { 213 return getHorizontalAlignMap(); 214 } 215 216 219 private static final String VERTICAL_ALIGN_TOP = "Top"; 220 private static final String VERTICAL_ALIGN_MIDDLE = "Middle"; 221 private static final String VERTICAL_ALIGN_BOTTOM = "Bottom"; 222 223 private static Map verticalAlignMap = null; 224 225 public static Map getVerticalAlignMap() 226 { 227 if (verticalAlignMap == null) 228 { 229 verticalAlignMap = new HashMap (6); 230 verticalAlignMap.put(VERTICAL_ALIGN_TOP, new Byte (JRAlignment.VERTICAL_ALIGN_TOP)); 231 verticalAlignMap.put(VERTICAL_ALIGN_MIDDLE, new Byte (JRAlignment.VERTICAL_ALIGN_MIDDLE)); 232 verticalAlignMap.put(VERTICAL_ALIGN_BOTTOM, new Byte (JRAlignment.VERTICAL_ALIGN_BOTTOM)); 233 verticalAlignMap.put(new Byte (JRAlignment.VERTICAL_ALIGN_TOP), VERTICAL_ALIGN_TOP); 234 verticalAlignMap.put(new Byte (JRAlignment.VERTICAL_ALIGN_MIDDLE), VERTICAL_ALIGN_MIDDLE); 235 verticalAlignMap.put(new Byte (JRAlignment.VERTICAL_ALIGN_BOTTOM), VERTICAL_ALIGN_BOTTOM); 236 } 237 238 return verticalAlignMap; 239 } 240 241 244 private static final String ROTATION_NONE = "None"; 245 private static final String ROTATION_LEFT = "Left"; 246 private static final String ROTATION_RIGHT = "Right"; 247 private static final String ROTATION_UPSIDE_DOWN = "UpsideDown"; 248 249 private static Map rotationMap = null; 250 251 public static Map getRotationMap() 252 { 253 if (rotationMap == null) 254 { 255 rotationMap = new HashMap (6); 256 rotationMap.put(ROTATION_NONE, new Byte (JRTextElement.ROTATION_NONE)); 257 rotationMap.put(ROTATION_LEFT, new Byte (JRTextElement.ROTATION_LEFT)); 258 rotationMap.put(ROTATION_RIGHT, new Byte (JRTextElement.ROTATION_RIGHT)); 259 rotationMap.put(ROTATION_UPSIDE_DOWN, new Byte (JRTextElement.ROTATION_UPSIDE_DOWN)); 260 rotationMap.put(new Byte (JRTextElement.ROTATION_NONE), ROTATION_NONE); 261 rotationMap.put(new Byte (JRTextElement.ROTATION_LEFT), ROTATION_LEFT); 262 rotationMap.put(new Byte (JRTextElement.ROTATION_RIGHT), ROTATION_RIGHT); 263 rotationMap.put(new Byte (JRTextElement.ROTATION_UPSIDE_DOWN), ROTATION_UPSIDE_DOWN); 264 } 265 266 return rotationMap; 267 } 268 269 272 private static final String BREAK_TYPE_PAGE = "Page"; 273 private static final String BREAK_TYPE_COLUMN = "Column"; 274 275 private static Map breakTypeMap = null; 276 277 public static Map getBreakTypeMap() 278 { 279 if (breakTypeMap == null) 280 { 281 breakTypeMap = new HashMap (4); 282 breakTypeMap.put(BREAK_TYPE_PAGE, new Byte (JRBreak.TYPE_PAGE)); 283 breakTypeMap.put(BREAK_TYPE_COLUMN, new Byte (JRPrintText.RUN_DIRECTION_RTL)); 284 breakTypeMap.put(new Byte (JRBreak.TYPE_PAGE), BREAK_TYPE_PAGE); 285 breakTypeMap.put(new Byte (JRBreak.TYPE_COLUMN), BREAK_TYPE_COLUMN); 286 } 287 288 return breakTypeMap; 289 } 290 291 294 private static final String RUN_DIRECTION_LTR = "LTR"; 295 private static final String RUN_DIRECTION_RTL = "RTL"; 296 297 private static Map runDirectionMap = null; 298 299 public static Map getRunDirectionMap() 300 { 301 if (runDirectionMap == null) 302 { 303 runDirectionMap = new HashMap (4); 304 runDirectionMap.put(RUN_DIRECTION_LTR, new Byte (JRPrintText.RUN_DIRECTION_LTR)); 305 runDirectionMap.put(RUN_DIRECTION_RTL, new Byte (JRPrintText.RUN_DIRECTION_RTL)); 306 runDirectionMap.put(new Byte (JRPrintText.RUN_DIRECTION_LTR), RUN_DIRECTION_LTR); 307 runDirectionMap.put(new Byte (JRPrintText.RUN_DIRECTION_RTL), RUN_DIRECTION_RTL); 308 } 309 310 return runDirectionMap; 311 } 312 313 316 private static final String LINE_SPACING_SINGLE = "Single"; 317 private static final String LINE_SPACING_1_1_2 = "1_1_2"; 318 private static final String LINE_SPACING_DOUBLE = "Double"; 319 320 private static Map lineSpacingMap = null; 321 322 public static Map getLineSpacingMap() 323 { 324 if (lineSpacingMap == null) 325 { 326 lineSpacingMap = new HashMap (6); 327 lineSpacingMap.put(LINE_SPACING_SINGLE, new Byte (JRTextElement.LINE_SPACING_SINGLE)); 328 lineSpacingMap.put(LINE_SPACING_1_1_2, new Byte (JRTextElement.LINE_SPACING_1_1_2)); 329 lineSpacingMap.put(LINE_SPACING_DOUBLE, new Byte (JRTextElement.LINE_SPACING_DOUBLE)); 330 lineSpacingMap.put(new Byte (JRTextElement.LINE_SPACING_SINGLE), LINE_SPACING_SINGLE); 331 lineSpacingMap.put(new Byte (JRTextElement.LINE_SPACING_1_1_2), LINE_SPACING_1_1_2); 332 lineSpacingMap.put(new Byte (JRTextElement.LINE_SPACING_DOUBLE), LINE_SPACING_DOUBLE); 333 } 334 335 return lineSpacingMap; 336 } 337 338 341 private static final String DIRECTION_TOP_DOWN = "TopDown"; 342 private static final String DIRECTION_BOTTOM_UP = "BottomUp"; 343 344 private static Map directionMap = null; 345 346 public static Map getDirectionMap() 347 { 348 if (directionMap == null) 349 { 350 directionMap = new HashMap (4); 351 directionMap.put(DIRECTION_TOP_DOWN, new Byte (JRLine.DIRECTION_TOP_DOWN)); 352 directionMap.put(DIRECTION_BOTTOM_UP, new Byte (JRLine.DIRECTION_BOTTOM_UP)); 353 directionMap.put(new Byte (JRLine.DIRECTION_TOP_DOWN), DIRECTION_TOP_DOWN); 354 directionMap.put(new Byte (JRLine.DIRECTION_BOTTOM_UP), DIRECTION_BOTTOM_UP); 355 } 356 357 return directionMap; 358 } 359 360 363 private static final String SCALE_IMAGE_CLIP = "Clip"; 364 private static final String SCALE_IMAGE_FILL_FRAME = "FillFrame"; 365 private static final String SCALE_IMAGE_RETAIN_SHAPE = "RetainShape"; 366 367 private static Map scaleImageMap = null; 368 369 public static Map getScaleImageMap() 370 { 371 if (scaleImageMap == null) 372 { 373 scaleImageMap = new HashMap (6); 374 scaleImageMap.put(SCALE_IMAGE_CLIP, new Byte (JRImage.SCALE_IMAGE_CLIP)); 375 scaleImageMap.put(SCALE_IMAGE_FILL_FRAME, new Byte (JRImage.SCALE_IMAGE_FILL_FRAME)); 376 scaleImageMap.put(SCALE_IMAGE_RETAIN_SHAPE, new Byte (JRImage.SCALE_IMAGE_RETAIN_SHAPE)); 377 scaleImageMap.put(new Byte (JRImage.SCALE_IMAGE_CLIP), SCALE_IMAGE_CLIP); 378 scaleImageMap.put(new Byte (JRImage.SCALE_IMAGE_FILL_FRAME), SCALE_IMAGE_FILL_FRAME); 379 scaleImageMap.put(new Byte (JRImage.SCALE_IMAGE_RETAIN_SHAPE), SCALE_IMAGE_RETAIN_SHAPE); 380 } 381 382 return scaleImageMap; 383 } 384 385 388 private static final String ON_ERROR_TYPE_ERROR = "Error"; 389 private static final String ON_ERROR_TYPE_BLANK = "Blank"; 390 private static final String ON_ERROR_TYPE_ICON = "Icon"; 391 392 private static Map onErrorTypeMap = null; 393 394 public static Map getOnErrorTypeMap() 395 { 396 if (onErrorTypeMap == null) 397 { 398 onErrorTypeMap = new HashMap (6); 399 onErrorTypeMap.put(ON_ERROR_TYPE_ERROR, new Byte (JRImage.ON_ERROR_TYPE_ERROR)); 400 onErrorTypeMap.put(ON_ERROR_TYPE_BLANK, new Byte (JRImage.ON_ERROR_TYPE_BLANK)); 401 onErrorTypeMap.put(ON_ERROR_TYPE_ICON, new Byte (JRImage.ON_ERROR_TYPE_ICON)); 402 onErrorTypeMap.put(new Byte (JRImage.ON_ERROR_TYPE_ERROR), ON_ERROR_TYPE_ERROR); 403 onErrorTypeMap.put(new Byte (JRImage.ON_ERROR_TYPE_BLANK), ON_ERROR_TYPE_BLANK); 404 onErrorTypeMap.put(new Byte (JRImage.ON_ERROR_TYPE_ICON), ON_ERROR_TYPE_ICON); 405 } 406 407 return onErrorTypeMap; 408 } 409 410 413 private static final String STRETCH_TYPE_NO_STRETCH = "NoStretch"; 414 private static final String STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT = "RelativeToTallestObject"; 415 private static final String STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT = "RelativeToBandHeight"; 416 417 private static Map stretchTypeMap = null; 418 419 public static Map getStretchTypeMap() 420 { 421 if (stretchTypeMap == null) 422 { 423 stretchTypeMap = new HashMap (6); 424 stretchTypeMap.put(STRETCH_TYPE_NO_STRETCH, new Byte (JRElement.STRETCH_TYPE_NO_STRETCH)); 425 stretchTypeMap.put(STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT, new Byte (JRElement.STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT)); 426 stretchTypeMap.put(STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT, new Byte (JRElement.STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT)); 427 stretchTypeMap.put(new Byte (JRElement.STRETCH_TYPE_NO_STRETCH), STRETCH_TYPE_NO_STRETCH); 428 stretchTypeMap.put(new Byte (JRElement.STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT), STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT); 429 stretchTypeMap.put(new Byte (JRElement.STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT), STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT); 430 } 431 432 return stretchTypeMap; 433 } 434 435 438 private static final String PEN_NONE = "None"; 439 private static final String PEN_THIN = "Thin"; 440 private static final String PEN_1_POINT = "1Point"; 441 private static final String PEN_2_POINT = "2Point"; 442 private static final String PEN_4_POINT = "4Point"; 443 private static final String PEN_DOTTED = "Dotted"; 444 445 private static Map penMap = null; 446 447 public static Map getPenMap() 448 { 449 if (penMap == null) 450 { 451 penMap = new HashMap (10); 452 penMap.put(PEN_NONE, new Byte (JRGraphicElement.PEN_NONE)); 453 penMap.put(PEN_THIN, new Byte (JRGraphicElement.PEN_THIN)); 454 penMap.put(PEN_1_POINT, new Byte (JRGraphicElement.PEN_1_POINT)); 455 penMap.put(PEN_2_POINT, new Byte (JRGraphicElement.PEN_2_POINT)); 456 penMap.put(PEN_4_POINT, new Byte (JRGraphicElement.PEN_4_POINT)); 457 penMap.put(PEN_DOTTED, new Byte (JRGraphicElement.PEN_DOTTED)); 458 penMap.put(new Byte (JRGraphicElement.PEN_NONE), PEN_NONE); 459 penMap.put(new Byte (JRGraphicElement.PEN_THIN), PEN_THIN); 460 penMap.put(new Byte (JRGraphicElement.PEN_1_POINT), PEN_1_POINT); 461 penMap.put(new Byte (JRGraphicElement.PEN_2_POINT), PEN_2_POINT); 462 penMap.put(new Byte (JRGraphicElement.PEN_4_POINT), PEN_4_POINT); 463 penMap.put(new Byte (JRGraphicElement.PEN_DOTTED), PEN_DOTTED); 464 } 465 466 return penMap; 467 } 468 469 472 private static final String FILL_SOLID = "Solid"; 473 474 private static Map fillMap = null; 475 476 public static Map getFillMap() 477 { 478 if (fillMap == null) 479 { 480 fillMap = new HashMap (2); 481 fillMap.put(FILL_SOLID, new Byte (JRGraphicElement.FILL_SOLID)); 482 fillMap.put(new Byte (JRGraphicElement.FILL_SOLID), FILL_SOLID); 483 } 484 485 return fillMap; 486 } 487 488 491 private static final String RESET_TYPE_NONE = "None"; 492 private static final String RESET_TYPE_REPORT = "Report"; 493 private static final String RESET_TYPE_PAGE = "Page"; 494 private static final String RESET_TYPE_COLUMN = "Column"; 495 private static final String RESET_TYPE_GROUP = "Group"; 496 497 private static Map resetTypeMap = null; 498 499 public static Map getResetTypeMap() 500 { 501 if (resetTypeMap == null) 502 { 503 resetTypeMap = new HashMap (10); 504 resetTypeMap.put(RESET_TYPE_NONE, new Byte (JRVariable.RESET_TYPE_NONE)); 505 resetTypeMap.put(RESET_TYPE_REPORT, new Byte (JRVariable.RESET_TYPE_REPORT)); 506 resetTypeMap.put(RESET_TYPE_PAGE, new Byte (JRVariable.RESET_TYPE_PAGE)); 507 resetTypeMap.put(RESET_TYPE_COLUMN, new Byte (JRVariable.RESET_TYPE_COLUMN)); 508 resetTypeMap.put(RESET_TYPE_GROUP, new Byte (JRVariable.RESET_TYPE_GROUP)); 509 resetTypeMap.put(new Byte (JRVariable.RESET_TYPE_NONE), RESET_TYPE_NONE); 510 resetTypeMap.put(new Byte (JRVariable.RESET_TYPE_REPORT), RESET_TYPE_REPORT); 511 resetTypeMap.put(new Byte (JRVariable.RESET_TYPE_PAGE), RESET_TYPE_PAGE); 512 resetTypeMap.put(new Byte (JRVariable.RESET_TYPE_COLUMN), RESET_TYPE_COLUMN); 513 resetTypeMap.put(new Byte (JRVariable.RESET_TYPE_GROUP), RESET_TYPE_GROUP); 514 } 515 516 return resetTypeMap; 517 } 518 519 522 private static final String CALCULATION_NOTHING = "Nothing"; 523 private static final String CALCULATION_COUNT = "Count"; 524 private static final String CALCULATION_SUM = "Sum"; 525 private static final String CALCULATION_AVERAGE = "Average"; 526 private static final String CALCULATION_LOWEST = "Lowest"; 527 private static final String CALCULATION_HIGHEST = "Highest"; 528 private static final String CALCULATION_STANDARD_DEVIATION = "StandardDeviation"; 529 private static final String CALCULATION_VARIANCE = "Variance"; 530 private static final String CALCULATION_SYSTEM = "System"; 531 private static final String CALCULATION_FIRST = "First"; 532 private static final String CALCULATION_DISTINCT_COUNT = "DistinctCount"; 533 534 private static Map calculationMap = null; 535 536 public static Map getCalculationMap() 537 { 538 if (calculationMap == null) 539 { 540 calculationMap = new HashMap (18); 541 calculationMap.put(CALCULATION_NOTHING, new Byte (JRVariable.CALCULATION_NOTHING)); 542 calculationMap.put(CALCULATION_COUNT, new Byte (JRVariable.CALCULATION_COUNT)); 543 calculationMap.put(CALCULATION_SUM, new Byte (JRVariable.CALCULATION_SUM)); 544 calculationMap.put(CALCULATION_AVERAGE, new Byte (JRVariable.CALCULATION_AVERAGE)); 545 calculationMap.put(CALCULATION_LOWEST, new Byte (JRVariable.CALCULATION_LOWEST)); 546 calculationMap.put(CALCULATION_HIGHEST, new Byte (JRVariable.CALCULATION_HIGHEST)); 547 calculationMap.put(CALCULATION_STANDARD_DEVIATION, new Byte (JRVariable.CALCULATION_STANDARD_DEVIATION)); 548 calculationMap.put(CALCULATION_VARIANCE, new Byte (JRVariable.CALCULATION_VARIANCE)); 549 calculationMap.put(CALCULATION_SYSTEM, new Byte (JRVariable.CALCULATION_SYSTEM)); 550 calculationMap.put(CALCULATION_FIRST, new Byte (JRVariable.CALCULATION_FIRST)); 551 calculationMap.put(CALCULATION_DISTINCT_COUNT, new Byte (JRVariable.CALCULATION_DISTINCT_COUNT)); 552 calculationMap.put(new Byte (JRVariable.CALCULATION_NOTHING), CALCULATION_NOTHING); 553 calculationMap.put(new Byte (JRVariable.CALCULATION_COUNT), CALCULATION_COUNT); 554 calculationMap.put(new Byte (JRVariable.CALCULATION_SUM), CALCULATION_SUM); 555 calculationMap.put(new Byte (JRVariable.CALCULATION_AVERAGE), CALCULATION_AVERAGE); 556 calculationMap.put(new Byte (JRVariable.CALCULATION_LOWEST), CALCULATION_LOWEST); 557 calculationMap.put(new Byte (JRVariable.CALCULATION_HIGHEST), CALCULATION_HIGHEST); 558 calculationMap.put(new Byte (JRVariable.CALCULATION_STANDARD_DEVIATION), CALCULATION_STANDARD_DEVIATION); 559 calculationMap.put(new Byte (JRVariable.CALCULATION_VARIANCE), CALCULATION_VARIANCE); 560 calculationMap.put(new Byte (JRVariable.CALCULATION_SYSTEM), CALCULATION_SYSTEM); 561 calculationMap.put(new Byte (JRVariable.CALCULATION_FIRST), CALCULATION_FIRST); 562 calculationMap.put(new Byte (JRVariable.CALCULATION_DISTINCT_COUNT), CALCULATION_DISTINCT_COUNT); 563 } 564 565 return calculationMap; 566 } 567 568 571 private static final String PRINT_ORDER_VERTICAL = "Vertical"; 572 private static final String PRINT_ORDER_HORIZONTAL = "Horizontal"; 573 574 private static Map printOrderMap = null; 575 576 public static Map getPrintOrderMap() 577 { 578 if (printOrderMap == null) 579 { 580 printOrderMap = new HashMap (4); 581 printOrderMap.put(PRINT_ORDER_VERTICAL, new Byte (JRReport.PRINT_ORDER_VERTICAL)); 582 printOrderMap.put(PRINT_ORDER_HORIZONTAL, new Byte (JRReport.PRINT_ORDER_HORIZONTAL)); 583 printOrderMap.put(new Byte (JRReport.PRINT_ORDER_VERTICAL), PRINT_ORDER_VERTICAL); 584 printOrderMap.put(new Byte (JRReport.PRINT_ORDER_HORIZONTAL), PRINT_ORDER_HORIZONTAL); 585 } 586 587 return printOrderMap; 588 } 589 590 593 private static final String ORIENTATION_PORTRAIT = "Portrait"; 594 private static final String ORIENTATION_LANDSCAPE = "Landscape"; 595 596 private static Map orientationMap = null; 597 598 public static Map getOrientationMap() 599 { 600 if (orientationMap == null) 601 { 602 orientationMap = new HashMap (4); 603 orientationMap.put(ORIENTATION_PORTRAIT, new Byte (JRReport.ORIENTATION_PORTRAIT)); 604 orientationMap.put(ORIENTATION_LANDSCAPE, new Byte (JRReport.ORIENTATION_LANDSCAPE)); 605 orientationMap.put(new Byte (JRReport.ORIENTATION_PORTRAIT), ORIENTATION_PORTRAIT); 606 orientationMap.put(new Byte (JRReport.ORIENTATION_LANDSCAPE), ORIENTATION_LANDSCAPE); 607 } 608 609 return orientationMap; 610 } 611 612 615 private static final String WHEN_NO_DATA_TYPE_NO_PAGES = "NoPages"; 616 private static final String WHEN_NO_DATA_TYPE_BLANK_PAGE = "BlankPage"; 617 private static final String WHEN_NO_DATA_TYPE_ALL_SECTIONS_NO_DETAIL = "AllSectionsNoDetail"; 618 619 private static Map whenNoDataTypeMap = null; 620 621 public static Map getWhenNoDataTypeMap() 622 { 623 if (whenNoDataTypeMap == null) 624 { 625 whenNoDataTypeMap = new HashMap (6); 626 whenNoDataTypeMap.put(WHEN_NO_DATA_TYPE_NO_PAGES, new Byte (JRReport.WHEN_NO_DATA_TYPE_NO_PAGES)); 627 whenNoDataTypeMap.put(WHEN_NO_DATA_TYPE_BLANK_PAGE, new Byte (JRReport.WHEN_NO_DATA_TYPE_BLANK_PAGE)); 628 whenNoDataTypeMap.put(WHEN_NO_DATA_TYPE_ALL_SECTIONS_NO_DETAIL, new Byte (JRReport.WHEN_NO_DATA_TYPE_ALL_SECTIONS_NO_DETAIL)); 629 whenNoDataTypeMap.put(new Byte (JRReport.WHEN_NO_DATA_TYPE_NO_PAGES), WHEN_NO_DATA_TYPE_NO_PAGES); 630 whenNoDataTypeMap.put(new Byte (JRReport.WHEN_NO_DATA_TYPE_BLANK_PAGE), WHEN_NO_DATA_TYPE_BLANK_PAGE); 631 whenNoDataTypeMap.put(new Byte (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 640 private static final String EVALUATION_TIME_NOW = "Now"; 641 private static final String EVALUATION_TIME_REPORT = "Report"; 642 private static final String EVALUATION_TIME_PAGE = "Page"; 643 private static final String EVALUATION_TIME_COLUMN = "Column"; 644 private static final String EVALUATION_TIME_GROUP = "Group"; 645 private static final String EVALUATION_TIME_BAND = "Band"; 646 private static final String EVALUATION_TIME_AUTO = "Auto"; 647 648 private static Map evaluationTimeMap = null; 649 650 public static Map getEvaluationTimeMap() 651 { 652 if (evaluationTimeMap == null) 653 { 654 evaluationTimeMap = new HashMap (10); 655 evaluationTimeMap.put(EVALUATION_TIME_NOW, new Byte (JRExpression.EVALUATION_TIME_NOW)); 656 evaluationTimeMap.put(EVALUATION_TIME_REPORT, new Byte (JRExpression.EVALUATION_TIME_REPORT)); 657 evaluationTimeMap.put(EVALUATION_TIME_PAGE, new Byte (JRExpression.EVALUATION_TIME_PAGE)); 658 evaluationTimeMap.put(EVALUATION_TIME_COLUMN, new Byte (JRExpression.EVALUATION_TIME_COLUMN)); 659 evaluationTimeMap.put(EVALUATION_TIME_GROUP, new Byte (JRExpression.EVALUATION_TIME_GROUP)); 660 evaluationTimeMap.put(EVALUATION_TIME_BAND, new Byte (JRExpression.EVALUATION_TIME_BAND)); 661 evaluationTimeMap.put(EVALUATION_TIME_AUTO, new Byte (JRExpression.EVALUATION_TIME_AUTO)); 662 evaluationTimeMap.put(new Byte (JRExpression.EVALUATION_TIME_NOW), EVALUATION_TIME_NOW); 663 evaluationTimeMap.put(new Byte (JRExpression.EVALUATION_TIME_REPORT), EVALUATION_TIME_REPORT); 664 evaluationTimeMap.put(new Byte (JRExpression.EVALUATION_TIME_PAGE), EVALUATION_TIME_PAGE); 665 evaluationTimeMap.put(new Byte (JRExpression.EVALUATION_TIME_COLUMN), EVALUATION_TIME_COLUMN); 666 evaluationTimeMap.put(new Byte (JRExpression.EVALUATION_TIME_GROUP), EVALUATION_TIME_GROUP); 667 evaluationTimeMap.put(new Byte (JRExpression.EVALUATION_TIME_BAND), EVALUATION_TIME_BAND); 668 evaluationTimeMap.put(new Byte (JRExpression.EVALUATION_TIME_AUTO), EVALUATION_TIME_AUTO); 669 } 670 671 return evaluationTimeMap; 672 } 673 674 677 private static final String HYPERLINK_TYPE_NONE = "None"; 678 private static final String HYPERLINK_TYPE_REFERENCE = "Reference"; 679 private static final String HYPERLINK_TYPE_LOCAL_ANCHOR = "LocalAnchor"; 680 private static final String HYPERLINK_TYPE_LOCAL_PAGE = "LocalPage"; 681 private static final String HYPERLINK_TYPE_REMOTE_ANCHOR = "RemoteAnchor"; 682 private static final String HYPERLINK_TYPE_REMOTE_PAGE = "RemotePage"; 683 684 private static Map hyperlinkTypeMap = null; 685 686 687 690 public static Map getHyperlinkTypeMap() 691 { 692 if (hyperlinkTypeMap == null) 693 { 694 hyperlinkTypeMap = new HashMap (12); 695 hyperlinkTypeMap.put(HYPERLINK_TYPE_NONE, new Byte (JRHyperlink.HYPERLINK_TYPE_NONE)); 696 hyperlinkTypeMap.put(HYPERLINK_TYPE_REFERENCE, new Byte (JRHyperlink.HYPERLINK_TYPE_REFERENCE)); 697 hyperlinkTypeMap.put(HYPERLINK_TYPE_LOCAL_ANCHOR, new Byte (JRHyperlink.HYPERLINK_TYPE_LOCAL_ANCHOR)); 698 hyperlinkTypeMap.put(HYPERLINK_TYPE_LOCAL_PAGE, new Byte (JRHyperlink.HYPERLINK_TYPE_LOCAL_PAGE)); 699 hyperlinkTypeMap.put(HYPERLINK_TYPE_REMOTE_ANCHOR, new Byte (JRHyperlink.HYPERLINK_TYPE_REMOTE_ANCHOR)); 700 hyperlinkTypeMap.put(HYPERLINK_TYPE_REMOTE_PAGE, new Byte (JRHyperlink.HYPERLINK_TYPE_REMOTE_PAGE)); 701 hyperlinkTypeMap.put(new Byte (JRHyperlink.HYPERLINK_TYPE_NONE), HYPERLINK_TYPE_NONE); 702 hyperlinkTypeMap.put(new Byte (JRHyperlink.HYPERLINK_TYPE_REFERENCE), HYPERLINK_TYPE_REFERENCE); 703 hyperlinkTypeMap.put(new Byte (JRHyperlink.HYPERLINK_TYPE_LOCAL_ANCHOR), HYPERLINK_TYPE_LOCAL_ANCHOR); 704 hyperlinkTypeMap.put(new Byte (JRHyperlink.HYPERLINK_TYPE_LOCAL_PAGE), HYPERLINK_TYPE_LOCAL_PAGE); 705 hyperlinkTypeMap.put(new Byte (JRHyperlink.HYPERLINK_TYPE_REMOTE_ANCHOR), HYPERLINK_TYPE_REMOTE_ANCHOR); 706 hyperlinkTypeMap.put(new Byte (JRHyperlink.HYPERLINK_TYPE_REMOTE_PAGE), HYPERLINK_TYPE_REMOTE_PAGE); 707 } 708 709 return hyperlinkTypeMap; 710 } 711 712 715 private static final String HYPERLINK_TARGET_SELF = "Self"; 716 private static final String HYPERLINK_TARGET_BLANK = "Blank"; 717 718 private static Map hyperlinkTargetMap = null; 719 720 public static Map getHyperlinkTargetMap() 721 { 722 if (hyperlinkTargetMap == null) 723 { 724 hyperlinkTargetMap = new HashMap (4); 725 hyperlinkTargetMap.put(HYPERLINK_TARGET_SELF, new Byte (JRHyperlink.HYPERLINK_TARGET_SELF)); 726 hyperlinkTargetMap.put(HYPERLINK_TARGET_BLANK, new Byte (JRHyperlink.HYPERLINK_TARGET_BLANK)); 727 hyperlinkTargetMap.put(new Byte (JRHyperlink.HYPERLINK_TARGET_SELF), HYPERLINK_TARGET_SELF); 728 hyperlinkTargetMap.put(new Byte (JRHyperlink.HYPERLINK_TARGET_BLANK), HYPERLINK_TARGET_BLANK); 729 } 730 731 return hyperlinkTargetMap; 732 } 733 734 735 738 public static final String TITLE_POSITION_TOP = "Top"; 739 public static final String TITLE_POSITION_BOTTOM = "Bottom"; 740 public static final String TITLE_POSITION_LEFT = "Left"; 741 public static final String TITLE_POSITION_RIGHT = "Right"; 742 743 public static Map chartTitlePositionMap = null; 744 745 public static Map getChartTitlePositionMap() 746 { 747 if (chartTitlePositionMap == null) 748 { 749 chartTitlePositionMap = new HashMap (4); 750 chartTitlePositionMap.put(TITLE_POSITION_TOP, new Byte (JRChart.TITLE_POSITION_TOP)); 751 chartTitlePositionMap.put(TITLE_POSITION_BOTTOM, new Byte (JRChart.TITLE_POSITION_BOTTOM)); 752 chartTitlePositionMap.put(TITLE_POSITION_LEFT, new Byte (JRChart.TITLE_POSITION_LEFT)); 753 chartTitlePositionMap.put(TITLE_POSITION_RIGHT, new Byte (JRChart.TITLE_POSITION_RIGHT)); 754 chartTitlePositionMap.put(new Byte (JRChart.TITLE_POSITION_TOP), TITLE_POSITION_TOP); 755 chartTitlePositionMap.put(new Byte (JRChart.TITLE_POSITION_BOTTOM), TITLE_POSITION_BOTTOM); 756 chartTitlePositionMap.put(new Byte (JRChart.TITLE_POSITION_LEFT), TITLE_POSITION_LEFT); 757 chartTitlePositionMap.put(new Byte (JRChart.TITLE_POSITION_RIGHT), TITLE_POSITION_RIGHT); 758 } 759 760 return chartTitlePositionMap; 761 } 762 763 766 private static final String ORIENTATION_HORIZONTAL = "Horizontal"; 767 private static final String ORIENTATION_VERTICAL = "Vertical"; 768 769 private static Map plotOrientationMap = null; 770 771 public static Map getPlotOrientationMap() 772 { 773 if (plotOrientationMap == null) 774 { 775 plotOrientationMap = new HashMap (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 788 private static final String SORT_ORDER_ASCENDING = "Ascending"; 789 private static final String SORT_ORDER_DESCENDING = "Descending"; 790 791 private static Map sortOrderMap = null; 792 793 public static Map getSortOrderMap() 794 { 795 if (sortOrderMap == null) 796 { 797 sortOrderMap = new HashMap (4); 798 sortOrderMap.put(SORT_ORDER_ASCENDING, new Byte (JRSortField.SORT_ORDER_ASCENDING)); 799 sortOrderMap.put(SORT_ORDER_DESCENDING, new Byte (JRSortField.SORT_ORDER_DESCENDING)); 800 sortOrderMap.put(new Byte (JRSortField.SORT_ORDER_ASCENDING), SORT_ORDER_ASCENDING); 801 sortOrderMap.put(new Byte (JRSortField.SORT_ORDER_DESCENDING), SORT_ORDER_DESCENDING); 802 } 803 804 return sortOrderMap; 805 } 806 807 808 private static final String SCALE_ON_BOTH_AXES = "BothAxes"; 809 private static final String SCALE_ON_DOMAIN_AXIS = "DomainAxis"; 810 private static final String SCALE_ON_RANGE_AXIS = "RangeAxis"; 811 812 private static Map scaleTypeMap = null; 813 814 public static Map getScaleTypeMap(){ 815 if( scaleTypeMap == null ){ 816 scaleTypeMap = new HashMap ( 6 ); 817 scaleTypeMap.put( SCALE_ON_BOTH_AXES, new Integer ( XYBubbleRenderer.SCALE_ON_BOTH_AXES )); 818 scaleTypeMap.put( SCALE_ON_DOMAIN_AXIS, new Integer ( XYBubbleRenderer.SCALE_ON_DOMAIN_AXIS )); 819 scaleTypeMap.put( SCALE_ON_RANGE_AXIS, new Integer ( XYBubbleRenderer.SCALE_ON_RANGE_AXIS )); 820 scaleTypeMap.put( new Integer ( XYBubbleRenderer.SCALE_ON_BOTH_AXES ), SCALE_ON_BOTH_AXES ); 821 scaleTypeMap.put( new Integer ( XYBubbleRenderer.SCALE_ON_DOMAIN_AXIS ), SCALE_ON_DOMAIN_AXIS ); 822 scaleTypeMap.put( new Integer ( XYBubbleRenderer.SCALE_ON_RANGE_AXIS ), SCALE_ON_RANGE_AXIS ); 823 } 824 825 return scaleTypeMap; 826 } 827 828 829 830 private static final String TIME_PERIOD_YEAR = "Year"; 831 private static final String TIME_PERIOD_QUARTER = "Quarter"; 832 private static final String TIME_PERIOD_MONTH = "Month"; 833 private static final String TIME_PERIOD_WEEK = "Week"; 834 private static final String TIME_PERIOD_DAY = "Day"; 835 private static final String TIME_PERIOD_HOUR = "Hour"; 836 private static final String TIME_PERIOD_MINUTE = "Minute"; 837 private static final String TIME_PERIOD_SECOND = "Second"; 838 private static final String TIME_PERIOD_MILISECOND = "Milisecond"; 839 840 841 842 public static Class getTimePeriod( String 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 getTimePeriodName( Class 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 909 private static final String WHEN_RESOURCE_MISSING_TYPE_NULL = "Null"; 910 private static final String WHEN_RESOURCE_MISSING_TYPE_EMPTY = "Empty"; 911 private static final String WHEN_RESOURCE_MISSING_TYPE_KEY = "Key"; 912 private static final String WHEN_RESOURCE_MISSING_TYPE_ERROR = "Error"; 913 914 private static Map whenResourceMissingTypeMap = null; 915 916 public static Map getWhenResourceMissingTypeMap() 917 { 918 if (whenResourceMissingTypeMap == null) 919 { 920 whenResourceMissingTypeMap = new HashMap (); 921 whenResourceMissingTypeMap.put(WHEN_RESOURCE_MISSING_TYPE_NULL, new Byte (JRReport.WHEN_RESOURCE_MISSING_TYPE_NULL)); 922 whenResourceMissingTypeMap.put(WHEN_RESOURCE_MISSING_TYPE_EMPTY, new Byte (JRReport.WHEN_RESOURCE_MISSING_TYPE_EMPTY)); 923 whenResourceMissingTypeMap.put(WHEN_RESOURCE_MISSING_TYPE_KEY, new Byte (JRReport.WHEN_RESOURCE_MISSING_TYPE_KEY)); 924 whenResourceMissingTypeMap.put(WHEN_RESOURCE_MISSING_TYPE_ERROR, new Byte (JRReport.WHEN_RESOURCE_MISSING_TYPE_ERROR)); 925 whenResourceMissingTypeMap.put(new Byte (JRReport.WHEN_RESOURCE_MISSING_TYPE_NULL), WHEN_RESOURCE_MISSING_TYPE_NULL); 926 whenResourceMissingTypeMap.put(new Byte (JRReport.WHEN_RESOURCE_MISSING_TYPE_EMPTY), WHEN_RESOURCE_MISSING_TYPE_EMPTY); 927 whenResourceMissingTypeMap.put(new Byte (JRReport.WHEN_RESOURCE_MISSING_TYPE_KEY), WHEN_RESOURCE_MISSING_TYPE_KEY); 928 whenResourceMissingTypeMap.put(new Byte (JRReport.WHEN_RESOURCE_MISSING_TYPE_ERROR), WHEN_RESOURCE_MISSING_TYPE_ERROR); 929 } 930 931 return whenResourceMissingTypeMap; 932 } 933 934 935 938 private static final String METER_SHAPE_CHORD = "chord"; 939 private static final String METER_SHAPE_CIRCLE = "circle"; 940 private static final String METER_SHAPE_PIE = "pie"; 941 942 private static Map meterShapeMap = null; 943 944 public static Map getMeterShapeMap() 945 { 946 if (meterShapeMap == null) 947 { 948 meterShapeMap = new HashMap (); 949 meterShapeMap.put(METER_SHAPE_CHORD, new Byte (JRMeterPlot.SHAPE_CHORD)); 950 meterShapeMap.put(METER_SHAPE_CIRCLE, new Byte (JRMeterPlot.SHAPE_CIRCLE)); 951 meterShapeMap.put(METER_SHAPE_PIE, new Byte (JRMeterPlot.SHAPE_PIE)); 952 meterShapeMap.put(new Byte (JRMeterPlot.SHAPE_CHORD), METER_SHAPE_CHORD); 953 meterShapeMap.put(new Byte (JRMeterPlot.SHAPE_CIRCLE), METER_SHAPE_CIRCLE); 954 meterShapeMap.put(new Byte (JRMeterPlot.SHAPE_PIE), METER_SHAPE_PIE); 955 } 956 957 return meterShapeMap; 958 } 959 960 961 964 private static final String THERMOMETER_VALUE_LOCATION_NONE = "none"; 965 private static final String THERMOMETER_VALUE_LOCATION_LEFT = "left"; 966 private static final String THERMOMETER_VALUE_LOCATION_RIGHT = "right"; 967 private static final String THERMOMETER_VALUE_LOCATION_BULB = "bulb"; 968 969 private static Map thermometerValueLocationMap = null; 970 971 public static Map getThermometerValueLocationMap() 972 { 973 if (thermometerValueLocationMap == null) 974 { 975 thermometerValueLocationMap = new HashMap (); 976 thermometerValueLocationMap.put(THERMOMETER_VALUE_LOCATION_NONE, new Byte (JRThermometerPlot.LOCATION_NONE)); 977 thermometerValueLocationMap.put(THERMOMETER_VALUE_LOCATION_LEFT, new Byte (JRThermometerPlot.LOCATION_LEFT)); 978 thermometerValueLocationMap.put(THERMOMETER_VALUE_LOCATION_RIGHT, new Byte (JRThermometerPlot.LOCATION_RIGHT)); 979 thermometerValueLocationMap.put(THERMOMETER_VALUE_LOCATION_BULB, new Byte (JRThermometerPlot.LOCATION_BULB)); 980 thermometerValueLocationMap.put(new Byte (JRThermometerPlot.LOCATION_NONE), THERMOMETER_VALUE_LOCATION_NONE); 981 thermometerValueLocationMap.put(new Byte (JRThermometerPlot.LOCATION_LEFT), THERMOMETER_VALUE_LOCATION_LEFT); 982 thermometerValueLocationMap.put(new Byte (JRThermometerPlot.LOCATION_RIGHT), THERMOMETER_VALUE_LOCATION_RIGHT); 983 thermometerValueLocationMap.put(new Byte (JRThermometerPlot.LOCATION_BULB), THERMOMETER_VALUE_LOCATION_BULB); 984 } 985 986 return thermometerValueLocationMap; 987 } 988 989 990 993 private static final String AXIS_POSITION_LEFT_OR_TOP = "leftOrTop"; 994 private static final String AXIS_POSITION_RIGHT_OR_BOTTOM = "rightOrBottom"; 995 996 private static Map axisPositionMap = null; 997 998 public static Map getAxisPositionMap() 999 { 1000 if (axisPositionMap == null) 1001 { 1002 axisPositionMap = new HashMap (); 1003 axisPositionMap.put(AXIS_POSITION_LEFT_OR_TOP, new Byte (JRChartAxis.POSITION_LEFT_OR_TOP)); 1004 axisPositionMap.put(AXIS_POSITION_RIGHT_OR_BOTTOM, new Byte (JRChartAxis.POSITION_RIGHT_OR_BOTTOM)); 1005 axisPositionMap.put(new Byte (JRChartAxis.POSITION_LEFT_OR_TOP), AXIS_POSITION_LEFT_OR_TOP); 1006 axisPositionMap.put(new Byte (JRChartAxis.POSITION_RIGHT_OR_BOTTOM), AXIS_POSITION_RIGHT_OR_BOTTOM); 1007 } 1008 1009 return axisPositionMap; 1010 } 1011 1012 1013 1016 private static final String CROSSTAB_BUCKET_ORDER_ASCENDING = "Ascending"; 1017 private static final String CROSSTAB_BUCKET_ORDER_DESCENDING = "Descending"; 1018 1019 private static Map crosstabBucketOrderMap = null; 1020 1021 public static Map getCrosstabBucketOrderMap() 1022 { 1023 if (crosstabBucketOrderMap == null) 1024 { 1025 crosstabBucketOrderMap = new HashMap (); 1026 crosstabBucketOrderMap.put(CROSSTAB_BUCKET_ORDER_ASCENDING, new Byte (BucketDefinition.ORDER_ASCENDING)); 1027 crosstabBucketOrderMap.put(CROSSTAB_BUCKET_ORDER_DESCENDING, new Byte (BucketDefinition.ORDER_DESCENDING)); 1028 crosstabBucketOrderMap.put(new Byte (BucketDefinition.ORDER_ASCENDING), CROSSTAB_BUCKET_ORDER_ASCENDING); 1029 crosstabBucketOrderMap.put(new Byte (BucketDefinition.ORDER_DESCENDING), CROSSTAB_BUCKET_ORDER_DESCENDING); 1030 } 1031 1032 return crosstabBucketOrderMap; 1033 } 1034 1035 1036 private static final String CROSSTAB_PERCENTAGE_NONE = "None"; 1037 private static final String CROSSTAB_PERCENTAGE_GRAND_TOTAL = "GrandTotal"; 1038 1039 private static Map crosstabPercentageMap = null; 1040 1041 1042 public static Map getCrosstabPercentageMap() 1043 { 1044 if (crosstabPercentageMap == null) 1045 { 1046 crosstabPercentageMap = new HashMap (); 1047 crosstabPercentageMap.put(CROSSTAB_PERCENTAGE_NONE, new Byte (JRCrosstabMeasure.PERCENTAGE_TYPE_NONE)); 1048 crosstabPercentageMap.put(CROSSTAB_PERCENTAGE_GRAND_TOTAL, new Byte (JRCrosstabMeasure.PERCENTAGE_TYPE_GRAND_TOTAL)); 1049 crosstabPercentageMap.put(new Byte (JRCrosstabMeasure.PERCENTAGE_TYPE_NONE), CROSSTAB_PERCENTAGE_NONE); 1050 crosstabPercentageMap.put(new Byte (JRCrosstabMeasure.PERCENTAGE_TYPE_GRAND_TOTAL), CROSSTAB_PERCENTAGE_GRAND_TOTAL); 1051 } 1052 1053 return crosstabPercentageMap; 1054 } 1055 1056 1057 private static final String CROSSTAB_TOTAL_POSITION_NONE = "None"; 1058 private static final String CROSSTAB_TOTAL_POSITION_START = "Start"; 1059 private static final String CROSSTAB_TOTAL_POSITION_END = "End"; 1060 1061 private static Map crosstabTotalPositionMap = null; 1062 1063 1064 public static Map getCrosstabTotalPositionMap() 1065 { 1066 if (crosstabTotalPositionMap == null) 1067 { 1068 crosstabTotalPositionMap = new HashMap (); 1069 crosstabTotalPositionMap.put(CROSSTAB_TOTAL_POSITION_NONE, new Byte (BucketDefinition.TOTAL_POSITION_NONE)); 1070 crosstabTotalPositionMap.put(CROSSTAB_TOTAL_POSITION_START, new Byte (BucketDefinition.TOTAL_POSITION_START)); 1071 crosstabTotalPositionMap.put(CROSSTAB_TOTAL_POSITION_END, new Byte (BucketDefinition.TOTAL_POSITION_END)); 1072 crosstabTotalPositionMap.put(new Byte (BucketDefinition.TOTAL_POSITION_NONE), CROSSTAB_TOTAL_POSITION_NONE); 1073 crosstabTotalPositionMap.put(new Byte (BucketDefinition.TOTAL_POSITION_START), CROSSTAB_TOTAL_POSITION_START); 1074 crosstabTotalPositionMap.put(new Byte (BucketDefinition.TOTAL_POSITION_END), CROSSTAB_TOTAL_POSITION_END); 1075 } 1076 1077 return crosstabTotalPositionMap; 1078 } 1079 1080 1081 private static final String CROSSTAB_ROW_POSITION_TOP = "Top"; 1082 private static final String CROSSTAB_ROW_POSITION_MIDDLE = "Middle"; 1083 private static final String CROSSTAB_ROW_POSITION_BOTTOM = "Bottom"; 1084 private static final String CROSSTAB_ROW_POSITION_STRETCH = "Stretch"; 1085 1086 private static Map crosstabRowPositionMap = null; 1087 1088 1089 public static Map getCrosstabRowPositionMap() 1090 { 1091 if (crosstabRowPositionMap == null) 1092 { 1093 crosstabRowPositionMap = new HashMap (); 1094 crosstabRowPositionMap.put(CROSSTAB_ROW_POSITION_TOP, new Byte (JRCellContents.POSITION_Y_TOP)); 1095 crosstabRowPositionMap.put(CROSSTAB_ROW_POSITION_MIDDLE, new Byte (JRCellContents.POSITION_Y_MIDDLE)); 1096 crosstabRowPositionMap.put(CROSSTAB_ROW_POSITION_BOTTOM, new Byte (JRCellContents.POSITION_Y_BOTTOM)); 1097 crosstabRowPositionMap.put(CROSSTAB_ROW_POSITION_STRETCH, new Byte (JRCellContents.POSITION_Y_STRETCH)); 1098 crosstabRowPositionMap.put(new Byte (JRCellContents.POSITION_Y_TOP), CROSSTAB_ROW_POSITION_TOP); 1099 crosstabRowPositionMap.put(new Byte (JRCellContents.POSITION_Y_MIDDLE), CROSSTAB_ROW_POSITION_MIDDLE); 1100 crosstabRowPositionMap.put(new Byte (JRCellContents.POSITION_Y_BOTTOM), CROSSTAB_ROW_POSITION_BOTTOM); 1101 crosstabRowPositionMap.put(new Byte (JRCellContents.POSITION_Y_STRETCH), CROSSTAB_ROW_POSITION_STRETCH); 1102 } 1103 1104 return crosstabRowPositionMap; 1105 } 1106 1107 1108 private static final String CROSSTAB_COLUMN_POSITION_LEFT = "Left"; 1109 private static final String CROSSTAB_COLUMN_POSITION_CENTER = "Center"; 1110 private static final String CROSSTAB_COLUMN_POSITION_RIGHT = "Right"; 1111 private static final String CROSSTAB_COLUMN_POSITION_STRETCH = "Stretch"; 1112 1113 private static Map crosstabColumnPositionMap = null; 1114 1115 1116 public static Map getCrosstabColumnPositionMap() 1117 { 1118 if (crosstabColumnPositionMap == null) 1119 { 1120 crosstabColumnPositionMap = new HashMap (); 1121 crosstabColumnPositionMap.put(CROSSTAB_COLUMN_POSITION_LEFT, new Byte (JRCellContents.POSITION_X_LEFT)); 1122 crosstabColumnPositionMap.put(CROSSTAB_COLUMN_POSITION_CENTER, new Byte (JRCellContents.POSITION_X_CENTER)); 1123 crosstabColumnPositionMap.put(CROSSTAB_COLUMN_POSITION_RIGHT, new Byte (JRCellContents.POSITION_X_RIGHT)); 1124 crosstabColumnPositionMap.put(CROSSTAB_COLUMN_POSITION_STRETCH, new Byte (JRCellContents.POSITION_X_STRETCH)); 1125 crosstabColumnPositionMap.put(new Byte (JRCellContents.POSITION_X_LEFT), CROSSTAB_COLUMN_POSITION_LEFT); 1126 crosstabColumnPositionMap.put(new Byte (JRCellContents.POSITION_X_CENTER), CROSSTAB_COLUMN_POSITION_CENTER); 1127 crosstabColumnPositionMap.put(new Byte (JRCellContents.POSITION_X_RIGHT), CROSSTAB_COLUMN_POSITION_RIGHT); 1128 crosstabColumnPositionMap.put(new Byte (JRCellContents.POSITION_X_STRETCH), CROSSTAB_COLUMN_POSITION_STRETCH); 1129 } 1130 1131 return crosstabColumnPositionMap; 1132 } 1133 1134 1135 1138 public static Color getColor(String strColor, Color defaultColor) 1139 { 1140 Color 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 (Integer.parseInt(strColor.substring(1), 16)); 1148 } 1149 else if ('0' <= firstChar && firstChar <= '9') 1150 { 1151 color = new Color (Integer.parseInt(strColor)); 1152 } 1153 else 1154 { 1155 if (JRXmlConstants.getColorMap().containsKey(strColor)) 1156 { 1157 color = (Color )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 |