Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stage.setTitle("Convex Hull");
- final NumberAxis xAxis = new NumberAxis(0, ConvexHull.getHighestX(pointCount, ConvexHull.xVal)+5, 5);
- final NumberAxis yAxis = new NumberAxis(0, ConvexHull.getHighestY(pointCount, ConvexHull.yVal)+5, 5);
- final ScatterChart<Number, Number> sc = new
- ScatterChart<Number, Number>(xAxis, yAxis);
- final LineChart<Number, Number> lc = new
- LineChart<Number, Number>(xAxis, yAxis);
- XYChart.Series series = new XYChart.Series();
- for (int i = 0; i < pointCount; i++){
- series.getData().add(new XYChart.Data(ConvexHull.xVal[i],ConvexHull.yVal[i]));
- }
- XYChart.Series series1 = new XYChart.Series();
- for (int i = 0; i < pointCount; i++){
- series1.getData().add(new XYChart.Data(ConvexHull.xVal[i],ConvexHull.yVal[i]));
- }
- sc.getData().addAll(series);
- lc.getData().addAll(series1);
- Pane pane = new Pane();
- pane.getChildren().add(sc);
- pane.getChildren().add(lc);
- lc.setOpacity(0.5);
- Scene scene = new Scene(pane, 500, 400);
- stage.setScene(scene);
- stage.show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement