Exemple #1
0
  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);
        });
  }
Exemple #2
0
  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);
        });
  }
Exemple #3
0
  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();
        });
  }
Exemple #4
0
 public final void setOnMousePressed(EventHandler<? super MouseEvent> value) {
   PlatformFX.runLater(() -> this.circle.setOnMousePressed(value));
 }
Exemple #5
0
 public final void setStroke(Paint value) {
   PlatformFX.runLater(() -> this.circle.setStroke(value));
 }
Exemple #6
0
 private void relocate() {
   PlatformFX.runLater(() -> this.circle.relocate(this.topLeftX, this.topLeftY));
 }
Exemple #7
0
 @Override
 public void toFront() {
   PlatformFX.runLater(() -> this.circle.toFront());
 }
Exemple #8
0
 public void toBack() {
   PlatformFX.runLater(() -> this.circle.toBack());
 }
Exemple #9
0
 public final void setVisible(boolean value) {
   PlatformFX.runLater(() -> this.circle.setVisible(value));
 }