当前位置: 首页>>代码示例>>Java>>正文


Java SunHints.INTVAL_STROKE_PURE属性代码示例

本文整理汇总了Java中sun.awt.SunHints.INTVAL_STROKE_PURE属性的典型用法代码示例。如果您正苦于以下问题:Java SunHints.INTVAL_STROKE_PURE属性的具体用法?Java SunHints.INTVAL_STROKE_PURE怎么用?Java SunHints.INTVAL_STROKE_PURE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在sun.awt.SunHints的用法示例。


在下文中一共展示了SunHints.INTVAL_STROKE_PURE属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderPath

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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:AAShapePipe.java

示例2: getStrokeSpans

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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:LoopPipe.java

示例3: renderPath

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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:AAShapePipe.java

示例4: renderPath

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 = tileStateProvider.acquire();
    try {
        final int[] abox = ts.abox;

        final AATileGenerator aatg =
            renderengine.getAATileGenerator(s, sg.transform, sg.getCompClip(),
                                            bs, thin, adjust, abox);
        if (aatg != null) {
            renderTiles(sg, s, aatg, abox, ts);
        }
    } finally {
        tileStateProvider.release(ts);
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:19,代码来源:AAShapePipe.java

示例5: renderPath

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 = tileStateProvider.acquire();
    try {
        final int[] abox = ts.abox;

        final AATileGenerator aatg
                              = renderengine.getAATileGenerator(s, sg.transform, sg.getCompClip(),
                        bs, thin, adjust, abox);
        if (aatg != null) {
            renderTiles(sg, s, aatg, abox, ts);
        }
    } finally {
        tileStateProvider.release(ts);
    }
}
 
开发者ID:bourgesl,项目名称:marlin-graphics,代码行数:19,代码来源:AAShapePipe.java

示例6: renderPath

public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) {
    boolean adjust = (bs != null &&
                      sg.strokeHint != SunHints.INTVAL_STROKE_PURE);
    boolean thin = (sg.strokeState <= sg.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);
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:17,代码来源:AAShapePipe.java

示例7: getStrokeSpans

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 <= sg2d.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;
        t.printStackTrace();
        throw new InternalError("Unable to Stroke shape ("+
                                t.getMessage()+")");
    }
    return sr;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:26,代码来源:LoopPipe.java

示例8: renderPath

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();
    final TileState ts = tileStateThreadLocal.get();
    final int[] abox = ts.abox;

    AATileGenerator aatg =
        renderengine.getAATileGenerator(s, sg.transform, clip,
                                        bs, thin, adjust, abox);
    if (aatg == null) {
        // Nothing to render
        return;
    }

    renderTiles(sg, s, aatg, abox, ts);
}
 
开发者ID:bourgesl,项目名称:marlin-renderer,代码行数:19,代码来源:AAShapePipe.java

示例9: fillRectangle

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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:PixelToParallelogramConverter.java

示例10: drawRectangle

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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:54,代码来源:PixelToParallelogramConverter.java

示例11: getFillSSI

/**
 * 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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:LoopPipe.java


注:本文中的sun.awt.SunHints.INTVAL_STROKE_PURE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。