简体   繁体   English

JavaFX时间轴控件

[英]JavaFX Timeline control

I want to create a scrollable timeline controller with circles connected to a baseline filled with a number ( size of circle corresponding to containing number) and a trailing icon. 我想创建一个可滚动的时间轴控制器,其中的圆连接到填充有数字(圆的大小对应于包含数字的圆)的基线,并且尾随图标。

Since I am new to JavaFX i have no idea how to start. 由于我是JavaFX的新手,所以我不知道如何开始。 In Swing i would eg use JPanel and ovverride its onPaint() method to draw the circles, lines and icons... Swing我将例如使用JPanel和ovverride的onPaint()方法绘制圆,线和图标...

In JavaFX I thought about using a horizontal ListView with custom ListCell , but i am not sure if the baseline is possible with it. 在JavaFX中,我考虑过将水平ListView与自定义ListCell ,但是我不确定基线是否可以使用它。 So i am looking for ideas how to implementiert such a controll... 所以我正在寻找如何实施这种控制的想法...

时间轴控制器草图

Try using a HBox wrapped inside a ScrollPane . 尝试使用包装在ScrollPaneHBox

You can add elements to HBox using getChildren.add(node) . 您可以使用getChildren.add(node)将元素添加到HBox中。 The elements will be automatically shown on the scene and the ScrollPane will adjust the ScrollBar for you. 元素将自动显示在场景中,并且ScrollPane将为您调整ScrollBar。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM