private void addObservers() { startSpeed.addObserver(this); acceleration.addObserver(this); time.addObserver(this); finishSpeed.addObserver(this); path.addObserver(this); }
public void update(Observable obs, Object obj) { if (isUpdating) { return; } isUpdating = true; PhysicBodyMoving moving = new PhysicBodyMoving(startSpeed.getValue(), acceleration.getValue(), time.getValue()); finishSpeed.setValue(moving.getFinishSpeed()); path.setValue(moving.getPath()); isUpdating = false; }
public Presenter(final Stage stage) { init(); time.setMin(0); addObservers(); exit.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { stage.close(); } }); }