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


Java SunHints类代码示例

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


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

示例1: renderPath

import sun.awt.SunHints; //导入依赖的package包/类
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,代码行数:18,代码来源:AAShapePipe.java

示例2: getStrokeSpans

import sun.awt.SunHints; //导入依赖的package包/类
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,代码行数:26,代码来源:LoopPipe.java

示例3: drawGlyphList

import sun.awt.SunHints; //导入依赖的package包/类
protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl,
                             int aaHint) {
    switch (aaHint) {
     case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
         sg2d.loops.drawGlyphListLoop.
             DrawGlyphList(sg2d, sg2d.surfaceData, gl);
         return;
     case SunHints.INTVAL_TEXT_ANTIALIAS_ON:
         sg2d.loops.drawGlyphListAALoop.
             DrawGlyphListAA(sg2d, sg2d.surfaceData, gl);
         return;
    case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB:
    case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB:
        sg2d.loops.drawGlyphListLCDLoop.
            DrawGlyphListLCD(sg2d,sg2d.surfaceData, gl);
        return;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:GlyphListLoopPipe.java

示例4: drawGlyphVector

import sun.awt.SunHints; //导入依赖的package包/类
public void drawGlyphVector(SunGraphics2D sg2d, GlyphVector g,
                            float x, float y)
{
    FontRenderContext frc = g.getFontRenderContext();
    FontInfo info = sg2d.getGVFontInfo(g.getFont(), frc);
    switch (info.aaHint) {
    case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
        super.drawGlyphVector(sg2d, g, x, y);
        return;
    case SunHints.INTVAL_TEXT_ANTIALIAS_ON:
         sg2d.surfaceData.aaTextRenderer.drawGlyphVector(sg2d, g, x, y);
        return;
    case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB:
    case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB:
         sg2d.surfaceData.lcdTextRenderer.drawGlyphVector(sg2d, g, x, y);
        return;
    default:
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:X11TextRenderer.java

示例5: renderPath

import sun.awt.SunHints; //导入依赖的package包/类
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,代码行数:20,代码来源:AAShapePipe.java

示例6: drawGlyphVector

import sun.awt.SunHints; //导入依赖的package包/类
public void drawGlyphVector(SunGraphics2D sg2d, GlyphVector g,
                            float x, float y)
{
    FontRenderContext frc = g.getFontRenderContext();
    FontInfo info = sg2d.getGVFontInfo(g.getFont(), frc);
    switch (info.aaHint) {
    case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
        super.drawGlyphVector(sg2d, g, x, y);
        return;
    case SunHints.INTVAL_TEXT_ANTIALIAS_ON:
         SurfaceData.aaTextRenderer.drawGlyphVector(sg2d, g, x, y);
        return;
    case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB:
    case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB:
         SurfaceData.lcdTextRenderer.drawGlyphVector(sg2d, g, x, y);
        return;
    default:
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:X11TextRenderer.java

示例7: renderPath

import sun.awt.SunHints; //导入依赖的package包/类
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,代码行数:20,代码来源:AAShapePipe.java

示例8: drawGlyphListSegment

import sun.awt.SunHints; //导入依赖的package包/类
private void drawGlyphListSegment(SunGraphics2D sg2d, GlyphList gl, int fromglyph, int toGlyph,
                                  int aaHint, boolean isColor) {
    if (fromglyph >= toGlyph) return;
    if (isColor) {
        sg2d.loops.drawGlyphListColorLoop.
                DrawGlyphListColor(sg2d, sg2d.surfaceData, gl, fromglyph, toGlyph);
    } else {
        switch (aaHint) {
            case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
                sg2d.loops.drawGlyphListLoop.
                        DrawGlyphList(sg2d, sg2d.surfaceData, gl, fromglyph, toGlyph);
                return;
            case SunHints.INTVAL_TEXT_ANTIALIAS_ON:
                sg2d.loops.drawGlyphListAALoop.
                        DrawGlyphListAA(sg2d, sg2d.surfaceData, gl, fromglyph, toGlyph);
                return;
            case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB:
            case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB:
                sg2d.loops.drawGlyphListLCDLoop.
                        DrawGlyphListLCD(sg2d, sg2d.surfaceData, gl, fromglyph, toGlyph);
                return;
        }
    }
}
 
开发者ID:JetBrains,项目名称:jdk8u_jdk,代码行数:25,代码来源:GlyphListLoopPipe.java

示例9: renderPath

import sun.awt.SunHints; //导入依赖的package包/类
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,代码行数:20,代码来源:AAShapePipe.java

示例10: renderPath

import sun.awt.SunHints; //导入依赖的package包/类
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,代码行数:18,代码来源:AAShapePipe.java

示例11: getStrokeSpans

import sun.awt.SunHints; //导入依赖的package包/类
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,代码行数:27,代码来源:LoopPipe.java


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