@Override
  public boolean update() {
    int speed = 1;
    if (myImageView.getFitWidth() <= 300) {
      myImageView.setVisible(true);
      myImageView.setFitHeight(myImageView.getFitHeight() + speed);
      myImageView.relocate(
          myWidth / 2 - myImageView.getFitWidth() / 2,
          myHeight / 2 - myImageView.getFitHeight() / 2);
      myImageView.setFitWidth(myImageView.getFitWidth() + speed);
      myImageView.setRotate(myImageView.getRotate() + speed);
    } else if (myImageView.getRotate() <= 360) {
      myImageView.setRotate(myImageView.getRotate() + speed);
    }

    return (myImageView.getFitHeight() <= 300 || myImageView.getRotate() <= 300);
  }
Exemplo n.º 2
0
 public static void setImageView(ImageView iv) {
   imageView = iv;
   angle = imageView.getRotate();
   imageView.setRotate(0);
   image =
       SwingFXUtils.toFXImage(
           SwingFXUtils.fromFXImage(imageView.snapshot(null, null), null), null);
 }
 public void rotateClockwise() {
   double r = mImageView.getRotate();
   mImageView.setRotate(r + 90);
 }