JavaFX – 动态修改顺序过渡

huangapple go评论79阅读模式
英文:

JavaFX - Sequential Transition modify at runtime

问题

我一直在探索JavaFX中的连续过渡,它似乎非常适合我所需的情况。因此,我正在开发一个JavaFX桌面应用程序,主要用于展示一些图片、文字,并播放一些视频和音频文件。现在,由于这些项目中有一些是按顺序呈现的,我决定使用连续过渡。现在,我遇到了一个问题,我已经尝试解决,但似乎没有按预期工作。让我们想象一下,这些项目呈现给用户的顺序在一个映射中预定义。当这些项目呈现给用户时,他/她需要提供一个答案,如果答案正确,你可以认为该项目可以归类为已完成。然而,在某些情况下,我需要用户重复学习一些项目。而且这必须是在“即时”进行的,因为我有另一个窗口,另一个人会决定哪些项目必须重复。如您所见,这就需要在运行时对连续过渡进行一些修改。对于如何解决这个挑战,您有什么建议吗?

谢谢,

英文:

I have been exploring the Sequential Transition from JavaFX, and it seems a perfect fit for what I need. So, I am working on a JavaFX desktop application that essentially shows some pictures, text, and plays some video and audio files. Now, since some of those items are presented sequentially, I have decided to use the sequential transition. Now, I just run into a problem that I have tried to address but it does not seem to work as expected. Let's imagine that the sequence in which those items are presented is predefined in a Map. When those items are presented to the user, he/she needs to provide an answer, and if that is correct you can think that the item can be categorized as Done. However, in some of the cases I need that the user repeats some of the items for learning purposes. And that has to be done 'on-the-fly' since I have another window in which someone else decides which items must be repeated. As you can see, this requires some modification of the sequential transition at runtime. Is there any suggestions on how to address this challenge?

Thanks,

答案1

得分: 1

《SequentialTransition》的文档所述:

> 不可能更改正在运行的SequentialTransition的子项。如果为正在运行的SequentialTransition更改了子项,则必须停止动画,然后重新启动以获取新值。

英文:

As the documentation for SequentialTransition states:

> It is not possible to change the children of a running SequentialTransition. If the children are changed for a running SequentialTransition, the animation has to be stopped and started again to pick up the new value.

huangapple
  • 本文由 发表于 2020年8月20日 04:44:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/63494726.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定