KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > kawa > models > FillShape


1 package gnu.kawa.models;
2 import java.awt.*;
3 import java.awt.geom.*;
4
5 public class FillShape implements Paintable
6 {
7   Shape shape;
8
9   public FillShape (Shape shape)
10   {
11     this.shape = shape;
12   }
13
14   public void paint (Graphics2D graphics)
15   {
16     graphics.fill(shape);
17   }
18
19   public Rectangle2D getBounds2D()
20   {
21     return shape.getBounds2D();
22   }
23
24   public Paintable transform (AffineTransform tr)
25   {
26     return new FillShape(tr.createTransformedShape(shape));
27   }
28 }
29
Popular Tags