1 16 17 18 package org.apache.poi.hssf.usermodel; 19 20 import java.awt.*; 21 import java.awt.geom.AffineTransform ; 22 import java.awt.image.BufferedImage ; 23 import java.awt.image.BufferedImageOp ; 24 import java.awt.image.ImageObserver ; 25 import java.awt.image.RenderedImage ; 26 import java.awt.image.renderable.RenderableImage ; 27 import java.awt.font.GlyphVector ; 28 import java.awt.font.FontRenderContext ; 29 import java.util.Map ; 30 import java.text.AttributedCharacterIterator ; 31 32 public class DummyGraphics2d 33 extends Graphics2D 34 { 35 BufferedImage img; 36 private Graphics2D g2D; 37 38 public DummyGraphics2d() 39 { 40 img = new BufferedImage (1000, 1000, 2); 41 g2D = (Graphics2D)img.getGraphics(); 42 } 43 44 public void addRenderingHints(Map hints) 45 { 46 System.out.println( "addRenderingHinds(Map):" ); 47 System.out.println( " hints = " + hints ); 48 g2D.addRenderingHints( hints ); 49 } 50 51 public void clip(Shape s) 52 { 53 System.out.println( "clip(Shape):" ); 54 System.out.println( " s = " + s ); 55 g2D.clip( s ); 56 } 57 58 public void draw(Shape s) 59 { 60 System.out.println( "draw(Shape):" ); 61 System.out.println( "s = " + s ); 62 g2D.draw( s ); 63 } 64 65 public void drawGlyphVector(GlyphVector g, float x, float y) 66 { 67 System.out.println( "drawGlyphVector(GlyphVector, float, float):" ); 68 System.out.println( "g = " + g ); 69 System.out.println( "x = " + x ); 70 System.out.println( "y = " + y ); 71 g2D.drawGlyphVector( g, x, y ); 72 } 73 74 public void drawImage(BufferedImage img, 75 BufferedImageOp op, 76 int x, 77 int y) 78 { 79 System.out.println( "drawImage(BufferedImage, BufferedImageOp, x, y):" ); 80 System.out.println( "img = " + img ); 81 System.out.println( "op = " + op ); 82 System.out.println( "x = " + x ); 83 System.out.println( "y = " + y ); 84 g2D.drawImage( img, op, x, y ); 85 } 86 87 public boolean drawImage(Image img, 88 AffineTransform xform, 89 ImageObserver obs) 90 { 91 System.out.println( "drawImage(Image,AfflineTransform,ImageObserver):" ); 92 System.out.println( "img = " + img ); 93 System.out.println( "xform = " + xform ); 94 System.out.println( "obs = " + obs ); 95 return g2D.drawImage( img, xform, obs ); 96 } 97 98 public void drawRenderableImage(RenderableImage img, 99 AffineTransform xform) 100 { 101 System.out.println( "drawRenderableImage(RenderableImage, AfflineTransform):" ); 102 System.out.println( "img = " + img ); 103 System.out.println( "xform = " + xform ); 104 g2D.drawRenderableImage( img, xform ); 105 } 106 107 public void drawRenderedImage(RenderedImage img, 108 AffineTransform xform) 109 { 110 System.out.println( "drawRenderedImage(RenderedImage, AffineTransform):" ); 111 System.out.println( "img = " + img ); 112 System.out.println( "xform = " + xform ); 113 g2D.drawRenderedImage( img, xform ); 114 } 115 116 public void drawString(AttributedCharacterIterator iterator, 117 float x, float y) 118 { 119 System.out.println( "drawString(AttributedCharacterIterator):" ); 120 System.out.println( "iterator = " + iterator ); 121 System.out.println( "x = " + x ); 122 System.out.println( "y = " + y ); 123 g2D.drawString( iterator, x, y ); 124 } 125 126 132 public void drawString(String s, float x, float y) 133 { 134 System.out.println( "drawString(s,x,y):" ); 135 System.out.println( "s = " + s ); 136 System.out.println( "x = " + x ); 137 System.out.println( "y = " + y ); 138 g2D.drawString( s, x, y ); 139 } 140 141 146 public void fill(Shape s) 147 { 148 System.out.println( "fill(Shape):" ); 149 System.out.println( "s = " + s ); 150 g2D.fill( s ); 151 } 152 153 158 public Color getBackground() 159 { 160 System.out.println( "getBackground():" ); 161 return g2D.getBackground(); 162 } 163 164 public Composite getComposite() 165 { 166 System.out.println( "getComposite():" ); 167 return g2D.getComposite(); 168 } 169 170 public GraphicsConfiguration getDeviceConfiguration() 171 { 172 System.out.println( "getDeviceConfiguration():" ); 173 return g2D.getDeviceConfiguration(); 174 } 175 176 public FontRenderContext getFontRenderContext() 177 { 178 System.out.println( "getFontRenderContext():" ); 179 return g2D.getFontRenderContext(); 180 } 181 182 public Paint getPaint() 183 { 184 System.out.println( "getPaint():" ); 185 return g2D.getPaint(); 186 } 187 188 public Object getRenderingHint(RenderingHints.Key hintKey) 189 { 190 System.out.println( "getRenderingHint(RenderingHints.Key):" ); 191 System.out.println( "hintKey = " + hintKey ); 192 return g2D.getRenderingHint( hintKey ); 193 } 194 195 public RenderingHints getRenderingHints() 196 { 197 System.out.println( "getRenderingHints():" ); 198 return g2D.getRenderingHints(); 199 } 200 201 public Stroke getStroke() 202 { 203 System.out.println( "getStroke():" ); 204 return g2D.getStroke(); 205 } 206 207 public AffineTransform getTransform() 208 { 209 System.out.println( "getTransform():" ); 210 return g2D.getTransform(); 211 } 212 213 public boolean hit(Rectangle rect, 214 Shape s, 215 boolean onStroke) 216 { 217 System.out.println( "hit(Rectangle, Shape, onStroke):" ); 218 System.out.println( "rect = " + rect ); 219 System.out.println( "s = " + s ); 220 System.out.println( "onStroke = " + onStroke ); 221 return g2D.hit( rect, s, onStroke ); 222 } 223 224 public void rotate(double theta) 225 { 226 System.out.println( "rotate(theta):" ); 227 System.out.println( "theta = " + theta ); 228 g2D.rotate( theta ); 229 } 230 231 public void rotate(double theta, double x, double y) 232 { 233 System.out.println( "rotate(double,double,double):" ); 234 System.out.println( "theta = " + theta ); 235 System.out.println( "x = " + x ); 236 System.out.println( "y = " + y ); 237 g2D.rotate( theta, x, y ); 238 } 239 240 public void scale(double sx, double sy) 241 { 242 System.out.println( "scale(double,double):" ); 243 System.out.println( "sx = " + sx ); 244 System.out.println( "sy" ); 245 g2D.scale( sx, sy ); 246 } 247 248 public void setBackground(Color color) 249 { 250 System.out.println( "setBackground(Color):" ); 251 System.out.println( "color = " + color ); 252 g2D.setBackground( color ); 253 } 254 255 public void setComposite(Composite comp) 256 { 257 System.out.println( "setComposite(Composite):" ); 258 System.out.println( "comp = " + comp ); 259 g2D.setComposite( comp ); 260 } 261 262 public void setPaint( Paint paint ) 263 { 264 System.out.println( "setPain(Paint):" ); 265 System.out.println( "paint = " + paint ); 266 g2D.setPaint( paint ); 267 } 268 269 public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue) 270 { 271 System.out.println( "setRenderingHint(RenderingHints.Key, Object):" ); 272 System.out.println( "hintKey = " + hintKey ); 273 System.out.println( "hintValue = " + hintValue ); 274 g2D.setRenderingHint( hintKey, hintValue ); 275 } 276 277 public void setRenderingHints(Map hints) 278 { 279 System.out.println( "setRenderingHints(Map):" ); 280 System.out.println( "hints = " + hints ); 281 g2D.setRenderingHints( hints ); 282 } 283 284 public void setStroke(Stroke s) 285 { 286 System.out.println( "setStroke(Stoke):" ); 287 System.out.println( "s = " + s ); 288 g2D.setStroke( s ); 289 } 290 291 public void setTransform(AffineTransform Tx) 292 { 293 System.out.println( "setTransform():" ); 294 System.out.println( "Tx = " + Tx ); 295 g2D.setTransform( Tx ); 296 } 297 298 public void shear(double shx, double shy) 299 { 300 System.out.println( "shear(shx, dhy):" ); 301 System.out.println( "shx = " + shx ); 302 System.out.println( "shy = " + shy ); 303 g2D.shear( shx, shy ); 304 } 305 306 public void transform(AffineTransform Tx) 307 { 308 System.out.println( "transform(AffineTransform):" ); 309 System.out.println( "Tx = " + Tx ); 310 g2D.transform( Tx ); 311 } 312 313 public void translate(double tx, double ty) 314 { 315 System.out.println( "translate(double, double):" ); 316 System.out.println( "tx = " + tx ); 317 System.out.println( "ty = " + ty ); 318 g2D.translate( tx, ty ); 319 } 320 321 326 public void clearRect(int x, int y, int width, int height) 327 { 328 System.out.println( "clearRect(int,int,int,int):" ); 329 System.out.println( "x = " + x ); 330 System.out.println( "y = " + y ); 331 System.out.println( "width = " + width ); 332 System.out.println( "height = " + height ); 333 g2D.clearRect( x, y, width, height ); 334 } 335 336 public void clipRect(int x, int y, int width, int height) 337 { 338 System.out.println( "clipRect(int, int, int, int):" ); 339 System.out.println( "x = " + x ); 340 System.out.println( "y = " + y ); 341 System.out.println( "width = " + width ); 342 System.out.println( "height = " + height ); 343 g2D.clipRect( x, y, width, height ); 344 } 345 346 public void copyArea(int x, int y, int width, int height, 347 int dx, int dy) 348 { 349 System.out.println( "copyArea(int,int,int,int):" ); 350 System.out.println( "x = " + x ); 351 System.out.println( "y = " + y ); 352 System.out.println( "width = " + width ); 353 System.out.println( "height = " + height ); 354 g2D.copyArea( x, y, width, height, dx, dy ); 355 } 356 357 public Graphics create() 358 { 359 System.out.println( "create():" ); 360 return g2D.create(); 361 } 362 363 public Graphics create(int x, int y, int width, int height) { 364 System.out.println( "create(int,int,int,int):" ); 365 System.out.println( "x = " + x ); 366 System.out.println( "y = " + y ); 367 System.out.println( "width = " + width ); 368 System.out.println( "height = " + height ); 369 return g2D.create( x, y, width, height ); 370 } 371 372 public void dispose() 373 { 374 System.out.println( "dispose():" ); 375 g2D.dispose(); 376 } 377 378 public void draw3DRect(int x, int y, int width, int height, 379 boolean raised) { 380 System.out.println( "draw3DRect(int,int,int,int,boolean):" ); 381 System.out.println( "x = " + x ); 382 System.out.println( "y = " + y ); 383 System.out.println( "width = " + width ); 384 System.out.println( "height = " + height ); 385 System.out.println( "raised = " + raised ); 386 g2D.draw3DRect( x, y, width, height, raised ); 387 } 388 389 public void drawArc(int x, int y, int width, int height, 390 int startAngle, int arcAngle) 391 { 392 System.out.println( "drawArc(int,int,int,int,int,int):" ); 393 System.out.println( "x = " + x ); 394 System.out.println( "y = " + y ); 395 System.out.println( "width = " + width ); 396 System.out.println( "height = " + height ); 397 System.out.println( "startAngle = " + startAngle ); 398 System.out.println( "arcAngle = " + arcAngle ); 399 g2D.drawArc( x, y, width, height, startAngle, arcAngle ); 400 } 401 402 public void drawBytes(byte data[], int offset, int length, int x, int y) { 403 System.out.println( "drawBytes(byte[],int,int,int,int):" ); 404 System.out.println( "data = " + data ); 405 System.out.println( "offset = " + offset ); 406 System.out.println( "length = " + length ); 407 System.out.println( "x = " + x ); 408 System.out.println( "y = " + y ); 409 g2D.drawBytes( data, offset, length, x, y ); 410 } 411 412 public void drawChars(char data[], int offset, int length, int x, int y) { 413 System.out.println( "drawChars(data,int,int,int,int):" ); 414 System.out.println( "data = " + data ); 415 System.out.println( "offset = " + offset ); 416 System.out.println( "length = " + length ); 417 System.out.println( "x = " + x ); 418 System.out.println( "y = " + y ); 419 g2D.drawChars( data, offset, length, x, y ); 420 } 421 422 public boolean drawImage(Image img, 423 int dx1, int dy1, int dx2, int dy2, 424 int sx1, int sy1, int sx2, int sy2, 425 ImageObserver observer) 426 { 427 System.out.println( "drawImage(Image,int,int,int,int,int,int,int,int,ImageObserver):" ); 428 System.out.println( "img = " + img ); 429 System.out.println( "dx1 = " + dx1 ); 430 System.out.println( "dy1 = " + dy1 ); 431 System.out.println( "dx2 = " + dx2 ); 432 System.out.println( "dy2 = " + dy2 ); 433 System.out.println( "sx1 = " + sx1 ); 434 System.out.println( "sy1 = " + sy1 ); 435 System.out.println( "sx2 = " + sx2 ); 436 System.out.println( "sy2 = " + sy2 ); 437 System.out.println( "observer = " + observer ); 438 return g2D.drawImage( img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer ); 439 } 440 441 public boolean drawImage(Image img, 442 int dx1, int dy1, int dx2, int dy2, 443 int sx1, int sy1, int sx2, int sy2, 444 Color bgcolor, 445 ImageObserver observer) 446 { 447 System.out.println( "drawImage(Image,int,int,int,int,int,int,int,int,Color,ImageObserver):" ); 448 System.out.println( "img = " + img ); 449 System.out.println( "dx1 = " + dx1 ); 450 System.out.println( "dy1 = " + dy1 ); 451 System.out.println( "dx2 = " + dx2 ); 452 System.out.println( "dy2 = " + dy2 ); 453 System.out.println( "sx1 = " + sx1 ); 454 System.out.println( "sy1 = " + sy1 ); 455 System.out.println( "sx2 = " + sx2 ); 456 System.out.println( "sy2 = " + sy2 ); 457 System.out.println( "bgcolor = " + bgcolor ); 458 System.out.println( "observer = " + observer ); 459 return g2D.drawImage( img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, bgcolor, observer ); 460 } 461 462 public boolean drawImage(Image img, int x, int y, 463 Color bgcolor, 464 ImageObserver observer) 465 { 466 System.out.println( "drawImage(Image,int,int,Color,ImageObserver):" ); 467 System.out.println( "img = " + img ); 468 System.out.println( "x = " + x ); 469 System.out.println( "y = " + y ); 470 System.out.println( "bgcolor = " + bgcolor ); 471 System.out.println( "observer = " + observer ); 472 return g2D.drawImage( img, x, y, bgcolor, observer ); 473 } 474 475 public boolean drawImage(Image img, int x, int y, 476 ImageObserver observer) 477 { 478 System.out.println( "drawImage(Image,int,int,observer):" ); 479 System.out.println( "img = " + img ); 480 System.out.println( "x = " + x ); 481 System.out.println( "y = " + y ); 482 System.out.println( "observer = " + observer ); 483 return g2D.drawImage( img, x, y, observer ); 484 } 485 486 public boolean drawImage(Image img, int x, int y, 487 int width, int height, 488 Color bgcolor, 489 ImageObserver observer) 490 { 491 System.out.println( "drawImage(Image,int,int,int,int,Color,ImageObserver):" ); 492 System.out.println( "img = " + img ); 493 System.out.println( "x = " + x ); 494 System.out.println( "y = " + y ); 495 System.out.println( "width = " + width ); 496 System.out.println( "height = " + height ); 497 System.out.println( "bgcolor = " + bgcolor ); 498 System.out.println( "observer = " + observer ); 499 return g2D.drawImage( img, x, y, width, height, bgcolor, observer ); 500 } 501 502 public boolean drawImage(Image img, int x, int y, 503 int width, int height, 504 ImageObserver observer) 505 { 506 System.out.println( "drawImage(Image,int,int,width,height,observer):" ); 507 System.out.println( "img = " + img ); 508 System.out.println( "x = " + x ); 509 System.out.println( "y = " + y ); 510 System.out.println( "width = " + width ); 511 System.out.println( "height = " + height ); 512 System.out.println( "observer = " + observer ); 513 return g2D.drawImage( img, x, y, width, height, observer ); 514 } 515 516 public void drawLine(int x1, int y1, int x2, int y2) 517 { 518 System.out.println( "drawLine(int,int,int,int):" ); 519 System.out.println( "x1 = " + x1 ); 520 System.out.println( "y1 = " + y1 ); 521 System.out.println( "x2 = " + x2 ); 522 System.out.println( "y2 = " + y2 ); 523 g2D.drawLine( x1, y1, x2, y2 ); 524 } 525 526 public void drawOval(int x, int y, int width, int height) 527 { 528 System.out.println( "drawOval(int,int,int,int):" ); 529 System.out.println( "x = " + x ); 530 System.out.println( "y = " + y ); 531 System.out.println( "width = " + width ); 532 System.out.println( "height = " + height ); 533 g2D.drawOval( x, y, width, height ); 534 } 535 536 public void drawPolygon(Polygon p) { 537 System.out.println( "drawPolygon(Polygon):" ); 538 System.out.println( "p = " + p ); 539 g2D.drawPolygon( p ); 540 } 541 542 public void drawPolygon(int xPoints[], int yPoints[], 543 int nPoints) 544 { 545 System.out.println( "drawPolygon(int[],int[],int):" ); 546 System.out.println( "xPoints = " + xPoints ); 547 System.out.println( "yPoints = " + yPoints ); 548 System.out.println( "nPoints = " + nPoints ); 549 g2D.drawPolygon( xPoints, yPoints, nPoints ); 550 } 551 552 public void drawPolyline(int xPoints[], int yPoints[], 553 int nPoints) 554 { 555 System.out.println( "drawPolyline(int[],int[],int):" ); 556 System.out.println( "xPoints = " + xPoints ); 557 System.out.println( "yPoints = " + yPoints ); 558 System.out.println( "nPoints = " + nPoints ); 559 g2D.drawPolyline( xPoints, yPoints, nPoints ); 560 } 561 562 public void drawRect(int x, int y, int width, int height) { 563 System.out.println( "drawRect(int,int,int,int):" ); 564 System.out.println( "x = " + x ); 565 System.out.println( "y = " + y ); 566 System.out.println( "width = " + width ); 567 System.out.println( "height = " + height ); 568 g2D.drawRect( x, y, width, height ); 569 } 570 571 public void drawRoundRect(int x, int y, int width, int height, 572 int arcWidth, int arcHeight) 573 { 574 System.out.println( "drawRoundRect(int,int,int,int,int,int):" ); 575 System.out.println( "x = " + x ); 576 System.out.println( "y = " + y ); 577 System.out.println( "width = " + width ); 578 System.out.println( "height = " + height ); 579 System.out.println( "arcWidth = " + arcWidth ); 580 System.out.println( "arcHeight = " + arcHeight ); 581 g2D.drawRoundRect( x, y, width, height, arcWidth, arcHeight ); 582 } 583 584 public void drawString(AttributedCharacterIterator iterator, 585 int x, int y) 586 { 587 System.out.println( "drawString(AttributedCharacterIterator,int,int):" ); 588 System.out.println( "iterator = " + iterator ); 589 System.out.println( "x = " + x ); 590 System.out.println( "y = " + y ); 591 g2D.drawString( iterator, x, y ); 592 } 593 594 public void drawString(String str, int x, int y) 595 { 596 System.out.println( "drawString(str,int,int):" ); 597 System.out.println( "str = " + str ); 598 System.out.println( "x = " + x ); 599 System.out.println( "y = " + y ); 600 g2D.drawString( str, x, y ); 601 } 602 603 public void fill3DRect(int x, int y, int width, int height, 604 boolean raised) { 605 System.out.println( "fill3DRect(int,int,int,int,boolean):" ); 606 System.out.println( "x = " + x ); 607 System.out.println( "y = " + y ); 608 System.out.println( "width = " + width ); 609 System.out.println( "height = " + height ); 610 System.out.println( "raised = " + raised ); 611 g2D.fill3DRect( x, y, width, height, raised ); 612 } 613 614 public void fillArc(int x, int y, int width, int height, 615 int startAngle, int arcAngle) 616 { 617 System.out.println( "fillArc(int,int,int,int,int,int):" ); 618 System.out.println( "x = " + x ); 619 System.out.println( "y = " + y ); 620 System.out.println( "width = " + width ); 621 System.out.println( "height = " + height ); 622 System.out.println( "startAngle = " + startAngle ); 623 System.out.println( "arcAngle = " + arcAngle ); 624 g2D.fillArc( x, y, width, height, startAngle, arcAngle ); 625 } 626 627 public void fillOval(int x, int y, int width, int height) 628 { 629 System.out.println( "fillOval(int,int,int,int):" ); 630 System.out.println( "x = " + x ); 631 System.out.println( "y = " + y ); 632 System.out.println( "width = " + width ); 633 System.out.println( "height = " + height ); 634 g2D.fillOval( x, y, width, height ); 635 } 636 637 public void fillPolygon(Polygon p) { 638 System.out.println( "fillPolygon(Polygon):" ); 639 System.out.println( "p = " + p ); 640 g2D.fillPolygon( p ); 641 } 642 643 public void fillPolygon(int xPoints[], int yPoints[], 644 int nPoints) 645 { 646 System.out.println( "fillPolygon(int[],int[],int):" ); 647 System.out.println( "xPoints = " + xPoints ); 648 System.out.println( "yPoints = " + yPoints ); 649 System.out.println( "nPoints = " + nPoints ); 650 g2D.fillPolygon( xPoints, yPoints, nPoints ); 651 } 652 653 public void fillRect(int x, int y, int width, int height) 654 { 655 System.out.println( "fillRect(int,int,int,int):" ); 656 System.out.println( "x = " + x ); 657 System.out.println( "y = " + y ); 658 System.out.println( "width = " + width ); 659 System.out.println( "height = " + height ); 660 g2D.fillRect( x, y, width, height ); 661 } 662 663 public void fillRoundRect(int x, int y, int width, int height, 664 int arcWidth, int arcHeight) 665 { 666 System.out.println( "fillRoundRect(int,int,int,int,int,int):" ); 667 System.out.println( "x = " + x ); 668 System.out.println( "y = " + y ); 669 System.out.println( "width = " + width ); 670 System.out.println( "height = " + height ); 671 g2D.fillRoundRect( x, y, width, height, arcWidth, arcHeight ); 672 } 673 674 public void finalize() { 675 System.out.println( "finalize():" ); 676 g2D.finalize(); 677 } 678 679 public Shape getClip() 680 { 681 System.out.println( "getClip():" ); 682 return g2D.getClip(); 683 } 684 685 public Rectangle getClipBounds() 686 { 687 System.out.println( "getClipBounds():" ); 688 return g2D.getClipBounds(); 689 } 690 691 public Rectangle getClipBounds(Rectangle r) { 692 System.out.println( "getClipBounds(Rectangle):" ); 693 System.out.println( "r = " + r ); 694 return g2D.getClipBounds( r ); 695 } 696 697 public Rectangle getClipRect() { 698 System.out.println( "getClipRect():" ); 699 return g2D.getClipRect(); 700 } 701 702 public Color getColor() 703 { 704 System.out.println( "getColor():" ); 705 return g2D.getColor(); 706 } 707 708 public Font getFont() 709 { 710 System.out.println( "getFont():" ); 711 return g2D.getFont(); 712 } 713 714 public FontMetrics getFontMetrics() { 715 System.out.println( "getFontMetrics():" ); 716 return g2D.getFontMetrics(); 717 } 718 719 public FontMetrics getFontMetrics(Font f) 720 { 721 System.out.println( "getFontMetrics():" ); 722 return g2D.getFontMetrics( f ); 723 } 724 725 public boolean hitClip(int x, int y, int width, int height) { 726 System.out.println( "hitClip(int,int,int,int):" ); 727 System.out.println( "x = " + x ); 728 System.out.println( "y = " + y ); 729 System.out.println( "width = " + width ); 730 System.out.println( "height = " + height ); 731 return g2D.hitClip( x, y, width, height ); 732 } 733 734 public void setClip(Shape clip) 735 { 736 System.out.println( "setClip(Shape):" ); 737 System.out.println( "clip = " + clip ); 738 g2D.setClip( clip ); 739 } 740 741 public void setClip(int x, int y, int width, int height) 742 { 743 System.out.println( "setClip(int,int,int,int):" ); 744 System.out.println( "x = " + x ); 745 System.out.println( "y = " + y ); 746 System.out.println( "width = " + width ); 747 System.out.println( "height = " + height ); 748 g2D.setClip( x, y, width, height ); 749 } 750 751 public void setColor(Color c) 752 { 753 System.out.println( "setColor():" ); 754 System.out.println( "c = " + c ); 755 g2D.setColor( c ); 756 } 757 758 public void setFont(Font font) 759 { 760 System.out.println( "setFont(Font):" ); 761 System.out.println( "font = " + font ); 762 g2D.setFont( font ); 763 } 764 765 public void setPaintMode() 766 { 767 System.out.println( "setPaintMode():" ); 768 g2D.setPaintMode(); 769 } 770 771 public void setXORMode(Color c1) 772 { 773 System.out.println( "setXORMode(Color):" ); 774 System.out.println( "c1 = " + c1 ); 775 g2D.setXORMode( c1 ); 776 } 777 778 public String toString() { 779 System.out.println( "toString():" ); 780 return g2D.toString(); 781 } 782 783 public void translate(int x, int y) 784 { 785 System.out.println( "translate(int,int):" ); 786 System.out.println( "x = " + x ); 787 System.out.println( "y = " + y ); 788 g2D.translate( x, y ); 789 } 790 } 791 | Popular Tags |