KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > Stroke


1 /*
2  * @(#)Stroke.java 1.22 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.awt;
9
10 /**
11  * The <code>Stroke</code> interface allows a
12  * {@link Graphics2D} object to obtain a {@link Shape} that is the
13  * decorated outline, or stylistic representation of the outline,
14  * of the specified <code>Shape</code>.
15  * Stroking a <code>Shape</code> is like tracing its outline with a
16  * marking pen of the appropriate size and shape.
17  * The area where the pen would place ink is the area enclosed by the
18  * outline <code>Shape</code>.
19  * <p>
20  * The methods of the <code>Graphics2D</code> interface that use the
21  * outline <code>Shape</code> returned by a <code>Stroke</code> object
22  * include <code>draw</code> and any other methods that are
23  * implemented in terms of that method, such as
24  * <code>drawLine</code>, <code>drawRect</code>,
25  * <code>drawRoundRect</code>, <code>drawOval</code>,
26  * <code>drawArc</code>, <code>drawPolyline</code>,
27  * and <code>drawPolygon</code>.
28  * <p>
29  * The objects of the classes implementing <code>Stroke</code>
30  * must be read-only because <code>Graphics2D</code> does not
31  * clone these objects either when they are set as an attribute
32  * with the <code>setStroke</code> method or when the
33  * <code>Graphics2D</code> object is itself cloned.
34  * If a <code>Stroke</code> object is modified after it is set in
35  * the <code>Graphics2D</code> context then the behavior
36  * of subsequent rendering would be undefined.
37  * @see BasicStroke
38  * @see Graphics2D#setStroke
39  * @version 1.22, 12/19/03
40  */

41 public interface Stroke {
42     /**
43      * Returns an outline <code>Shape</code> which encloses the area that
44      * should be painted when the <code>Shape</code> is stroked according
45      * to the rules defined by the
46      * object implementing the <code>Stroke</code> interface.
47      * @param p a <code>Shape</code> to be stroked
48      * @return the stroked outline <code>Shape</code>.
49      */

50     Shape JavaDoc createStrokedShape (Shape JavaDoc p);
51 }
52
53
54
55
56
Popular Tags