Author: abearez Date: Sat Jan 6 02:51:53 2018 New Revision: 1820369 URL: http://svn.apache.org/viewvc?rev=1820369&view=rev Log: introduce XDDFShapeProperties as user model API (closes #72 from GitHub)
Added: poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/BlackWhiteMode.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/CompoundLine.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/HasShapeProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineCap.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndLength.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndType.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndWidth.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PathShadeType.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PenAlignment.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetColor.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetGeometry.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetLineDash.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetPattern.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/RectangleAlignment.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/SchemeColor.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/SystemColor.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/TileFlipMode.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFAdjustHandlePolar.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFAdjustHandleXY.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColor.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorHsl.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorPreset.java - copied, changed from r1820242, poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLayout.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorRgbBinary.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorRgbPercent.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorSchemeBased.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorSystemDefined.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFConnectionSite.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFCustomGeometry2D.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFDashStop.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFEffectContainer.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFEffectList.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFExtensionList.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFFillProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFGeometryGuide.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFGeometryRectangle.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFGradientFillProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFGradientStop.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFGroupFillProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFLineEndProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFLineJoinBevelProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFLineJoinMiterProperties.java - copied, changed from r1820242, poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLayout.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFLineJoinProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFLineJoinRoundProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFLineProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFLinearShadeProperties.java - copied, changed from r1820242, poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLayout.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFNoFillProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFPath.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFPathShadeProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFPatternFillProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFPictureFillProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFPoint2D.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFPositiveSize2D.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFPresetGeometry2D.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFPresetLineDash.java - copied, changed from r1820242, poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLayout.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFRelativeRectangle.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFScene3D.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFShape3D.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFShapeProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFSolidFillProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFStretchInfoProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFTileInfoProperties.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFTransform2D.java poi/trunk/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestXDDFColor.java Modified: poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBarChartData.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFCategoryAxis.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChart.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartAxis.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartLegend.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDateAxis.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLayout.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLegendEntry.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLineChartData.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFManualLayout.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPieChartData.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFRadarChartData.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFScatterChartData.java poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFValueAxis.java poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTheme.java Modified: poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java?rev=1820369&r1=1820368&r2=1820369&view=diff ============================================================================== --- poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java (original) +++ poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java Sat Jan 6 02:51:53 2018 @@ -55,9 +55,9 @@ public class BarChartDemo { return; } - BufferedReader modelReader = new BufferedReader(new FileReader(args[1])); - XMLSlideShow pptx = null; - try { + try (FileInputStream argIS = new FileInputStream(args[0]); + BufferedReader modelReader = new BufferedReader(new FileReader(args[1]))) { + String chartTitle = modelReader.readLine(); // first line is chart title // Category Axis Data @@ -76,25 +76,18 @@ public class BarChartDemo { String[] categories = listCategories.toArray(new String[listCategories.size()]); Double[] values = listValues.toArray(new Double[listValues.size()]); - pptx = new XMLSlideShow(new FileInputStream(args[0])); - XSLFSlide slide = pptx.getSlides().get(0); - setBarData(findChart(slide), chartTitle, categories, values); - - XSLFChart chart = findChart(pptx.createSlide().importContent(slide)); - setColumnData(chart, "Column variant"); - - // save the result - OutputStream out = new FileOutputStream("bar-chart-demo-output.pptx"); - try { - pptx.write(out); - } finally { - out.close(); - } - } finally { - if (pptx != null) { - pptx.close(); + try (XMLSlideShow pptx = new XMLSlideShow(argIS)) { + XSLFSlide slide = pptx.getSlides().get(0); + setBarData(findChart(slide), chartTitle, categories, values); + + XSLFChart chart = findChart(pptx.createSlide().importContent(slide)); + setColumnData(chart, "Column variant"); + + // save the result + try (OutputStream out = new FileOutputStream("bar-chart-demo-output.pptx")) { + pptx.write(out); + } } - modelReader.close(); } } Modified: poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java?rev=1820369&r1=1820368&r2=1820369&view=diff ============================================================================== --- poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java (original) +++ poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java Sat Jan 6 02:51:53 2018 @@ -52,10 +52,11 @@ public class PieChartDemo { return; } - try (BufferedReader modelReader = new BufferedReader(new FileReader(args[1]))) { + try (FileInputStream argIS = new FileInputStream(args[0]); + BufferedReader modelReader = new BufferedReader(new FileReader(args[1]))) { String chartTitle = modelReader.readLine(); // first line is chart title - try (XMLSlideShow pptx = new XMLSlideShow(new FileInputStream(args[0]))) { + try (XMLSlideShow pptx = new XMLSlideShow(argIS)) { XSLFSlide slide = pptx.getSlides().get(0); // find chart in the slide @@ -70,17 +71,17 @@ public class PieChartDemo { if(chart == null) { throw new IllegalStateException("chart not found in the template"); } - + // Series Text List<XDDFChartData> series = chart.getChartSeries(); XDDFPieChartData pie = (XDDFPieChartData) series.get(0); - + // Category Axis Data List<String> listCategories = new ArrayList<String>(3); - + // Values List<Double> listValues = new ArrayList<Double>(3); - + // set model String ln; while((ln = modelReader.readLine()) != null){ Added: poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java (added) +++ poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,104 @@ +/* ==================================================================== + 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.xssf.usermodel.examples; + +import java.io.FileOutputStream; +import java.io.IOException; + +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.xddf.usermodel.PresetColor; +import org.apache.poi.xddf.usermodel.XDDFColor; +import org.apache.poi.xddf.usermodel.XDDFShapeProperties; +import org.apache.poi.xddf.usermodel.XDDFSolidFillProperties; +import org.apache.poi.xddf.usermodel.chart.AxisCrosses; +import org.apache.poi.xddf.usermodel.chart.AxisPosition; +import org.apache.poi.xddf.usermodel.chart.ChartTypes; +import org.apache.poi.xddf.usermodel.chart.LegendPosition; +import org.apache.poi.xddf.usermodel.chart.XDDFCategoryAxis; +import org.apache.poi.xddf.usermodel.chart.XDDFChartData; +import org.apache.poi.xddf.usermodel.chart.XDDFChartLegend; +import org.apache.poi.xddf.usermodel.chart.XDDFDataSource; +import org.apache.poi.xddf.usermodel.chart.XDDFDataSourcesFactory; +import org.apache.poi.xddf.usermodel.chart.XDDFNumericalDataSource; +import org.apache.poi.xddf.usermodel.chart.XDDFValueAxis; +import org.apache.poi.xssf.usermodel.XSSFChart; +import org.apache.poi.xssf.usermodel.XSSFClientAnchor; +import org.apache.poi.xssf.usermodel.XSSFDrawing; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +/** + * Line chart example. + */ +public class BarChart { + + public static void main(String[] args) throws IOException { + try (XSSFWorkbook wb = new XSSFWorkbook()) { + XSSFSheet sheet = wb.createSheet("barchart"); + final int NUM_OF_ROWS = 3; + final int NUM_OF_COLUMNS = 10; + + // Create a row and put some cells in it. Rows are 0 based. + Row row; + Cell cell; + for (int rowIndex = 0; rowIndex < NUM_OF_ROWS; rowIndex++) { + row = sheet.createRow((short) rowIndex); + for (int colIndex = 0; colIndex < NUM_OF_COLUMNS; colIndex++) { + cell = row.createCell((short) colIndex); + cell.setCellValue(colIndex * (rowIndex + 1)); + } + } + + XSSFDrawing drawing = sheet.createDrawingPatriarch(); + XSSFClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 5, 10, 15); + + XSSFChart chart = drawing.createChart(anchor); + XDDFChartLegend legend = chart.getOrAddLegend(); + legend.setPosition(LegendPosition.TOP_RIGHT); + + // Use a category axis for the bottom axis. + XDDFCategoryAxis bottomAxis = chart.createCategoryAxis(AxisPosition.BOTTOM); + XDDFValueAxis leftAxis = chart.createValueAxis(AxisPosition.LEFT); + leftAxis.setCrosses(AxisCrosses.AUTO_ZERO); + + XDDFDataSource<Double> xs = XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1)); + XDDFNumericalDataSource<Double> ys1 = XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(1, 1, 0, NUM_OF_COLUMNS - 1)); + XDDFNumericalDataSource<Double> ys2 = XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(2, 2, 0, NUM_OF_COLUMNS - 1)); + + XDDFChartData data = chart.createData(ChartTypes.BAR, bottomAxis, leftAxis); + data.addSeries(xs, ys1); + data.addSeries(xs, ys2); + chart.plot(data); + + XDDFSolidFillProperties fill = new XDDFSolidFillProperties(XDDFColor.from(PresetColor.CHARTREUSE)); + XDDFChartData.Series firstSeries = data.getSeries().get(0); + XDDFShapeProperties properties = firstSeries.getShapeProperties(); + if (properties == null) { + properties = new XDDFShapeProperties(); + } + properties.setFillProperties(fill); + firstSeries.setShapeProperties(properties); + + // Write the output to a file + try (FileOutputStream fileOut = new FileOutputStream("ooxml-bar-chart.xlsx")) { + wb.write(fileOut); + } + } + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/BlackWhiteMode.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/BlackWhiteMode.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/BlackWhiteMode.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/BlackWhiteMode.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,46 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STBlackWhiteMode; + +public enum BlackWhiteMode { + AUTO(STBlackWhiteMode.AUTO), + BLACK(STBlackWhiteMode.BLACK), + BLACK_GRAY(STBlackWhiteMode.BLACK_GRAY), + BLACK_WHITE(STBlackWhiteMode.BLACK_WHITE); + + final STBlackWhiteMode.Enum underlying; + + BlackWhiteMode(STBlackWhiteMode.Enum mode) { + this.underlying = mode; + } + + private final static HashMap<STBlackWhiteMode.Enum, BlackWhiteMode> reverse = new HashMap<STBlackWhiteMode.Enum, BlackWhiteMode>(); + static { + for (BlackWhiteMode value : values()) { + reverse.put(value.underlying, value); + } + } + + static BlackWhiteMode valueOf(STBlackWhiteMode.Enum mode) { + return reverse.get(mode); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/CompoundLine.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/CompoundLine.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/CompoundLine.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/CompoundLine.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,47 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STCompoundLine; + +public enum CompoundLine { + DOUBLE(STCompoundLine.DBL), + SINGLE(STCompoundLine.SNG), + THICK_THIN(STCompoundLine.THICK_THIN), + THIN_THICK(STCompoundLine.THIN_THICK), + TRIPLE(STCompoundLine.TRI); + + final STCompoundLine.Enum underlying; + + CompoundLine(STCompoundLine.Enum line) { + this.underlying = line; + } + + private final static HashMap<STCompoundLine.Enum, CompoundLine> reverse = new HashMap<STCompoundLine.Enum, CompoundLine>(); + static { + for (CompoundLine value : values()) { + reverse.put(value.underlying, value); + } + } + + static CompoundLine valueOf(STCompoundLine.Enum LineEndWidth) { + return reverse.get(LineEndWidth); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/HasShapeProperties.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/HasShapeProperties.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/HasShapeProperties.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/HasShapeProperties.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,22 @@ +/* ==================================================================== + 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.xddf.usermodel; + +public interface HasShapeProperties { + XDDFShapeProperties getOrAddShapeProperties(); +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineCap.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineCap.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineCap.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineCap.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,45 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STLineCap; + +public enum LineCap { + FLAT(STLineCap.FLAT), + ROUND(STLineCap.RND), + SQUARE(STLineCap.SQ); + + final STLineCap.Enum underlying; + + LineCap(STLineCap.Enum line) { + this.underlying = line; + } + + private final static HashMap<STLineCap.Enum, LineCap> reverse = new HashMap<STLineCap.Enum, LineCap>(); + static { + for (LineCap value : values()) { + reverse.put(value.underlying, value); + } + } + + static LineCap valueOf(STLineCap.Enum LineEndWidth) { + return reverse.get(LineEndWidth); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndLength.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndLength.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndLength.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndLength.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,45 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STLineEndLength; + +public enum LineEndLength { + LARGE(STLineEndLength.LG), + MEDIUM(STLineEndLength.MED), + SMALL(STLineEndLength.SM); + + final STLineEndLength.Enum underlying; + + LineEndLength(STLineEndLength.Enum lineEnd) { + this.underlying = lineEnd; + } + + private final static HashMap<STLineEndLength.Enum, LineEndLength> reverse = new HashMap<STLineEndLength.Enum, LineEndLength>(); + static { + for (LineEndLength value : values()) { + reverse.put(value.underlying, value); + } + } + + static LineEndLength valueOf(STLineEndLength.Enum LineEndWidth) { + return reverse.get(LineEndWidth); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndType.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndType.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndType.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndType.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,48 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STLineEndType; + +public enum LineEndType { + ARROW(STLineEndType.ARROW), + DIAMOND(STLineEndType.DIAMOND), + NONE(STLineEndType.NONE), + OVAL(STLineEndType.OVAL), + STEALTH(STLineEndType.STEALTH), + TRIANGLE(STLineEndType.TRIANGLE); + + final STLineEndType.Enum underlying; + + LineEndType(STLineEndType.Enum lineEnd) { + this.underlying = lineEnd; + } + + private final static HashMap<STLineEndType.Enum, LineEndType> reverse = new HashMap<STLineEndType.Enum, LineEndType>(); + static { + for (LineEndType value : values()) { + reverse.put(value.underlying, value); + } + } + + static LineEndType valueOf(STLineEndType.Enum LineEndWidth) { + return reverse.get(LineEndWidth); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndWidth.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndWidth.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndWidth.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/LineEndWidth.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,45 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STLineEndWidth; + +public enum LineEndWidth { + LARGE(STLineEndWidth.LG), + MEDIUM(STLineEndWidth.MED), + SMALL(STLineEndWidth.SM); + + final STLineEndWidth.Enum underlying; + + LineEndWidth(STLineEndWidth.Enum lineEnd) { + this.underlying = lineEnd; + } + + private final static HashMap<STLineEndWidth.Enum, LineEndWidth> reverse = new HashMap<STLineEndWidth.Enum, LineEndWidth>(); + static { + for (LineEndWidth value : values()) { + reverse.put(value.underlying, value); + } + } + + static LineEndWidth valueOf(STLineEndWidth.Enum LineEndWidth) { + return reverse.get(LineEndWidth); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PathShadeType.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PathShadeType.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PathShadeType.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PathShadeType.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,45 @@ +/* ==================================================================== +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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STPathShadeType; + +public enum PathShadeType { + CIRCLE(STPathShadeType.CIRCLE), + RECTANGLE(STPathShadeType.RECT), + SHAPE(STPathShadeType.SHAPE); + + final STPathShadeType.Enum underlying; + + PathShadeType(STPathShadeType.Enum pathShadeType) { + this.underlying = pathShadeType; + } + + private final static HashMap<STPathShadeType.Enum, PathShadeType> reverse = new HashMap<STPathShadeType.Enum, PathShadeType>(); + static { + for (PathShadeType value : values()) { + reverse.put(value.underlying, value); + } + } + + static PathShadeType valueOf(STPathShadeType.Enum pathShadeType) { + return reverse.get(pathShadeType); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PenAlignment.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PenAlignment.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PenAlignment.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PenAlignment.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,44 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STPenAlignment; + +public enum PenAlignment { + CENTER(STPenAlignment.CTR), + IN(STPenAlignment.IN); + + final STPenAlignment.Enum underlying; + + PenAlignment(STPenAlignment.Enum alignment) { + this.underlying = alignment; + } + + private final static HashMap<STPenAlignment.Enum, PenAlignment> reverse = new HashMap<STPenAlignment.Enum, PenAlignment>(); + static { + for (PenAlignment value : values()) { + reverse.put(value.underlying, value); + } + } + + static PenAlignment valueOf(STPenAlignment.Enum LineEndWidth) { + return reverse.get(LineEndWidth); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetColor.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetColor.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetColor.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetColor.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,180 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STPresetColorVal; + +public enum PresetColor { + ALICE_BLUE(STPresetColorVal.ALICE_BLUE), + ANTIQUE_WHITE(STPresetColorVal.ANTIQUE_WHITE), + AQUA(STPresetColorVal.AQUA), + AQUAMARINE(STPresetColorVal.AQUAMARINE), + AZURE(STPresetColorVal.AZURE), + BEIGE(STPresetColorVal.BEIGE), + BISQUE(STPresetColorVal.BISQUE), + BLACK(STPresetColorVal.BLACK), + BLANCHED_ALMOND(STPresetColorVal.BLANCHED_ALMOND), + BLUE(STPresetColorVal.BLUE), + BLUE_VIOLET(STPresetColorVal.BLUE_VIOLET), + CADET_BLUE(STPresetColorVal.CADET_BLUE), + CHARTREUSE(STPresetColorVal.CHARTREUSE), + CHOCOLATE(STPresetColorVal.CHOCOLATE), + CORAL(STPresetColorVal.CORAL), + CORNFLOWER_BLUE(STPresetColorVal.CORNFLOWER_BLUE), + CORNSILK(STPresetColorVal.CORNSILK), + CRIMSON(STPresetColorVal.CRIMSON), + CYAN(STPresetColorVal.CYAN), + DEEP_PINK(STPresetColorVal.DEEP_PINK), + DEEP_SKY_BLUE(STPresetColorVal.DEEP_SKY_BLUE), + DIM_GRAY(STPresetColorVal.DIM_GRAY), + DARK_BLUE(STPresetColorVal.DK_BLUE), + DARK_CYAN(STPresetColorVal.DK_CYAN), + DARK_GOLDENROD(STPresetColorVal.DK_GOLDENROD), + DARK_GRAY(STPresetColorVal.DK_GRAY), + DARK_GREEN(STPresetColorVal.DK_GREEN), + DARK_KHAKI(STPresetColorVal.DK_KHAKI), + DARK_MAGENTA(STPresetColorVal.DK_MAGENTA), + DARK_OLIVE_GREEN(STPresetColorVal.DK_OLIVE_GREEN), + DARK_ORANGE(STPresetColorVal.DK_ORANGE), + DARK_ORCHID(STPresetColorVal.DK_ORCHID), + DARK_RED(STPresetColorVal.DK_RED), + DARK_SALMON(STPresetColorVal.DK_SALMON), + DARK_SEA_GREEN(STPresetColorVal.DK_SEA_GREEN), + DARK_SLATE_BLUE(STPresetColorVal.DK_SLATE_BLUE), + DARK_SLATE_GRAY(STPresetColorVal.DK_SLATE_GRAY), + DARK_TURQUOISE(STPresetColorVal.DK_TURQUOISE), + DARK_VIOLET(STPresetColorVal.DK_VIOLET), + DODGER_BLUE(STPresetColorVal.DODGER_BLUE), + FIREBRICK(STPresetColorVal.FIREBRICK), + FLORAL_WHITE(STPresetColorVal.FLORAL_WHITE), + FOREST_GREEN(STPresetColorVal.FOREST_GREEN), + FUCHSIA(STPresetColorVal.FUCHSIA), + GAINSBORO(STPresetColorVal.GAINSBORO), + GHOST_WHITE(STPresetColorVal.GHOST_WHITE), + GOLD(STPresetColorVal.GOLD), + GOLDENROD(STPresetColorVal.GOLDENROD), + GRAY(STPresetColorVal.GRAY), + GREEN(STPresetColorVal.GREEN), + GREEN_YELLOW(STPresetColorVal.GREEN_YELLOW), + HONEYDEW(STPresetColorVal.HONEYDEW), + HOT_PINK(STPresetColorVal.HOT_PINK), + INDIAN_RED(STPresetColorVal.INDIAN_RED), + INDIGO(STPresetColorVal.INDIGO), + IVORY(STPresetColorVal.IVORY), + KHAKI(STPresetColorVal.KHAKI), + LAVENDER(STPresetColorVal.LAVENDER), + LAVENDER_BLUSH(STPresetColorVal.LAVENDER_BLUSH), + LAWN_GREEN(STPresetColorVal.LAWN_GREEN), + LEMON_CHIFFON(STPresetColorVal.LEMON_CHIFFON), + LIME(STPresetColorVal.LIME), + LIME_GREEN(STPresetColorVal.LIME_GREEN), + LINEN(STPresetColorVal.LINEN), + LIGHT_BLUE(STPresetColorVal.LT_BLUE), + LIGHT_CORAL(STPresetColorVal.LT_CORAL), + LIGHT_CYAN(STPresetColorVal.LT_CYAN), + LIGHT_GOLDENROD_YELLOW(STPresetColorVal.LT_GOLDENROD_YELLOW), + LIGHT_GRAY(STPresetColorVal.LT_GRAY), + LIGHT_GREEN(STPresetColorVal.LT_GREEN), + LIGHT_PINK(STPresetColorVal.LT_PINK), + LIGHT_SALMON(STPresetColorVal.LT_SALMON), + LIGHT_SEA_GREEN(STPresetColorVal.LT_SEA_GREEN), + LIGHT_SKY_BLUE(STPresetColorVal.LT_SKY_BLUE), + LIGHT_SLATE_GRAY(STPresetColorVal.LT_SLATE_GRAY), + LIGHT_STEEL_BLUE(STPresetColorVal.LT_STEEL_BLUE), + LIGHT_YELLOW(STPresetColorVal.LT_YELLOW), + MAGENTA(STPresetColorVal.MAGENTA), + MAROON(STPresetColorVal.MAROON), + MEDIUM_AQUAMARINE(STPresetColorVal.MED_AQUAMARINE), + MEDIUM_BLUE(STPresetColorVal.MED_BLUE), + MEDIUM_ORCHID(STPresetColorVal.MED_ORCHID), + MEDIUM_PURPLE(STPresetColorVal.MED_PURPLE), + MEDIUM_SEA_GREEN(STPresetColorVal.MED_SEA_GREEN), + MEDIUM_SLATE_BLUE(STPresetColorVal.MED_SLATE_BLUE), + MEDIUM_SPRING_GREEN(STPresetColorVal.MED_SPRING_GREEN), + MEDIUM_TURQUOISE(STPresetColorVal.MED_TURQUOISE), + MEDIUM_VIOLET_RED(STPresetColorVal.MED_VIOLET_RED), + MIDNIGHT_BLUE(STPresetColorVal.MIDNIGHT_BLUE), + MINT_CREAM(STPresetColorVal.MINT_CREAM), + MISTY_ROSE(STPresetColorVal.MISTY_ROSE), + MOCCASIN(STPresetColorVal.MOCCASIN), + NAVAJO_WHITE(STPresetColorVal.NAVAJO_WHITE), + NAVY(STPresetColorVal.NAVY), + OLD_LACE(STPresetColorVal.OLD_LACE), + OLIVE(STPresetColorVal.OLIVE), + OLIVE_DRAB(STPresetColorVal.OLIVE_DRAB), + ORANGE(STPresetColorVal.ORANGE), + ORANGE_RED(STPresetColorVal.ORANGE_RED), + ORCHID(STPresetColorVal.ORCHID), + PALE_GOLDENROD(STPresetColorVal.PALE_GOLDENROD), + PALE_GREEN(STPresetColorVal.PALE_GREEN), + PALE_TURQUOISE(STPresetColorVal.PALE_TURQUOISE), + PALE_VIOLET_RED(STPresetColorVal.PALE_VIOLET_RED), + PAPAYA_WHIP(STPresetColorVal.PAPAYA_WHIP), + PEACH_PUFF(STPresetColorVal.PEACH_PUFF), + PERU(STPresetColorVal.PERU), + PINK(STPresetColorVal.PINK), + PLUM(STPresetColorVal.PLUM), + POWDER_BLUE(STPresetColorVal.POWDER_BLUE), + PURPLE(STPresetColorVal.PURPLE), + RED(STPresetColorVal.RED), + ROSY_BROWN(STPresetColorVal.ROSY_BROWN), + ROYAL_BLUE(STPresetColorVal.ROYAL_BLUE), + SADDLE_BROWN(STPresetColorVal.SADDLE_BROWN), + SALMON(STPresetColorVal.SALMON), + SANDY_BROWN(STPresetColorVal.SANDY_BROWN), + SEA_GREEN(STPresetColorVal.SEA_GREEN), + SEA_SHELL(STPresetColorVal.SEA_SHELL), + SIENNA(STPresetColorVal.SIENNA), + SILVER(STPresetColorVal.SILVER), + SKY_BLUE(STPresetColorVal.SKY_BLUE), + SLATE_BLUE(STPresetColorVal.SLATE_BLUE), + SLATE_GRAY(STPresetColorVal.SLATE_GRAY), + SNOW(STPresetColorVal.SNOW), + SPRING_GREEN(STPresetColorVal.SPRING_GREEN), + STEEL_BLUE(STPresetColorVal.STEEL_BLUE), + TAN(STPresetColorVal.TAN), + TEAL(STPresetColorVal.TEAL), + THISTLE(STPresetColorVal.THISTLE), + TOMATO(STPresetColorVal.TOMATO), + TURQUOISE(STPresetColorVal.TURQUOISE), + VIOLET(STPresetColorVal.VIOLET), + WHEAT(STPresetColorVal.WHEAT), + WHITE(STPresetColorVal.WHITE), + WHITE_SMOKE(STPresetColorVal.WHITE_SMOKE), + YELLOW(STPresetColorVal.YELLOW), + YELLOW_GREEN(STPresetColorVal.YELLOW_GREEN); + + final STPresetColorVal.Enum underlying; + + PresetColor(STPresetColorVal.Enum color) { + this.underlying = color; + } + + private final static HashMap<STPresetColorVal.Enum, PresetColor> reverse = new HashMap<STPresetColorVal.Enum, PresetColor>(); + static { + for (PresetColor value : values()) { + reverse.put(value.underlying, value); + } + } + + static PresetColor valueOf(STPresetColorVal.Enum color) { + return reverse.get(color); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetGeometry.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetGeometry.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetGeometry.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetGeometry.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,230 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STShapeType; + +public enum PresetGeometry { + ACCENT_BORDER_CALLOUT_1(STShapeType.ACCENT_BORDER_CALLOUT_1), + ACCENT_BORDER_CALLOUT_2(STShapeType.ACCENT_BORDER_CALLOUT_2), + ACCENT_BORDER_CALLOUT_3(STShapeType.ACCENT_BORDER_CALLOUT_3), + ACCENT_CALLOUT_1(STShapeType.ACCENT_CALLOUT_1), + ACCENT_CALLOUT_2(STShapeType.ACCENT_CALLOUT_2), + ACCENT_CALLOUT_3(STShapeType.ACCENT_CALLOUT_3), + ACTION_BUTTON_BACK_PREVIOUS(STShapeType.ACTION_BUTTON_BACK_PREVIOUS), + ACTION_BUTTON_BEGINNING(STShapeType.ACTION_BUTTON_BEGINNING), + ACTION_BUTTON_BLANK(STShapeType.ACTION_BUTTON_BLANK), + ACTION_BUTTON_DOCUMENT(STShapeType.ACTION_BUTTON_DOCUMENT), + ACTION_BUTTON_END(STShapeType.ACTION_BUTTON_END), + ACTION_BUTTON_FORWARD_NEXT(STShapeType.ACTION_BUTTON_FORWARD_NEXT), + ACTION_BUTTON_HELP(STShapeType.ACTION_BUTTON_HELP), + ACTION_BUTTON_HOME(STShapeType.ACTION_BUTTON_HOME), + ACTION_BUTTON_INFORMATION(STShapeType.ACTION_BUTTON_INFORMATION), + ACTION_BUTTON_MOVIE(STShapeType.ACTION_BUTTON_MOVIE), + ACTION_BUTTON_RETURN(STShapeType.ACTION_BUTTON_RETURN), + ACTION_BUTTON_SOUND(STShapeType.ACTION_BUTTON_SOUND), + ARC(STShapeType.ARC), + BENT_ARROW(STShapeType.BENT_ARROW), + BENT_CONNECTOR_2(STShapeType.BENT_CONNECTOR_2), + BENT_CONNECTOR_3(STShapeType.BENT_CONNECTOR_3), + DARK_BLUE(STShapeType.BENT_CONNECTOR_4), + BENT_CONNECTOR_4(STShapeType.BENT_CONNECTOR_4), + BENT_CONNECTOR_5(STShapeType.BENT_CONNECTOR_5), + BENT_UP_ARROW(STShapeType.BENT_UP_ARROW), + BEVEL(STShapeType.BEVEL), + BLOCK_ARC(STShapeType.BLOCK_ARC), + BORDER_CALLOUT_1(STShapeType.BORDER_CALLOUT_1), + BORDER_CALLOUT_2(STShapeType.BORDER_CALLOUT_2), + BORDER_CALLOUT_3(STShapeType.BORDER_CALLOUT_3), + BRACE_PAIR(STShapeType.BRACE_PAIR), + BRACKET_PAIR(STShapeType.BRACKET_PAIR), + CALLOUT_1(STShapeType.CALLOUT_1), + CALLOUT_2(STShapeType.CALLOUT_2), + CALLOUT_3(STShapeType.CALLOUT_3), + CAN(STShapeType.CAN), + CHART_PLUS(STShapeType.CHART_PLUS), + CHART_STAR(STShapeType.CHART_STAR), + CHART_X(STShapeType.CHART_X), + CHEVRON(STShapeType.CHEVRON), + CHORD(STShapeType.CHORD), + CIRCULAR_ARROW(STShapeType.CIRCULAR_ARROW), + CLOUD(STShapeType.CLOUD), + CLOUD_CALLOUT(STShapeType.CLOUD_CALLOUT), + CORNER(STShapeType.CORNER), + CORNER_TABS(STShapeType.CORNER_TABS), + CUBE(STShapeType.CUBE), + CURVED_CONNECTOR_2(STShapeType.CURVED_CONNECTOR_2), + CURVED_CONNECTOR_3(STShapeType.CURVED_CONNECTOR_3), + CURVED_CONNECTOR_4(STShapeType.CURVED_CONNECTOR_4), + CURVED_CONNECTOR_5(STShapeType.CURVED_CONNECTOR_5), + CURVED_DOWN_ARROW(STShapeType.CURVED_DOWN_ARROW), + CURVED_LEFT_ARROW(STShapeType.CURVED_LEFT_ARROW), + CURVED_RIGHT_ARROW(STShapeType.CURVED_RIGHT_ARROW), + CURVED_UP_ARROW(STShapeType.CURVED_UP_ARROW), + DECAGON(STShapeType.DECAGON), + DIAGONAL_STRIPE(STShapeType.DIAG_STRIPE), + DIAMOND(STShapeType.DIAMOND), + DODECAGON(STShapeType.DODECAGON), + DONUT(STShapeType.DONUT), + DOUBLE_WAVE(STShapeType.DOUBLE_WAVE), + DOWN_ARROW(STShapeType.DOWN_ARROW), + DOWN_ARROW_CALLOUT(STShapeType.DOWN_ARROW_CALLOUT), + ELLIPSE(STShapeType.ELLIPSE), + ELLIPSE_RIBBON(STShapeType.ELLIPSE_RIBBON), + ELLIPSE_RIBBON_2(STShapeType.ELLIPSE_RIBBON_2), + FLOW_CHART_ALTERNATE_PROCESS(STShapeType.FLOW_CHART_ALTERNATE_PROCESS), + FLOW_CHART_COLLATE(STShapeType.FLOW_CHART_COLLATE), + FLOW_CHART_CONNECTOR(STShapeType.FLOW_CHART_CONNECTOR), + FLOW_CHART_DECISION(STShapeType.FLOW_CHART_DECISION), + FLOW_CHART_DELAY(STShapeType.FLOW_CHART_DELAY), + FLOW_CHART_DISPLAY(STShapeType.FLOW_CHART_DISPLAY), + FLOW_CHART_DOCUMENT(STShapeType.FLOW_CHART_DOCUMENT), + FLOW_CHART_EXTRACT(STShapeType.FLOW_CHART_EXTRACT), + FLOW_CHART_INPUT_OUTPUT(STShapeType.FLOW_CHART_INPUT_OUTPUT), + FLOW_CHART_INTERNAL_STORAGE(STShapeType.FLOW_CHART_INTERNAL_STORAGE), + FLOW_CHART_MAGNETIC_DISK(STShapeType.FLOW_CHART_MAGNETIC_DISK), + FLOW_CHART_MAGNETIC_DRUM(STShapeType.FLOW_CHART_MAGNETIC_DRUM), + FLOW_CHART_MAGNETIC_TAPE(STShapeType.FLOW_CHART_MAGNETIC_TAPE), + FLOW_CHART_MANUAL_INPUT(STShapeType.FLOW_CHART_MANUAL_INPUT), + FLOW_CHART_MANUAL_OPERATION(STShapeType.FLOW_CHART_MANUAL_OPERATION), + FLOW_CHART_MERGE(STShapeType.FLOW_CHART_MERGE), + FLOW_CHART_MULTIDOCUMENT(STShapeType.FLOW_CHART_MULTIDOCUMENT), + FLOW_CHART_OFFLINE_STORAGE(STShapeType.FLOW_CHART_OFFLINE_STORAGE), + FLOW_CHART_OFFPAGE_CONNECTOR(STShapeType.FLOW_CHART_OFFPAGE_CONNECTOR), + FLOW_CHART_ONLINE_STORAGE(STShapeType.FLOW_CHART_ONLINE_STORAGE), + FLOW_CHART_OR(STShapeType.FLOW_CHART_OR), + FLOW_CHART_PREDEFINED_PROCESS(STShapeType.FLOW_CHART_PREDEFINED_PROCESS), + FLOW_CHART_PREPARATION(STShapeType.FLOW_CHART_PREPARATION), + FLOW_CHART_PROCESS(STShapeType.FLOW_CHART_PROCESS), + FLOW_CHART_PUNCHED_CARD(STShapeType.FLOW_CHART_PUNCHED_CARD), + FLOW_CHART_PUNCHED_TAPE(STShapeType.FLOW_CHART_PUNCHED_TAPE), + FLOW_CHART_SORT(STShapeType.FLOW_CHART_SORT), + FLOW_CHART_SUMMING_JUNCTION(STShapeType.FLOW_CHART_SUMMING_JUNCTION), + FLOW_CHART_TERMINATOR(STShapeType.FLOW_CHART_TERMINATOR), + FOLDED_CORNER(STShapeType.FOLDED_CORNER), + FRAME(STShapeType.FRAME), + FUNNEL(STShapeType.FUNNEL), + GEAR_6(STShapeType.GEAR_6), + GEAR_9(STShapeType.GEAR_9), + HALF_FRAME(STShapeType.HALF_FRAME), + HEART(STShapeType.HEART), + HEPTAGON(STShapeType.HEPTAGON), + HEXAGON(STShapeType.HEXAGON), + HOME_PLATE(STShapeType.HOME_PLATE), + HORIZONTAL_SCROLL(STShapeType.HORIZONTAL_SCROLL), + IRREGULAR_SEAL_1(STShapeType.IRREGULAR_SEAL_1), + IRREGULAR_SEAL_2(STShapeType.IRREGULAR_SEAL_2), + LEFT_ARROW(STShapeType.LEFT_ARROW), + LEFT_ARROW_CALLOUT(STShapeType.LEFT_ARROW_CALLOUT), + LEFT_BRACE(STShapeType.LEFT_BRACE), + LEFT_BRACKET(STShapeType.LEFT_BRACKET), + LEFT_CIRCULAR_ARROW(STShapeType.LEFT_CIRCULAR_ARROW), + LEFT_RIGHT_ARROW(STShapeType.LEFT_RIGHT_ARROW), + LEFT_RIGHT_ARROW_CALLOUT(STShapeType.LEFT_RIGHT_ARROW_CALLOUT), + LEFT_RIGHT_CIRCULAR_ARROW(STShapeType.LEFT_RIGHT_CIRCULAR_ARROW), + LEFT_RIGHT_RIBBON(STShapeType.LEFT_RIGHT_RIBBON), + LEFT_RIGHT_UP_ARROW(STShapeType.LEFT_RIGHT_UP_ARROW), + LEFT_UP_ARROW(STShapeType.LEFT_UP_ARROW), + LIGHTNING_BOLT(STShapeType.LIGHTNING_BOLT), + LINE(STShapeType.LINE), + LINE_INVERTED(STShapeType.LINE_INV), + MATH_DIVIDE(STShapeType.MATH_DIVIDE), + MATH_EQUAL(STShapeType.MATH_EQUAL), + MATH_MINUS(STShapeType.MATH_MINUS), + MATH_MULTIPLY(STShapeType.MATH_MULTIPLY), + MATH_NOT_EQUAL(STShapeType.MATH_NOT_EQUAL), + MATH_PLUS(STShapeType.MATH_PLUS), + MOON(STShapeType.MOON), + NO_SMOKING(STShapeType.NO_SMOKING), + NON_ISOSCELES_TRAPEZOID(STShapeType.NON_ISOSCELES_TRAPEZOID), + NOTCHED_RIGHT_ARROW(STShapeType.NOTCHED_RIGHT_ARROW), + OCTAGON(STShapeType.OCTAGON), + PARALLELOGRAM(STShapeType.PARALLELOGRAM), + PENTAGON(STShapeType.PENTAGON), + PIE(STShapeType.PIE), + PIE_WEDGE(STShapeType.PIE_WEDGE), + PLAQUE(STShapeType.PLAQUE), + PLAQUE_TABS(STShapeType.PLAQUE_TABS), + PLUS(STShapeType.PLUS), + QUAD_ARROW(STShapeType.QUAD_ARROW), + QUAD_ARROW_CALLOUT(STShapeType.QUAD_ARROW_CALLOUT), + RECTANGLE(STShapeType.RECT), + RIBBON(STShapeType.RIBBON), + RIBBON_2(STShapeType.RIBBON_2), + RIGHT_ARROW(STShapeType.RIGHT_ARROW), + RIGHT_ARROW_CALLOUT(STShapeType.RIGHT_ARROW_CALLOUT), + RIGHT_BRACE(STShapeType.RIGHT_BRACE), + RIGHT_BRACKET(STShapeType.RIGHT_BRACKET), + ROUND_RECTANGLE_1_CORNER(STShapeType.ROUND_1_RECT), + ROUND_RECTANGLE_2_DIAGONAL_CORNERS(STShapeType.ROUND_2_DIAG_RECT), + ROUND_RECTANGLE_2_SAME_SIDE_CORNERS(STShapeType.ROUND_2_SAME_RECT), + ROUND_RECTANGLE(STShapeType.ROUND_RECT), + RIGHT_TRIANGLE(STShapeType.RT_TRIANGLE), + SMILEY_FACE(STShapeType.SMILEY_FACE), + SNIP_RECTANGLE_1_CORNER(STShapeType.SNIP_1_RECT), + SNIP_RECTANGLE_2_DIAGONAL_CORNERS(STShapeType.SNIP_2_DIAG_RECT), + SNIP_RECTANGLE_2_SAME_SIDE_CORNERS(STShapeType.SNIP_2_SAME_RECT), + SNIP_ROUND_RECTANGLE(STShapeType.SNIP_ROUND_RECT), + SQUARE_TABS(STShapeType.SQUARE_TABS), + STAR_10(STShapeType.STAR_10), + STAR_12(STShapeType.STAR_12), + STAR_16(STShapeType.STAR_16), + STAR_24(STShapeType.STAR_24), + STAR_32(STShapeType.STAR_32), + STAR_4(STShapeType.STAR_4), + STAR_5(STShapeType.STAR_5), + STAR_6(STShapeType.STAR_6), + STAR_7(STShapeType.STAR_7), + STAR_8(STShapeType.STAR_8), + STRAIGHT_CONNECTOR(STShapeType.STRAIGHT_CONNECTOR_1), + STRIPED_RIGHT_ARROW(STShapeType.STRIPED_RIGHT_ARROW), + SUN(STShapeType.SUN), + SWOOSH_ARROW(STShapeType.SWOOSH_ARROW), + TEARDROP(STShapeType.TEARDROP), + TRAPEZOID(STShapeType.TRAPEZOID), + TRIANGLE(STShapeType.TRIANGLE), + UP_ARROW(STShapeType.UP_ARROW), + UP_ARROW_CALLOUT(STShapeType.UP_ARROW_CALLOUT), + UP_DOWN_ARROW(STShapeType.UP_DOWN_ARROW), + UP_DOWN_ARROW_CALLOUT(STShapeType.UP_DOWN_ARROW_CALLOUT), + UTURN_ARROW(STShapeType.UTURN_ARROW), + VERTICAL_SCROLL(STShapeType.VERTICAL_SCROLL), + WAVE(STShapeType.WAVE), + WEDGE_ELLIPSE_CALLOUT(STShapeType.WEDGE_ELLIPSE_CALLOUT), + WEDGE_RECTANGLE_CALLOUT(STShapeType.WEDGE_RECT_CALLOUT), + WEDGE_ROUND_RECTANGLE_CALLOUT(STShapeType.WEDGE_ROUND_RECT_CALLOUT); + + final STShapeType.Enum underlying; + + PresetGeometry(STShapeType.Enum shape) { + this.underlying = shape; + } + + private final static HashMap<STShapeType.Enum, PresetGeometry> reverse = new HashMap<STShapeType.Enum, PresetGeometry>(); + static { + for (PresetGeometry value : values()) { + reverse.put(value.underlying, value); + } + } + + static PresetGeometry valueOf(STShapeType.Enum shape) { + return reverse.get(shape); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetLineDash.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetLineDash.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetLineDash.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetLineDash.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,53 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STPresetLineDashVal; + +public enum PresetLineDash { + DASH(STPresetLineDashVal.DASH), + DASH_DOT(STPresetLineDashVal.DASH_DOT), + DOT(STPresetLineDashVal.DOT), + LARGE_DASH(STPresetLineDashVal.LG_DASH), + LARGE_DASH_DOT(STPresetLineDashVal.LG_DASH_DOT), + LARGE_DASH_DOT_DOT(STPresetLineDashVal.LG_DASH_DOT_DOT), + SOLID(STPresetLineDashVal.SOLID), + SYSTEM_DASH(STPresetLineDashVal.SYS_DASH), + SYSTEM_DASH_DOT(STPresetLineDashVal.SYS_DASH_DOT), + SYSTEM_DASH_DOT_DOT(STPresetLineDashVal.SYS_DASH_DOT_DOT), + SYSTEM_DOT(STPresetLineDashVal.SYS_DOT); + + final STPresetLineDashVal.Enum underlying; + + PresetLineDash(STPresetLineDashVal.Enum dash) { + this.underlying = dash; + } + + private final static HashMap<STPresetLineDashVal.Enum, PresetLineDash> reverse = new HashMap<STPresetLineDashVal.Enum, PresetLineDash>(); + static { + for (PresetLineDash value : values()) { + reverse.put(value.underlying, value); + } + } + + static PresetLineDash valueOf(STPresetLineDashVal.Enum dash) { + return reverse.get(dash); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetPattern.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetPattern.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetPattern.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/PresetPattern.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,96 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STPresetPatternVal; + +public enum PresetPattern { + CROSS(STPresetPatternVal.CROSS), + DASH_DOWNWARD_DIAGONAL(STPresetPatternVal.DASH_DN_DIAG), + DASH_HORIZONTAL(STPresetPatternVal.DASH_HORZ), + DASH_UPWARD_DIAGONAL(STPresetPatternVal.DASH_UP_DIAG), + DASH_VERTICAL(STPresetPatternVal.DASH_VERT), + DIAGONAL_BRICK(STPresetPatternVal.DIAG_BRICK), + DIAGONAL_CROSS(STPresetPatternVal.DIAG_CROSS), + DIVOT(STPresetPatternVal.DIVOT), + DARK_DOWNWARD_DIAGONAL(STPresetPatternVal.DK_DN_DIAG), + DARK_HORIZONTAL(STPresetPatternVal.DK_HORZ), + DARK_UPWARD_DIAGONAL(STPresetPatternVal.DK_UP_DIAG), + DARK_VERTICAL(STPresetPatternVal.DK_VERT), + DOWNWARD_DIAGONAL(STPresetPatternVal.DN_DIAG), + DOTTED_DIAMOND(STPresetPatternVal.DOT_DMND), + DOTTED_GRID(STPresetPatternVal.DOT_GRID), + HORIZONTAL(STPresetPatternVal.HORZ), + HORIZONTAL_BRICK(STPresetPatternVal.HORZ_BRICK), + LARGE_CHECKER_BOARD(STPresetPatternVal.LG_CHECK), + LARGE_CONFETTI(STPresetPatternVal.LG_CONFETTI), + LARGE_GRID(STPresetPatternVal.LG_GRID), + LIGHT_DOWNWARD_DIAGONAL(STPresetPatternVal.LT_DN_DIAG), + LIGHT_HORIZONTAL(STPresetPatternVal.LT_HORZ), + LIGHT_UPWARD_DIAGONAL(STPresetPatternVal.LT_UP_DIAG), + LIGHT_VERTICAL(STPresetPatternVal.LT_VERT), + NARROW_HORIZONTAL(STPresetPatternVal.NAR_HORZ), + NARROW_VERTICAL(STPresetPatternVal.NAR_VERT), + OPEN_DIAMOND(STPresetPatternVal.OPEN_DMND), + PERCENT_5(STPresetPatternVal.PCT_5), + PERCENT_10(STPresetPatternVal.PCT_10), + PERCENT_20(STPresetPatternVal.PCT_20), + PERCENT_25(STPresetPatternVal.PCT_25), + PERCENT_30(STPresetPatternVal.PCT_30), + PERCENT_40(STPresetPatternVal.PCT_40), + PERCENT_50(STPresetPatternVal.PCT_50), + PERCENT_60(STPresetPatternVal.PCT_60), + PERCENT_70(STPresetPatternVal.PCT_70), + PERCENT_75(STPresetPatternVal.PCT_75), + PERCENT_80(STPresetPatternVal.PCT_80), + PERCENT_90(STPresetPatternVal.PCT_90), + PLAID(STPresetPatternVal.PLAID), + SHINGLE(STPresetPatternVal.SHINGLE), + SMALL_CHECKER_BOARD(STPresetPatternVal.SM_CHECK), + SMALL_CONFETTI(STPresetPatternVal.SM_CONFETTI), + SMALL_GRID(STPresetPatternVal.SM_GRID), + SOLID_DIAMOND(STPresetPatternVal.SOLID_DMND), + SPHERE(STPresetPatternVal.SPHERE), + TRELLIS(STPresetPatternVal.TRELLIS), + UPWARD_DIAGONAL(STPresetPatternVal.UP_DIAG), + VERTICAL(STPresetPatternVal.VERT), + WAVE(STPresetPatternVal.WAVE), + WEAVE(STPresetPatternVal.WEAVE), + WIDE_DOWNWARD_DIAGONAL(STPresetPatternVal.WD_DN_DIAG), + WIDE_UPWARD_DIAGONAL(STPresetPatternVal.WD_UP_DIAG), + ZIG_ZAG(STPresetPatternVal.ZIG_ZAG); + + final STPresetPatternVal.Enum underlying; + + PresetPattern(STPresetPatternVal.Enum pattern) { + this.underlying = pattern; + } + + private final static HashMap<STPresetPatternVal.Enum, PresetPattern> reverse = new HashMap<STPresetPatternVal.Enum, PresetPattern>(); + static { + for (PresetPattern value : values()) { + reverse.put(value.underlying, value); + } + } + + static PresetPattern valueOf(STPresetPatternVal.Enum pattern) { + return reverse.get(pattern); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/RectangleAlignment.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/RectangleAlignment.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/RectangleAlignment.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/RectangleAlignment.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,51 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STRectAlignment; + +public enum RectangleAlignment { + BOTTOM(STRectAlignment.B), + BOTTOM_LEFT(STRectAlignment.BL), + BOTTOM_RIGHT(STRectAlignment.BR), + CENTER(STRectAlignment.CTR), + LEFT(STRectAlignment.L), + RIGHT(STRectAlignment.R), + TOP(STRectAlignment.T), + TOP_LEFT(STRectAlignment.TL), + TOP_RIGHT(STRectAlignment.TR); + + final STRectAlignment.Enum underlying; + + RectangleAlignment(STRectAlignment.Enum alignment) { + this.underlying = alignment; + } + + private final static HashMap<STRectAlignment.Enum, RectangleAlignment> reverse = new HashMap<STRectAlignment.Enum, RectangleAlignment>(); + static { + for (RectangleAlignment value : values()) { + reverse.put(value.underlying, value); + } + } + + static RectangleAlignment valueOf(STRectAlignment.Enum alignment) { + return reverse.get(alignment); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/SchemeColor.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/SchemeColor.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/SchemeColor.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/SchemeColor.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,59 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STSchemeColorVal; + +public enum SchemeColor { + ACCENT_1(STSchemeColorVal.ACCENT_1), + ACCENT_2(STSchemeColorVal.ACCENT_2), + ACCENT_3(STSchemeColorVal.ACCENT_3), + ACCENT_4(STSchemeColorVal.ACCENT_4), + ACCENT_5(STSchemeColorVal.ACCENT_5), + ACCENT_6(STSchemeColorVal.ACCENT_6), + BACKGROUND_1(STSchemeColorVal.BG_1), + BACKGROUND_2(STSchemeColorVal.BG_2), + DARK_1(STSchemeColorVal.DK_1), + DARK_2(STSchemeColorVal.DK_2), + FOLLOWED_LINK(STSchemeColorVal.FOL_HLINK), + LINK(STSchemeColorVal.HLINK), + LIGHT_1(STSchemeColorVal.LT_1), + LIGHT_2(STSchemeColorVal.LT_2), + PLACEHOLDER(STSchemeColorVal.PH_CLR), + TEXT_1(STSchemeColorVal.TX_1), + TEXT_2(STSchemeColorVal.TX_2); + + final STSchemeColorVal.Enum underlying; + + SchemeColor(STSchemeColorVal.Enum color) { + this.underlying = color; + } + + private final static HashMap<STSchemeColorVal.Enum, SchemeColor> reverse = new HashMap<STSchemeColorVal.Enum, SchemeColor>(); + static { + for (SchemeColor value : values()) { + reverse.put(value.underlying, value); + } + } + + static SchemeColor valueOf(STSchemeColorVal.Enum color) { + return reverse.get(color); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/SystemColor.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/SystemColor.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/SystemColor.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/SystemColor.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,72 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STSystemColorVal; + +public enum SystemColor { + ACTIVE_BORDER(STSystemColorVal.ACTIVE_BORDER), + ACTIVE_CAPTION(STSystemColorVal.ACTIVE_CAPTION), + APPLICATION_WORKSPACE(STSystemColorVal.APP_WORKSPACE), + BACKGROUND(STSystemColorVal.BACKGROUND), + BUTTON_FACE(STSystemColorVal.BTN_FACE), + BUTTON_HIGHLIGHT(STSystemColorVal.BTN_HIGHLIGHT), + BUTTON_SHADOW(STSystemColorVal.BTN_SHADOW), + BUTTON_TEXT(STSystemColorVal.BTN_TEXT), + CAPTION_TEXT(STSystemColorVal.CAPTION_TEXT), + GRADIENT_ACTIVE_CAPTION(STSystemColorVal.GRADIENT_ACTIVE_CAPTION), + GRADIENT_INACTIVE_CAPTION(STSystemColorVal.GRADIENT_INACTIVE_CAPTION), + GRAY_TEXT(STSystemColorVal.GRAY_TEXT), + HIGHLIGHT(STSystemColorVal.HIGHLIGHT), + HIGHLIGHT_TEXT(STSystemColorVal.HIGHLIGHT_TEXT), + HOT_LIGHT(STSystemColorVal.HOT_LIGHT), + INACTIVE_BORDER(STSystemColorVal.INACTIVE_BORDER), + INACTIVE_CAPTION(STSystemColorVal.INACTIVE_CAPTION), + INACTIVE_CAPTION_TEXT(STSystemColorVal.INACTIVE_CAPTION_TEXT), + INFO_BACKGROUND(STSystemColorVal.INFO_BK), + INFO_TEXT(STSystemColorVal.INFO_TEXT), + MENU(STSystemColorVal.MENU), + MENU_BAR(STSystemColorVal.MENU_BAR), + MENU_HIGHLIGHT(STSystemColorVal.MENU_HIGHLIGHT), + MENU_TEXT(STSystemColorVal.MENU_TEXT), + SCROLL_BAR(STSystemColorVal.SCROLL_BAR), + WINDOW(STSystemColorVal.WINDOW), + WINDOW_FRAME(STSystemColorVal.WINDOW_FRAME), + WINDOW_TEXT(STSystemColorVal.WINDOW_TEXT), + X_3D_DARK_SHADOW(STSystemColorVal.X_3_D_DK_SHADOW), + X_3D_LIGHT(STSystemColorVal.X_3_D_LIGHT); + + final STSystemColorVal.Enum underlying; + + SystemColor(STSystemColorVal.Enum color) { + this.underlying = color; + } + + private final static HashMap<STSystemColorVal.Enum, SystemColor> reverse = new HashMap<STSystemColorVal.Enum, SystemColor>(); + static { + for (SystemColor value : values()) { + reverse.put(value.underlying, value); + } + } + + static SystemColor valueOf(STSystemColorVal.Enum color) { + return reverse.get(color); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/TileFlipMode.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/TileFlipMode.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/TileFlipMode.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/TileFlipMode.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,46 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import java.util.HashMap; + +import org.openxmlformats.schemas.drawingml.x2006.main.STTileFlipMode; + +public enum TileFlipMode { + NONE(STTileFlipMode.NONE), + X(STTileFlipMode.X), + XY(STTileFlipMode.XY), + Y(STTileFlipMode.Y); + + final STTileFlipMode.Enum underlying; + + TileFlipMode(STTileFlipMode.Enum mode) { + this.underlying = mode; + } + + private final static HashMap<STTileFlipMode.Enum, TileFlipMode> reverse = new HashMap<STTileFlipMode.Enum, TileFlipMode>(); + static { + for (TileFlipMode value : values()) { + reverse.put(value.underlying, value); + } + } + + static TileFlipMode valueOf(STTileFlipMode.Enum mode) { + return reverse.get(mode); + } +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFAdjustHandlePolar.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFAdjustHandlePolar.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFAdjustHandlePolar.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFAdjustHandlePolar.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,39 @@ +/* + * ==================================================================== + * 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.xddf.usermodel; + +import org.apache.poi.util.Beta; +import org.apache.poi.util.Internal; +import org.openxmlformats.schemas.drawingml.x2006.main.CTPolarAdjustHandle; + +@Beta +public class XDDFAdjustHandlePolar { + private CTPolarAdjustHandle handle; + + @Internal + public XDDFAdjustHandlePolar(CTPolarAdjustHandle handle) { + this.handle = handle; + } + + @Internal + public CTPolarAdjustHandle getXmlObject() { + return handle; + } + } Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFAdjustHandleXY.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFAdjustHandleXY.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFAdjustHandleXY.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFAdjustHandleXY.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,39 @@ +/* + * ==================================================================== + * 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.xddf.usermodel; + +import org.apache.poi.util.Beta; +import org.apache.poi.util.Internal; +import org.openxmlformats.schemas.drawingml.x2006.main.CTXYAdjustHandle; + +@Beta +public class XDDFAdjustHandleXY { + private CTXYAdjustHandle handle; + + @Internal + public XDDFAdjustHandleXY(CTXYAdjustHandle handle) { + this.handle = handle; + } + + @Internal + public CTXYAdjustHandle getXmlObject() { + return handle; + } + } Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColor.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColor.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColor.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColor.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,79 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import org.apache.poi.util.Beta; +import org.apache.poi.util.Internal; +import org.apache.xmlbeans.XmlObject; +import org.openxmlformats.schemas.drawingml.x2006.main.CTColor; + +@Beta +public abstract class XDDFColor { + protected CTColor container; + + @Internal + protected XDDFColor(CTColor container) { + this.container = container; + } + + public static XDDFColor from(byte[] color) { + return new XDDFColorRgbBinary(color); + } + + public static XDDFColor from(int red, int green, int blue) { + return new XDDFColorRgbPercent(red, green, blue); + } + + public static XDDFColor from(PresetColor color) { + return new XDDFColorPreset(color); + } + + public static XDDFColor from(SchemeColor color) { + return new XDDFColorSchemeBased(color); + } + + public static XDDFColor from(SystemColor color) { + return new XDDFColorSystemDefined(color); + } + + @Internal + protected static XDDFColor forColorContainer(CTColor container) { + if (container.isSetHslClr()) { + return new XDDFColorHsl(container.getHslClr(), container); + } else if (container.isSetPrstClr()) { + return new XDDFColorPreset(container.getPrstClr(), container); + } else if (container.isSetSchemeClr()) { + return new XDDFColorSchemeBased(container.getSchemeClr(), container); + } else if (container.isSetScrgbClr()) { + return new XDDFColorRgbPercent(container.getScrgbClr(), container); + } else if (container.isSetSrgbClr()) { + return new XDDFColorRgbBinary(container.getSrgbClr(), container); + } else if (container.isSetSysClr()) { + return new XDDFColorSystemDefined(container.getSysClr(), container); + } + return null; + } + + @Internal + protected CTColor getColorContainer() { + return container; + } + + @Internal + protected abstract XmlObject getXmlObject(); +} Added: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorHsl.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorHsl.java?rev=1820369&view=auto ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorHsl.java (added) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorHsl.java Sat Jan 6 02:51:53 2018 @@ -0,0 +1,77 @@ +/* ==================================================================== + 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.xddf.usermodel; + +import org.apache.poi.util.Beta; +import org.apache.poi.util.Internal; +import org.apache.xmlbeans.XmlObject; +import org.openxmlformats.schemas.drawingml.x2006.main.CTColor; +import org.openxmlformats.schemas.drawingml.x2006.main.CTHslColor; + +@Beta +public class XDDFColorHsl extends XDDFColor { + private CTHslColor color; + + public XDDFColorHsl(int hue, int saturation, int luminance) { + this(CTHslColor.Factory.newInstance(), CTColor.Factory.newInstance()); + setHue(hue); + setSaturation(saturation); + setLuminance(luminance); + } + + @Internal + protected XDDFColorHsl(CTHslColor color) { + this(color, null); + } + + @Internal + protected XDDFColorHsl(CTHslColor color, CTColor container) { + super(container); + this.color = color; + } + + @Override + @Internal + protected XmlObject getXmlObject() { + return color; + } + + public int getHue() { + return color.getHue2(); + } + + public void setHue(int hue) { + color.setHue2(hue); + } + + public int getSaturation() { + return color.getSat2(); + } + + public void setSaturation(int saturation) { + color.setSat2(saturation); + } + + public int getLuminance() { + return color.getLum2(); + } + + public void setLuminance(int lightness) { + color.setLum2(lightness); + } +} Copied: poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorPreset.java (from r1820242, poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLayout.java) URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorPreset.java?p2=poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorPreset.java&p1=poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLayout.java&r1=1820242&r2=1820369&rev=1820369&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLayout.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFColorPreset.java Sat Jan 6 02:51:53 2018 @@ -15,59 +15,55 @@ limitations under the License. ==================================================================== */ -package org.apache.poi.xddf.usermodel.chart; +package org.apache.poi.xddf.usermodel; import org.apache.poi.util.Beta; import org.apache.poi.util.Internal; -import org.openxmlformats.schemas.drawingml.x2006.chart.CTLayout; +import org.apache.xmlbeans.XmlObject; +import org.openxmlformats.schemas.drawingml.x2006.main.CTColor; +import org.openxmlformats.schemas.drawingml.x2006.main.CTPresetColor; @Beta -public class XDDFLayout { - private CTLayout layout; +public class XDDFColorPreset extends XDDFColor { + private CTPresetColor color; - public XDDFLayout() { - this(CTLayout.Factory.newInstance()); + public XDDFColorPreset(PresetColor color) { + this(CTPresetColor.Factory.newInstance(), CTColor.Factory.newInstance()); + setValue(color); } @Internal - protected XDDFLayout(CTLayout layout) { - this.layout = layout; + protected XDDFColorPreset(CTPresetColor color) { + this(color, null); } @Internal - protected CTLayout getXmlObject() { - return layout; + protected XDDFColorPreset(CTPresetColor color, CTColor container) { + super(container); + this.color = color; } - public void setExtensionList(XDDFChartExtensionList list) { - if (list == null) { - layout.unsetExtLst(); - } else { - layout.setExtLst(list.getXmlObject()); - } + @Override + @Internal + protected XmlObject getXmlObject() { + return color; } - public XDDFChartExtensionList getExtensionList() { - if (layout.isSetExtLst()) { - return new XDDFChartExtensionList(layout.getExtLst()); + public PresetColor getValue() { + if (color.isSetVal()) { + return PresetColor.valueOf(color.getVal()); } else { return null; } } - public void setManualLayout(XDDFManualLayout manual) { - if (manual == null) { - layout.unsetManualLayout(); - } else { - layout.setManualLayout(manual.getXmlObject()); - } - } - - public XDDFManualLayout getManualLayout() { - if (layout.isSetManualLayout()) { - return new XDDFManualLayout(layout); + public void setValue(PresetColor value) { + if (value == null) { + if (color.isSetVal()) { + color.unsetVal(); + } } else { - return null; + color.setVal(value.underlying); } } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org For additional commands, e-mail: commits-h...@poi.apache.org