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


Java PPaintContext.getRenderQuality方法代码示例

本文整理汇总了Java中edu.umd.cs.piccolo.util.PPaintContext.getRenderQuality方法的典型用法代码示例。如果您正苦于以下问题:Java PPaintContext.getRenderQuality方法的具体用法?Java PPaintContext.getRenderQuality怎么用?Java PPaintContext.getRenderQuality使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.umd.cs.piccolo.util.PPaintContext的用法示例。


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

示例1: createYLineNode

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
private PNode createYLineNode( double minX, double maxX, double y ) {
    PPath child = new PPath( new Line2D.Double( minX, y, maxX, y ) ) {

        //Use low quality rendering to improve performance when grid is turned on
        @Override protected void paint( PPaintContext paintContext ) {
            int renderQuality = paintContext.getRenderQuality();
            paintContext.setRenderQuality( PPaintContext.LOW_QUALITY_RENDERING );
            super.paint( paintContext );
            paintContext.setRenderQuality( renderQuality );
        }
    };
    boolean thickStroke = MathUtil.isApproxEqual( y, 0, 0.001 );

    //On 11/29/2011 It was requested to make every other line thick instead of every 5 lines.
    if ( (int) y % 2 == 0 ) {
        thickStroke = true;
    }
    child.setStroke( new BasicStroke( 0.01f * ( thickStroke ? 3 : 1 ) ) );
    return child;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:21,代码来源:GridNode.java

示例2: createXLineNode

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
private PNode createXLineNode( double minY, double maxY, double x ) {
    PPath child = new PPath( new Line2D.Double( x, minY, x, maxY ) ) {

        //Use low quality rendering to improve performance when grid is turned on
        @Override protected void paint( PPaintContext paintContext ) {
            int renderQuality = paintContext.getRenderQuality();
            paintContext.setRenderQuality( PPaintContext.LOW_QUALITY_RENDERING );
            super.paint( paintContext );
            paintContext.setRenderQuality( renderQuality );
        }
    };
    boolean thickStroke = MathUtil.isApproxEqual( x, highlightX, 0.001 );
    child.setStroke( new BasicStroke( 0.01f * ( thickStroke ? 3 : 1 ) ) );
    return child;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:16,代码来源:GridNode.java

示例3: paint

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
/**
 * Use high quality rendering hints for painting this node.
 *
 * @param paintContext
 */
protected void paint( PPaintContext paintContext ) {
    int rq = paintContext.getRenderQuality();
    paintContext.setRenderQuality( PPaintContext.HIGH_QUALITY_RENDERING );
    super.paint( paintContext );
    paintContext.setRenderQuality( rq );
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:12,代码来源:HighQualityPhetPPath.java


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