1 28 package net.sf.jasperreports.engine.fill; 29 30 import java.awt.Color ; 31 32 import net.sf.jasperreports.engine.JRBox; 33 import net.sf.jasperreports.engine.JRConstants; 34 import net.sf.jasperreports.engine.JRDefaultStyleProvider; 35 import net.sf.jasperreports.engine.JRElement; 36 import net.sf.jasperreports.engine.util.JRStyleResolver; 37 38 45 public class JRTemplateFrame extends JRTemplateElement implements JRBox 46 { 47 private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; 48 49 50 55 public JRTemplateFrame(JRDefaultStyleProvider defaultStyleProvider, JRFillCellContents cell) 56 { 57 super(defaultStyleProvider); 58 59 parentStyle = cell.getStyle(); 60 61 setBackcolor(cell.getBackcolor()); 62 setMode(cell.getMode()); 63 setBox(cell.getBox()); 64 } 65 66 67 72 public JRTemplateFrame(JRDefaultStyleProvider defaultStyleProvider, JRFillFrame frame) 73 { 74 super(defaultStyleProvider); 75 76 setElement(frame); 77 setBox(frame); 78 } 79 80 83 public byte getMode() 84 { 85 return JRStyleResolver.getMode(this, JRElement.MODE_TRANSPARENT); 86 } 87 88 93 protected void setBox(JRBox box) 94 { 95 if (box != null) 96 { 97 border = box.getOwnBorder(); 98 topBorder = box.getOwnTopBorder(); 99 leftBorder = box.getOwnLeftBorder(); 100 bottomBorder = box.getOwnBottomBorder(); 101 rightBorder = box.getOwnRightBorder(); 102 borderColor = box.getOwnBorderColor(); 103 topBorderColor = box.getOwnTopBorderColor(); 104 leftBorderColor = box.getOwnLeftBorderColor(); 105 bottomBorderColor = box.getOwnBottomBorderColor(); 106 rightBorderColor = box.getOwnRightBorderColor(); 107 padding = box.getOwnPadding(); 108 topPadding = box.getOwnTopPadding(); 109 leftPadding = box.getOwnLeftPadding(); 110 bottomPadding = box.getOwnBottomPadding(); 111 rightPadding = box.getOwnRightPadding(); 112 } 113 } 114 115 116 protected Byte border; 118 protected Byte topBorder = null; 119 protected Byte leftBorder = null; 120 protected Byte bottomBorder = null; 121 protected Byte rightBorder = null; 122 protected Color borderColor = null; 123 protected Color topBorderColor = null; 124 protected Color leftBorderColor = null; 125 protected Color bottomBorderColor = null; 126 protected Color rightBorderColor = null; 127 protected Integer padding; 128 protected Integer topPadding = null; 129 protected Integer leftPadding = null; 130 protected Integer bottomPadding = null; 131 protected Integer rightPadding = null; 132 133 136 public byte getBorder() 137 { 138 return JRStyleResolver.getBorder(this); 139 } 140 141 public Byte getOwnBorder() 142 { 143 return border; 144 } 145 146 149 public void setBorder(byte border) 150 { 151 this.border = new Byte (border); 152 } 153 154 157 public Color getBorderColor() 158 { 159 return JRStyleResolver.getBorderColor(this, getForecolor()); 160 } 161 162 public Color getOwnBorderColor() 163 { 164 return borderColor; 165 } 166 167 170 public void setBorderColor(Color borderColor) 171 { 172 this.borderColor = borderColor; 173 } 174 175 178 public int getPadding() 179 { 180 return JRStyleResolver.getPadding(this); 181 } 182 183 public Integer getOwnPadding() 184 { 185 return padding; 186 } 187 188 191 public void setPadding(int padding) 192 { 193 this.padding = new Integer (padding); 194 } 195 196 199 public byte getTopBorder() 200 { 201 return JRStyleResolver.getTopBorder(this); 202 } 203 204 207 public Byte getOwnTopBorder() 208 { 209 return topBorder; 210 } 211 212 215 public void setTopBorder(byte topBorder) 216 { 217 this.topBorder = new Byte (topBorder); 218 } 219 220 223 public Color getTopBorderColor() 224 { 225 return JRStyleResolver.getTopBorderColor(this, getForecolor()); 226 } 227 228 231 public Color getOwnTopBorderColor() 232 { 233 return topBorderColor; 234 } 235 236 239 public void setTopBorderColor(Color topBorderColor) 240 { 241 this.topBorderColor = topBorderColor; 242 } 243 244 247 public int getTopPadding() 248 { 249 return JRStyleResolver.getTopPadding(this); 250 } 251 252 255 public Integer getOwnTopPadding() 256 { 257 return topPadding; 258 } 259 260 263 public void setTopPadding(int topPadding) 264 { 265 this.topPadding = new Integer (topPadding); 266 } 267 268 271 public byte getLeftBorder() 272 { 273 return JRStyleResolver.getLeftBorder(this); 274 } 275 276 279 public Byte getOwnLeftBorder() 280 { 281 return leftBorder; 282 } 283 284 287 public void setLeftBorder(byte leftBorder) 288 { 289 this.leftBorder = new Byte (leftBorder); 290 } 291 292 295 public Color getLeftBorderColor() 296 { 297 return JRStyleResolver.getLeftBorderColor(this, getForecolor()); 298 } 299 300 303 public Color getOwnLeftBorderColor() 304 { 305 return leftBorderColor; 306 } 307 308 311 public void setLeftBorderColor(Color leftBorderColor) 312 { 313 this.leftBorderColor = leftBorderColor; 314 } 315 316 319 public int getLeftPadding() 320 { 321 return JRStyleResolver.getLeftPadding(this); 322 } 323 324 327 public Integer getOwnLeftPadding() 328 { 329 return leftPadding; 330 } 331 332 335 public void setLeftPadding(int leftPadding) 336 { 337 this.leftPadding = new Integer (leftPadding); 338 } 339 340 343 public byte getBottomBorder() 344 { 345 return JRStyleResolver.getBottomBorder(this); 346 } 347 348 351 public Byte getOwnBottomBorder() 352 { 353 return bottomBorder; 354 } 355 356 359 public void setBottomBorder(byte bottomBorder) 360 { 361 this.bottomBorder = new Byte (bottomBorder); 362 } 363 364 367 public Color getBottomBorderColor() 368 { 369 return JRStyleResolver.getBottomBorderColor(this, getForecolor()); 370 } 371 372 375 public Color getOwnBottomBorderColor() 376 { 377 return bottomBorderColor; 378 } 379 380 383 public void setBottomBorderColor(Color bottomBorderColor) 384 { 385 this.bottomBorderColor = bottomBorderColor; 386 } 387 388 391 public int getBottomPadding() 392 { 393 return JRStyleResolver.getBottomPadding(this); 394 } 395 396 399 public Integer getOwnBottomPadding() 400 { 401 return bottomPadding; 402 } 403 404 407 public void setBottomPadding(int bottomPadding) 408 { 409 this.bottomPadding = new Integer (bottomPadding); 410 } 411 412 415 public byte getRightBorder() 416 { 417 return JRStyleResolver.getRightBorder(this); 418 } 419 420 423 public Byte getOwnRightBorder() 424 { 425 return rightBorder; 426 } 427 428 431 public void setRightBorder(byte rightBorder) 432 { 433 this.rightBorder = new Byte (rightBorder); 434 } 435 436 439 public Color getRightBorderColor() 440 { 441 return JRStyleResolver.getRightBorderColor(this, getForecolor()); 442 } 443 444 447 public Color getOwnRightBorderColor() 448 { 449 return rightBorderColor; 450 } 451 452 455 public void setRightBorderColor(Color rightBorderColor) 456 { 457 this.rightBorderColor = rightBorderColor; 458 } 459 460 463 public int getRightPadding() 464 { 465 return JRStyleResolver.getRightPadding(this); 466 } 467 468 471 public Integer getOwnRightPadding() 472 { 473 return rightPadding; 474 } 475 476 479 public void setRightPadding(int rightPadding) 480 { 481 this.rightPadding = new Integer (rightPadding); 482 } 483 484 487 public void setBorder(Byte border) 488 { 489 this.border = border; 490 } 491 492 495 public void setPadding(Integer padding) 496 { 497 this.padding = padding; 498 } 499 500 503 public void setTopBorder(Byte topBorder) 504 { 505 this.topBorder = topBorder; 506 } 507 508 511 public void setTopPadding(Integer topPadding) 512 { 513 this.topPadding = topPadding; 514 } 515 516 519 public void setLeftBorder(Byte leftBorder) 520 { 521 this.leftBorder = leftBorder; 522 } 523 524 527 public void setLeftPadding(Integer leftPadding) 528 { 529 this.leftPadding = leftPadding; 530 } 531 532 535 public void setBottomBorder(Byte bottomBorder) 536 { 537 this.bottomBorder = bottomBorder; 538 } 539 540 543 public void setBottomPadding(Integer bottomPadding) 544 { 545 this.bottomPadding = bottomPadding; 546 } 547 548 551 public void setRightBorder(Byte rightBorder) 552 { 553 this.rightBorder = rightBorder; 554 } 555 556 559 public void setRightPadding(Integer rightPadding) 560 { 561 this.rightPadding = rightPadding; 562 } 563 564 } 565 | Popular Tags |