FXMisc / Flowless

Efficient VirtualFlow for JavaFX
BSD 2-Clause "Simplified" License
185 stars 38 forks source link

Add API for getting and showing a TargetPosition #41

Open JordanMartinez opened 7 years ago

JordanMartinez commented 7 years ago

Per the end of my comment in #32:

As a side note, I think there should be a way to get the navigator's current position, so that one could use that to determine what to display after some change occurs (e.g. scroll from the current position or display an item 10 indexes higher, etc.) via VirtualFlow's show method. In order to support that functionality, there would need to be more view-related API methods that returned a TargetPosition of a specific cell.

JordanMartinez commented 7 years ago

On second thought, this might be better implemented by virtualFlow.getCellIfVisble(idx).map(c -> c.getNode().getLayoutBounds()) (or similar bounds calculations like that on the screen) and using that to calculate the offset value to use in virtualFlow.show(idx, offset)