import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.awt.geom.Rectangle2D;
/**
* Definition of a custom geometric shape
package org.apache.poi.xslf.model.geom;
-import org.apache.poi.util.Units;
import org.apache.xmlbeans.XmlObject;
import org.openxmlformats.schemas.drawingml.x2006.main.*;
-import java.awt.Shape;
-import java.awt.geom.AffineTransform;
import java.awt.geom.GeneralPath;
-import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.List;
CTGradientFillProperties gradFill, Rectangle2D anchor,\r
XSLFTheme theme, CTSchemeColor phClr) {\r
double angle = gradFill.getLin().getAng() / 60000;\r
+ @SuppressWarnings("deprecation")\r
CTGradientStop[] gs = gradFill.getGsLst().getGsArray();\r
\r
Arrays.sort(gs, new Comparator<CTGradientStop>() {\r
CTGradientFillProperties gradFill, Rectangle2D anchor,\r
XSLFTheme theme, CTSchemeColor phClr) {\r
\r
+ @SuppressWarnings("deprecation")\r
CTGradientStop[] gs = gradFill.getGsLst().getGsArray();\r
Arrays.sort(gs, new Comparator<CTGradientStop>() {\r
public int compare(CTGradientStop o1, CTGradientStop o2) {\r
private static Paint createRadialGradientPaint(\r
CTGradientFillProperties gradFill, Rectangle2D anchor,\r
XSLFTheme theme, CTSchemeColor phClr) {\r
+ @SuppressWarnings("deprecation")\r
CTGradientStop[] gs = gradFill.getGsLst().getGsArray();\r
\r
Point2D pCenter = new Point2D.Double(anchor.getX() + anchor.getWidth()/2,\r
}\r
\r
\r
- @SuppressWarnings("deprecation") // getXYZArray() array accessors are deprecated\r
Paint getPaint(Graphics2D graphics, XmlObject spPr, CTSchemeColor phClr) {\r
\r
Paint paint = null;\r
package org.apache.poi.xslf.usermodel;\r
\r
/**\r
- * Created by IntelliJ IDEA.\r
- * User: yegor\r
- * Date: 11/3/11\r
- * Time: 5:07 PM\r
- * To change this template use File | Settings | File Templates.\r
+ * @author Yegor Kozlov\r
*/\r
public enum TextCap {\r
NONE,\r
import org.apache.xmlbeans.XmlObject;\r
import org.openxmlformats.schemas.drawingml.x2006.main.CTBackgroundFillStyleList;\r
import org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties;\r
import org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference;\r
import org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D;\r
import org.openxmlformats.schemas.presentationml.x2006.main.CTBackground;\r
package org.apache.poi.xslf.usermodel;\r
\r
import org.apache.poi.util.Beta;\r
-import org.apache.poi.xslf.model.geom.Outline;\r
-import org.apache.poi.xslf.model.geom.Path;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties;\r
import org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties;\r
import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps;\r
import org.openxmlformats.schemas.drawingml.x2006.main.CTPresetGeometry2D;\r
import org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.STLineEndLength;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.STLineEndType;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.STLineEndWidth;\r
import org.openxmlformats.schemas.drawingml.x2006.main.STShapeType;\r
import org.openxmlformats.schemas.presentationml.x2006.main.CTConnector;\r
import org.openxmlformats.schemas.presentationml.x2006.main.CTConnectorNonVisual;\r
\r
-import java.awt.Shape;\r
-import java.awt.Graphics2D;\r
-import java.awt.Color;\r
-import java.awt.geom.AffineTransform;\r
-import java.awt.geom.Ellipse2D;\r
-import java.awt.geom.GeneralPath;\r
-import java.awt.geom.Rectangle2D;\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
/**\r
* Specifies a connection shape.\r
*\r
\r
import javax.imageio.ImageIO;\r
import java.awt.Graphics2D;\r
-import java.awt.Image;\r
import java.awt.geom.AffineTransform;\r
import java.awt.geom.Rectangle2D;\r
import java.awt.image.BufferedImage;\r
-import java.io.ByteArrayInputStream;\r
import java.io.IOException;\r
-import java.io.InputStream;\r
\r
/**\r
* For now this class renders only images supported by the javax.imageio.ImageIO\r
private boolean includeCellComments = false;
private boolean includeHeadersFooters = true;
+ /**
+ * @deprecated Use {@link #XSSFExcelExtractor(org.apache.poi.openxml4j.opc.OPCPackage)} instead.
+ */
public XSSFExcelExtractor(String path) throws XmlException, OpenXML4JException, IOException {
this(new XSSFWorkbook(path));
}
package org.apache.poi.xssf.usermodel;\r
\r
import org.apache.poi.ss.usermodel.BorderFormatting;\r
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STBorderStyle;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorderPr;\r
import org.apache.poi.xssf.usermodel.extensions.XSSFCellFill;
import org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder.BorderSide;
import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlToken;
-import org.w3c.dom.Node;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorderPr;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellAlignment;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellProtection;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTChartSpace;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTTitle;
import org.openxmlformats.schemas.drawingml.x2006.chart.ChartSpaceDocument;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTLayout;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTManualLayout;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTPlotArea;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTValAx;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTPrintSettings;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTPageMargins;
-import org.openxmlformats.schemas.drawingml.x2006.chart.STLayoutTarget;
-import org.openxmlformats.schemas.drawingml.x2006.chart.STLayoutMode;
import org.openxmlformats.schemas.officeDocument.x2006.relationships.STRelationshipId;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
}
private void parseValueAxis() {
- for (CTValAx valAx : chart.getPlotArea().getValAxArray()) {
+ for (CTValAx valAx : chart.getPlotArea().getValAxList()) {
axis.add(new XSSFValueAxis(this, valAx));
}
}
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCfRule;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCfType;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STConditionalFormattingOperator;\r
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDxfs;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDxf;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont;\r
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTStylesheet;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder;\r
\r
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlOptions;
-import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps;
import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.*;
import org.openxmlformats.schemas.officeDocument.x2006.relationships.STRelationshipId;
package org.apache.poi.xssf.usermodel;\r
\r
import org.apache.poi.ss.usermodel.*;\r
-import org.apache.poi.hssf.util.HSSFColor;\r
-import org.apache.poi.POIXMLException;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTUnderlineProperty;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STUnderlineValues;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTVerticalAlignFontProperty;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STVerticalAlignRun;\r
\r
-import java.util.Map;\r
-import java.util.Iterator;\r
-import java.awt.*;\r
-import java.awt.Font;\r
\r
/**\r
* @author Yegor Kozlov\r
import javax.xml.namespace.QName;
-import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.util.Internal;
-import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlCursor;
import org.openxmlformats.schemas.drawingml.x2006.main.*;
import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTGraphicalObjectFrame;
package org.apache.poi.xssf.usermodel;
import java.awt.Dimension;
-import java.awt.image.BufferedImage;
import java.io.IOException;
-import java.util.Iterator;
-
-import javax.imageio.ImageIO;
-import javax.imageio.ImageReader;
-import javax.imageio.stream.ImageInputStream;
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture;
import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPictureNonVisual;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCol;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
/**
* Represents a picture shape in a SpreadsheetML drawing.
return buf.toString();
}
- @SuppressWarnings("deprecation")
void applyFont(TreeMap<Integer, CTRPrElt> formats, int startIndex, int endIndex, CTRPrElt fmt) {
// delete format runs that fit between startIndex and endIndex
// runs intersecting startIndex and endIndex remain
while(sub.size() > 1) sub.remove(sub.lastKey());
}
- TreeMap<Integer, CTRPrElt> getFormatMap(CTRst entry){
- int length = 0;
- TreeMap<Integer, CTRPrElt> formats = new TreeMap<Integer, CTRPrElt>();
- for (CTRElt r : entry.getRArray()) {
- String txt = r.getT();
- CTRPrElt fmt = r.getRPr();
-
- length += txt.length();
- formats.put(length, fmt);
- }
- return formats;
+ @SuppressWarnings("deprecation")
+ TreeMap<Integer, CTRPrElt> getFormatMap(CTRst entry){
+ int length = 0;
+ TreeMap<Integer, CTRPrElt> formats = new TreeMap<Integer, CTRPrElt>();
+ for (CTRElt r : entry.getRArray()) {
+ String txt = r.getT();
+ CTRPrElt fmt = r.getRPr();
+
+ length += txt.length();
+ formats.put(length, fmt);
}
+ return formats;
+ }
CTRst buildCTRst(String text, TreeMap<Integer, CTRPrElt> formats){
if(text.length() != formats.lastKey()) {
import org.apache.poi.ss.util.CellRangeAddress;\r
import org.apache.poi.ss.SpreadsheetVersion;\r
import org.apache.poi.hssf.record.cf.CellRangeUtil;\r
-import org.apache.xmlbeans.XmlObject;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCfRule;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCfType;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTConditionalFormatting;\r
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet;\r
\r
import java.util.List;\r
-import java.util.Arrays;\r
import java.util.ArrayList;\r
\r
/**\r
package org.apache.poi.xssf.usermodel;
import org.apache.poi.hssf.util.HSSFColor;
-import org.apache.poi.ss.usermodel.IndexedColors;
import org.openxmlformats.schemas.drawingml.x2006.main.*;
import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape;
import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShapeNonVisual;
import org.apache.poi.ss.usermodel.charts.AxisCrosses;
import org.apache.poi.util.Beta;
import org.apache.poi.xssf.usermodel.XSSFChart;
-import org.openxmlformats.schemas.drawingml.x2006.chart.CTChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumFmt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTCrosses;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTLayoutMode;\r
import org.openxmlformats.schemas.drawingml.x2006.chart.CTLayoutTarget;\r
import org.openxmlformats.schemas.drawingml.x2006.chart.STLayoutMode;\r
-import org.openxmlformats.schemas.drawingml.x2006.chart.STLayoutTarget;\r
\r
/**\r
* Represents a SpreadsheetML manual layout.\r
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumFmt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTCrosses;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTScaling;
-import org.openxmlformats.schemas.drawingml.x2006.chart.STAxPos;
import org.openxmlformats.schemas.drawingml.x2006.chart.STCrossBetween;
import org.openxmlformats.schemas.drawingml.x2006.chart.STTickLblPos;
package org.apache.poi.xssf.usermodel.helpers;
import java.util.Arrays;
-import java.util.Iterator;
-import java.text.AttributedString;
-import java.text.NumberFormat;
-import java.text.DecimalFormat;
-import java.awt.font.TextLayout;
-import java.awt.font.FontRenderContext;
-import java.awt.font.TextAttribute;
-import java.awt.geom.AffineTransform;
import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.util.CTColComparator;
import org.apache.poi.xssf.util.NumericRanges;
-import org.apache.poi.xssf.usermodel.*;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCol;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet;
package org.apache.poi;
-import java.io.File;
-
import org.apache.poi.util.IOUtils;
import org.apache.poi.xslf.XSLFSlideShow;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.util.TempFile;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.InputStream;
/**
public class TestXSLFBugs extends TestCase {
+ @SuppressWarnings("deprecation")
public void test51187() throws Exception {
XMLSlideShow ss = XSLFTestDataSamples.openSampleDocument("51187.pptx");
import org.apache.poi.xslf.XSLFTestDataSamples;\r
import org.openxmlformats.schemas.presentationml.x2006.main.CTPicture;\r
\r
-import java.io.IOException;\r
import java.util.Arrays;\r
import java.util.HashMap;\r
import java.util.List;\r
package org.apache.poi.xslf.usermodel;\r
\r
import junit.framework.TestCase;\r
-import org.apache.poi.xslf.XSLFTestDataSamples;\r
-\r
-import java.awt.*;\r
-import java.awt.geom.Rectangle2D;\r
\r
/**\r
- * test common operatrions on containers of shapes (sheets and groups of shapes)\r
+ * test common operations on containers of shapes (sheets and groups of shapes)\r
*\r
* @author Yegor Kozlov\r
*/\r
import org.apache.poi.xslf.XSLFTestDataSamples;\r
\r
import java.awt.Color;\r
-import java.io.FileInputStream;\r
import java.util.Arrays;\r
\r
/**\r
package org.apache.poi.xssf.io;
-import java.io.File;
import java.util.List;
import junit.framework.TestCase;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFPictureData;
-import org.apache.poi.xssf.XSSFITestDataProvider;
import org.apache.poi.POIDataSamples;
package org.apache.poi.xssf.model;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.List;
-
-import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
-import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.XSSFTestDataSamples;
import org.apache.poi.xssf.usermodel.*;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCommentList;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComments;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRst;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument;
public class TestCommentsTable extends TestCase {
package org.apache.poi.xssf.usermodel;
-import junit.framework.TestCase;
-import org.apache.poi.xssf.XSSFTestDataSamples;
import org.apache.poi.xssf.XSSFITestDataProvider;
import org.apache.poi.ss.usermodel.BaseTestSheetHiding;
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.ss.usermodel.FontUnderline;
-import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.xssf.XSSFTestDataSamples;
-import org.apache.poi.xssf.dev.XSSFDump;
-import org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun;
import org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties;
import org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph;
import org.openxmlformats.schemas.drawingml.x2006.main.STTextUnderlineType;
import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTDrawing;
-import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape;
/**
* @author Yegor Kozlov
package org.apache.poi.xssf.usermodel;
-import junit.framework.TestCase;
-
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellReference;
-import org.apache.poi.xssf.XSSFTestDataSamples;
import org.apache.poi.xssf.XSSFITestDataProvider;
public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator {
package org.apache.poi.xssf.usermodel;
import java.io.IOException;
-import java.io.StringWriter;
import java.util.TreeMap;
import junit.framework.TestCase;
-import org.apache.poi.POIXMLDocumentPart;
-import org.apache.xmlbeans.XmlOptions;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRPrElt;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRst;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STXstring;
import org.apache.poi.ss.usermodel.charts.*;
import org.apache.poi.xssf.usermodel.*;
-import org.apache.poi.xssf.usermodel.charts.*;
public final class TestXSSFChartAxis extends TestCase {
\r
import org.apache.poi.ss.usermodel.*;\r
import org.apache.poi.ss.usermodel.charts.ChartLegend;\r
-import org.apache.poi.ss.usermodel.charts.LegendPosition;\r
import org.apache.poi.ss.usermodel.charts.ManualLayout;\r
import org.apache.poi.ss.usermodel.charts.LayoutMode;\r
import org.apache.poi.ss.usermodel.charts.LayoutTarget;\r
import org.apache.poi.ss.usermodel.charts.*;
import org.apache.poi.xssf.usermodel.*;
-import org.apache.poi.xssf.usermodel.charts.*;
public final class TestXSSFValueAxis extends TestCase {
\r
import org.apache.poi.POIDataSamples;\r
import org.apache.poi.util.IOUtils;\r
-import org.apache.poi.util.PackageHelper;\r
import org.apache.poi.xwpf.usermodel.XWPFDocument;\r
\r
/**\r
comments = XWPFTestDataSamples.openSampleDocument("WordWithAttachments.docx");
}
+ @SuppressWarnings("deprecation")
public void testHyperlink() {
XWPFParagraph ps;
XWPFParagraph ph;
package org.apache.poi.xwpf.usermodel;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.lang.String;
import java.math.BigInteger;
import junit.framework.TestCase;
import org.apache.poi.xwpf.XWPFTestDataSamples;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STFtnEdn;
import org.apache.poi.xwpf.XWPFTestDataSamples;
import org.apache.poi.xwpf.usermodel.XWPFTable.XWPFBorderType;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblCellMar;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STBorder;