Search in sources :

Example 1 with ViewContext

use of io.datafx.controller.context.ViewContext in project JFoenix by jfoenixadmin.

the class AnimatedFlowContainer method setViewContext.

@Override
public <U> void setViewContext(ViewContext<U> context) {
    updatePlaceholder(context.getRootNode());
    if (animation != null) {
        animation.stop();
    }
    animation = new Timeline();
    animation.getKeyFrames().addAll(animationProducer.apply(this));
    animation.getKeyFrames().add(new KeyFrame(duration, (e) -> clearPlaceholder()));
    animation.play();
}
Also used : Color(javafx.scene.paint.Color) KeyFrame(javafx.animation.KeyFrame) FlowContainer(io.datafx.controller.flow.FlowContainer) Node(javafx.scene.Node) Timeline(javafx.animation.Timeline) WritableImage(javafx.scene.image.WritableImage) ViewContext(io.datafx.controller.context.ViewContext) SnapshotParameters(javafx.scene.SnapshotParameters) StackPane(javafx.scene.layout.StackPane) Function(java.util.function.Function) Duration(javafx.util.Duration) List(java.util.List) ImageView(javafx.scene.image.ImageView) ContainerAnimations(io.datafx.controller.flow.container.ContainerAnimations) Image(javafx.scene.image.Image) Timeline(javafx.animation.Timeline) KeyFrame(javafx.animation.KeyFrame)

Aggregations

ViewContext (io.datafx.controller.context.ViewContext)1 FlowContainer (io.datafx.controller.flow.FlowContainer)1 ContainerAnimations (io.datafx.controller.flow.container.ContainerAnimations)1 List (java.util.List)1 Function (java.util.function.Function)1 KeyFrame (javafx.animation.KeyFrame)1 Timeline (javafx.animation.Timeline)1 Node (javafx.scene.Node)1 SnapshotParameters (javafx.scene.SnapshotParameters)1 Image (javafx.scene.image.Image)1 ImageView (javafx.scene.image.ImageView)1 WritableImage (javafx.scene.image.WritableImage)1 StackPane (javafx.scene.layout.StackPane)1 Color (javafx.scene.paint.Color)1 Duration (javafx.util.Duration)1