added new thread

This commit is contained in:
Sem van der Hoeven
2020-03-04 20:51:40 +01:00
parent a296868817
commit eff782aa86
3 changed files with 57 additions and 8 deletions

View File

@@ -12,21 +12,19 @@ import org.jfree.fx.FXGraphics2D;
import org.jfree.fx.ResizableCanvas;
public class Visualiser extends Application {
private Stage stage;
private double frameTime = 0;
@Override
public void start(Stage primaryStage) throws Exception {
BorderPane pane = new BorderPane();
this.stage = primaryStage;
ResizableCanvas canvas = new ResizableCanvas(this::draw, pane);
canvas.setWidth(1600);
canvas.setHeight(800);
pane.setCenter(canvas);
FXGraphics2D g2d = new FXGraphics2D(canvas.getGraphicsContext2D());
draw(g2d);
stage.setScene(new Scene(pane));
stage.setTitle("Webcrawler results");
primaryStage.setScene(new Scene(pane));
primaryStage.setTitle("Webcrawler results");
primaryStage.show();
new AnimationTimer() {