From: Henry P. <hen...@in...> - 2006-12-04 12:48:27
Attachments:
patch_chart_panel.txt
|
Hi David, no it shouldn't because the listeners are not yet attached to the panel, I just had a quick look this way (see attached patch): changed this.chart = chart; into this.setChart(chart); added a println after this line added a println in the paintComponent. run a demo, you can see that the setChart do not trigger a repaint. I'll modify ChartComposite this way. should I commit to ChartPanel too? Regards, Henry David Gilbert wrote: > > Henry Proudhon wrote: >> >> Hi David, >> >> >> >> a quick question on the ChartPanel class: >> >> would it be a good idea to replace line 548: >> >> >> >> this.chart = chart; >> >> >> >> by: this.setChart(chart); >> >> >> >> this way the listeners are all set at once. >> >> we have the same thing in ChartComposite... >> >> >> >> Regards, >> >> Henry >> >> > > Hi Henry, > > > > > > The only reason I can think of against calling setChart() is that it > > triggers a panel repaint(), and I'm not sure whether that is a problem > > or not...possibly not, because the panel isn't visible yet? I really > > hate thinking about these GUI state things...any thoughts? > > > > Regards, > > > > Dave |
From: T. L. B. <lam...@ho...> - 2006-12-04 13:03:19
|
Remove me. |
From: David G. <dav...@ob...> - 2006-12-04 14:35:17
|
T. Lamine Ba wrote: > Remove me. > > Done. Note that you can remove yourself via the following page: https://lists.sourceforge.net/lists/listinfo/jfreechart-developers Regards, Dave Gilbert JFreeChart Project Leader |
From: David G. <dav...@ob...> - 2006-12-04 14:38:13
|
Hi Henry, Yes please, commit the change. Regards, Dave Henry Proudhon wrote: > Hi David, > > no it shouldn't because the listeners are not yet attached to the panel, > I just had a quick look this way (see attached patch): > > changed this.chart = chart; into this.setChart(chart); > added a println after this line > added a println in the paintComponent. > > run a demo, you can see that the setChart do not trigger a repaint. > > I'll modify ChartComposite this way. should I commit to ChartPanel too? > > Regards, > Henry > > David Gilbert wrote: > >>> Henry Proudhon wrote: >>> >>>>> Hi David, >>>>> >>>>> a quick question on the ChartPanel class: >>>>> would it be a good idea to replace line 548: >>>>> >>>>> this.chart = chart; >>>>> >>>>> by: this.setChart(chart); >>>>> >>>>> this way the listeners are all set at once. >>>>> we have the same thing in ChartComposite... >>>>> >>>>> Regards, >>>>> Henry >>>>> >>>>> >>> Hi Henry, >>> >>> >>> The only reason I can think of against calling setChart() is that it >>> triggers a panel repaint(), and I'm not sure whether that is a problem >>> or not...possibly not, because the panel isn't visible yet? I really >>> hate thinking about these GUI state things...any thoughts? >>> >>> Regards, >>> >>> Dave >>> >>> ------------------------------------------------------------------------ >>> >>> ### Eclipse Workspace Patch 1.0 >>> #P jfreechart >>> Index: source/org/jfree/chart/ChartPanel.java >>> =================================================================== >>> RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/ChartPanel.java,v >>> retrieving revision 1.20.2.10 >>> diff -u -r1.20.2.10 ChartPanel.java >>> --- source/org/jfree/chart/ChartPanel.java 6 Nov 2006 14:36:59 -0000 1.20.2.10 >>> +++ source/org/jfree/chart/ChartPanel.java 4 Dec 2006 11:14:37 -0000 >>> @@ -545,7 +545,8 @@ >>> boolean zoom, >>> boolean tooltips) { >>> >>> - this.chart = chart; >>> + this.setChart(chart); >>> + System.out.println("after setting up the chart"); >>> this.chartMouseListeners = new EventListenerList(); >>> if (chart != null) { >>> chart.addChangeListener(this); >>> @@ -1166,6 +1167,7 @@ >>> */ >>> public void paintComponent(Graphics g) { >>> super.paintComponent(g); >>> + System.out.println("new pain event detected"); >>> if (this.chart == null) { >>> return; >>> } >>> >>> ------------------------------------------------------------------------ >>> >>> ------------------------------------------------------------------------- >>> Take Surveys. Earn Cash. Influence the Future of IT >>> Join SourceForge.net's Techsay panel and you'll get the chance to share your >>> opinions on IT & business topics through brief surveys - and earn cash >>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> jfreechart-developers mailing list >>> jfr...@li... >>> https://lists.sourceforge.net/lists/listinfo/jfreechart-developers >>> |