Skip to content

Commit

Permalink
use new JavaFX API
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmasB committed Mar 14, 2024
1 parent 386473a commit 3c4ad4f
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ protected void initUI() {
spinnerVelX.setPrefWidth(65);
spinnerVelY.setPrefWidth(65);

spinnerVelX.valueProperty().addListener((observable, oldValue, newValue) -> {
emitter.setVelocityFunction(i -> new Point2D(newValue, spinnerVelY.getValue()));
spinnerVelX.valueProperty().subscribe(newX -> {
emitter.setVelocityFunction(i -> new Point2D(newX, spinnerVelY.getValue()));
});

spinnerVelY.valueProperty().addListener((observable, oldValue, newValue) -> {
emitter.setVelocityFunction(i -> new Point2D(spinnerVelX.getValue(), newValue));
spinnerVelY.valueProperty().subscribe(newY -> {
emitter.setVelocityFunction(i -> new Point2D(spinnerVelX.getValue(), newY));
});

Spinner<Double> spinnerAccelX = new Spinner<>(-150.0, 150.0, 0.0, 10);
Expand All @@ -87,12 +87,12 @@ protected void initUI() {
spinnerAccelX.setPrefWidth(65);
spinnerAccelY.setPrefWidth(65);

spinnerAccelX.valueProperty().addListener((observable, oldValue, newValue) -> {
emitter.setAccelerationFunction(() -> new Point2D(newValue, spinnerAccelY.getValue()));
spinnerAccelX.valueProperty().subscribe(newX -> {
emitter.setAccelerationFunction(() -> new Point2D(newX, spinnerAccelY.getValue()));
});

spinnerAccelY.valueProperty().addListener((observable, oldValue, newValue) -> {
emitter.setAccelerationFunction(() -> new Point2D(spinnerAccelX.getValue(), newValue));
spinnerAccelY.valueProperty().subscribe(newY -> {
emitter.setAccelerationFunction(() -> new Point2D(spinnerAccelX.getValue(), newY));
});

ChoiceBox<BlendMode> choiceBlend = getUIFactoryService().newChoiceBox(
Expand Down

0 comments on commit 3c4ad4f

Please sign in to comment.