Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
public class TransitionPane extends StackPane {

private Node currentNode;
private Animation oldAnimation;

public TransitionPane() {
FXUtils.setOverflowHidden(this);
Expand All @@ -51,11 +50,6 @@ public final void setContent(Node newView, AnimationProducer transition, Duratio

public void setContent(Node newView, AnimationProducer transition,
Duration duration, Interpolator interpolator) {
if (oldAnimation != null) {
oldAnimation.stop();
oldAnimation = null;
}

Node previousNode = currentNode != newView && getWidth() > 0 && getHeight() > 0 ? currentNode : null;
currentNode = newView;

Expand Down Expand Up @@ -86,19 +80,15 @@ public void setContent(Node newView, AnimationProducer transition,
previousNode,
newView,
duration, interpolator);
newAnimation.statusProperty().addListener((observable, oldValue, newValue) -> {
if (oldValue == Animation.Status.RUNNING && newValue != Animation.Status.RUNNING) {
setMouseTransparent(false);
getChildren().remove(previousNode);

if (cacheHint != null) {
newView.setCache(false);
}
newAnimation.setOnFinished(e -> {
setMouseTransparent(false);
getChildren().remove(previousNode);

if (cacheHint != null) {
newView.setCache(false);
}
});

oldAnimation = newAnimation;
newAnimation.play();
FXUtils.playAnimation(this, "transition_pane", newAnimation);
});

}
Expand Down