XChart icon indicating copy to clipboard operation
XChart copied to clipboard

Can we get a "no default interaction" superclass of XChartPanel?

Open gbl opened this issue 5 years ago • 1 comments

Right now, the default, and only, constructor of XChartPanel adds a lot of mouse listeners and keyboard shortcuts to the panel. Removing those is a bit tedious if you don't want the default behaviour.

Would it be possible to

a) move the mouse listeners, mouse motion listeners, and keyboard shortcuts into separate, overridable methods, like initPopupMenu, initTooltips, initCursor, initKeyStrokes that get called from the constructor, so you can subclass XChartPanel, overriding these methods with NOPs or your own versions

or

b) add a glue class NoDefaultInteractionXChartPanel between XChartPanel and JPanel that has what's neccesary to display, but not interact, with the panel? (paintComponent, getChart, getPreferredSize)?

Of course I could just create my own class and copy/paste the few methods into it, but an "official" version would be a bit less fragile in the future.

gbl avatar Nov 27 '20 18:11 gbl

Thanks for the suggestion. I'll think about it.

timmolter avatar Dec 13 '20 12:12 timmolter