Permalink
Browse files

issue-38: remove empty spaces and use Invalidation listener that can …

…be removed.
  • Loading branch information...
jose.pereda
jose.pereda committed Nov 3, 2018
1 parent 41385e3 commit 74b5220d3c92717c00e459f7816b3d54ba9637e6
@@ -31,5 +31,4 @@ compileJava {
javadoc {
options.addBooleanOption("Xdoclint:none").setValue(true);
options.addBooleanOption("javafx").setValue(true);
}
}
@@ -35,5 +35,4 @@ compileJava {
javadoc {
options.addBooleanOption("Xdoclint:none").setValue(true);
options.addBooleanOption("javafx").setValue(true);
}
}
@@ -40,6 +40,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.animation.Timeline;
import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.scene.Parent;
@@ -73,9 +75,13 @@ protected void createMesh() {
timeline.setCycleCount(Timeline.INDEFINITE);
timeline.play();
model.sceneProperty().addListener((obs, ov, nv) -> {
if (nv == null) {
timeline.stop();
model.sceneProperty().addListener(new InvalidationListener() {
@Override
public void invalidated(Observable observable) {
if (model.getScene() == null) {
model.sceneProperty().removeListener(this);
timeline.stop();
}
}
});
}

0 comments on commit 74b5220

Please sign in to comment.