public Circle(double radius, Parent parent) { PlatformFX.runLater( () -> { this.radius = radius; this.circle = new javafx.scene.shape.Circle(this.radius); this.circle.setFill(null); this.circle.setStroke(Color.BLACK); parent.addNode(this.circle); }); }
public Circle(double radius) { PlatformFX.runLater( () -> { this.radius = radius; this.circle = new javafx.scene.shape.Circle(this.radius); this.circle.setFill(null); this.circle.setStroke(Color.BLACK); PanelGame panelGame = Instances.getPanelGameInstance(); panelGame.addNode(this.circle); }); }
public final void setRadius(double radius) { PlatformFX.runLater( () -> { double centerX = this.topLeftX + this.radius; double centerY = this.topLeftY + this.radius; this.radius = radius; this.topLeftX = centerX - this.radius; this.topLeftY = centerY - this.radius; this.circle.setRadius(radius); relocate(); }); }
public final void setOnMousePressed(EventHandler<? super MouseEvent> value) { PlatformFX.runLater(() -> this.circle.setOnMousePressed(value)); }
public final void setStroke(Paint value) { PlatformFX.runLater(() -> this.circle.setStroke(value)); }
private void relocate() { PlatformFX.runLater(() -> this.circle.relocate(this.topLeftX, this.topLeftY)); }
@Override public void toFront() { PlatformFX.runLater(() -> this.circle.toFront()); }
public void toBack() { PlatformFX.runLater(() -> this.circle.toBack()); }
public final void setVisible(boolean value) { PlatformFX.runLater(() -> this.circle.setVisible(value)); }