ATTN David Gilbert: ChartPanel -> JLayeredPane ?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Jii
Posts: 128
Joined: Thu Apr 21, 2005 11:17 am

ATTN David Gilbert: ChartPanel -> JLayeredPane ?

Post by Jii » Fri Dec 02, 2005 12:06 pm

Any chance you could make ChartPanel extend JLayeredPane instead of JPanel ? It wouldn't remove any functionality but would add a whole new dimension (excuse the pun) to it's use. For instance adding toolbars would be easy as heck. :)

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Fri Dec 02, 2005 2:36 pm

With 1.0.0 about to go out, it's too late to make a change like this. I'm not familiar with the JLayeredPane class, so I can't really judge whether this is a good idea or not. Perhaps you could put together a ChartLayeredPane class and a demo to show the advantages of it. If the advantages are clear, then I don't mind putting it into a future 1.0.x release alongside ChartPanel, then people could choose whichever suits them best.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Jii
Posts: 128
Joined: Thu Apr 21, 2005 11:17 am

Post by Jii » Fri Dec 02, 2005 3:11 pm

david.gilbert wrote:With 1.0.0 about to go out, it's too late to make a change like this. I'm not familiar with the JLayeredPane class, so I can't really judge whether this is a good idea or not. Perhaps you could put together a ChartLayeredPane class and a demo to show the advantages of it. If the advantages are clear, then I don't mind putting it into a future 1.0.x release alongside ChartPanel, then people could choose whichever suits them best.
The advantage is that you can add a toolbar to a chartpanel without sweating blood to do it :)

I would post a demo but it would be huge and contain a bunch of our source code so i wont.

reden
Posts: 6
Joined: Tue Nov 22, 2005 11:46 pm

Post by reden » Fri Dec 02, 2005 5:55 pm

Couldn't you just put the ChartPanel in a JLayeredPane and then have the same effect?

Jii
Posts: 128
Joined: Thu Apr 21, 2005 11:17 am

Post by Jii » Mon Dec 05, 2005 12:56 pm

reden wrote:Couldn't you just put the ChartPanel in a JLayeredPane and then have the same effect?
Well no because you can't set a different layoutmanager to each layer, so either the chart would have to be resized manually all the time or the toolbar would be stretched to fit the entire window. If ChartPanel were a JLayeredPane this wouln't be an issue :/

Locked