本文整理匯總了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);
}
}