當前位置: 首頁>>代碼示例>>Java>>正文


Java Path.setSmooth方法代碼示例

本文整理匯總了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;
}
 
開發者ID:bourgesl,項目名稱:marlin-fx,代碼行數:9,代碼來源:TestNonAARasterization.java

示例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;
}
 
開發者ID:kasperisager,項目名稱:kelvin-maps,代碼行數:37,代碼來源:Relation.java

示例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();
}
 
開發者ID:bourgesl,項目名稱:marlin-fx,代碼行數:51,代碼來源:TestNonAARasterization.java


注:本文中的javafx.scene.shape.Path.setSmooth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。