本文整理汇总了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;
}
示例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;
}
示例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 );
}