]> source.dussan.org Git - poi.git/commitdiff
Fix bug #57185 - Should be Series not Serie, latter is incorrect English / a Typo
authorNick Burch <nick@apache.org>
Tue, 4 Nov 2014 22:11:07 +0000 (22:11 +0000)
committerNick Burch <nick@apache.org>
Tue, 4 Nov 2014 22:11:07 +0000 (22:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1636755 13f79535-47bb-0310-9956-ffa450edef68

15 files changed:
src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java
src/java/org/apache/poi/ss/usermodel/charts/ChartSerie.java [deleted file]
src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java [new file with mode: 0644]
src/java/org/apache/poi/ss/usermodel/charts/LineChartData.java
src/java/org/apache/poi/ss/usermodel/charts/LineChartSerie.java [deleted file]
src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java [new file with mode: 0644]
src/java/org/apache/poi/ss/usermodel/charts/ScatterChartData.java
src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSerie.java [deleted file]
src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSeries.java [new file with mode: 0644]
src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSerie.java [deleted file]
src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSeries.java [new file with mode: 0644]
src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFLineChartData.java
src/ooxml/java/org/apache/poi/xssf/usermodel/charts/XSSFScatterChartData.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java

index 9fc24ac0d7d61240f65361282e19b151a9fbbdc5..d8564c52312b73639a781600696f81cc7705e921 100644 (file)
 ==================================================================== */\r
 package org.apache.poi.xssf.usermodel.examples;\r
 \r
-import org.apache.poi.ss.usermodel.*;\r
-import org.apache.poi.ss.usermodel.charts.*;\r
+import java.io.FileOutputStream;\r
+\r
+import org.apache.poi.ss.usermodel.Cell;\r
+import org.apache.poi.ss.usermodel.Chart;\r
+import org.apache.poi.ss.usermodel.ClientAnchor;\r
+import org.apache.poi.ss.usermodel.Drawing;\r
+import org.apache.poi.ss.usermodel.Row;\r
+import org.apache.poi.ss.usermodel.Sheet;\r
+import org.apache.poi.ss.usermodel.Workbook;\r
+import org.apache.poi.ss.usermodel.charts.AxisCrosses;\r
+import org.apache.poi.ss.usermodel.charts.AxisPosition;\r
+import org.apache.poi.ss.usermodel.charts.ChartAxis;\r
+import org.apache.poi.ss.usermodel.charts.ChartDataSource;\r
+import org.apache.poi.ss.usermodel.charts.ChartLegend;\r
+import org.apache.poi.ss.usermodel.charts.DataSources;\r
+import org.apache.poi.ss.usermodel.charts.LegendPosition;\r
+import org.apache.poi.ss.usermodel.charts.LineChartData;\r
+import org.apache.poi.ss.usermodel.charts.ValueAxis;\r
 import org.apache.poi.ss.util.CellRangeAddress;\r
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;\r
 \r
-import java.io.FileOutputStream;\r
-\r
 /**\r
  * Line chart example.\r
- *\r
- * @author Martin Andersson\r
  */\r
 public class LineChart {\r
 \r
@@ -66,8 +78,8 @@ public class LineChart {
         ChartDataSource<Number> ys2 = DataSources.fromNumericCellRange(sheet, new CellRangeAddress(2, 2, 0, NUM_OF_COLUMNS - 1));\r
 \r
 \r
-        data.addSerie(xs, ys1);\r
-        data.addSerie(xs, ys2);\r
+        data.addSeries(xs, ys1);\r
+        data.addSeries(xs, ys2);\r
 \r
         chart.plot(data, bottomAxis, leftAxis);\r
 \r
diff --git a/src/java/org/apache/poi/ss/usermodel/charts/ChartSerie.java b/src/java/org/apache/poi/ss/usermodel/charts/ChartSerie.java
deleted file mode 100644 (file)
index 47f9914..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ====================================================================\r
-   Licensed to the Apache Software Foundation (ASF) under one or more\r
-   contributor license agreements.  See the NOTICE file distributed with\r
-   this work for additional information regarding copyright ownership.\r
-   The ASF licenses this file to You under the Apache License, Version 2.0\r
-   (the "License"); you may not use this file except in compliance with\r
-   the License.  You may obtain a copy of the License at\r
-\r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-   Unless required by applicable law or agreed to in writing, software\r
-   distributed under the License is distributed on an "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-   See the License for the specific language governing permissions and\r
-   limitations under the License.\r
-==================================================================== */\r
-\r
-package org.apache.poi.ss.usermodel.charts;\r
-\r
-import org.apache.poi.ss.util.CellReference;\r
-\r
-/**\r
- * Basic settings for all chart series.\r
- *\r
- * @author Martin Andersson\r
- */\r
-public interface ChartSerie {\r
-\r
-    /**\r
-     * Sets the title of the series as a string literal.\r
-     *\r
-     * @param title\r
-     */\r
-    void setTitle(String title);\r
-\r
-    /**\r
-     * Sets the title of the series as a cell reference.\r
-     *\r
-     * @param titleReference\r
-     */\r
-    void setTitle(CellReference titleReference);\r
-\r
-    /**\r
-     * @return title as string literal.\r
-     */\r
-    String getTitleString();\r
-\r
-    /**\r
-     * @return title as cell reference.\r
-     */\r
-    CellReference getTitleCellReference();\r
-\r
-    /**\r
-     * @return title type.\r
-     */\r
-    TitleType getTitleType();\r
-}\r
diff --git a/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java b/src/java/org/apache/poi/ss/usermodel/charts/ChartSeries.java
new file mode 100644 (file)
index 0000000..05a39d4
--- /dev/null
@@ -0,0 +1,55 @@
+/* ====================================================================\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to You under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+==================================================================== */\r
+\r
+package org.apache.poi.ss.usermodel.charts;\r
+\r
+import org.apache.poi.ss.util.CellReference;\r
+\r
+/**\r
+ * Basic settings for all chart series.\r
+ */\r
+public interface ChartSeries {\r
+\r
+    /**\r
+     * Sets the title of the series as a string literal.\r
+     *\r
+     * @param title\r
+     */\r
+    void setTitle(String title);\r
+\r
+    /**\r
+     * Sets the title of the series as a cell reference.\r
+     *\r
+     * @param titleReference\r
+     */\r
+    void setTitle(CellReference titleReference);\r
+\r
+    /**\r
+     * @return title as string literal.\r
+     */\r
+    String getTitleString();\r
+\r
+    /**\r
+     * @return title as cell reference.\r
+     */\r
+    CellReference getTitleCellReference();\r
+\r
+    /**\r
+     * @return title type.\r
+     */\r
+    TitleType getTitleType();\r
+}\r
index dbc99700d379d2aff1af247ee989117093fa00e8..f3bf10f5665a9f057b3f4c54311bbed9709edc9a 100644 (file)
 \r
 package org.apache.poi.ss.usermodel.charts;\r
 \r
-import org.apache.poi.util.Beta;\r
-\r
 import java.util.List;\r
 \r
+import org.apache.poi.util.Beta;\r
+\r
 /**\r
- * @author Martin Andersson\r
+ * Data for a Line Chart\r
  */\r
 @Beta\r
 public interface LineChartData extends ChartData {\r
@@ -32,10 +32,10 @@ public interface LineChartData extends ChartData {
      * @param values     data source for values.\r
      * @return a new line chart serie.\r
      */\r
-    LineChartSerie addSerie(ChartDataSource<?> categories, ChartDataSource<? extends Number> values);\r
+    LineChartSeries addSeries(ChartDataSource<?> categories, ChartDataSource<? extends Number> values);\r
 \r
     /**\r
      * @return list of all series.\r
      */\r
-    List<? extends LineChartSerie> getSeries();\r
+    List<? extends LineChartSeries> getSeries();\r
 }\r
diff --git a/src/java/org/apache/poi/ss/usermodel/charts/LineChartSerie.java b/src/java/org/apache/poi/ss/usermodel/charts/LineChartSerie.java
deleted file mode 100644 (file)
index 9dd9593..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ====================================================================\r
-   Licensed to the Apache Software Foundation (ASF) under one or more\r
-   contributor license agreements.  See the NOTICE file distributed with\r
-   this work for additional information regarding copyright ownership.\r
-   The ASF licenses this file to You under the Apache License, Version 2.0\r
-   (the "License"); you may not use this file except in compliance with\r
-   the License.  You may obtain a copy of the License at\r
-\r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-   Unless required by applicable law or agreed to in writing, software\r
-   distributed under the License is distributed on an "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-   See the License for the specific language governing permissions and\r
-   limitations under the License.\r
-==================================================================== */\r
-\r
-package org.apache.poi.ss.usermodel.charts;\r
-\r
-import org.apache.poi.util.Beta;\r
-\r
-/**\r
- * Represents a line chart serie.\r
- *\r
- * @author Martin Andersson\r
- */\r
-@Beta\r
-public interface LineChartSerie extends ChartSerie {\r
-\r
-    /**\r
-     * @return data source used for category axis data.\r
-     */\r
-    ChartDataSource<?> getCategoryAxisData();\r
-\r
-    /**\r
-     * @return data source used for value axis.\r
-     */\r
-    ChartDataSource<? extends Number> getValues();\r
-\r
-}\r
diff --git a/src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java b/src/java/org/apache/poi/ss/usermodel/charts/LineChartSeries.java
new file mode 100644 (file)
index 0000000..d1c03a9
--- /dev/null
@@ -0,0 +1,38 @@
+/* ====================================================================\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to You under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+==================================================================== */\r
+\r
+package org.apache.poi.ss.usermodel.charts;\r
+\r
+import org.apache.poi.util.Beta;\r
+\r
+/**\r
+ * Represents a line chart series.\r
+ */\r
+@Beta\r
+public interface LineChartSeries extends ChartSeries {\r
+\r
+    /**\r
+     * @return data source used for category axis data.\r
+     */\r
+    ChartDataSource<?> getCategoryAxisData();\r
+\r
+    /**\r
+     * @return data source used for value axis.\r
+     */\r
+    ChartDataSource<? extends Number> getValues();\r
+\r
+}\r
index 81917473b0534675282c177fdce7f9eb2674b9ca..594b5bdfe3d70de452a3632c12d41fb746bdc652 100644 (file)
@@ -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<? extends Number> ys);
+       ScatterChartSeries addSerie(ChartDataSource<?> xs, ChartDataSource<? extends Number> ys);
 
        /**
         * @return list of all series
         */
-       List<? extends ScatterChartSerie> getSeries();
+       List<? extends ScatterChartSeries> getSeries();
 }
diff --git a/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSerie.java b/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSerie.java
deleted file mode 100644 (file)
index a5fa424..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/* ====================================================================
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel.charts;
-
-import org.apache.poi.util.Beta;
-
-/**
- * Represents scatter charts serie.
- *
- * @author Roman Kashitsyn
- * @author Martin Andersson
- */
-@Beta
-public interface ScatterChartSerie extends ChartSerie {
-
-    /**
-     * @return data source used for X axis values
-     */
-    ChartDataSource<?> getXValues();
-
-    /**
-     * @return data source used for Y axis values
-     */
-    ChartDataSource<? extends Number> getYValues();
-
-}
diff --git a/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSeries.java b/src/java/org/apache/poi/ss/usermodel/charts/ScatterChartSeries.java
new file mode 100644 (file)
index 0000000..f200cb6
--- /dev/null
@@ -0,0 +1,38 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel.charts;
+
+import org.apache.poi.util.Beta;
+
+/**
+ * Represents scatter charts series.
+ */
+@Beta
+public interface ScatterChartSeries extends ChartSeries {
+
+    /**
+     * @return data source used for X axis values
+     */
+    ChartDataSource<?> getXValues();
+
+    /**
+     * @return data source used for Y axis values
+     */
+    ChartDataSource<? extends Number> getYValues();
+
+}
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSerie.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSerie.java
deleted file mode 100644 (file)
index eb2fb2f..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ====================================================================\r
-   Licensed to the Apache Software Foundation (ASF) under one or more\r
-   contributor license agreements.  See the NOTICE file distributed with\r
-   this work for additional information regarding copyright ownership.\r
-   The ASF licenses this file to You under the Apache License, Version 2.0\r
-   (the "License"); you may not use this file except in compliance with\r
-   the License.  You may obtain a copy of the License at\r
-\r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-   Unless required by applicable law or agreed to in writing, software\r
-   distributed under the License is distributed on an "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-   See the License for the specific language governing permissions and\r
-   limitations under the License.\r
-==================================================================== */\r
-\r
-package org.apache.poi.xssf.usermodel.charts;\r
-\r
-import org.apache.poi.ss.usermodel.charts.ChartSerie;\r
-import org.apache.poi.ss.usermodel.charts.TitleType;\r
-import org.apache.poi.ss.util.CellReference;\r
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx;\r
-\r
-/**\r
- * @author Martin Andersson\r
- */\r
-public abstract class AbstractXSSFChartSerie implements ChartSerie {\r
-\r
-    private String titleValue;\r
-    private CellReference titleRef;\r
-    private TitleType titleType;\r
-\r
-    public void setTitle(CellReference titleReference) {\r
-        titleType = TitleType.CELL_REFERENCE;\r
-        titleRef = titleReference;\r
-    }\r
-\r
-    public void setTitle(String title) {\r
-        titleType = TitleType.STRING;\r
-        titleValue = title;\r
-    }\r
-\r
-    public CellReference getTitleCellReference() {\r
-        if (TitleType.CELL_REFERENCE.equals(titleType)) {\r
-            return titleRef;\r
-        }\r
-        throw new IllegalStateException("Title type is not CellReference.");\r
-    }\r
-\r
-    public String getTitleString() {\r
-        if (TitleType.STRING.equals(titleType)) {\r
-            return titleValue;\r
-        }\r
-        throw new IllegalStateException("Title type is not String.");\r
-    }\r
-\r
-    public TitleType getTitleType() {\r
-        return titleType;\r
-    }\r
-\r
-    protected boolean isTitleSet() {\r
-        return titleType != null;\r
-    }\r
-\r
-    protected CTSerTx getCTSerTx() {\r
-        CTSerTx tx = CTSerTx.Factory.newInstance();\r
-        switch (titleType) {\r
-            case CELL_REFERENCE:\r
-                tx.addNewStrRef().setF(titleRef.formatAsString());\r
-                return tx;\r
-            case STRING:\r
-                tx.setV(titleValue);\r
-                return tx;\r
-            default:\r
-                throw new IllegalStateException("Unkown title type: " + titleType);\r
-        }\r
-    }\r
-}\r
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSeries.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/charts/AbstractXSSFChartSeries.java
new file mode 100644 (file)
index 0000000..09393e5
--- /dev/null
@@ -0,0 +1,79 @@
+/* ====================================================================\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to You under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+==================================================================== */\r
+\r
+package org.apache.poi.xssf.usermodel.charts;\r
+\r
+import org.apache.poi.ss.usermodel.charts.ChartSeries;\r
+import org.apache.poi.ss.usermodel.charts.TitleType;\r
+import org.apache.poi.ss.util.CellReference;\r
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx;\r
+\r
+/**\r
+ * Base of all XSSF Chart Series\r
+ */\r
+public abstract class AbstractXSSFChartSeries implements ChartSeries {\r
+\r
+    private String titleValue;\r
+    private CellReference titleRef;\r
+    private TitleType titleType;\r
+\r
+    public void setTitle(CellReference titleReference) {\r
+        titleType = TitleType.CELL_REFERENCE;\r
+        titleRef = titleReference;\r
+    }\r
+\r
+    public void setTitle(String title) {\r
+        titleType = TitleType.STRING;\r
+        titleValue = title;\r
+    }\r
+\r
+    public CellReference getTitleCellReference() {\r
+        if (TitleType.CELL_REFERENCE.equals(titleType)) {\r
+            return titleRef;\r
+        }\r
+        throw new IllegalStateException("Title type is not CellReference.");\r
+    }\r
+\r
+    public String getTitleString() {\r
+        if (TitleType.STRING.equals(titleType)) {\r
+            return titleValue;\r
+        }\r
+        throw new IllegalStateException("Title type is not String.");\r
+    }\r
+\r
+    public TitleType getTitleType() {\r
+        return titleType;\r
+    }\r
+\r
+    protected boolean isTitleSet() {\r
+        return titleType != null;\r
+    }\r
+\r
+    protected CTSerTx getCTSerTx() {\r
+        CTSerTx tx = CTSerTx.Factory.newInstance();\r
+        switch (titleType) {\r
+            case CELL_REFERENCE:\r
+                tx.addNewStrRef().setF(titleRef.formatAsString());\r
+                return tx;\r
+            case STRING:\r
+                tx.setV(titleValue);\r
+                return tx;\r
+            default:\r
+                throw new IllegalStateException("Unkown title type: " + titleType);\r
+        }\r
+    }\r
+}\r
index 7da2b1e3832a6ecdbb996af6ddbf26ea8e5ab34b..54bba03bb2cd5704567208b854a7212162b8ae24 100644 (file)
 \r
 package org.apache.poi.xssf.usermodel.charts;\r
 \r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
 import org.apache.poi.ss.usermodel.Chart;\r
 import org.apache.poi.ss.usermodel.charts.ChartAxis;\r
 import org.apache.poi.ss.usermodel.charts.ChartDataSource;\r
 import org.apache.poi.ss.usermodel.charts.LineChartData;\r
-import org.apache.poi.ss.usermodel.charts.LineChartSerie;\r
+import org.apache.poi.ss.usermodel.charts.LineChartSeries;\r
 import org.apache.poi.util.Beta;\r
 import org.apache.poi.xssf.usermodel.XSSFChart;\r
-import org.openxmlformats.schemas.drawingml.x2006.chart.*;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource;\r
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTLineChart;\r
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTLineSer;\r
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;\r
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTPlotArea;\r
+import org.openxmlformats.schemas.drawingml.x2006.chart.STMarkerStyle;\r
 \r
 /**\r
- * @author Martin Andersson\r
+ * Holds data for a XSSF Line Chart\r
  */\r
 @Beta\r
 public class XSSFLineChartData implements LineChartData {\r
@@ -38,19 +43,19 @@ public class XSSFLineChartData implements LineChartData {
     /**\r
      * List of all data series.\r
      */\r
-    private List<Serie> series;\r
+    private List<Series> series;\r
 \r
     public XSSFLineChartData() {\r
-        series = new ArrayList<Serie>();\r
+        series = new ArrayList<Series>();\r
     }\r
 \r
-    static class Serie extends AbstractXSSFChartSerie implements LineChartSerie {\r
+    static class Series extends AbstractXSSFChartSeries implements LineChartSeries {\r
         private int id;\r
         private int order;\r
         private ChartDataSource<?> categories;\r
         private ChartDataSource<? extends Number> values;\r
 \r
-        protected Serie(int id, int order,\r
+        protected Series(int id, int order,\r
                         ChartDataSource<?> categories,\r
                         ChartDataSource<? extends Number> values) {\r
             this.id = id;\r
@@ -86,17 +91,17 @@ public class XSSFLineChartData implements LineChartData {
         }\r
     }\r
 \r
-    public LineChartSerie addSerie(ChartDataSource<?> categoryAxisData, ChartDataSource<? extends Number> values) {\r
+    public LineChartSeries addSeries(ChartDataSource<?> categoryAxisData, ChartDataSource<? extends Number> values) {\r
         if (!values.isNumeric()) {\r
             throw new IllegalArgumentException("Value data source must be numeric.");\r
         }\r
         int numOfSeries = series.size();\r
-        Serie newSerie = new Serie(numOfSeries, numOfSeries, categoryAxisData, values);\r
-        series.add(newSerie);\r
-        return newSerie;\r
+        Series newSeries = new Series(numOfSeries, numOfSeries, categoryAxisData, values);\r
+        series.add(newSeries);\r
+        return newSeries;\r
     }\r
 \r
-    public List<? extends LineChartSerie> getSeries() {\r
+    public List<? extends LineChartSeries> getSeries() {\r
         return series;\r
     }\r
 \r
@@ -110,7 +115,7 @@ public class XSSFLineChartData implements LineChartData {
         CTLineChart lineChart = plotArea.addNewLineChart();\r
         lineChart.addNewVaryColors().setVal(false);\r
 \r
-        for (Serie s : series) {\r
+        for (Series s : series) {\r
             s.addToChart(lineChart);\r
         }\r
 \r
index 088e6fc2a7b42804c6fd1dfaee3f3d67487bf24f..f31b35503144bcf131acf3d7424872c2bf5f297d 100644 (file)
 
 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<Serie> series;
+    private List<Series> series;
 
     public XSSFScatterChartData() {
-        series = new ArrayList<Serie>();
+        series = new ArrayList<Series>();
     }
 
     /**
      * 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<? extends Number> ys;
 
-        protected Serie(int id, int order,
+        protected Series(int id, int order,
                         ChartDataSource<?> xs,
                         ChartDataSource<? extends Number> ys) {
             super();
@@ -99,13 +103,13 @@ public class XSSFScatterChartData implements ScatterChartData {
         }
     }
 
-    public ScatterChartSerie addSerie(ChartDataSource<?> xs,
+    public ScatterChartSeries addSerie(ChartDataSource<?> xs,
                                       ChartDataSource<? extends Number> 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<? extends Serie> getSeries() {
+    public List<? extends Series> getSeries() {
         return series;
     }
 
index c4c04b8d940d9a3a6d56493088ad26eb092c26a8..cf7fd78ed3fcbb645384ed4652f47fb47d2c32b0 100644 (file)
@@ -28,13 +28,13 @@ import org.apache.poi.ss.usermodel.charts.ChartAxis;
 import org.apache.poi.ss.usermodel.charts.ChartDataSource;\r
 import org.apache.poi.ss.usermodel.charts.DataSources;\r
 import org.apache.poi.ss.usermodel.charts.LineChartData;\r
-import org.apache.poi.ss.usermodel.charts.LineChartSerie;\r
+import org.apache.poi.ss.usermodel.charts.LineChartSeries;\r
 import org.apache.poi.ss.util.CellRangeAddress;\r
 import org.apache.poi.ss.util.SheetBuilder;\r
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;\r
 \r
 /**\r
- * @author Martin Andersson\r
+ * Tests for XSSF Line Charts\r
  */\r
 public class TestXSSFLineChartData extends TestCase {\r
 \r
@@ -58,7 +58,7 @@ public class TestXSSFLineChartData extends TestCase {
 \r
         ChartDataSource<String> xs = DataSources.fromStringCellRange(sheet, CellRangeAddress.valueOf("A1:J1"));\r
         ChartDataSource<Number> ys = DataSources.fromNumericCellRange(sheet, CellRangeAddress.valueOf("A2:J2"));\r
-        LineChartSerie series = lineChartData.addSerie(xs, ys);\r
+        LineChartSeries series = lineChartData.addSeries(xs, ys);\r
 \r
         assertNotNull(series);\r
         assertEquals(1, lineChartData.getSeries().size());\r
index 2780a51767697cd343fa562c618700c062f0e861..e041e891c6d768f984f0516363ecd4d1b40ce9ca 100644 (file)
@@ -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<String> xs = DataSources.fromStringCellRange(sheet, CellRangeAddress.valueOf("A1:J1"));
         ChartDataSource<Number> 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());