From: David G. <dav...@ob...> - 2006-06-08 09:03:18
Attachments:
diff.txt
|
Hi, The attached patch updates StatCVS to use the latest version of JFreeChart (1.0.1). Anonymous CVS at SourceForge seems broken for me, so I created this patch as a diff between my modified StatCVS source files and a clean StatCVS-0.2.2 source directory. There are only a few changes required, so you could probably edit the sources manually. The JFreeChart API is now stable, so this should allow future JFreeChart releases in the 1.0.x series to be used with StatCVS without requiring modifications to StatCVS. I'm hopeful that with this patch, and the previous one I posted (to remove the Sun-specific class reference), I will be able to get StatCVS running out-of-the-box with JamVM and GNU Classpath. Regards, Dave Gilbert JFreeChart Project Leader |
From: David G. <dav...@ob...> - 2006-06-14 10:29:02
Attachments:
diff.txt
|
Hi All, Richard gave me access to CVS and I've committed the attached patch (which is slightly different to my original version) to make StatCVS work with JFreeChart 1.0.1. Regards, Dave Gilbert David Gilbert wrote: > Hi, > > The attached patch updates StatCVS to use the latest version of > JFreeChart (1.0.1). Anonymous CVS at SourceForge seems broken for me, > so I created this patch as a diff between my modified StatCVS source > files and a clean StatCVS-0.2.2 source directory. There are only a > few changes required, so you could probably edit the sources manually. > > The JFreeChart API is now stable, so this should allow future > JFreeChart releases in the 1.0.x series to be used with StatCVS > without requiring modifications to StatCVS. > > I'm hopeful that with this patch, and the previous one I posted (to > remove the Sun-specific class reference), I will be able to get > StatCVS running out-of-the-box with JamVM and GNU Classpath. > > Regards, > > Dave Gilbert > JFreeChart Project Leader > >------------------------------------------------------------------------ > >diff -ru statcvs-src-clean/src/net/sf/statcvs/renderer/Chart.java statcvs-src-mod/src/net/sf/statcvs/renderer/Chart.java >--- statcvs-src-clean/src/net/sf/statcvs/renderer/Chart.java 2004-10-12 09:23:18.000000000 +0100 >+++ statcvs-src-mod/src/net/sf/statcvs/renderer/Chart.java 2006-06-08 09:55:38.000000000 +0100 >@@ -33,7 +33,8 @@ > import org.jfree.chart.ChartUtilities; > import org.jfree.chart.JFreeChart; > import org.jfree.chart.title.TextTitle; >-import org.jfree.ui.Spacer; >+import org.jfree.ui.RectangleInsets; >+import org.jfree.util.UnitType; > > /** > * superclass of all charts >@@ -105,7 +106,8 @@ > > private void addTitles() { > TextTitle title2 = new TextTitle(title, font); >- title2.setSpacer(new Spacer(Spacer.RELATIVE, 0.05, 0.05, 0.05, 0.0)); >+ title2.setMargin(new RectangleInsets(UnitType.RELATIVE, 0.05, 0.05, >+ 0.05, 0.0)); > chart.addSubtitle(title2); > } > >diff -ru statcvs-src-clean/src/net/sf/statcvs/renderer/LOCChart.java statcvs-src-mod/src/net/sf/statcvs/renderer/LOCChart.java >--- statcvs-src-clean/src/net/sf/statcvs/renderer/LOCChart.java 2004-10-12 09:23:18.000000000 +0100 >+++ statcvs-src-mod/src/net/sf/statcvs/renderer/LOCChart.java 2006-06-08 09:56:16.000000000 +0100 >@@ -72,7 +72,7 @@ > TimeSeriesCollection collection = new TimeSeriesCollection(); > collection.addSeries(locSeries); > createLOCChart(collection, colors, title); >- createChart(); >+ createChart(); > saveChart(width, height); > } > >@@ -96,7 +96,7 @@ > while (it.hasNext()) { > TimeSeries series = (TimeSeries) it.next(); > collection.addSeries(series); >- colors[i] = OutputUtils.getStringColor(series.getName()); >+ colors[i] = OutputUtils.getStringColor(series.getKey().toString()); > i++; > } > createLOCChart(collection, colors, title); >diff -ru statcvs-src-clean/src/net/sf/statcvs/renderer/StackedBarChart.java statcvs-src-mod/src/net/sf/statcvs/renderer/StackedBarChart.java >--- statcvs-src-clean/src/net/sf/statcvs/renderer/StackedBarChart.java 2004-10-12 09:23:18.000000000 +0100 >+++ statcvs-src-mod/src/net/sf/statcvs/renderer/StackedBarChart.java 2006-06-05 14:13:22.000000000 +0100 >@@ -37,13 +37,14 @@ > import net.sf.statcvs.output.ConfigurationOptions; > > import org.jfree.chart.ChartFactory; >-import org.jfree.chart.Legend; > import org.jfree.chart.axis.NumberAxis; > import org.jfree.chart.axis.NumberTickUnit; > import org.jfree.chart.plot.CategoryPlot; > import org.jfree.chart.plot.PlotOrientation; > import org.jfree.chart.renderer.category.CategoryItemRenderer; >+import org.jfree.chart.title.LegendTitle; > import org.jfree.data.category.DefaultCategoryDataset; >+import org.jfree.ui.RectangleEdge; > > /** > * Class for producing stacked bar charts >@@ -150,8 +151,8 @@ > rangeAxis.setTickUnit(new NumberTickUnit(20.0, new DecimalFormat("0"))); > rangeAxis.setUpperBound(100.0); > >- Legend legend = getChart().getLegend(); >- legend.setAnchor(Legend.NORTH); >+ LegendTitle legend = getChart().getLegend(); >+ legend.setPosition(RectangleEdge.TOP); > > createChart(); > saveChart(450, 19 * content.getAuthors().size() + 110, "activity.png"); > > >------------------------------------------------------------------------ > >_______________________________________________ >Statcvs-users mailing list >Sta...@li... >https://lists.sourceforge.net/lists/listinfo/statcvs-users > > |
From: Ray B. <rj_...@rj...> - 2006-06-14 10:46:01
|
Hi David Thanks! This makes my life a bit easier now. :) David Gilbert wrote: > Hi All, > > Richard gave me access to CVS and I've committed the attached patch > (which is slightly different to my original version) to make StatCVS > work with JFreeChart 1.0.1. > > Regards, > > Dave Gilbert > > David Gilbert wrote: > >> Hi, >> >> The attached patch updates StatCVS to use the latest version of >> JFreeChart (1.0.1). Anonymous CVS at SourceForge seems broken for >> me, so I created this patch as a diff between my modified StatCVS >> source files and a clean StatCVS-0.2.2 source directory. There are >> only a few changes required, so you could probably edit the sources >> manually. >> >> The JFreeChart API is now stable, so this should allow future >> JFreeChart releases in the 1.0.x series to be used with StatCVS >> without requiring modifications to StatCVS. >> >> I'm hopeful that with this patch, and the previous one I posted (to >> remove the Sun-specific class reference), I will be able to get >> StatCVS running out-of-the-box with JamVM and GNU Classpath. >> >> Regards, >> >> Dave Gilbert >> JFreeChart Project Leader >> >> ------------------------------------------------------------------------ >> >> diff -ru statcvs-src-clean/src/net/sf/statcvs/renderer/Chart.java >> statcvs-src-mod/src/net/sf/statcvs/renderer/Chart.java >> --- statcvs-src-clean/src/net/sf/statcvs/renderer/Chart.java >> 2004-10-12 09:23:18.000000000 +0100 >> +++ statcvs-src-mod/src/net/sf/statcvs/renderer/Chart.java >> 2006-06-08 09:55:38.000000000 +0100 >> @@ -33,7 +33,8 @@ >> import org.jfree.chart.ChartUtilities; >> import org.jfree.chart.JFreeChart; >> import org.jfree.chart.title.TextTitle; >> -import org.jfree.ui.Spacer; >> +import org.jfree.ui.RectangleInsets; >> +import org.jfree.util.UnitType; >> >> /** >> * superclass of all charts >> @@ -105,7 +106,8 @@ >> >> private void addTitles() { >> TextTitle title2 = new TextTitle(title, font); >> - title2.setSpacer(new Spacer(Spacer.RELATIVE, 0.05, 0.05, >> 0.05, 0.0)); >> + title2.setMargin(new RectangleInsets(UnitType.RELATIVE, >> 0.05, 0.05, + 0.05, 0.0)); >> chart.addSubtitle(title2); >> } >> >> diff -ru statcvs-src-clean/src/net/sf/statcvs/renderer/LOCChart.java >> statcvs-src-mod/src/net/sf/statcvs/renderer/LOCChart.java >> --- statcvs-src-clean/src/net/sf/statcvs/renderer/LOCChart.java >> 2004-10-12 09:23:18.000000000 +0100 >> +++ statcvs-src-mod/src/net/sf/statcvs/renderer/LOCChart.java >> 2006-06-08 09:56:16.000000000 +0100 >> @@ -72,7 +72,7 @@ >> TimeSeriesCollection collection = new TimeSeriesCollection(); >> collection.addSeries(locSeries); >> createLOCChart(collection, colors, title); >> - createChart(); >> + createChart(); >> saveChart(width, height); >> } >> >> @@ -96,7 +96,7 @@ >> while (it.hasNext()) { >> TimeSeries series = (TimeSeries) it.next(); >> collection.addSeries(series); >> - colors[i] = >> OutputUtils.getStringColor(series.getName()); + colors[i] >> = OutputUtils.getStringColor(series.getKey().toString()); >> i++; >> } >> createLOCChart(collection, colors, title); >> diff -ru >> statcvs-src-clean/src/net/sf/statcvs/renderer/StackedBarChart.java >> statcvs-src-mod/src/net/sf/statcvs/renderer/StackedBarChart.java >> --- >> statcvs-src-clean/src/net/sf/statcvs/renderer/StackedBarChart.java >> 2004-10-12 09:23:18.000000000 +0100 >> +++ >> statcvs-src-mod/src/net/sf/statcvs/renderer/StackedBarChart.java >> 2006-06-05 14:13:22.000000000 +0100 >> @@ -37,13 +37,14 @@ >> import net.sf.statcvs.output.ConfigurationOptions; >> >> import org.jfree.chart.ChartFactory; >> -import org.jfree.chart.Legend; >> import org.jfree.chart.axis.NumberAxis; >> import org.jfree.chart.axis.NumberTickUnit; >> import org.jfree.chart.plot.CategoryPlot; >> import org.jfree.chart.plot.PlotOrientation; >> import org.jfree.chart.renderer.category.CategoryItemRenderer; >> +import org.jfree.chart.title.LegendTitle; >> import org.jfree.data.category.DefaultCategoryDataset; >> +import org.jfree.ui.RectangleEdge; >> >> /** >> * Class for producing stacked bar charts >> @@ -150,8 +151,8 @@ >> rangeAxis.setTickUnit(new NumberTickUnit(20.0, new >> DecimalFormat("0"))); >> rangeAxis.setUpperBound(100.0); >> >> - Legend legend = getChart().getLegend(); >> - legend.setAnchor(Legend.NORTH); >> + LegendTitle legend = getChart().getLegend(); >> + legend.setPosition(RectangleEdge.TOP); >> >> createChart(); >> saveChart(450, 19 * content.getAuthors().size() + 110, >> "activity.png"); >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Statcvs-users mailing list >> Sta...@li... >> https://lists.sourceforge.net/lists/listinfo/statcvs-users >> >> > > ------------------------------------------------------------------------ > > Index: src/net/sf/statcvs/renderer/Chart.java > =================================================================== > RCS file: /cvsroot/statcvs/statcvs/src/net/sf/statcvs/renderer/Chart.java,v > retrieving revision 1.10 > diff -u -r1.10 Chart.java > --- src/net/sf/statcvs/renderer/Chart.java 12 Oct 2004 07:22:42 -0000 1.10 > +++ src/net/sf/statcvs/renderer/Chart.java 14 Jun 2006 10:24:12 -0000 > @@ -33,7 +33,8 @@ > import org.jfree.chart.ChartUtilities; > import org.jfree.chart.JFreeChart; > import org.jfree.chart.title.TextTitle; > -import org.jfree.ui.Spacer; > +import org.jfree.ui.RectangleInsets; > +import org.jfree.util.UnitType; > > /** > * superclass of all charts > @@ -105,7 +106,8 @@ > > private void addTitles() { > TextTitle title2 = new TextTitle(title, font); > - title2.setSpacer(new Spacer(Spacer.RELATIVE, 0.05, 0.05, 0.05, 0.0)); > + title2.setMargin(new RectangleInsets(UnitType.RELATIVE, 0.05, 0.05, > + 0.05, 0.0)); > chart.addSubtitle(title2); > } > > Index: src/net/sf/statcvs/renderer/LOCChart.java > =================================================================== > RCS file: /cvsroot/statcvs/statcvs/src/net/sf/statcvs/renderer/LOCChart.java,v > retrieving revision 1.39 > diff -u -r1.39 LOCChart.java > --- src/net/sf/statcvs/renderer/LOCChart.java 14 Dec 2004 13:38:13 -0000 1.39 > +++ src/net/sf/statcvs/renderer/LOCChart.java 14 Jun 2006 10:24:12 -0000 > @@ -98,7 +98,7 @@ > while (it.hasNext()) { > TimeSeries series = (TimeSeries) it.next(); > collection.addSeries(series); > - colors[i] = OutputUtils.getStringColor(series.getName()); > + colors[i] = OutputUtils.getStringColor(series.getKey().toString()); > i++; > } > createLOCChart(collection, colors, title, annotations); > Index: src/net/sf/statcvs/renderer/StackedBarChart.java > =================================================================== > RCS file: /cvsroot/statcvs/statcvs/src/net/sf/statcvs/renderer/StackedBarChart.java,v > retrieving revision 1.23 > diff -u -r1.23 StackedBarChart.java > --- src/net/sf/statcvs/renderer/StackedBarChart.java 12 Oct 2004 07:22:42 -0000 1.23 > +++ src/net/sf/statcvs/renderer/StackedBarChart.java 14 Jun 2006 10:24:12 -0000 > @@ -37,13 +37,14 @@ > import net.sf.statcvs.output.ConfigurationOptions; > > import org.jfree.chart.ChartFactory; > -import org.jfree.chart.Legend; > import org.jfree.chart.axis.NumberAxis; > import org.jfree.chart.axis.NumberTickUnit; > import org.jfree.chart.plot.CategoryPlot; > import org.jfree.chart.plot.PlotOrientation; > import org.jfree.chart.renderer.category.CategoryItemRenderer; > +import org.jfree.chart.title.LegendTitle; > import org.jfree.data.category.DefaultCategoryDataset; > +import org.jfree.ui.RectangleEdge; > > /** > * Class for producing stacked bar charts > @@ -150,8 +151,8 @@ > rangeAxis.setTickUnit(new NumberTickUnit(20.0, new DecimalFormat("0"))); > rangeAxis.setUpperBound(100.0); > > - Legend legend = getChart().getLegend(); > - legend.setAnchor(Legend.NORTH); > + LegendTitle legend = getChart().getLegend(); > + legend.setPosition(RectangleEdge.TOP); > > createChart(); > saveChart(450, 19 * content.getAuthors().size() + 110, "activity.png"); > Index: src/net/sf/statcvs/renderer/SymbolicNameAnnotation.java > =================================================================== > RCS file: /cvsroot/statcvs/statcvs/src/net/sf/statcvs/renderer/SymbolicNameAnnotation.java,v > retrieving revision 1.1 > diff -u -r1.1 SymbolicNameAnnotation.java > --- src/net/sf/statcvs/renderer/SymbolicNameAnnotation.java 14 Dec 2004 13:38:13 -0000 1.1 > +++ src/net/sf/statcvs/renderer/SymbolicNameAnnotation.java 14 Jun 2006 10:24:12 -0000 > @@ -33,9 +33,10 @@ > import org.jfree.chart.axis.ValueAxis; > import org.jfree.chart.plot.Plot; > import org.jfree.chart.plot.PlotOrientation; > +import org.jfree.chart.plot.PlotRenderingInfo; > import org.jfree.chart.plot.XYPlot; > +import org.jfree.text.TextUtilities; > import org.jfree.ui.RectangleEdge; > -import org.jfree.ui.RefineryUtilities; > import org.jfree.ui.TextAnchor; > > > @@ -69,9 +70,9 @@ > } > > /** > - * @see org.jfree.chart.annotations.XYAnnotation#draw(java.awt.Graphics2D, org.jfree.chart.plot.XYPlot, java.awt.geom.Rectangle2D, org.jfree.chart.axis.ValueAxis, org.jfree.chart.axis.ValueAxis) > + * @see org.jfree.chart.annotations.XYAnnotation#draw(java.awt.Graphics2D, org.jfree.chart.plot.XYPlot, java.awt.geom.Rectangle2D, org.jfree.chart.axis.ValueAxis, org.jfree.chart.axis.ValueAxis, int, org.jfree.chart.plot.PlotRenderingInfo) > */ > - public void draw(Graphics2D g2d, XYPlot xyPlot, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis) { > + public void draw(Graphics2D g2d, XYPlot xyPlot, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info) { > PlotOrientation orientation = xyPlot.getOrientation(); > > // don't draw the annotation if symbolic names date is out of axis' bounds. > @@ -88,15 +89,15 @@ > xyPlot.getRangeAxisLocation(), > orientation); > > - float x = (float)domainAxis.translateValueToJava2D( > + float x = (float)domainAxis.valueToJava2D( > symbolicName.getDate().getTime(), > dataArea, > domainEdge); > - float y1 = (float)rangeAxis.translateValueToJava2D( > + float y1 = (float)rangeAxis.valueToJava2D( > rangeAxis.getUpperBound(), > dataArea, > rangeEdge); > - float y2 = (float)rangeAxis.translateValueToJava2D( > + float y2 = (float)rangeAxis.valueToJava2D( > rangeAxis.getLowerBound(), > dataArea, > rangeEdge); > @@ -116,14 +117,14 @@ > /*g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, > RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);*/ > > - RefineryUtilities.drawRotatedString( > + TextUtilities.drawRotatedString( > symbolicName.getName(), > g2d, > anchorX, > anchorY, > TextAnchor.BOTTOM_RIGHT, > - TextAnchor.BOTTOM_RIGHT, > - -Math.PI/2 > + -Math.PI/2, > + TextAnchor.BOTTOM_RIGHT > ); > } > > > ------------------------------------------------------------------------ > > _______________________________________________ > Statcvs-users mailing list > Sta...@li... > https://lists.sourceforge.net/lists/listinfo/statcvs-users > -- Ray Booysen rj_...@rj... |
From: David G. <dav...@ob...> - 2006-06-14 10:51:08
|
Hi Ray, Great! Let me know if you spot any problems...I don't think there will be any, the StatCVS code seems nicely laid out and I only needed to make a few small changes, but you never know. Regards, Dave Ray Booysen wrote: >Hi David > >Thanks! This makes my life a bit easier now. :) > >David Gilbert wrote: > > >>Hi All, >> >>Richard gave me access to CVS and I've committed the attached patch >>(which is slightly different to my original version) to make StatCVS >>work with JFreeChart 1.0.1. >> >>Regards, >> >>Dave Gilbert >> >> >> |