KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > gvt > ShapePainter


1 /*
2
3    Copyright 2000-2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.gvt;
19
20 import java.awt.Graphics2D JavaDoc;
21 import java.awt.Shape JavaDoc;
22 import java.awt.geom.Rectangle2D JavaDoc;
23 import java.awt.geom.Point2D JavaDoc;
24
25 /**
26  * Renders the shape of a <tt>ShapeNode</tt>.
27  *
28  * @author <a HREF="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
29  * @version $Id: ShapePainter.java,v 1.15 2004/08/18 07:14:27 vhardy Exp $
30  */

31 public interface ShapePainter {
32
33     /**
34      * Paints the specified shape using the specified Graphics2D.
35      *
36      * @param g2d the Graphics2D to use
37      */

38     void paint(Graphics2D JavaDoc g2d);
39
40     /**
41      * Returns the area painted by this shape painter.
42      */

43     Shape JavaDoc getPaintedArea();
44
45     /**
46      * Returns the bounds of the area painted by this shape painter
47      */

48     Rectangle2D JavaDoc getPaintedBounds2D();
49
50     /**
51      * Returns true if <tt>pt</tt> is in the painted area.
52      */

53     boolean inPaintedArea(Point2D JavaDoc pt);
54
55     /**
56      * Returns the area covered by this shape painter (even if nothing
57      * is painted there).
58      */

59     Shape JavaDoc getSensitiveArea();
60
61     /**
62      * Returns the bounds of the area covered by this shape painter
63      * (even if nothing is painted there).
64      */

65     Rectangle2D JavaDoc getSensitiveBounds2D();
66
67     /**
68      * Returns true if <tt>pt</tt> is in the sensitive area.
69      */

70     boolean inSensitiveArea(Point2D JavaDoc pt);
71
72     /**
73      * Sets the Shape this shape painter is associated with.
74      *
75      * @param shape new shape this painter should be associated with.
76      * Should not be null.
77      */

78     void setShape(Shape JavaDoc shape);
79
80     /**
81      * Gets the shape this shape painter is associated with.
82      *
83      * @return shape associated with this painter
84      */

85     Shape JavaDoc getShape();
86 }
87
Popular Tags