Overlay objects in SpreadsheetView

41 views
Skip to first unread message

Elias Mårtenson

unread,
Nov 28, 2023, 12:02:45 PM11/28/23
to ControlsFX
In my application, I have a SpreadsheetView which is used in a similar way to a regular spreadsheet to display data. Essentially I'm using it to provide a canvas for users to lay out their datasets in a way that is familiar to users of Excel.

What I want to achieve is the ability to overlay graphics objects (like charts) in the same way Excel does.

I was thinking that perhaps I could override the default implementation of SpreadsheetGridView and replace it with something that uses StackPane to display the overlay graphics. However, this is not possible as this is not an exposed API.

Unless I'm missing something, what I want to do is actually not possible using SpreadsheetView, and if so, I'd like a configuration of this. I could then perhaps work on improving SpreadsheetView to provide this capability.

Elias Mårtenson

unread,
Nov 30, 2023, 5:01:39 AM11/30/23
to ControlsFX
I have experimented a bit more with this, and I've gotten a bit further. However, I'm not sure if I'm going down the right path.

I have forked SpreadhseetView so that I can mess around with its internal state while experimenting. What I'm doing is to wrap the cellsView in another pane, and I can then put the overlay widgets in that pane.

However, these widgets have two problems:
    1) They will of course not scroll with the background, and
    2) They overlap the headers

It appears the implementation of VirtualFlow uses manual clipping to ensure that cells don't overdraw the headers and the scrollbars, and then somrhow moves the clip when the cells are scrolled. I don't fully understand that part yet.

So my current question is: Does any of this ring a bell? Is this the approach that should be taken?

Mark Schmieder

unread,
Dec 1, 2023, 11:18:31 AM12/1/23
to ControlsFX
Which version of ControlsFX? SpreadsheetView has had some pretty radical re-workings on several occasions, and I have my own bugfixes, extensions, etc. that I haven't had time to post here (I have posted most of my other ControlsFX snippets for review earlier this year), so I can tajke a look to see if I came across any related overlay tweaks that I did a few years ago when I was actively working on SpreadsheetView. I need to revive SpreadsheetView for a new project soon anyway, so it's good timing, but I want to make sure we're on the same page regarding version. As you probably know, SpreadsheetView used Private API and thus did not initially make it past Java 8.
Reply all
Reply to author
Forward
0 new messages