Skip to content
Snippets Groups Projects
Verified Commit 427e508c authored by Julien Plissonneau Duquène's avatar Julien Plissonneau Duquène
Browse files

Fix FTBFS with newer jfreechart


Closes: #1099290
Signed-off-by: default avatarJulien Plissonneau Duquène <sre4ever@free.fr>
parent 51b37902
No related branches found
No related tags found
1 merge request!2Fix FTBFS with newer jfreechart
statcvs (1:0.7.0.dfsg-11) UNRELEASED; urgency=medium
* Adopt package, adding myself to uploaders. (Closes: #897311)
* Update jfreechart compatibility patch to fix FTBFS. (Closes: #1099290)
-- Julien Plissonneau Duquène <sre4ever@free.fr> Sat, 29 Mar 2025 22:10:19 +0000
......
From: Markus Koschany <apo@debian.org>
Author: Markus Koschany <apo@debian.org>
Author: Julien Plissonneau Duquène <sre4ever@free.fr>
Date: Fri, 21 Oct 2016 17:18:20 +0200
Subject: jfreechart compatibility
Debian-Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841547
Bug-Debian: https://bugs.debian.org/1099290
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841547
Forwarded: no
---
src/net/sf/statcvs/charts/SymbolicNameAnnotation.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Last-Update: 2025-03-29
diff --git a/src/net/sf/statcvs/charts/SymbolicNameAnnotation.java b/src/net/sf/statcvs/charts/SymbolicNameAnnotation.java
index e099519..b749d58 100644
--- a/src/net/sf/statcvs/charts/SymbolicNameAnnotation.java
+++ b/src/net/sf/statcvs/charts/SymbolicNameAnnotation.java
@@ -24,6 +24,7 @@ import org.jfree.chart.plot.XYPlot;
import org.jfree.text.TextUtilities;
import org.jfree.ui.RectangleEdge;
import org.jfree.ui.TextAnchor;
@@ -21,9 +21,10 @@
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.TextAnchor;
+import org.jfree.chart.text.TextUtils;
+import org.jfree.chart.ui.RectangleEdge;
+import org.jfree.chart.ui.TextAnchor;
+import org.jfree.chart.event.AnnotationChangeListener;
/**
* SymbolicNameAnnotation
@@ -131,4 +132,10 @@ public class SymbolicNameAnnotation implements XYAnnotation {
@@ -110,7 +111,7 @@
}
g2d.setFont(font);
g2d.setPaint(textPaint);
- TextUtilities.drawRotatedString(symbolicName.getName(), g2d, getArrangedLabelX(symbolicName, dataArea, domainAxis, domainEdge), y1 + 2,
+ TextUtils.drawRotatedString(symbolicName.getName(), g2d, getArrangedLabelX(symbolicName, dataArea, domainAxis, domainEdge), y1 + 2,
TextAnchor.BOTTOM_RIGHT, -Math.PI / 2, TextAnchor.BOTTOM_RIGHT);
}
@@ -131,4 +132,10 @@
private float getNaturalX(final SymbolicName tag, final Rectangle2D dataArea, final ValueAxis domainAxis, final RectangleEdge domainEdge) {
return (float) domainAxis.valueToJava2D(tag.getDate().getTime(), dataArea, domainEdge);
}
......@@ -33,3 +45,268 @@ index e099519..b749d58 100644
+ public void addChangeListener(AnnotationChangeListener listener) {
+ };
+}
--- a/src/net/sf/statcvs/charts/ChartConfigUtil.java
+++ b/src/net/sf/statcvs/charts/ChartConfigUtil.java
@@ -22,9 +22,9 @@
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
import org.jfree.chart.title.TextTitle;
import org.jfree.data.xy.XYDataset;
-import org.jfree.ui.Align;
-import org.jfree.ui.HorizontalAlignment;
-import org.jfree.ui.RectangleEdge;
+import org.jfree.chart.ui.Align;
+import org.jfree.chart.ui.HorizontalAlignment;
+import org.jfree.chart.ui.RectangleEdge;
/**
* @author benoitx
@@ -109,8 +109,8 @@
final Boolean filledShapes = ConfigurationOptions.getConfigBooleanProperty("chart." + chartName + ".filledShapes", "chart.filledShapes",
Boolean.FALSE);
- ((XYLineAndShapeRenderer) renderer).setBaseShapesVisible(showShapes.booleanValue());
- ((XYLineAndShapeRenderer) renderer).setBaseShapesFilled(filledShapes.booleanValue());
+ ((XYLineAndShapeRenderer) renderer).setDefaultShapesVisible(showShapes.booleanValue());
+ ((XYLineAndShapeRenderer) renderer).setDefaultShapesFilled(filledShapes.booleanValue());
}
}
--- a/src/net/sf/statcvs/charts/ModifyAddChartMaker.java
+++ b/src/net/sf/statcvs/charts/ModifyAddChartMaker.java
@@ -24,7 +24,7 @@
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.CategoryItemRenderer;
import org.jfree.data.category.DefaultCategoryDataset;
-import org.jfree.ui.RectangleEdge;
+import org.jfree.chart.ui.RectangleEdge;
/**
* Class for producing the "Author Activity: Modifying/Adding" chart
--- a/src/net/sf/statcvs/charts/ModuleEvolutionChartMaker.java
+++ b/src/net/sf/statcvs/charts/ModuleEvolutionChartMaker.java
@@ -15,14 +15,15 @@
import net.sf.statcvs.util.IntegerMap;
import org.jfree.chart.JFreeChart;
-import org.jfree.chart.axis.ColorBar;
import org.jfree.chart.axis.DateAxis;
+import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.axis.SymbolAxis;
import org.jfree.chart.axis.ValueAxis;
-import org.jfree.chart.plot.ContourPlot;
-import org.jfree.data.contour.ContourDataset;
-import org.jfree.data.contour.DefaultContourDataset;
-import org.jfree.ui.RectangleEdge;
+import org.jfree.chart.plot.XYPlot;
+import org.jfree.chart.renderer.xy.XYBlockRenderer;
+import org.jfree.chart.ui.RectangleEdge;
+import org.jfree.data.xy.DefaultXYZDataset;
+import org.jfree.data.xy.XYZDataset;
/**
* Class for producing directory pie charts
@@ -57,7 +58,7 @@
public ChartImage toFile() {
- final ContourDataset data = buildDs();
+ final XYZDataset data = buildDs();
if (data == null) {
return null;
@@ -71,14 +72,13 @@
yAxis.setLowerMargin(0.0);
yAxis.setUpperMargin(0.0);
- final ColorBar zAxis = new ColorBar("Commit Activity (%)");
- zAxis.getAxis();
+ final ValueAxis zAxis = new NumberAxis("Commit Activity (%)");
- final ContourPlot plot = new ContourPlot(data, xAxis, yAxis, zAxis);
+ final XYPlot plot = new XYPlot(data, xAxis, yAxis, new XYBlockRenderer());
//plot.setRenderAsPoints(true);
// don't use plot units for ratios when x axis is date
- plot.setDataAreaRatio(0.0);
- plot.setColorBarLocation(RectangleEdge.BOTTOM);
+ //plot.setDataAreaRatio(0.0);
+ //plot.setColorBarLocation(RectangleEdge.BOTTOM);
final JFreeChart chart = new JFreeChart(config.getProjectName(), null, plot, false);
@@ -91,7 +91,7 @@
return this.config.createChartImage(this.fileName, this.title, chart, dim);
}
- private ContourDataset buildDs() {
+ private XYZDataset buildDs() {
final Map mapByDate = new LinkedHashMap();
int max = 0;
final long elapsed = repository.getLastDate().getTime() - repository.getFirstDate().getTime();
@@ -191,9 +191,9 @@
return null;
}
- final Date[] oDateX = new Date[numValues];
- final Double[] oDoubleY = new Double[numValues];
- final Double[] oDoubleZ = new Double[numValues];
+ final double[] oDoubleX = new double[numValues];
+ final double[] oDoubleY = new double[numValues];
+ final double[] oDoubleZ = new double[numValues];
it = mapByDate.keySet().iterator();
for (int x = 0; x < dateCount; x++) {
@@ -212,20 +212,22 @@
final Module group = (Module) it2.next();
final int index = (x * groupCount) + y;
- oDateX[index] = date;
- oDoubleY[index] = new Double(y);
+ oDoubleX[index] = Long.valueOf(date.getTime()).doubleValue();
+ oDoubleY[index] = y;
final double value = map.get(group.getName()) * 100.0 / max;
- oDoubleZ[index] = (value != 0) ? new Double(value) : null;
+ oDoubleZ[index] = value;
}
} else {
for (int y = 0; y < groupCount; y++) {
final int index = (x * groupCount) + y;
- oDateX[index] = date;
- oDoubleY[index] = new Double(y);
- //oDoubleZ[index] = null;
+ oDoubleX[index] = Long.valueOf(date.getTime()).doubleValue();
+ oDoubleY[index] = y;
+ oDoubleZ[index] = 0;
}
}
}
- return new DefaultContourDataset(null, oDateX, oDoubleY, oDoubleZ);
+ final DefaultXYZDataset xyzDs = new DefaultXYZDataset();
+ xyzDs.addSeries(0, new double[][]{oDoubleX, oDoubleY, oDoubleZ});
+ return xyzDs;
}
-}
\ No newline at end of file
+}
--- a/src/net/sf/statcvs/charts/ChartImage.java
+++ b/src/net/sf/statcvs/charts/ChartImage.java
@@ -6,7 +6,7 @@
import java.io.IOException;
import java.util.logging.Logger;
-import org.jfree.chart.ChartUtilities;
+import org.jfree.chart.ChartUtils;
import org.jfree.chart.JFreeChart;
/**
@@ -58,7 +58,7 @@
}
logger.info("writing chart '" + this.title + "' to " + this.fileName);
try {
- ChartUtilities.saveChartAsPNG(new File(rootDirectory + fileName), chart, size.width, size.height);
+ ChartUtils.saveChartAsPNG(new File(rootDirectory + fileName), chart, size.width, size.height);
} catch (final IOException e) {
logger.warning("could not write chart '" + fileName + "': " + e);
}
@@ -93,4 +93,4 @@
public int getHeight() {
return this.size.height;
}
-}
\ No newline at end of file
+}
--- a/src/net/sf/statcvs/charts/CommitScatterChartMaker.java
+++ b/src/net/sf/statcvs/charts/CommitScatterChartMaker.java
@@ -113,7 +113,7 @@
}
private TimeSeries createTimeSeries(final SortedSet revisions) {
- final TimeSeries result = new TimeSeries("Dummy", Second.class);
+ final TimeSeries result = new TimeSeries("Dummy");
final Iterator it = revisions.iterator();
Date lastDate = new Date();
while (it.hasNext()) {
@@ -145,7 +145,7 @@
valueAxis.setRange(0.0, 24.0);
valueAxis.setLabelFont(new Font("SansSerif", Font.PLAIN, 9));
final XYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES);
- renderer.setShape(new Rectangle(new Dimension(2, 2)));
+ renderer.setDefaultShape(new Rectangle(new Dimension(2, 2)));
final XYPlot result = new XYPlot(new TimeSeriesCollection(series), null, valueAxis, renderer);
result.getRenderer().setSeriesPaint(0, color);
final Iterator it = annotations.iterator();
--- a/src/net/sf/statcvs/charts/DirectoryPieChartMaker.java
+++ b/src/net/sf/statcvs/charts/DirectoryPieChartMaker.java
@@ -90,7 +90,7 @@
plot.setLabelShadowPaint(null);
plot.setLabelOutlinePaint(Color.LIGHT_GRAY);
plot.setForegroundAlpha(0.8f);
- plot.setSectionOutlinePaint(Color.BLACK);
+ plot.setSectionOutlinePaint(0, Color.BLACK);
it = colors.entrySet().iterator();
while (it.hasNext()) {
final Entry entry = (Entry) it.next();
@@ -165,4 +165,4 @@
return result;
}
}
-}
\ No newline at end of file
+}
--- a/src/net/sf/statcvs/charts/TimeLineChartMaker.java
+++ b/src/net/sf/statcvs/charts/TimeLineChartMaker.java
@@ -89,7 +89,7 @@
}
private TimeSeries createTimeSeries(final TimeLine timeLine) {
- final TimeSeries result = new TimeSeries("!??!SERIES_LABEL!??!", Millisecond.class);
+ final TimeSeries result = new TimeSeries("!??!SERIES_LABEL!??!");
final Iterator it = timeLine.getDataPoints().iterator();
while (it.hasNext()) {
final TimePoint timePoint = (TimePoint) it.next();
--- a/src/net/sf/statcvs/output/ChurnPageMaker.java
+++ b/src/net/sf/statcvs/output/ChurnPageMaker.java
@@ -82,7 +82,7 @@
}
final List annotations = SymbolicNameAnnotation.createAnnotations(config.getRepository().getSymbolicNames());
- final TimeSeries timeLine = new TimeSeries(Messages.getString("CHURN_TOUCHED_LINE"), Day.class);
+ final TimeSeries timeLine = new TimeSeries(Messages.getString("CHURN_TOUCHED_LINE"));
for (final Iterator it = changePerRevision.entrySet().iterator(); it.hasNext();) {
final Map.Entry entry = (Entry) it.next();
--- a/src/net/sf/statcvs/reports/LOCSeriesBuilder.java
+++ b/src/net/sf/statcvs/reports/LOCSeriesBuilder.java
@@ -37,7 +37,7 @@
* value of new lines will be counted.
*/
public LOCSeriesBuilder(final String seriesTitle, final boolean countEffective) {
- series = new TimeSeries(seriesTitle, Minute.class);
+ series = new TimeSeries(seriesTitle);
this.countEffective = countEffective;
}
@@ -104,4 +104,4 @@
public int getMaximum() {
return this.maximum;
}
-}
\ No newline at end of file
+}
--- a/src/net/sf/statcvs/charts/ModuleSizePieChartMaker.java
+++ b/src/net/sf/statcvs/charts/ModuleSizePieChartMaker.java
@@ -80,7 +80,7 @@
plot.setLabelShadowPaint(null);
plot.setLabelOutlinePaint(Color.LIGHT_GRAY);
plot.setForegroundAlpha(0.8f);
- plot.setSectionOutlinePaint(Color.BLACK);
+ plot.setSectionOutlinePaint(0, Color.BLACK);
plot.setBackgroundPaint(ChartConfigUtil.getPlotColor(chartName));
chart.setBackgroundPaint(ChartConfigUtil.getBackgroundColor(chartName));
@@ -92,4 +92,4 @@
return this.config.createChartImage(this.fileName, this.title, chart, dim);
}
-}
\ No newline at end of file
+}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment