1 /* |
1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
25 |
25 |
26 package java.awt; |
26 package java.awt; |
27 |
27 |
28 import java.beans.ConstructorProperties; |
28 import java.beans.ConstructorProperties; |
29 |
29 |
30 import javax.tools.annotation.GenerateNativeHeader; |
30 import java.lang.annotation.Native; |
31 |
31 |
32 /** |
32 /** |
33 * The <code>BasicStroke</code> class defines a basic set of rendering |
33 * The <code>BasicStroke</code> class defines a basic set of rendering |
34 * attributes for the outlines of graphics primitives, which are rendered |
34 * attributes for the outlines of graphics primitives, which are rendered |
35 * with a {@link Graphics2D} object that has its Stroke attribute set to |
35 * with a {@link Graphics2D} object that has its Stroke attribute set to |
109 * For more information on the user space coordinate system and the |
109 * For more information on the user space coordinate system and the |
110 * rendering process, see the <code>Graphics2D</code> class comments. |
110 * rendering process, see the <code>Graphics2D</code> class comments. |
111 * @see Graphics2D |
111 * @see Graphics2D |
112 * @author Jim Graham |
112 * @author Jim Graham |
113 */ |
113 */ |
114 /* No native methods here, but the constants are needed in the supporting JNI code */ |
|
115 @GenerateNativeHeader |
|
116 public class BasicStroke implements Stroke { |
114 public class BasicStroke implements Stroke { |
117 |
115 |
118 /** |
116 /** |
119 * Joins path segments by extending their outside edges until |
117 * Joins path segments by extending their outside edges until |
120 * they meet. |
118 * they meet. |
121 */ |
119 */ |
122 public final static int JOIN_MITER = 0; |
120 @Native public final static int JOIN_MITER = 0; |
123 |
121 |
124 /** |
122 /** |
125 * Joins path segments by rounding off the corner at a radius |
123 * Joins path segments by rounding off the corner at a radius |
126 * of half the line width. |
124 * of half the line width. |
127 */ |
125 */ |
128 public final static int JOIN_ROUND = 1; |
126 @Native public final static int JOIN_ROUND = 1; |
129 |
127 |
130 /** |
128 /** |
131 * Joins path segments by connecting the outer corners of their |
129 * Joins path segments by connecting the outer corners of their |
132 * wide outlines with a straight segment. |
130 * wide outlines with a straight segment. |
133 */ |
131 */ |
134 public final static int JOIN_BEVEL = 2; |
132 @Native public final static int JOIN_BEVEL = 2; |
135 |
133 |
136 /** |
134 /** |
137 * Ends unclosed subpaths and dash segments with no added |
135 * Ends unclosed subpaths and dash segments with no added |
138 * decoration. |
136 * decoration. |
139 */ |
137 */ |
140 public final static int CAP_BUTT = 0; |
138 @Native public final static int CAP_BUTT = 0; |
141 |
139 |
142 /** |
140 /** |
143 * Ends unclosed subpaths and dash segments with a round |
141 * Ends unclosed subpaths and dash segments with a round |
144 * decoration that has a radius equal to half of the width |
142 * decoration that has a radius equal to half of the width |
145 * of the pen. |
143 * of the pen. |
146 */ |
144 */ |
147 public final static int CAP_ROUND = 1; |
145 @Native public final static int CAP_ROUND = 1; |
148 |
146 |
149 /** |
147 /** |
150 * Ends unclosed subpaths and dash segments with a square |
148 * Ends unclosed subpaths and dash segments with a square |
151 * projection that extends beyond the end of the segment |
149 * projection that extends beyond the end of the segment |
152 * to a distance equal to half of the line width. |
150 * to a distance equal to half of the line width. |
153 */ |
151 */ |
154 public final static int CAP_SQUARE = 2; |
152 @Native public final static int CAP_SQUARE = 2; |
155 |
153 |
156 float width; |
154 float width; |
157 |
155 |
158 int join; |
156 int join; |
159 int cap; |
157 int cap; |