From 4923afc9f84b8ce7123b190f95ce19dae554b9a6 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Tue, 4 Nov 2014 22:11:07 +0000 Subject: [PATCH] Fix bug #57185 - Should be Series not Serie, latter is incorrect English / a Typo git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1636755 13f79535-47bb-0310-9956-ffa450edef68 --- .../xssf/usermodel/examples/LineChart.java | 28 ++++++++++---- .../{ChartSerie.java => ChartSeries.java} | 4 +- .../ss/usermodel/charts/LineChartData.java | 10 ++--- ...neChartSerie.java => LineChartSeries.java} | 6 +-- .../ss/usermodel/charts/ScatterChartData.java | 8 ++-- ...hartSerie.java => ScatterChartSeries.java} | 7 +--- ...erie.java => AbstractXSSFChartSeries.java} | 6 +-- .../usermodel/charts/XSSFLineChartData.java | 37 +++++++++++-------- .../charts/XSSFScatterChartData.java | 34 +++++++++-------- .../charts/TestXSSFLineChartData.java | 6 +-- .../charts/TestXSSFScatterChartData.java | 17 ++++++--- 11 files changed, 92 insertions(+), 71 deletions(-) rename src/java/org/apache/poi/ss/usermodel/charts/{ChartSerie.java => ChartSeries.java} (93%) rename src/java/org/apache/poi/ss/usermodel/charts/{LineChartSerie.java => LineChartSeries.java} (88%) rename src/java/org/apache/poi/ss/usermodel/charts/{ScatterChartSerie.java => ScatterChartSeries.java} (89%) rename src/ooxml/java/org/apache/poi/xssf/usermodel/charts/{AbstractXSSFChartSerie.java => AbstractXSSFChartSeries.java} (91%) diff --git a/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java b/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java index 9fc24ac0d..d8564c523 100644 --- a/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java +++ b/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java @@ -16,17 +16,29 @@ ==================================================================== */ package org.apache.poi.xssf.usermodel.examples; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.usermodel.charts.*; +import java.io.FileOutputStream; + +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Chart; +import org.apache.poi.ss.usermodel.ClientAnchor; +import org.apache.poi.ss.usermodel.Drawing; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.charts.AxisCrosses; +import org.apache.poi.ss.usermodel.charts.AxisPosition; +import org.apache.poi.ss.usermodel.charts.ChartAxis; +import org.apache.poi.ss.usermodel.charts.ChartDataSource; +import org.apache.poi.ss.usermodel.charts.ChartLegend; +import org.apache.poi.ss.usermodel.charts.DataSources; +import org.apache.poi.ss.usermodel.charts.LegendPosition; +import org.apache.poi.ss.usermodel.charts.LineChartData; +import org.apache.poi.ss.usermodel.charts.ValueAxis; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import java.io.FileOutputStream; - /** * Line chart example. - * - * @author Martin Andersson */ public class LineChart { @@ -66,8 +78,8 @@ public class LineChart { ChartDataSource ys2 = DataSources.fromNumericCellRange(sheet, new CellRangeAddress(2, 2, 0, NUM_OF_COLUMNS - 1)); - data.addSerie(xs, ys1); - data.addSerie(xs, ys2); + data.addSeries(xs, ys1); + data.addSeries(xs, ys2); chart.plot(data, bottomAxis, leftAxis); diff --git a/src/java/org/apache/poi/ss/usermodel/charts/ChartSerie.java b/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java similarity index 93% rename from src/java/org/apache/poi/ss/usermodel/charts/ChartSerie.java rename to src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java index 47f9914b5..05a39d45e 100644 --- a/src/java/org/apache/poi/ss/usermodel/charts/ChartSerie.java +++ b/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java @@ -21,10 +21,8 @@ import org.apache.poi.ss.util.CellReference; /** * Basic settings for all chart series. - * - * @author Martin Andersson */ -public interface ChartSerie { +public interface ChartSeries { /** * Sets the title of the series as a string literal. diff --git a/src/java/org/apache/poi/ss/usermodel/charts/LineChartData.java b/src/java/org/apache/poi/ss/usermodel/charts/LineChartData.java index dbc99700d..f3bf10f56 100644 --- a/src/java/org/apache/poi/ss/usermodel/charts/LineChartData.java +++ b/src/java/org/apache/poi/ss/usermodel/charts/LineChartData.java @@ -17,12 +17,12 @@ package org.apache.poi.ss.usermodel.charts; -import org.apache.poi.util.Beta; - import java.util.List; +import org.apache.poi.util.Beta; + /** - * @author Martin Andersson + * Data for a Line Chart */ @Beta public interface LineChartData extends ChartData { @@ -32,10 +32,10 @@ public interface LineChartData extends ChartData { * @param values data source for values. * @return a new line chart serie. */ - LineChartSerie addSerie(ChartDataSource categories, ChartDataSource values); + LineChartSeries addSeries(ChartDataSource categories, ChartDataSource values); /** * @return list of all series. */ - List getSeries(); + List getSeries(); } diff --git a/src/java/org/apache/poi/ss/usermodel/charts/LineChartSerie.java b/src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java similarity index 88% rename from src/java/org/apache/poi/ss/usermodel/charts/LineChartSerie.java rename to src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java index 9dd959392..d1c03a951 100644 --- a/src/java/org/apache/poi/ss/usermodel/charts/LineChartSerie.java +++ b/src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java @@ -20,12 +20,10 @@ package org.apache.poi.ss.usermodel.charts; import org.apache.poi.util.Beta; /** - * Represents a line chart serie. - * - * @author Martin Andersson + * Represents a line chart series. */ @Beta -public interface LineChartSerie extends ChartSerie { +public interface LineChartSeries extends ChartSeries { /** * @return data source used for category axis data. diff --git a/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartData.java b/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartData.java index 81917473b..594b5bdfe 100644 --- a/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartData.java +++ b/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartData.java @@ -20,18 +20,18 @@ package org.apache.poi.ss.usermodel.charts; import java.util.List; /** - * @author Roman Kashitsyn + * Data for a Scatter Chart */ public interface ScatterChartData extends ChartData { /** * @param xs data source to be used for X axis values * @param ys data source to be used for Y axis values - * @return a new scatter charts serie + * @return a new scatter charts series */ - ScatterChartSerie addSerie(ChartDataSource xs, ChartDataSource ys); + ScatterChartSeries addSerie(ChartDataSource xs, ChartDataSource ys); /** * @return list of all series */ - List getSeries(); + List getSeries(); } diff --git a/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSerie.java b/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSeries.java similarity index 89% rename from src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSerie.java rename to src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSeries.java index a5fa42499..f200cb6ba 100644 --- a/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSerie.java +++ b/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSeries.java @@ -20,13 +20,10 @@ package org.apache.poi.ss.usermodel.charts; import org.apache.poi.util.Beta; /** - * Represents scatter charts serie. - * - * @author Roman Kashitsyn - * @author Martin Andersson + * Represents scatter charts series. */ @Beta -public interface ScatterChartSerie extends ChartSerie { +public interface ScatterChartSeries extends ChartSeries { /** * @return data source used for X axis values diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSerie.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSeries.java similarity index 91% rename from src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSerie.java rename to src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSeries.java index eb2fb2f59..09393e51a 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSerie.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSeries.java @@ -17,15 +17,15 @@ package org.apache.poi.xssf.usermodel.charts; -import org.apache.poi.ss.usermodel.charts.ChartSerie; +import org.apache.poi.ss.usermodel.charts.ChartSeries; import org.apache.poi.ss.usermodel.charts.TitleType; import org.apache.poi.ss.util.CellReference; import org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx; /** - * @author Martin Andersson + * Base of all XSSF Chart Series */ -public abstract class AbstractXSSFChartSerie implements ChartSerie { +public abstract class AbstractXSSFChartSeries implements ChartSeries { private String titleValue; private CellReference titleRef; diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFLineChartData.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFLineChartData.java index 7da2b1e38..54bba03bb 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFLineChartData.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFLineChartData.java @@ -17,20 +17,25 @@ package org.apache.poi.xssf.usermodel.charts; +import java.util.ArrayList; +import java.util.List; + import org.apache.poi.ss.usermodel.Chart; import org.apache.poi.ss.usermodel.charts.ChartAxis; import org.apache.poi.ss.usermodel.charts.ChartDataSource; import org.apache.poi.ss.usermodel.charts.LineChartData; -import org.apache.poi.ss.usermodel.charts.LineChartSerie; +import org.apache.poi.ss.usermodel.charts.LineChartSeries; import org.apache.poi.util.Beta; import org.apache.poi.xssf.usermodel.XSSFChart; -import org.openxmlformats.schemas.drawingml.x2006.chart.*; - -import java.util.ArrayList; -import java.util.List; +import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource; +import org.openxmlformats.schemas.drawingml.x2006.chart.CTLineChart; +import org.openxmlformats.schemas.drawingml.x2006.chart.CTLineSer; +import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource; +import org.openxmlformats.schemas.drawingml.x2006.chart.CTPlotArea; +import org.openxmlformats.schemas.drawingml.x2006.chart.STMarkerStyle; /** - * @author Martin Andersson + * Holds data for a XSSF Line Chart */ @Beta public class XSSFLineChartData implements LineChartData { @@ -38,19 +43,19 @@ public class XSSFLineChartData implements LineChartData { /** * List of all data series. */ - private List series; + private List series; public XSSFLineChartData() { - series = new ArrayList(); + series = new ArrayList(); } - static class Serie extends AbstractXSSFChartSerie implements LineChartSerie { + static class Series extends AbstractXSSFChartSeries implements LineChartSeries { private int id; private int order; private ChartDataSource categories; private ChartDataSource values; - protected Serie(int id, int order, + protected Series(int id, int order, ChartDataSource categories, ChartDataSource values) { this.id = id; @@ -86,17 +91,17 @@ public class XSSFLineChartData implements LineChartData { } } - public LineChartSerie addSerie(ChartDataSource categoryAxisData, ChartDataSource values) { + public LineChartSeries addSeries(ChartDataSource categoryAxisData, ChartDataSource values) { if (!values.isNumeric()) { throw new IllegalArgumentException("Value data source must be numeric."); } int numOfSeries = series.size(); - Serie newSerie = new Serie(numOfSeries, numOfSeries, categoryAxisData, values); - series.add(newSerie); - return newSerie; + Series newSeries = new Series(numOfSeries, numOfSeries, categoryAxisData, values); + series.add(newSeries); + return newSeries; } - public List getSeries() { + public List getSeries() { return series; } @@ -110,7 +115,7 @@ public class XSSFLineChartData implements LineChartData { CTLineChart lineChart = plotArea.addNewLineChart(); lineChart.addNewVaryColors().setVal(false); - for (Serie s : series) { + for (Series s : series) { s.addToChart(lineChart); } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFScatterChartData.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFScatterChartData.java index 088e6fc2a..f31b35503 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFScatterChartData.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFScatterChartData.java @@ -17,23 +17,27 @@ package org.apache.poi.xssf.usermodel.charts; +import java.util.ArrayList; +import java.util.List; + import org.apache.poi.ss.usermodel.Chart; import org.apache.poi.ss.usermodel.charts.ChartAxis; import org.apache.poi.ss.usermodel.charts.ChartDataSource; import org.apache.poi.ss.usermodel.charts.ScatterChartData; -import org.apache.poi.ss.usermodel.charts.ScatterChartSerie; +import org.apache.poi.ss.usermodel.charts.ScatterChartSeries; import org.apache.poi.util.Beta; import org.apache.poi.xssf.usermodel.XSSFChart; -import org.openxmlformats.schemas.drawingml.x2006.chart.*; - -import java.util.ArrayList; -import java.util.List; +import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource; +import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource; +import org.openxmlformats.schemas.drawingml.x2006.chart.CTPlotArea; +import org.openxmlformats.schemas.drawingml.x2006.chart.CTScatterChart; +import org.openxmlformats.schemas.drawingml.x2006.chart.CTScatterSer; +import org.openxmlformats.schemas.drawingml.x2006.chart.CTScatterStyle; +import org.openxmlformats.schemas.drawingml.x2006.chart.STScatterStyle; /** * Represents DrawingML scatter charts. - * - * @author Roman Kashitsyn */ @Beta public class XSSFScatterChartData implements ScatterChartData { @@ -41,22 +45,22 @@ public class XSSFScatterChartData implements ScatterChartData { /** * List of all data series. */ - private List series; + private List series; public XSSFScatterChartData() { - series = new ArrayList(); + series = new ArrayList(); } /** * Package private ScatterChartSerie implementation. */ - static class Serie extends AbstractXSSFChartSerie implements ScatterChartSerie { + static class Series extends AbstractXSSFChartSeries implements ScatterChartSeries { private int id; private int order; private ChartDataSource xs; private ChartDataSource ys; - protected Serie(int id, int order, + protected Series(int id, int order, ChartDataSource xs, ChartDataSource ys) { super(); @@ -99,13 +103,13 @@ public class XSSFScatterChartData implements ScatterChartData { } } - public ScatterChartSerie addSerie(ChartDataSource xs, + public ScatterChartSeries addSerie(ChartDataSource xs, ChartDataSource ys) { if (!ys.isNumeric()) { throw new IllegalArgumentException("Y axis data source must be numeric."); } int numOfSeries = series.size(); - Serie newSerie = new Serie(numOfSeries, numOfSeries, xs, ys); + Series newSerie = new Series(numOfSeries, numOfSeries, xs, ys); series.add(newSerie); return newSerie; } @@ -120,7 +124,7 @@ public class XSSFScatterChartData implements ScatterChartData { CTScatterChart scatterChart = plotArea.addNewScatterChart(); addStyle(scatterChart); - for (Serie s : series) { + for (Series s : series) { s.addToChart(scatterChart); } @@ -129,7 +133,7 @@ public class XSSFScatterChartData implements ScatterChartData { } } - public List getSeries() { + public List getSeries() { return series; } diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java index c4c04b8d9..cf7fd78ed 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java @@ -28,13 +28,13 @@ import org.apache.poi.ss.usermodel.charts.ChartAxis; import org.apache.poi.ss.usermodel.charts.ChartDataSource; import org.apache.poi.ss.usermodel.charts.DataSources; import org.apache.poi.ss.usermodel.charts.LineChartData; -import org.apache.poi.ss.usermodel.charts.LineChartSerie; +import org.apache.poi.ss.usermodel.charts.LineChartSeries; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.SheetBuilder; import org.apache.poi.xssf.usermodel.XSSFWorkbook; /** - * @author Martin Andersson + * Tests for XSSF Line Charts */ public class TestXSSFLineChartData extends TestCase { @@ -58,7 +58,7 @@ public class TestXSSFLineChartData extends TestCase { ChartDataSource xs = DataSources.fromStringCellRange(sheet, CellRangeAddress.valueOf("A1:J1")); ChartDataSource ys = DataSources.fromNumericCellRange(sheet, CellRangeAddress.valueOf("A2:J2")); - LineChartSerie series = lineChartData.addSerie(xs, ys); + LineChartSeries series = lineChartData.addSeries(xs, ys); assertNotNull(series); assertEquals(1, lineChartData.getSeries().size()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java index 2780a5176..e041e891c 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java @@ -19,16 +19,23 @@ package org.apache.poi.xssf.usermodel.charts; import junit.framework.TestCase; -import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.usermodel.Chart; +import org.apache.poi.ss.usermodel.ClientAnchor; +import org.apache.poi.ss.usermodel.Drawing; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.charts.AxisPosition; +import org.apache.poi.ss.usermodel.charts.ChartAxis; +import org.apache.poi.ss.usermodel.charts.ChartDataSource; +import org.apache.poi.ss.usermodel.charts.DataSources; +import org.apache.poi.ss.usermodel.charts.ScatterChartData; +import org.apache.poi.ss.usermodel.charts.ScatterChartSeries; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.SheetBuilder; -import org.apache.poi.ss.usermodel.charts.*; import org.apache.poi.xssf.usermodel.XSSFWorkbook; /** * Tests for XSSFScatterChartData. - * - * @author Roman Kashitsyn */ public final class TestXSSFScatterChartData extends TestCase { @@ -52,7 +59,7 @@ public final class TestXSSFScatterChartData extends TestCase { ChartDataSource xs = DataSources.fromStringCellRange(sheet, CellRangeAddress.valueOf("A1:J1")); ChartDataSource ys = DataSources.fromNumericCellRange(sheet, CellRangeAddress.valueOf("A2:J2")); - ScatterChartSerie series = scatterChartData.addSerie(xs, ys); + ScatterChartSeries series = scatterChartData.addSerie(xs, ys); assertNotNull(series); assertEquals(1, scatterChartData.getSeries().size());