1 /*
2 * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
136 dashphase,
137 rdrCtx.transformerPC2D.wrapPath2d(p2d)
138 );
139
140 // Use Path2D copy constructor (trim)
141 return new Path2D.Float(p2d);
142
143 } finally {
144 // recycle the RendererContext instance
145 returnRendererContext(rdrCtx);
146 }
147 }
148
149 /**
150 * Sends the geometry for a widened path as specified by the parameters
151 * to the specified consumer.
152 * <p>
153 * The specified {@code src} {@link Shape} is widened according
154 * to the parameters specified by the {@link BasicStroke} object.
155 * Adjustments are made to the path as appropriate for the
156 * {@link VALUE_STROKE_NORMALIZE} hint if the {@code normalize}
157 * boolean parameter is true.
158 * Adjustments are made to the path as appropriate for the
159 * {@link VALUE_ANTIALIAS_ON} hint if the {@code antialias}
160 * boolean parameter is true.
161 * <p>
162 * The geometry of the widened path is forwarded to the indicated
163 * {@link PathConsumer2D} object as it is calculated.
164 *
165 * @param src the source path to be widened
166 * @param bs the {@code BasicSroke} object specifying the
167 * decorations to be applied to the widened path
168 * @param normalize indicates whether stroke normalization should
169 * be applied
170 * @param antialias indicates whether or not adjustments appropriate
171 * to antialiased rendering should be applied
172 * @param consumer the {@code PathConsumer2D} instance to forward
173 * the widened geometry to
174 * @since 1.7
175 */
176 @Override
177 public void strokeTo(Shape src,
178 AffineTransform at,
179 BasicStroke bs,
180 boolean thin,
|
1 /*
2 * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
136 dashphase,
137 rdrCtx.transformerPC2D.wrapPath2d(p2d)
138 );
139
140 // Use Path2D copy constructor (trim)
141 return new Path2D.Float(p2d);
142
143 } finally {
144 // recycle the RendererContext instance
145 returnRendererContext(rdrCtx);
146 }
147 }
148
149 /**
150 * Sends the geometry for a widened path as specified by the parameters
151 * to the specified consumer.
152 * <p>
153 * The specified {@code src} {@link Shape} is widened according
154 * to the parameters specified by the {@link BasicStroke} object.
155 * Adjustments are made to the path as appropriate for the
156 * {@link java.awt.RenderingHints#VALUE_STROKE_NORMALIZE} hint if the
157 * {@code normalize} boolean parameter is true.
158 * Adjustments are made to the path as appropriate for the
159 * {@link java.awt.RenderingHints#VALUE_ANTIALIAS_ON} hint if the
160 * {@code antialias} boolean parameter is true.
161 * <p>
162 * The geometry of the widened path is forwarded to the indicated
163 * {@link PathConsumer2D} object as it is calculated.
164 *
165 * @param src the source path to be widened
166 * @param bs the {@code BasicSroke} object specifying the
167 * decorations to be applied to the widened path
168 * @param normalize indicates whether stroke normalization should
169 * be applied
170 * @param antialias indicates whether or not adjustments appropriate
171 * to antialiased rendering should be applied
172 * @param consumer the {@code PathConsumer2D} instance to forward
173 * the widened geometry to
174 * @since 1.7
175 */
176 @Override
177 public void strokeTo(Shape src,
178 AffineTransform at,
179 BasicStroke bs,
180 boolean thin,
|