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