Java Code Examples for sun.awt.SunHints#INTVAL_STROKE_PURE
The following examples show how to use
sun.awt.SunHints#INTVAL_STROKE_PURE .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AAShapePipe.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) { boolean adjust = (bs != null && sg.strokeHint != SunHints.INTVAL_STROKE_PURE); boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED); Region clip = sg.getCompClip(); int abox[] = new int[4]; AATileGenerator aatg = renderengine.getAATileGenerator(s, sg.transform, clip, bs, thin, adjust, abox); if (aatg == null) { // Nothing to render return; } renderTiles(sg, s, aatg, abox); }
Example 2
Source File: AAShapePipe.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) { final boolean adjust = (bs != null && sg.strokeHint != SunHints.INTVAL_STROKE_PURE); final boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED); final TileState ts = TILE_STATE_PROVIDER.acquire(); try { final int[] abox = ts.abox; final AATileGenerator aatg = RDR_ENGINE.getAATileGenerator(s, sg.transform, sg.getCompClip(), bs, thin, adjust, abox); if (aatg != null) { renderTiles(sg, s, aatg, abox, ts); } } finally { TILE_STATE_PROVIDER.release(ts); } }
Example 3
Source File: LoopPipe.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public static ShapeSpanIterator getStrokeSpans(SunGraphics2D sg2d, Shape s) { ShapeSpanIterator sr = new ShapeSpanIterator(false); try { sr.setOutputArea(sg2d.getCompClip()); sr.setRule(PathIterator.WIND_NON_ZERO); BasicStroke bs = (BasicStroke) sg2d.stroke; boolean thin = (sg2d.strokeState <= SunGraphics2D.STROKE_THINDASHED); boolean normalize = (sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE); RenderEngine.strokeTo(s, sg2d.transform, bs, thin, normalize, false, sr); } catch (Throwable t) { sr.dispose(); sr = null; throw new InternalError("Unable to Stroke shape ("+ t.getMessage()+")", t); } return sr; }
Example 4
Source File: AAShapePipe.java From Bytecoder with Apache License 2.0 | 6 votes |
public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) { final boolean adjust = (bs != null && sg.strokeHint != SunHints.INTVAL_STROKE_PURE); final boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED); final TileState ts = TILE_STATE_PROVIDER.acquire(); try { final int[] abox = ts.abox; final AATileGenerator aatg = RDR_ENGINE.getAATileGenerator(s, sg.transform, sg.getCompClip(), bs, thin, adjust, abox); if (aatg != null) { renderTiles(sg, s, aatg, abox, ts); } } finally { TILE_STATE_PROVIDER.release(ts); } }
Example 5
Source File: LoopPipe.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public static ShapeSpanIterator getStrokeSpans(SunGraphics2D sg2d, Shape s) { ShapeSpanIterator sr = new ShapeSpanIterator(false); try { sr.setOutputArea(sg2d.getCompClip()); sr.setRule(PathIterator.WIND_NON_ZERO); BasicStroke bs = (BasicStroke) sg2d.stroke; boolean thin = (sg2d.strokeState <= SunGraphics2D.STROKE_THINDASHED); boolean normalize = (sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE); RenderEngine.strokeTo(s, sg2d.transform, bs, thin, normalize, false, sr); } catch (Throwable t) { sr.dispose(); sr = null; throw new InternalError("Unable to Stroke shape ("+ t.getMessage()+")", t); } return sr; }
Example 6
Source File: LoopPipe.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static ShapeSpanIterator getStrokeSpans(SunGraphics2D sg2d, Shape s) { ShapeSpanIterator sr = new ShapeSpanIterator(false); try { sr.setOutputArea(sg2d.getCompClip()); sr.setRule(PathIterator.WIND_NON_ZERO); BasicStroke bs = (BasicStroke) sg2d.stroke; boolean thin = (sg2d.strokeState <= SunGraphics2D.STROKE_THINDASHED); boolean normalize = (sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE); RenderEngine.strokeTo(s, sg2d.transform, bs, thin, normalize, false, sr); } catch (Throwable t) { sr.dispose(); sr = null; throw new InternalError("Unable to Stroke shape ("+ t.getMessage()+")", t); } return sr; }
Example 7
Source File: AAShapePipe.java From hottub with GNU General Public License v2.0 | 6 votes |
public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) { boolean adjust = (bs != null && sg.strokeHint != SunHints.INTVAL_STROKE_PURE); boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED); Region clip = sg.getCompClip(); int abox[] = new int[4]; AATileGenerator aatg = renderengine.getAATileGenerator(s, sg.transform, clip, bs, thin, adjust, abox); if (aatg == null) { // Nothing to render return; } renderTiles(sg, s, aatg, abox); }
Example 8
Source File: AAShapePipe.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) { boolean adjust = (bs != null && sg.strokeHint != SunHints.INTVAL_STROKE_PURE); boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED); Region clip = sg.getCompClip(); int abox[] = new int[4]; AATileGenerator aatg = renderengine.getAATileGenerator(s, sg.transform, clip, bs, thin, adjust, abox); if (aatg == null) { // Nothing to render return; } renderTiles(sg, s, aatg, abox); }
Example 9
Source File: AAShapePipe.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) { boolean adjust = (bs != null && sg.strokeHint != SunHints.INTVAL_STROKE_PURE); boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED); Region clip = sg.getCompClip(); int abox[] = new int[4]; AATileGenerator aatg = renderengine.getAATileGenerator(s, sg.transform, clip, bs, thin, adjust, abox); if (aatg == null) { // Nothing to render return; } renderTiles(sg, s, aatg, abox); }
Example 10
Source File: PixelToParallelogramConverter.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void fillRectangle(SunGraphics2D sg2d, double rx, double ry, double rw, double rh) { double px, py; double dx1, dy1, dx2, dy2; AffineTransform txform = sg2d.transform; dx1 = txform.getScaleX(); dy1 = txform.getShearY(); dx2 = txform.getShearX(); dy2 = txform.getScaleY(); px = rx * dx1 + ry * dx2 + txform.getTranslateX(); py = rx * dy1 + ry * dy2 + txform.getTranslateY(); dx1 *= rw; dy1 *= rw; dx2 *= rh; dy2 *= rh; if (adjustfill && sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM && sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE) { double newx = normalize(px); double newy = normalize(py); dx1 = normalize(px + dx1) - newx; dy1 = normalize(py + dy1) - newy; dx2 = normalize(px + dx2) - newx; dy2 = normalize(py + dy2) - newy; px = newx; py = newy; } outrenderer.fillParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2); }
Example 11
Source File: PixelToParallelogramConverter.java From Bytecoder with Apache License 2.0 | 5 votes |
public void fillRectangle(SunGraphics2D sg2d, double rx, double ry, double rw, double rh) { double px, py; double dx1, dy1, dx2, dy2; AffineTransform txform = sg2d.transform; dx1 = txform.getScaleX(); dy1 = txform.getShearY(); dx2 = txform.getShearX(); dy2 = txform.getScaleY(); px = rx * dx1 + ry * dx2 + txform.getTranslateX(); py = rx * dy1 + ry * dy2 + txform.getTranslateY(); dx1 *= rw; dy1 *= rw; dx2 *= rh; dy2 *= rh; if (adjustfill && sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM && sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE) { double newx = normalize(px); double newy = normalize(py); dx1 = normalize(px + dx1) - newx; dy1 = normalize(py + dy1) - newy; dx2 = normalize(px + dx2) - newx; dy2 = normalize(py + dy2) - newy; px = newx; py = newy; } outrenderer.fillParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2); }
Example 12
Source File: PixelToParallelogramConverter.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
public void drawRectangle(SunGraphics2D sg2d, double rx, double ry, double rw, double rh, double lw) { double px, py; double dx1, dy1, dx2, dy2; double lw1, lw2; AffineTransform txform = sg2d.transform; dx1 = txform.getScaleX(); dy1 = txform.getShearY(); dx2 = txform.getShearX(); dy2 = txform.getScaleY(); px = rx * dx1 + ry * dx2 + txform.getTranslateX(); py = rx * dy1 + ry * dy2 + txform.getTranslateY(); // lw along dx1,dy1 scale by transformed length of dx2,dy2 vectors // and vice versa lw1 = len(dx1, dy1) * lw; lw2 = len(dx2, dy2) * lw; dx1 *= rw; dy1 *= rw; dx2 *= rh; dy2 *= rh; if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM && sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE) { double newx = normalize(px); double newy = normalize(py); dx1 = normalize(px + dx1) - newx; dy1 = normalize(py + dy1) - newy; dx2 = normalize(px + dx2) - newx; dy2 = normalize(py + dy2) - newy; px = newx; py = newy; } lw1 = Math.max(lw1, minPenSize); lw2 = Math.max(lw2, minPenSize); double len1 = len(dx1, dy1); double len2 = len(dx2, dy2); if (lw1 >= len1 || lw2 >= len2) { // The line widths are large enough to consume the // entire hole in the middle of the parallelogram // so we can just fill the outer parallelogram. fillOuterParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2, len1, len2, lw1, lw2); } else { outrenderer.drawParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2, lw1 / len1, lw2 / len2); } }
Example 13
Source File: PixelToParallelogramConverter.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
public void drawRectangle(SunGraphics2D sg2d, double rx, double ry, double rw, double rh, double lw) { double px, py; double dx1, dy1, dx2, dy2; double lw1, lw2; AffineTransform txform = sg2d.transform; dx1 = txform.getScaleX(); dy1 = txform.getShearY(); dx2 = txform.getShearX(); dy2 = txform.getScaleY(); px = rx * dx1 + ry * dx2 + txform.getTranslateX(); py = rx * dy1 + ry * dy2 + txform.getTranslateY(); // lw along dx1,dy1 scale by transformed length of dx2,dy2 vectors // and vice versa lw1 = len(dx1, dy1) * lw; lw2 = len(dx2, dy2) * lw; dx1 *= rw; dy1 *= rw; dx2 *= rh; dy2 *= rh; if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM && sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE) { double newx = normalize(px); double newy = normalize(py); dx1 = normalize(px + dx1) - newx; dy1 = normalize(py + dy1) - newy; dx2 = normalize(px + dx2) - newx; dy2 = normalize(py + dy2) - newy; px = newx; py = newy; } lw1 = Math.max(lw1, minPenSize); lw2 = Math.max(lw2, minPenSize); double len1 = len(dx1, dy1); double len2 = len(dx2, dy2); if (lw1 >= len1 || lw2 >= len2) { // The line widths are large enough to consume the // entire hole in the middle of the parallelogram // so we can just fill the outer parallelogram. fillOuterParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2, len1, len2, lw1, lw2); } else { outrenderer.drawParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2, lw1 / len1, lw2 / len2); } }
Example 14
Source File: PixelToParallelogramConverter.java From hottub with GNU General Public License v2.0 | 4 votes |
public void drawRectangle(SunGraphics2D sg2d, double rx, double ry, double rw, double rh, double lw) { double px, py; double dx1, dy1, dx2, dy2; double lw1, lw2; AffineTransform txform = sg2d.transform; dx1 = txform.getScaleX(); dy1 = txform.getShearY(); dx2 = txform.getShearX(); dy2 = txform.getScaleY(); px = rx * dx1 + ry * dx2 + txform.getTranslateX(); py = rx * dy1 + ry * dy2 + txform.getTranslateY(); // lw along dx1,dy1 scale by transformed length of dx2,dy2 vectors // and vice versa lw1 = len(dx1, dy1) * lw; lw2 = len(dx2, dy2) * lw; dx1 *= rw; dy1 *= rw; dx2 *= rh; dy2 *= rh; if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM && sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE) { double newx = normalize(px); double newy = normalize(py); dx1 = normalize(px + dx1) - newx; dy1 = normalize(py + dy1) - newy; dx2 = normalize(px + dx2) - newx; dy2 = normalize(py + dy2) - newy; px = newx; py = newy; } lw1 = Math.max(lw1, minPenSize); lw2 = Math.max(lw2, minPenSize); double len1 = len(dx1, dy1); double len2 = len(dx2, dy2); if (lw1 >= len1 || lw2 >= len2) { // The line widths are large enough to consume the // entire hole in the middle of the parallelogram // so we can just fill the outer parallelogram. fillOuterParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2, len1, len2, lw1, lw2); } else { outrenderer.drawParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2, lw1 / len1, lw2 / len2); } }
Example 15
Source File: PixelToParallelogramConverter.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public void drawRectangle(SunGraphics2D sg2d, double rx, double ry, double rw, double rh, double lw) { double px, py; double dx1, dy1, dx2, dy2; double lw1, lw2; AffineTransform txform = sg2d.transform; dx1 = txform.getScaleX(); dy1 = txform.getShearY(); dx2 = txform.getShearX(); dy2 = txform.getScaleY(); px = rx * dx1 + ry * dx2 + txform.getTranslateX(); py = rx * dy1 + ry * dy2 + txform.getTranslateY(); // lw along dx1,dy1 scale by transformed length of dx2,dy2 vectors // and vice versa lw1 = len(dx1, dy1) * lw; lw2 = len(dx2, dy2) * lw; dx1 *= rw; dy1 *= rw; dx2 *= rh; dy2 *= rh; if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM && sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE) { double newx = normalize(px); double newy = normalize(py); dx1 = normalize(px + dx1) - newx; dy1 = normalize(py + dy1) - newy; dx2 = normalize(px + dx2) - newx; dy2 = normalize(py + dy2) - newy; px = newx; py = newy; } lw1 = Math.max(lw1, minPenSize); lw2 = Math.max(lw2, minPenSize); double len1 = len(dx1, dy1); double len2 = len(dx2, dy2); if (lw1 >= len1 || lw2 >= len2) { // The line widths are large enough to consume the // entire hole in the middle of the parallelogram // so we can just fill the outer parallelogram. fillOuterParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2, len1, len2, lw1, lw2); } else { outrenderer.drawParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2, lw1 / len1, lw2 / len2); } }
Example 16
Source File: PixelToParallelogramConverter.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
public void drawRectangle(SunGraphics2D sg2d, double rx, double ry, double rw, double rh, double lw) { double px, py; double dx1, dy1, dx2, dy2; double lw1, lw2; AffineTransform txform = sg2d.transform; dx1 = txform.getScaleX(); dy1 = txform.getShearY(); dx2 = txform.getShearX(); dy2 = txform.getScaleY(); px = rx * dx1 + ry * dx2 + txform.getTranslateX(); py = rx * dy1 + ry * dy2 + txform.getTranslateY(); // lw along dx1,dy1 scale by transformed length of dx2,dy2 vectors // and vice versa lw1 = len(dx1, dy1) * lw; lw2 = len(dx2, dy2) * lw; dx1 *= rw; dy1 *= rw; dx2 *= rh; dy2 *= rh; if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM && sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE) { double newx = normalize(px); double newy = normalize(py); dx1 = normalize(px + dx1) - newx; dy1 = normalize(py + dy1) - newy; dx2 = normalize(px + dx2) - newx; dy2 = normalize(py + dy2) - newy; px = newx; py = newy; } lw1 = Math.max(lw1, minPenSize); lw2 = Math.max(lw2, minPenSize); double len1 = len(dx1, dy1); double len2 = len(dx2, dy2); if (lw1 >= len1 || lw2 >= len2) { // The line widths are large enough to consume the // entire hole in the middle of the parallelogram // so we can just fill the outer parallelogram. fillOuterParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2, len1, len2, lw1, lw2); } else { outrenderer.drawParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2, lw1 / len1, lw2 / len2); } }
Example 17
Source File: PixelToParallelogramConverter.java From Bytecoder with Apache License 2.0 | 4 votes |
public void drawRectangle(SunGraphics2D sg2d, double rx, double ry, double rw, double rh, double lw) { double px, py; double dx1, dy1, dx2, dy2; double lw1, lw2; AffineTransform txform = sg2d.transform; dx1 = txform.getScaleX(); dy1 = txform.getShearY(); dx2 = txform.getShearX(); dy2 = txform.getScaleY(); px = rx * dx1 + ry * dx2 + txform.getTranslateX(); py = rx * dy1 + ry * dy2 + txform.getTranslateY(); // lw along dx1,dy1 scale by transformed length of dx2,dy2 vectors // and vice versa lw1 = len(dx1, dy1) * lw; lw2 = len(dx2, dy2) * lw; dx1 *= rw; dy1 *= rw; dx2 *= rh; dy2 *= rh; if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM && sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE) { double newx = normalize(px); double newy = normalize(py); dx1 = normalize(px + dx1) - newx; dy1 = normalize(py + dy1) - newy; dx2 = normalize(px + dx2) - newx; dy2 = normalize(py + dy2) - newy; px = newx; py = newy; } lw1 = Math.max(lw1, minPenSize); lw2 = Math.max(lw2, minPenSize); double len1 = len(dx1, dy1); double len2 = len(dx2, dy2); if (lw1 >= len1 || lw2 >= len2) { // The line widths are large enough to consume the // entire hole in the middle of the parallelogram // so we can just fill the outer parallelogram. fillOuterParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2, len1, len2, lw1, lw2); } else { outrenderer.drawParallelogram(sg2d, rx, ry, rx+rw, ry+rh, px, py, dx1, dy1, dx2, dy2, lw1 / len1, lw2 / len2); } }
Example 18
Source File: LoopPipe.java From jdk8u60 with GNU General Public License v2.0 | 2 votes |
/** * Return a ShapeSpanIterator instance that normalizes as * appropriate for a fill operation as per the settings in * the specified SunGraphics2D object. * * The ShapeSpanIterator will be newly constructed and ready * to start taking in geometry. * * Note that the caller is responsible for calling dispose() * on the returned ShapeSpanIterator inside a try/finally block: * <pre> * ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d); * try { * ssi.setOutputArea(clip); * ssi.appendPath(...); // or appendPoly * // iterate the spans from ssi and operate on them * } finally { * ssi.dispose(); * } * </pre> */ public static ShapeSpanIterator getFillSSI(SunGraphics2D sg2d) { boolean adjust = ((sg2d.stroke instanceof BasicStroke) && sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE); return new ShapeSpanIterator(adjust); }
Example 19
Source File: LoopPipe.java From openjdk-8-source with GNU General Public License v2.0 | 2 votes |
/** * Return a ShapeSpanIterator instance that normalizes as * appropriate for a fill operation as per the settings in * the specified SunGraphics2D object. * * The ShapeSpanIterator will be newly constructed and ready * to start taking in geometry. * * Note that the caller is responsible for calling dispose() * on the returned ShapeSpanIterator inside a try/finally block: * <pre> * ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d); * try { * ssi.setOutputArea(clip); * ssi.appendPath(...); // or appendPoly * // iterate the spans from ssi and operate on them * } finally { * ssi.dispose(); * } * </pre> */ public static ShapeSpanIterator getFillSSI(SunGraphics2D sg2d) { boolean adjust = ((sg2d.stroke instanceof BasicStroke) && sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE); return new ShapeSpanIterator(adjust); }
Example 20
Source File: LoopPipe.java From TencentKona-8 with GNU General Public License v2.0 | 2 votes |
/** * Return a ShapeSpanIterator instance that normalizes as * appropriate for a fill operation as per the settings in * the specified SunGraphics2D object. * * The ShapeSpanIterator will be newly constructed and ready * to start taking in geometry. * * Note that the caller is responsible for calling dispose() * on the returned ShapeSpanIterator inside a try/finally block: * <pre> * ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d); * try { * ssi.setOutputArea(clip); * ssi.appendPath(...); // or appendPoly * // iterate the spans from ssi and operate on them * } finally { * ssi.dispose(); * } * </pre> */ public static ShapeSpanIterator getFillSSI(SunGraphics2D sg2d) { boolean adjust = ((sg2d.stroke instanceof BasicStroke) && sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE); return new ShapeSpanIterator(adjust); }