49 * <dt>void strokeTo(Shape, [rendering parameters], PathConsumer2D);
50 * <dd>This method performs widening of the source path on the fly
51 * and sends the results to the given {@link PathConsumer2D} object.
52 * This procedure avoids having to create an intermediate Shape
53 * object to hold the results of the {@code createStrokedShape} method.
54 * The main user of this method is the Java 2D non-antialiasing renderer.
55 * <dt>AATileGenerator getAATileGenerator(Shape, [rendering parameters]);
56 * <dd>This method returns an object which can iterate over the
57 * specified bounding box and produce tiles of coverage values for
58 * antialiased rendering. The details of the operation of the
59 * {@link AATileGenerator} object are explained in its class comments.
60 * </dl>
61 * Additionally, the following informational method supplies important
62 * data about the implementation.
63 * <dl>
64 * <dt>float getMinimumAAPenSize()
65 * <dd>This method provides information on how small the BasicStroke
66 * line width can get before dropouts occur. Rendering with a BasicStroke
67 * is defined to never allow the line to have breaks, gaps, or dropouts
68 * even if the width is set to 0.0f, so this information allows the
69 * {@link SunGraphics2D} class to detect the "thin line" case and set
70 * the rendering attributes accordingly.
71 * </dl>
72 * At startup the runtime will load a single instance of this class.
73 * It searches the classpath for a registered provider of this API
74 * and returns either the last one it finds, or the instance whose
75 * class name matches the value supplied in the System property
76 * {@code sun.java2d.renderer}.
77 * Additionally, a runtime System property flag can be set to trace
78 * all calls to methods on the {@code RenderingEngine} in use by
79 * setting the sun.java2d.renderer.trace property to any non-null value.
80 * <p>
81 * Parts of the system that need to use any of the above features should
82 * call {@code RenderingEngine.getInstance()} to obtain the properly
83 * registered (and possibly trace-enabled) version of the RenderingEngine.
84 */
85 public abstract class RenderingEngine {
86 private static RenderingEngine reImpl;
87
88 /**
89 * Returns an instance of {@code RenderingEngine} as determined
160 * @param dashes the dash length array as per {@code BasicStroke}
161 * @param dashphase the initial dash phase as per {@code BasicStroke}
162 * @return the widened path stored in a new {@code Shape} object
163 * @since 1.7
164 */
165 public abstract Shape createStrokedShape(Shape src,
166 float width,
167 int caps,
168 int join,
169 float miterlimit,
170 float dashes[],
171 float dashphase);
172
173 /**
174 * Sends the geometry for a widened path as specified by the parameters
175 * to the specified consumer.
176 * <p>
177 * The specified {@code src} {@link Shape} is widened according
178 * to the parameters specified by the {@link BasicStroke} object.
179 * Adjustments are made to the path as appropriate for the
180 * {@link VALUE_STROKE_NORMALIZE} hint if the {@code normalize}
181 * boolean parameter is true.
182 * Adjustments are made to the path as appropriate for the
183 * {@link VALUE_ANTIALIAS_ON} hint if the {@code antialias}
184 * boolean parameter is true.
185 * <p>
186 * The geometry of the widened path is forwarded to the indicated
187 * {@link PathConsumer2D} object as it is calculated.
188 *
189 * @param src the source path to be widened
190 * @param bs the {@code BasicSroke} object specifying the
191 * decorations to be applied to the widened path
192 * @param normalize indicates whether stroke normalization should
193 * be applied
194 * @param antialias indicates whether or not adjustments appropriate
195 * to antialiased rendering should be applied
196 * @param consumer the {@code PathConsumer2D} instance to forward
197 * the widened geometry to
198 * @since 1.7
199 */
200 public abstract void strokeTo(Shape src,
201 AffineTransform at,
202 BasicStroke bs,
203 boolean thin,
204 boolean normalize,
|
49 * <dt>void strokeTo(Shape, [rendering parameters], PathConsumer2D);
50 * <dd>This method performs widening of the source path on the fly
51 * and sends the results to the given {@link PathConsumer2D} object.
52 * This procedure avoids having to create an intermediate Shape
53 * object to hold the results of the {@code createStrokedShape} method.
54 * The main user of this method is the Java 2D non-antialiasing renderer.
55 * <dt>AATileGenerator getAATileGenerator(Shape, [rendering parameters]);
56 * <dd>This method returns an object which can iterate over the
57 * specified bounding box and produce tiles of coverage values for
58 * antialiased rendering. The details of the operation of the
59 * {@link AATileGenerator} object are explained in its class comments.
60 * </dl>
61 * Additionally, the following informational method supplies important
62 * data about the implementation.
63 * <dl>
64 * <dt>float getMinimumAAPenSize()
65 * <dd>This method provides information on how small the BasicStroke
66 * line width can get before dropouts occur. Rendering with a BasicStroke
67 * is defined to never allow the line to have breaks, gaps, or dropouts
68 * even if the width is set to 0.0f, so this information allows the
69 * {@link sun.java2d.SunGraphics2D} class to detect the "thin line" case and set
70 * the rendering attributes accordingly.
71 * </dl>
72 * At startup the runtime will load a single instance of this class.
73 * It searches the classpath for a registered provider of this API
74 * and returns either the last one it finds, or the instance whose
75 * class name matches the value supplied in the System property
76 * {@code sun.java2d.renderer}.
77 * Additionally, a runtime System property flag can be set to trace
78 * all calls to methods on the {@code RenderingEngine} in use by
79 * setting the sun.java2d.renderer.trace property to any non-null value.
80 * <p>
81 * Parts of the system that need to use any of the above features should
82 * call {@code RenderingEngine.getInstance()} to obtain the properly
83 * registered (and possibly trace-enabled) version of the RenderingEngine.
84 */
85 public abstract class RenderingEngine {
86 private static RenderingEngine reImpl;
87
88 /**
89 * Returns an instance of {@code RenderingEngine} as determined
160 * @param dashes the dash length array as per {@code BasicStroke}
161 * @param dashphase the initial dash phase as per {@code BasicStroke}
162 * @return the widened path stored in a new {@code Shape} object
163 * @since 1.7
164 */
165 public abstract Shape createStrokedShape(Shape src,
166 float width,
167 int caps,
168 int join,
169 float miterlimit,
170 float dashes[],
171 float dashphase);
172
173 /**
174 * Sends the geometry for a widened path as specified by the parameters
175 * to the specified consumer.
176 * <p>
177 * The specified {@code src} {@link Shape} is widened according
178 * to the parameters specified by the {@link BasicStroke} object.
179 * Adjustments are made to the path as appropriate for the
180 * {@link java.awt.RenderingHints#VALUE_STROKE_NORMALIZE} hint if the
181 * {@code normalize} boolean parameter is true.
182 * Adjustments are made to the path as appropriate for the
183 * {@link java.awt.RenderingHints#VALUE_ANTIALIAS_ON} hint if the
184 * {@code antialias} boolean parameter is true.
185 * <p>
186 * The geometry of the widened path is forwarded to the indicated
187 * {@link PathConsumer2D} object as it is calculated.
188 *
189 * @param src the source path to be widened
190 * @param bs the {@code BasicSroke} object specifying the
191 * decorations to be applied to the widened path
192 * @param normalize indicates whether stroke normalization should
193 * be applied
194 * @param antialias indicates whether or not adjustments appropriate
195 * to antialiased rendering should be applied
196 * @param consumer the {@code PathConsumer2D} instance to forward
197 * the widened geometry to
198 * @since 1.7
199 */
200 public abstract void strokeTo(Shape src,
201 AffineTransform at,
202 BasicStroke bs,
203 boolean thin,
204 boolean normalize,
|