Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. stage.setTitle("Convex Hull");
  2. final NumberAxis xAxis = new NumberAxis(0, ConvexHull.getHighestX(pointCount, ConvexHull.xVal)+5, 5);
  3. final NumberAxis yAxis = new NumberAxis(0, ConvexHull.getHighestY(pointCount, ConvexHull.yVal)+5, 5);
  4. final ScatterChart<Number, Number> sc = new
  5. ScatterChart<Number, Number>(xAxis, yAxis);
  6. final LineChart<Number, Number> lc = new
  7. LineChart<Number, Number>(xAxis, yAxis);
  8.  
  9. XYChart.Series series = new XYChart.Series();
  10. for (int i = 0; i < pointCount; i++){
  11. series.getData().add(new XYChart.Data(ConvexHull.xVal[i],ConvexHull.yVal[i]));
  12. }
  13.  
  14. XYChart.Series series1 = new XYChart.Series();
  15. for (int i = 0; i < pointCount; i++){
  16. series1.getData().add(new XYChart.Data(ConvexHull.xVal[i],ConvexHull.yVal[i]));
  17. }
  18.  
  19. sc.getData().addAll(series);
  20. lc.getData().addAll(series1);
  21.  
  22. Pane pane = new Pane();
  23. pane.getChildren().add(sc);
  24. pane.getChildren().add(lc);
  25.  
  26. lc.setOpacity(0.5);
  27.  
  28. Scene scene = new Scene(pane, 500, 400);
  29. stage.setScene(scene);
  30. stage.show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement