The easiest way to do this is with ScrollPane. Inside the ScrollPane, you define your rows and their layouts (probably each row is an HBox containing an ImageView and a TableView that is set to the height of the ImageView). Then, the TableViews inside your ScrollPane should let ScrollPane override their scrolling - that is, their onScroll caps to ScrollPane.
Then you override the onScroll behavior for ScrollPane. The scrolling algorithm may look like this:
There are two modes.
1) Scrolling IN the album scrolls the TableView on this line. If the scrolling is beyond the bounds of the TableView scrollHeight (range between 0 and scrollHeight), then the mode switches to scrolling through the TO album.
2) Scrolling to an album scrolls ScrollPane to the level of the current line. Scrolling more than the current line height will move to the next album and switch the mode back to scrolling to that album.
3) Edges: Scrolling in ScrollPane outside of ScrollPane ScrollHeight (range between 0 and scrollHeight) immediately jumps to the next album and switches the mode back to IN scrolling of this album.
I would give a code example, but I never saw anyone try to do this. I just know that you CAN do it.
Steve k
source share