本文整理汇总了Java中javafx.scene.canvas.GraphicsContext.strokeRoundRect方法的典型用法代码示例。如果您正苦于以下问题:Java GraphicsContext.strokeRoundRect方法的具体用法?Java GraphicsContext.strokeRoundRect怎么用?Java GraphicsContext.strokeRoundRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.canvas.GraphicsContext
的用法示例。
在下文中一共展示了GraphicsContext.strokeRoundRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawShapes
import javafx.scene.canvas.GraphicsContext; //导入方法依赖的package包/类
private static void drawShapes(GraphicsContext gc) {
gc.setFill(Color.GREEN);
gc.setStroke(Color.BLUE);
gc.setLineWidth(5);
gc.strokeLine(40, 10, 10, 40);
gc.fillOval(10, 60, 30, 30);
gc.strokeOval(60, 60, 30, 30);
gc.fillRoundRect(110, 60, 30, 30, 10, 10);
gc.strokeRoundRect(160, 60, 30, 30, 10, 10);
gc.fillArc(10, 110, 30, 30, 45, 240, ArcType.OPEN);
gc.fillArc(60, 110, 30, 30, 45, 240, ArcType.CHORD);
gc.fillArc(110, 110, 30, 30, 45, 240, ArcType.ROUND);
gc.strokeArc(10, 160, 30, 30, 45, 240, ArcType.OPEN);
gc.strokeArc(60, 160, 30, 30, 45, 240, ArcType.CHORD);
gc.strokeArc(110, 160, 30, 30, 45, 240, ArcType.ROUND);
gc.fillPolygon(new double[]{10, 40, 10, 40},
new double[]{210, 210, 240, 240}, 4);
gc.strokePolygon(new double[]{60, 90, 60, 90},
new double[]{210, 210, 240, 240}, 4);
gc.strokePolyline(new double[]{110, 140, 110, 140},
new double[]{210, 210, 240, 240}, 4);
}
示例2: render
import javafx.scene.canvas.GraphicsContext; //导入方法依赖的package包/类
public void render(GraphicsContext g)
{
g.setFill(COLOR_BACKGROUND);
g.fillRect(this.x, this.y, this.width, this.height);
g.setLineWidth(this.enabled ? OUTLINE_LINE_WIDTH : INACTIVE_LINE_WIDTH);
g.setStroke(this.outline);
g.strokeRoundRect(this.x, this.y, this.width, this.height,
OUTLINE_ROUND_RADIUS, OUTLINE_ROUND_RADIUS);
this.onRender(g);
if (!this.enabled)
{
g.setFill(COLOR_DISABLED_OVERLAY);
g.fillRoundRect(this.x, this.y, this.width, this.height,
OUTLINE_ROUND_RADIUS, OUTLINE_ROUND_RADIUS);
}
}