本文整理汇总了Java中javafx.scene.shape.Path.setSmooth方法的典型用法代码示例。如果您正苦于以下问题:Java Path.setSmooth方法的具体用法?Java Path.setSmooth怎么用?Java Path.setSmooth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Path
的用法示例。
在下文中一共展示了Path.setSmooth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makePath
import javafx.scene.shape.Path; //导入方法依赖的package包/类
public Path makePath() {
Path p = new Path();
p.setFill(Color.BLACK);
p.setStroke(null);
p.setCache(false);
p.setSmooth(false);
return p;
}
示例2: multipolygon
import javafx.scene.shape.Path; //导入方法依赖的package包/类
/**
* Construct a multipolygon from the ways in the relation.
*
* @return A multipolygon constructed from the ways of the relation.
*/
private Path multipolygon() {
Path path = new Path();
path.setFillRule(FillRule.EVEN_ODD);
// Don't use antialiasing for performance reasons.
path.setSmooth(false);
for (Element element: this.members) {
if (!(element instanceof Way)) {
continue;
}
Way way = (Way) element;
for (int i = 0; i < way.nodes().size(); i++) {
Node node = way.nodes().get(i);
if (i == 0) {
path.getElements().add(new MoveTo(node.x(), node.y()));
}
else {
path.getElements().add(new LineTo(node.x(), node.y()));
}
}
}
path.getStyleClass().add("member");
return path;
}
示例3: start
import javafx.scene.shape.Path; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
BorderPane root = new BorderPane();
progressLabel = new Text("running...");
root.setBottom(progressLabel);
resultcv = new Canvas(TESTW * MAG, TESTH * MAG);
resultpath = new Path();
resultpath.setCache(false);
resultpath.setSmooth(false);
resultpath.getTransforms().add(new Scale(MAG, MAG));
resultpath.setFill(null);
resultpath.setStroke(Color.DARKGRAY);
resultpath.setStrokeWidth(1.0 / MAG);
root.setCenter(new Group(resultcv, resultpath));
HBox legend = new HBox();
legend.getChildren().add(new Text("Good Pixel: "));
legend.getChildren().add(makeStatusCanvas(FGPIXEL, true, false));
legend.getChildren().add(new Text(" Bad Pixels: "));
legend.getChildren().add(makeStatusCanvas(FGPIXEL, false, false));
legend.getChildren().add(makeStatusCanvas(BGPIXEL, true, false));
legend.getChildren().add(new Text(" Iffy Pixels: "));
legend.getChildren().add(makeStatusCanvas(FGPIXEL, false, true));
legend.getChildren().add(makeStatusCanvas(BGPIXEL, true, true));
legend.getChildren().add(new Text(" Alpha(AA) Pixel: "));
legend.getChildren().add(makeStatusCanvas(12, true, false));
resulttext = new Text("(waiting for result)");
VBox vb = new VBox(legend, resulttext);
vb.setAlignment(Pos.TOP_CENTER);
vb.setFillWidth(false);
root.setTop(vb);
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setTitle("Testing "+shapemode);
stage.show();
resultcv.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
dumpTest();
}
});
Thread t = new Thread(() -> generatePaths());
t.setDaemon(true);
t.start();
}