From d37bc96cddff068638d4bcd4c513b5ef3decf14e Mon Sep 17 00:00:00 2001 From: richardxs Date: Thu, 18 Nov 2021 11:00:17 -0600 Subject: [PATCH 1/5] Solution to issue #234 --- .../org/jfree/chart/plot/PolygonPlot.java | 116 ++++++++++++++++++ .../org/jfree/chart/plot/PolygonPlotTest.java | 22 ++++ 2 files changed, 138 insertions(+) create mode 100644 src/main/java/org/jfree/chart/plot/PolygonPlot.java create mode 100644 src/test/java/org/jfree/chart/plot/PolygonPlotTest.java diff --git a/src/main/java/org/jfree/chart/plot/PolygonPlot.java b/src/main/java/org/jfree/chart/plot/PolygonPlot.java new file mode 100644 index 000000000..279e50114 --- /dev/null +++ b/src/main/java/org/jfree/chart/plot/PolygonPlot.java @@ -0,0 +1,116 @@ +package org.jfree.chart.plot; +import java.awt.*; +import javax.swing.JPanel; +import org.jfree.chart.ChartFactory; + +import org.jfree.chart.axis.AxisLocation; +import org.jfree.chart.swing.ChartPanel; +import org.jfree.chart.JFreeChart; +import org.jfree.chart.annotations.XYPolygonAnnotation; +import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; +import org.jfree.chart.swing.UIUtils; +import org.jfree.data.xy.XYDataset; +import org.jfree.chart.swing.ApplicationFrame; +import org.jfree.chart.axis.NumberAxis; + +/** + * This demo illustrates the solution to issue #234. + */ +public class PolygonPlot extends ApplicationFrame{ + private static XYDataset dataset; + private static XYPlot xyplot; + + /** + * Creates a new demo instance. + * + * @param title the frame title. + */ + public PolygonPlot(String title) { + super(title); + JPanel chartPanel = createDemoPanel(title); + chartPanel.setPreferredSize(new java.awt.Dimension(1000, 500)); + setContentPane(chartPanel); + } + + /** + * Creates a chart. + * + * + * @return The chart. + */ + + private static JFreeChart createChart(String title) { + JFreeChart chart = ChartFactory.createScatterPlot( + title, "Distance(m)", "Depth(m)", dataset, + PlotOrientation.VERTICAL, true, true, false); + + + xyplot = (XYPlot) chart.getPlot(); + xyplot.setDomainPannable(true); + xyplot.setRangePannable(true); + xyplot.setDomainAxisLocation(0, AxisLocation.TOP_OR_LEFT); + + NumberAxis domain = (NumberAxis) xyplot.getDomainAxis(); + domain.setRange(60.0, 800.0); + + + NumberAxis range = (NumberAxis) xyplot.getRangeAxis(); + range.setRange(0.0, 150.0); + range.setInverted(true); + return chart; + } + + public void paint(Graphics g){ + Graphics2D g2d = (Graphics2D)g; + XYLineAndShapeRenderer renderer + = (XYLineAndShapeRenderer) xyplot.getRenderer(); + xyplot.setBackgroundPaint(Color.white); + + Color color1 = new Color(138, 43, 226); + Color color2 = new Color(18, 10, 255); + Color color3 = new Color(18, 255, 0); + Color color4 = new Color(255, 255, 0); + + + XYPolygonAnnotation polygon1 = new XYPolygonAnnotation(new double[] {70.0, + 10.0,80.0, 21.0, 570.0, 21.0,560.0, 10.0}, null, null,color1); + renderer.addAnnotation(polygon1); + + XYPolygonAnnotation polygon2 = new XYPolygonAnnotation(new double[] {80.0, + 20.0, 110.0, 50.0, 600.0, 50.0, 570.0, 20.0}, null, null,color2); + renderer.addAnnotation(polygon2); + + XYPolygonAnnotation polygon3 = new XYPolygonAnnotation(new double[] {110.0, + 50.0, 130.0, 70.0, 620.0, 70.0, 600.0, 50.0}, null, null,color3); + renderer.addAnnotation(polygon3); + + + XYPolygonAnnotation polygon4 = new XYPolygonAnnotation(new double[] {130.0, + 70.0, 150.0, 90.0, 640.0, 90.0,620.0, 70.0}, null, null,color4); + renderer.addAnnotation(polygon4); + + XYPolygonAnnotation polygon5 = new XYPolygonAnnotation(new double[] {150.0, + 90.0, 180.0, 120.0, 670.0, 120.0, 640.0, 90.0}, null, null,new Color(255,165,0)); + renderer.addAnnotation(polygon5); + } + + /** + * Creates a panel for the demo (used by SuperDemo.java). + * + * @return A panel. + */ + public static JPanel createDemoPanel(String title) { + JFreeChart chart = createChart(title); + ChartPanel panel = new ChartPanel(chart); + // panel.setMouseWheelEnabled(true); + return panel; + } + + public static void main(String[] args) { + PolygonPlot demo = new PolygonPlot("PolygonPlot Demo"); + demo.pack(); + UIUtils.centerFrameOnScreen(demo); + demo.setVisible(true); + } + +} diff --git a/src/test/java/org/jfree/chart/plot/PolygonPlotTest.java b/src/test/java/org/jfree/chart/plot/PolygonPlotTest.java new file mode 100644 index 000000000..3345368d5 --- /dev/null +++ b/src/test/java/org/jfree/chart/plot/PolygonPlotTest.java @@ -0,0 +1,22 @@ +package org.jfree.chart.plot; + +import org.jfree.chart.swing.UIUtils; +import static org.junit.jupiter.api.Assertions.assertFalse; + +import org.junit.jupiter.api.Test; + +/** + * Tests for the {@link PolygonPlot} class. + */ +public class PolygonPlotTest { + /** + * Some checks for the equals() method. + */ + @Test + public void testEquals() { + PolygonPlot plot1 = new PolygonPlot("Polygon 1"); + PolygonPlot plot2 = new PolygonPlot("Ploygon 2"); + assertFalse(plot1.equals(plot2)); + assertFalse(plot2.equals(plot1)); + } +} \ No newline at end of file From f7e3d22d964eb25b2540b1733ffca5441407d8f5 Mon Sep 17 00:00:00 2001 From: richardxs Date: Thu, 18 Nov 2021 12:10:54 -0600 Subject: [PATCH 2/5] Solution to issue #168 --- .../chart/renderer/xy/XYSplineRenderer.java | 68 ++++++++-- .../chart/demo/XYSplineRendererDemo.java | 117 ++++++++++++++++++ .../renderer/xy/XYSplineRendererTest.java | 7 +- 3 files changed, 183 insertions(+), 9 deletions(-) create mode 100644 src/test/java/org/jfree/chart/demo/XYSplineRendererDemo.java diff --git a/src/main/java/org/jfree/chart/renderer/xy/XYSplineRenderer.java b/src/main/java/org/jfree/chart/renderer/xy/XYSplineRenderer.java index 64df374b7..0f665f24d 100644 --- a/src/main/java/org/jfree/chart/renderer/xy/XYSplineRenderer.java +++ b/src/main/java/org/jfree/chart/renderer/xy/XYSplineRenderer.java @@ -128,23 +128,30 @@ public XYSplineState(PlotRenderingInfo info) { private FillType fillType; private GradientPaintTransformer gradientPaintTransformer; - + + /** - * Creates a new instance with the precision attribute defaulting to 5 + * A tolerance for absolute difference of y_val between neighboring points + * if ABS(point1.y - point2.y) <= diffYTol, no spline interpolation + */ + private double diffYTol; + + /** + * Creates a new instance with the precision attribute defaulting to 5, diffYtol defaulting to 1e-6, * and no fill of the area 'under' the spline. */ public XYSplineRenderer() { - this(5, FillType.NONE); + this(5, 1e-6, FillType.NONE); } /** - * Creates a new renderer with the specified precision + * Creates a new renderer with the specified precision, diffYtol defaulting to 1e-6, * and no fill of the area 'under' (between '0' and) the spline. * * @param precision the number of points between data items. */ public XYSplineRenderer(int precision) { - this(precision, FillType.NONE); + this(precision, 1e-6, FillType.NONE); } /** @@ -157,13 +164,17 @@ public XYSplineRenderer(int precision) { * * @since 1.0.17 */ - public XYSplineRenderer(int precision, FillType fillType) { + public XYSplineRenderer(int precision, double diffYTol, FillType fillType) { super(); if (precision <= 0) { throw new IllegalArgumentException("Requires precision > 0."); } + if (diffYTol< 0) { + throw new IllegalArgumentException("Requires diffYTol >= 0.0"); + } Args.nullNotPermitted(fillType, "fillType"); this.precision = precision; + this.diffYTol = diffYTol; this.fillType = fillType; this.gradientPaintTransformer = new StandardGradientPaintTransformer(); } @@ -196,6 +207,33 @@ public void setPrecision(int p) { fireChangeEvent(); } + /** + * Returns a tolerance for absolute difference of y_val between neighboring points + * if ABS(point1.y - point2.y) <= diffYTol, no spline interpolation + * + * @return y tolerance. + * + * @see #setDiffYTol(double) + */ + public double getDiffYTol() { + return this.diffYTol; + } + + /** + * Set a tolerance for absolute difference of y_val between neighboring points and sends a {@link RendererChangeEvent} + * to all registered listeners. + * + * @param tol a tolerance for absolute difference of y_val between neighboring points + * + * @see #getDiffYTol() + */ + public void setDiffYTol(double tol) { + if (tol < 0.0) { + throw new IllegalArgumentException("Requires y tolerance >= 0."); + } + this.diffYTol = tol; + fireChangeEvent(); + } /** * Returns the type of fill that the renderer draws beneath the curve. * @@ -405,8 +443,10 @@ protected void drawPrimaryLineAsPath(XYItemRendererState state, // note that a[0]=a[np-1]=0 oldt = x[0]; oldy = d[0]; - for (int i = 1; i <= np - 1; i++) { - // loop over intervals between nodes + for (int i=1; i<=np-1; i++){ + // loop over intervals between nodes + // If two neighboring points are close, no spline interpolation + if (Math.abs(d[i-1]-d[i])>diffYTol){ for (int j = 1; j <= this.precision; j++) { t1 = (h[i] * j) / this.precision; t2 = h[i] - t1; @@ -420,6 +460,14 @@ protected void drawPrimaryLineAsPath(XYItemRendererState state, } } } + else{ + s.seriesPath.lineTo(x[i], d[i]); + if (this.fillType != FillType.NONE) { + s.fillArea.lineTo(x[i], d[i]); + s.fillArea.closePath(); + } + } + } } // Add last point @ y=0 for fillPath and close path if (this.fillType != FillType.NONE) { @@ -496,6 +544,10 @@ public boolean equals(Object obj) { if (this.precision != that.precision) { return false; } + if (this.diffYTol != that.diffYTol) { + return false; + } + if (this.fillType != that.fillType) { return false; } diff --git a/src/test/java/org/jfree/chart/demo/XYSplineRendererDemo.java b/src/test/java/org/jfree/chart/demo/XYSplineRendererDemo.java new file mode 100644 index 000000000..7be92d1b1 --- /dev/null +++ b/src/test/java/org/jfree/chart/demo/XYSplineRendererDemo.java @@ -0,0 +1,117 @@ +package org.jfree.chart.demo; + +import java.awt.Color; + +import javax.swing.JPanel; + + +import org.jfree.chart.swing.ChartPanel; +import org.jfree.chart.swing.ApplicationFrame; +import org.jfree.chart.swing.UIUtils; +import org.jfree.chart.ChartUtils; + +import org.jfree.chart.JFreeChart; +import org.jfree.chart.axis.NumberAxis; +import org.jfree.chart.plot.XYPlot; +import org.jfree.chart.renderer.xy.XYSplineRenderer; +import org.jfree.data.xy.XYDataset; +import org.jfree.data.xy.XYSeries; +import org.jfree.data.xy.XYSeriesCollection; +import org.jfree.chart.api.RectangleInsets; + +/** + * A demo showing a line chart drawn using spline curves. + * Demonstrate the solution to Issue #168 + */ +public class XYSplineRendererDemo extends ApplicationFrame { + + /** + * Creates a new instance of the demo application. + * + * @param title the frame title. + */ + public XYSplineRendererDemo(String title) { + super(title); + JPanel content = createDemoPanel(); + content.setPreferredSize(new java.awt.Dimension(500, 270)); + getContentPane().add(content); + } + + /** + * Creates a panel for the demo (used by SuperDemo.java). + * + * @return A panel. + */ + public static JPanel createDemoPanel() { + + // create plot... + NumberAxis xAxis = new NumberAxis("X"); + xAxis.setAutoRangeIncludesZero(false); + NumberAxis yAxis = new NumberAxis("Y"); + yAxis.setAutoRangeIncludesZero(false); + + XYSplineRenderer renderer1 = new XYSplineRenderer(); + XYPlot plot = new XYPlot(createSampleData(), xAxis, yAxis, renderer1); + plot.setBackgroundPaint(Color.lightGray); + plot.setDomainGridlinePaint(Color.white); + plot.setRangeGridlinePaint(Color.white); + plot.setAxisOffset(new RectangleInsets(4, 4, 4, 4)); + NumberAxis range = (NumberAxis) plot.getRangeAxis(); + range.setRange(-10.0, 40.0); + + // create and return the chart panel... + JFreeChart chart = new JFreeChart("XYSplineRenderer", + JFreeChart.DEFAULT_TITLE_FONT, plot, true); + ChartUtils.applyCurrentTheme(chart); + ChartPanel chartPanel = new ChartPanel(chart); + return chartPanel; + } + + /** + * Creates and returns a sample dataset. The data was randomly + * generated. + * + * @return a sample dataset. + */ + private static XYDataset createSampleData() { + XYSeries series = new XYSeries("Series 1"); + series.add(2.0, 0); + series.add(3.0, 0); + series.add(4.0, 0); + series.add(5.0, 0); + series.add(6.0, 30); + series.add(7.0, 0); + series.add(8.0, 0); + series.add(9.0, 0); + series.add(10.0, 0); + series.add(11.0, 0); + XYSeriesCollection result = new XYSeriesCollection(series); +// XYSeries series2 = new XYSeries("Series 2"); +// series2.add(11.0, 56.27); +// series2.add(10.0, 41.32); +// series2.add(9.0, 31.45); +// series2.add(8.0, 30.05); +// series2.add(7.0, 24.69); +// series2.add(6.0, 19.78); +// series2.add(5.0, 20.94); +// series2.add(4.0, 16.73); +// series2.add(3.0, 14.21); +// series2.add(2.0, 12.44); +// result.addSeries(series2); + return result; + } + + /** + * The starting point for the regression demo. + * + * @param args ignored. + */ + public static void main(String args[]) { + XYSplineRendererDemo appFrame = new XYSplineRendererDemo( + "JFreeChart: XYSplineRendererDemo.java"); + appFrame.pack(); + UIUtils.centerFrameOnScreen(appFrame); + appFrame.setVisible(true); + } + +} diff --git a/src/test/java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java b/src/test/java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java index 846a370f0..99e65fa52 100644 --- a/src/test/java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java +++ b/src/test/java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java @@ -68,7 +68,12 @@ public void testEquals() { assertFalse(r1.equals(r2)); r2.setPrecision(9); assertTrue(r1.equals(r2)); - + + r1.setDiffYTol(1e-3); + assertFalse(r1.equals(r2)); + r2.setDiffYTol(1e-3); + assertTrue(r1.equals(r2)); + r1.setFillType(XYSplineRenderer.FillType.TO_ZERO); assertFalse(r1.equals(r2)); r2.setFillType(XYSplineRenderer.FillType.TO_ZERO); From 366387e0621116695cf694a3f98470ebf2dbbc46 Mon Sep 17 00:00:00 2001 From: richardxs Date: Thu, 18 Nov 2021 13:23:54 -0600 Subject: [PATCH 3/5] Revert "Solution to issue #234" Revert "Solution to issue #234" This reverts commit d37bc96cddff068638d4bcd4c513b5ef3decf14e. --- .../org/jfree/chart/plot/PolygonPlot.java | 116 ------------------ .../org/jfree/chart/plot/PolygonPlotTest.java | 22 ---- 2 files changed, 138 deletions(-) delete mode 100644 src/main/java/org/jfree/chart/plot/PolygonPlot.java delete mode 100644 src/test/java/org/jfree/chart/plot/PolygonPlotTest.java diff --git a/src/main/java/org/jfree/chart/plot/PolygonPlot.java b/src/main/java/org/jfree/chart/plot/PolygonPlot.java deleted file mode 100644 index 279e50114..000000000 --- a/src/main/java/org/jfree/chart/plot/PolygonPlot.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.jfree.chart.plot; -import java.awt.*; -import javax.swing.JPanel; -import org.jfree.chart.ChartFactory; - -import org.jfree.chart.axis.AxisLocation; -import org.jfree.chart.swing.ChartPanel; -import org.jfree.chart.JFreeChart; -import org.jfree.chart.annotations.XYPolygonAnnotation; -import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; -import org.jfree.chart.swing.UIUtils; -import org.jfree.data.xy.XYDataset; -import org.jfree.chart.swing.ApplicationFrame; -import org.jfree.chart.axis.NumberAxis; - -/** - * This demo illustrates the solution to issue #234. - */ -public class PolygonPlot extends ApplicationFrame{ - private static XYDataset dataset; - private static XYPlot xyplot; - - /** - * Creates a new demo instance. - * - * @param title the frame title. - */ - public PolygonPlot(String title) { - super(title); - JPanel chartPanel = createDemoPanel(title); - chartPanel.setPreferredSize(new java.awt.Dimension(1000, 500)); - setContentPane(chartPanel); - } - - /** - * Creates a chart. - * - * - * @return The chart. - */ - - private static JFreeChart createChart(String title) { - JFreeChart chart = ChartFactory.createScatterPlot( - title, "Distance(m)", "Depth(m)", dataset, - PlotOrientation.VERTICAL, true, true, false); - - - xyplot = (XYPlot) chart.getPlot(); - xyplot.setDomainPannable(true); - xyplot.setRangePannable(true); - xyplot.setDomainAxisLocation(0, AxisLocation.TOP_OR_LEFT); - - NumberAxis domain = (NumberAxis) xyplot.getDomainAxis(); - domain.setRange(60.0, 800.0); - - - NumberAxis range = (NumberAxis) xyplot.getRangeAxis(); - range.setRange(0.0, 150.0); - range.setInverted(true); - return chart; - } - - public void paint(Graphics g){ - Graphics2D g2d = (Graphics2D)g; - XYLineAndShapeRenderer renderer - = (XYLineAndShapeRenderer) xyplot.getRenderer(); - xyplot.setBackgroundPaint(Color.white); - - Color color1 = new Color(138, 43, 226); - Color color2 = new Color(18, 10, 255); - Color color3 = new Color(18, 255, 0); - Color color4 = new Color(255, 255, 0); - - - XYPolygonAnnotation polygon1 = new XYPolygonAnnotation(new double[] {70.0, - 10.0,80.0, 21.0, 570.0, 21.0,560.0, 10.0}, null, null,color1); - renderer.addAnnotation(polygon1); - - XYPolygonAnnotation polygon2 = new XYPolygonAnnotation(new double[] {80.0, - 20.0, 110.0, 50.0, 600.0, 50.0, 570.0, 20.0}, null, null,color2); - renderer.addAnnotation(polygon2); - - XYPolygonAnnotation polygon3 = new XYPolygonAnnotation(new double[] {110.0, - 50.0, 130.0, 70.0, 620.0, 70.0, 600.0, 50.0}, null, null,color3); - renderer.addAnnotation(polygon3); - - - XYPolygonAnnotation polygon4 = new XYPolygonAnnotation(new double[] {130.0, - 70.0, 150.0, 90.0, 640.0, 90.0,620.0, 70.0}, null, null,color4); - renderer.addAnnotation(polygon4); - - XYPolygonAnnotation polygon5 = new XYPolygonAnnotation(new double[] {150.0, - 90.0, 180.0, 120.0, 670.0, 120.0, 640.0, 90.0}, null, null,new Color(255,165,0)); - renderer.addAnnotation(polygon5); - } - - /** - * Creates a panel for the demo (used by SuperDemo.java). - * - * @return A panel. - */ - public static JPanel createDemoPanel(String title) { - JFreeChart chart = createChart(title); - ChartPanel panel = new ChartPanel(chart); - // panel.setMouseWheelEnabled(true); - return panel; - } - - public static void main(String[] args) { - PolygonPlot demo = new PolygonPlot("PolygonPlot Demo"); - demo.pack(); - UIUtils.centerFrameOnScreen(demo); - demo.setVisible(true); - } - -} diff --git a/src/test/java/org/jfree/chart/plot/PolygonPlotTest.java b/src/test/java/org/jfree/chart/plot/PolygonPlotTest.java deleted file mode 100644 index 3345368d5..000000000 --- a/src/test/java/org/jfree/chart/plot/PolygonPlotTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.jfree.chart.plot; - -import org.jfree.chart.swing.UIUtils; -import static org.junit.jupiter.api.Assertions.assertFalse; - -import org.junit.jupiter.api.Test; - -/** - * Tests for the {@link PolygonPlot} class. - */ -public class PolygonPlotTest { - /** - * Some checks for the equals() method. - */ - @Test - public void testEquals() { - PolygonPlot plot1 = new PolygonPlot("Polygon 1"); - PolygonPlot plot2 = new PolygonPlot("Ploygon 2"); - assertFalse(plot1.equals(plot2)); - assertFalse(plot2.equals(plot1)); - } -} \ No newline at end of file From bcc9506d5c8efbf7a0c17490bd7a04ef1ee3ae85 Mon Sep 17 00:00:00 2001 From: richardxs Date: Tue, 7 Dec 2021 14:45:43 -0600 Subject: [PATCH 4/5] Update javadoc --- .../jfree/chart/renderer/xy/XYSplineRenderer.java | 12 +++++++----- .../chart/renderer/xy/XYSplineRendererTest.java | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/jfree/chart/renderer/xy/XYSplineRenderer.java b/src/main/java/org/jfree/chart/renderer/xy/XYSplineRenderer.java index 0f665f24d..d9976fccb 100644 --- a/src/main/java/org/jfree/chart/renderer/xy/XYSplineRenderer.java +++ b/src/main/java/org/jfree/chart/renderer/xy/XYSplineRenderer.java @@ -131,7 +131,7 @@ public XYSplineState(PlotRenderingInfo info) { /** - * A tolerance for absolute difference of y_val between neighboring points + * CS427: A tolerance for absolute difference of y_val between neighboring points * if ABS(point1.y - point2.y) <= diffYTol, no spline interpolation */ private double diffYTol; @@ -351,8 +351,9 @@ protected void drawPrimaryLineAsPath(XYItemRendererState state, Point2D p = plot.getOrientation() == PlotOrientation.HORIZONTAL ? new Point2D.Float((float) transY1, (float) transX1) : new Point2D.Float((float) transX1, (float) transY1); - if (!s.points.contains(p)) + if (!s.points.contains(p)) { s.points.add(p); + } } if (item == dataset.getItemCount(series) - 1) { // construct path @@ -424,9 +425,9 @@ protected void drawPrimaryLineAsPath(XYItemRendererState state, d[i] = cpi.y; } - for (int i = 1; i <= np - 1; i++) + for (int i = 1; i <= np - 1; i++) { h[i] = x[i] - x[i - 1]; - + } float[] sub = new float[np - 1]; float[] diag = new float[np - 1]; float[] sup = new float[np - 1]; @@ -521,8 +522,9 @@ where a(i,i-1) = sub[i] for 2<=i<=n b[i] -= sub[i] * b[i - 1]; } b[n] /= diag[n]; - for (i = n - 1; i >= 1; i--) + for (i = n - 1; i >= 1; i--) { b[i] = (b[i] - sup[i] * b[i + 1]) / diag[i]; + } } /** diff --git a/src/test/java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java b/src/test/java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java index 99e65fa52..88be92338 100644 --- a/src/test/java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java +++ b/src/test/java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java @@ -50,7 +50,7 @@ import org.junit.jupiter.api.Test; /** - * Tests for the {@link XYSplineRenderer} class. + * CS427: Tests for the {@link XYSplineRenderer} class. */ public class XYSplineRendererTest { From a539796dcef4f5e89275ab6dbad03e1b28a879e2 Mon Sep 17 00:00:00 2001 From: richardxs Date: Wed, 8 Dec 2021 00:28:48 -0600 Subject: [PATCH 5/5] Update javadoc --- .../java/org/jfree/chart/renderer/xy/XYSplineRenderer.java | 3 ++- .../java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jfree/chart/renderer/xy/XYSplineRenderer.java b/src/main/java/org/jfree/chart/renderer/xy/XYSplineRenderer.java index d9976fccb..59575611e 100644 --- a/src/main/java/org/jfree/chart/renderer/xy/XYSplineRenderer.java +++ b/src/main/java/org/jfree/chart/renderer/xy/XYSplineRenderer.java @@ -131,7 +131,8 @@ public XYSplineState(PlotRenderingInfo info) { /** - * CS427: A tolerance for absolute difference of y_val between neighboring points + * CS427: Issue link: https://github.com/jfree/jfreechart/issues/168 + * A tolerance for absolute difference of y_val between neighboring points * if ABS(point1.y - point2.y) <= diffYTol, no spline interpolation */ private double diffYTol; diff --git a/src/test/java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java b/src/test/java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java index 88be92338..fcba6f387 100644 --- a/src/test/java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java +++ b/src/test/java/org/jfree/chart/renderer/xy/XYSplineRendererTest.java @@ -50,7 +50,8 @@ import org.junit.jupiter.api.Test; /** - * CS427: Tests for the {@link XYSplineRenderer} class. + * CS427: Issue link: https://github.com/jfree/jfreechart/issues/168 + * Tests for the {@link XYSplineRenderer} class. */ public class XYSplineRendererTest {