JDK-8102944 : Add proper support for fixed cell height in VirtualFlow-based controls
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-05-20
  • Updated: 2015-06-16
  • Resolved: 2013-05-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Blocks :  
Description
It was found that fixed cell height results in a massive performance gain, so we should now turn the proof of concept implementations into proper API / implementation.

The proposal is to add a 'fixedCellSize' double property to ListView, TreeView, TreeTableView and TableView controls. By default the value will be -1, to indicate that the fixed size is not set. Any positive value will be used as the fixed size, ignoring the preferred heights / padding / etc of all cells. To improve readability, the default -1 value is the same as the Region.USE_COMPUTED_SIZE symbolic field. This allows developers to return to the default size calculations whilst retaining readability in their code.This will be the recommended approach of resetting the fixed cell size to its 'off' state.

Additionally, a -fx-fixed-cell-size property will be added to allow for the fixed cell size to be specified by CSS. This property will differ from -fx-cell-size in that whilst -fx-cell-size also sets the height of all cells, it does not enforce that this will be the only height. This is what -fx-fixed-cell-size does. In other words, developers would use only -fx-cell-size or -fx-fixed-cell-size - there would be no point in using both.
Comments
Verified on 8.0b97, that somehow it works. See a filed issue for additional info.
08-07-2013

https://javafx-jira.kenai.com/browse/RT-31471
06-07-2013

All controls don't react on this property dynamic changing (api and css). If I change property - nothing happens - only when I do any type of interaction, calling redraw. reopen this, or file new? Do you need app, or you can fix it without apps? (b94)
20-06-2013

How should it work with horizontal ListView?
20-06-2013

Based on the following benchmark (run on my laptop), I was able to get good performance gains (especially when the rendering was disabled). I have no performed similar benchmarks with ListView, TreeView or TreeTableView, but the results should be similar. java -cp "../../../artifacts/sdk/rt/lib/ext/jfxrt.jar;./dist/Controls.jar;../FXBenchmark/dist/FXBenchmark.jar;./dist/benchmarks-2.1.1.jar" -Djavafx.animation.fullspeed=true -Dquantum.norenderjobs=false jrockit.bm.Main controls.bm.TableViewBenchmark -mode keyboard -usePulse true -keysPerInjection 1 -cells 150 -i 1 -wt 0 -tr 30 Before fix: with rendering: 53.542774 fps no rendering: 120.313858 fps After fix (but disabled): with rendering: 56.870163 fps no rendering: 128.324173 fps After fix (and enabled): with rendering: 66.608391 fps (+24.402%) no rendering: 319.101105 fps (+165.224%)
22-05-2013

New API and implementation code pushed to controls repo. Changeset: 04dec9d5f4c7 Author: jgiles Date: Wed May 22 11:59:56 2013 +1200 URL: http://jfxsrc.us.oracle.com/javafx/8.0/scrum/controls/rt/rev/04dec9d5f4c7 Changeset: ea2b4ff7bf2b Author: jgiles Date: Wed May 22 13:37:20 2013 +1200 URL: http://jfxsrc.us.oracle.com/javafx/8.0/scrum/controls/rt/rev/ea2b4ff7bf2b
22-05-2013

Regarding the symbolic field, we'd have to use another name or else it would overlap with the USE_COMPUTED_SIZE from Region. Also, a symbolic field would need to be duplicated in ListView, TreeView, TableView and TreeTableView. If we aren't going to use Region.USE_COMPUTED_SIZE, did you want to have something like USE_CELL_COMPUTED_SIZE?
21-05-2013

Also update the description to indicate the new CSS property that can also be used -fx-fixed-cell-size
21-05-2013

Lets also add a static final int so people have a symbolic name for "USE_COMPUTED_SIZE" (doh! :-)) instead of just a -1?
21-05-2013