Exemplo n.º 1
0
 private void addObservers() {
   startSpeed.addObserver(this);
   acceleration.addObserver(this);
   time.addObserver(this);
   finishSpeed.addObserver(this);
   path.addObserver(this);
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public Presenter(final Stage stage) {
   init();
   time.setMin(0);
   addObservers();
   exit.setOnAction(
       new EventHandler<ActionEvent>() {
         @Override
         public void handle(ActionEvent event) {
           stage.close();
         }
       });
 }