什么是“虚拟化控制” ? (在JavaFX文档中提到)。 [英] what are "virtualized controls" ? (mentioned in JavaFX documentation).

查看:246
本文介绍了什么是“虚拟化控制” ? (在JavaFX文档中提到)。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自 http://docs.oracle.com /javafx/2/api/javafx/scene/control/Cell.html

Cell API用于虚拟化 ListView,TreeView和TableView等控件.Cell是Labeled控件,用于在ListView,TreeView或TableView中呈现单个行。

"The Cell API is used for virtualized controls such as ListView, TreeView, and TableView. A Cell is a Labeled Control, and is used to render a single "row" inside a ListView, TreeView or TableView."

他们为什么要虚拟化?

Why are they virtualized?

推荐答案

如果要在 Control 中显示大量数据例如 ListView ,您需要一些虚拟化 Nodes 创建和使用的方法。否则会影响内存占用,从而影响时间。

When you have a lot of data to display in a Control such as a ListView, you need some way of virtualizing the Nodes created and used. Otherwise it will affect the memory footprint and consequently the time.

例如,如果您有1000万个数据项,则不希望创建1000万个节点。因此,您可以创建足够的节点来动态填充显示,并在用户滚动 ListView 控件时重复使用它们。

For example, if you have 10 million data items, you don’t want to create 10 million Nodes. So you create enough Nodes to fill the display dynamically and reuse them as the user scrolls through the ListView control.

来自文档


因为TreeView,ListView,TableView和其他这样的控件可以用
来显示非常大量的数据,所以
创建一个实际的Cell是不可行的对于
中的每个项目,控件。我们使用非常小的b $ b几个单元表示非常大的数据集。每个Cell都被回收或重复使用。当我们说这些控件被虚拟化时,这就是

Because TreeView, ListView, TableView and other such controls can potentially be used for displaying incredibly large amounts of data, it is not feasible to create an actual Cell for every single item in the control. We represent extremely large data sets using only very few Cells. Each Cell is "recycled", or reused. This is what we mean when we say that these controls are virtualized.

PS:每个框架都有这种虚拟化,无论是Android,WPF,JavaFX等。

P.S : every framework has this kind of virtualization, be it Android, WPF , JavaFX etc.

来自JavaFX的一位开发人员:
http://fxexperience.com/2009/09/ui-virtualization/

From one of the developers of JavaFX: http://fxexperience.com/2009/09/ui-virtualization/

这篇关于什么是“虚拟化控制” ? (在JavaFX文档中提到)。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆