+++ /dev/null
-
-/* ====================================================================
- 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.hssf.record;
-
-
-/**
- * Process a single record. That is, an SST record or a continue record.
- * Refactored from code originally in SSTRecord.
- *
- * @author Glen Stampoultzis (glens at apache.org)
- */
-class RecordProcessor
-{
- //This class is not required anymore
-}
-
package org.apache.poi.ss.usermodel;
+import org.apache.poi.util.Removal;
+
+/**
+ * @deprecated 3.16 beta1. This interface isn't implemented ...
+ */
+@Deprecated
+@Removal(version="3.18")
public interface Textbox {
public final static short OBJECT_TYPE_TEXT = 6;
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.util;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Holds a collection of Sheet names and their associated
- * reference numbers.
- *
- * @author Andrew C. Oliver (acoliver at apache dot org)
- *
- */
-public class SheetReferences
-{
- Map<Integer, String> map;
- public SheetReferences()
- {
- map = new HashMap<Integer, String>(5);
- }
-
- public void addSheetReference(String sheetName, int number) {
- map.put(number, sheetName);
- }
-
- public String getSheetName(int number) {
- return map.get(number);
- }
-}
+++ /dev/null
-
-/* ====================================================================
- 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.util;
-
-import java.io.InputStream;
-import java.io.IOException;
-
-/**
- * Implementation of a BlockingInputStream to provide data to
- * RawDataBlock that expects data in 512 byte chunks. Useful to read
- * data from slow (ie, non FileInputStream) sources, for example when
- * reading an OLE2 Document over a network.
- *
- * Possible extensions: add a timeout. Currently a call to read(byte[]) on this
- * class is blocking, so use at your own peril if your underlying stream blocks.
- *
- * @author Jens Gerhard
- * @author aviks - documentation cleanups.
- */
-public class BlockingInputStream
- extends InputStream
-{
- protected InputStream is;
-
- public BlockingInputStream(InputStream is)
- {
- this.is = is;
- }
-
- public int available()
- throws IOException
- {
- return is.available();
- }
-
- public void close()
- throws IOException
- {
- is.close();
- }
-
- public void mark(int readLimit)
- {
- is.mark(readLimit);
- }
-
- public boolean markSupported()
- {
- return is.markSupported();
- }
-
- public int read()
- throws IOException
- {
- return is.read();
- }
-
- /**
- * We had to revert to byte per byte reading to keep
- * with slow network connections on one hand, without
- * missing the end-of-file.
- * This is the only method that does its own thing in this class
- * everything else is delegated to aggregated stream.
- * THIS IS A BLOCKING BLOCK READ!!!
- */
- public int read(byte[] bf)
- throws IOException
- {
-
- int i = 0;
- int b = 4611;
- while ( i < bf.length )
- {
- b = is.read();
- if ( b == -1 )
- break;
- bf[i++] = (byte) b;
- }
- if ( i == 0 && b == -1 )
- return -1;
- return i;
- }
-
- public int read(byte[] bf, int s, int l)
- throws IOException
- {
- return is.read(bf, s, l);
- }
-
- public void reset()
- throws IOException
- {
- is.reset();
- }
-
- public long skip(long n)
- throws IOException
- {
- return is.skip(n);
- }
-}
-
+++ /dev/null
-/* ====================================================================
- 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.openxml4j.opc;
-
-import java.io.File;
-
-/**
- * Storage class for configuration storage parameters.
- * TODO xml syntax checking is not done with JAXP by default -> remove the schema or do it ?
- *
- * @author CDubettier, Julen Chable
- * @version 1.0
- */
-public final class Configuration {
- // TODO configuration by default. should be clearly stated that it should be
- // changed to match installation path
- // as schemas dir is needed in runtime
- static private String pathForXmlSchema = System.getProperty("user.dir")
- + File.separator + "src" + File.separator + "schemas";
-
- public static String getPathForXmlSchema() {
- return pathForXmlSchema;
- }
-
- public static void setPathForXmlSchema(String pathForXmlSchema) {
- Configuration.pathForXmlSchema = pathForXmlSchema;
- }
-}
+++ /dev/null
-/*\r
- * ====================================================================\r
- * Licensed to the Apache Software Foundation (ASF) under one or more\r
- * contributor license agreements. See the NOTICE file distributed with\r
- * this work for additional information regarding copyright ownership.\r
- * The ASF licenses this file to You under the Apache License, Version 2.0\r
- * (the "License"); you may not use this file except in compliance with\r
- * the License. You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ====================================================================\r
- */\r
-\r
-package org.apache.poi.xslf.usermodel;\r
-\r
-/**\r
- * Manages fonts when rendering slides.\r
- *\r
- * Use this class to handle unknown / missing fonts or to substitute fonts\r
- */\r
-public interface XSLFFontManager {\r
-\r
- /**\r
- * select a font to be used to paint text\r
- *\r
- * @param typeface the font family as defined in the .pptx file.\r
- * This can be unknown or missing in the graphic environment.\r
- *\r
- * @return the font to be used to paint text\r
- */\r
-\r
- String getRendererableFont(String typeface, int pitchFamily);\r
-}\r
+++ /dev/null
-/*\r
- * ====================================================================\r
- * Licensed to the Apache Software Foundation (ASF) under one or more\r
- * contributor license agreements. See the NOTICE file distributed with\r
- * this work for additional information regarding copyright ownership.\r
- * The ASF licenses this file to You under the Apache License, Version 2.0\r
- * (the "License"); you may not use this file except in compliance with\r
- * the License. You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ====================================================================\r
- */\r
-\r
-package org.apache.poi.xslf.usermodel;\r
-\r
-import java.awt.Graphics2D;\r
-import java.awt.Insets;\r
-import java.awt.Shape;\r
-import java.awt.geom.AffineTransform;\r
-import java.awt.geom.Rectangle2D;\r
-import java.awt.image.BufferedImage;\r
-import java.io.IOException;\r
-\r
-import javax.imageio.ImageIO;\r
-\r
-import org.apache.poi.openxml4j.opc.PackagePart;\r
-import org.apache.poi.util.Beta;\r
-\r
-/**\r
- * For now this class renders only images supported by the javax.imageio.ImageIO\r
- * framework. Subclasses can override this class to support other formats, for\r
- * example, Use Apache batik to render WMF:\r
- * \r
- * <pre>\r
- * <code>\r
- * public class MyImageRendener extends XSLFImageRendener{\r
- * public boolean drawImage(Graphics2D graphics, XSLFPictureData data, Rectangle2D anchor){\r
- * boolean ok = super.drawImage(graphics, data, anchor);\r
- * if(!ok){\r
- * // see what type of image we are\r
- * String contentType = data.getPackagePart().getContentType();\r
- * if(contentType.equals("image/wmf")){\r
- * // use Apache Batik to handle WMF\r
- * // see http://xmlgraphics.apache.org/batik/\r
- * }\r
- * \r
- * }\r
- * return ok;\r
- * }\r
- * }\r
- * </code>\r
- * </pre>\r
- * \r
- * and then pass this class to your instance of java.awt.Graphics2D:\r
- * \r
- * <pre>\r
- * <code>\r
- * graphics.setRenderingHint(XSLFRenderingHint.IMAGE_RENDERER, new MyImageRendener());\r
- * </code>\r
- * </pre>\r
- * \r
- * @author Yegor Kozlov\r
- */\r
-@Beta\r
-public class XSLFImageRenderer {\r
-\r
- /**\r
- * Render picture data into the supplied graphics\r
- * \r
- * @return true if the picture data was successfully rendered\r
- */\r
- public boolean drawImage(Graphics2D graphics, XSLFPictureData data,\r
- Rectangle2D anchor) {\r
- return drawImage(graphics, data, anchor, null);\r
- }\r
- \r
- /**\r
- * Render picture data into the supplied graphics\r
- * \r
- * @return true if the picture data was successfully rendered\r
- */\r
- public boolean drawImage(Graphics2D graphics, XSLFPictureData data,\r
- Rectangle2D anchor, Insets clip) {\r
- boolean isClipped = true;\r
- if (clip == null) {\r
- isClipped = false;\r
- clip = new Insets(0,0,0,0);\r
- }\r
- \r
- BufferedImage img;\r
- try {\r
- img = ImageIO.read(data.getPackagePart().getInputStream());\r
- } catch (Exception e) {\r
- return false;\r
- }\r
- \r
- if(img == null) {\r
- return false;\r
- }\r
-\r
- int iw = img.getWidth();\r
- int ih = img.getHeight();\r
-\r
- double cw = (100000-clip.left-clip.right) / 100000.0;\r
- double ch = (100000-clip.top-clip.bottom) / 100000.0;\r
- double sx = anchor.getWidth()/(iw*cw);\r
- double sy = anchor.getHeight()/(ih*ch);\r
- double tx = anchor.getX()-(iw*sx*clip.left/100000.0);\r
- double ty = anchor.getY()-(ih*sy*clip.top/100000.0);\r
- AffineTransform at = new AffineTransform(sx, 0, 0, sy, tx, ty) ;\r
-\r
- Shape clipOld = graphics.getClip();\r
- if (isClipped) graphics.clip(anchor.getBounds2D());\r
- graphics.drawRenderedImage(img, at);\r
- graphics.setClip(clipOld);\r
-\r
- return true;\r
- }\r
-\r
- /**\r
- * Create a buffered image from the supplied package part.\r
- * This method is called to create texture paints.\r
- *\r
- * @return a <code>BufferedImage</code> containing the decoded\r
- * contents of the input, or <code>null</code>.\r
- */\r
- public BufferedImage readImage(PackagePart packagePart) throws IOException {\r
- return ImageIO.read(packagePart.getInputStream());\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-/*\r
- * ====================================================================\r
- * Licensed to the Apache Software Foundation (ASF) under one or more\r
- * contributor license agreements. See the NOTICE file distributed with\r
- * this work for additional information regarding copyright ownership.\r
- * The ASF licenses this file to You under the Apache License, Version 2.0\r
- * (the "License"); you may not use this file except in compliance with\r
- * the License. You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ====================================================================\r
- */\r
-\r
-package org.apache.poi.xslf.usermodel;\r
-\r
-import org.apache.poi.util.Internal;\r
-\r
-import java.awt.RenderingHints;\r
-\r
-/**\r
- *\r
- * @author Yegor Kozlov\r
- */\r
-public class XSLFRenderingHint extends RenderingHints.Key {\r
-\r
- public XSLFRenderingHint(int i){\r
- super(i);\r
- }\r
-\r
- @Override\r
- public boolean isCompatibleValue(Object val) {\r
- return true;\r
- }\r
-\r
- public static final XSLFRenderingHint GSAVE = new XSLFRenderingHint(1);\r
- public static final XSLFRenderingHint GRESTORE = new XSLFRenderingHint(2);\r
-\r
- /**\r
- * Use a custom image rendener\r
- *\r
- * @see XSLFImageRenderer\r
- */\r
- public static final XSLFRenderingHint IMAGE_RENDERER = new XSLFRenderingHint(3);\r
-\r
- /**\r
- * how to render text:\r
- *\r
- * {@link #TEXT_AS_CHARACTERS} (default) means to draw via\r
- * {@link java.awt.Graphics2D#drawString(java.text.AttributedCharacterIterator, float, float)}.\r
- * This mode draws text as characters. Use it if the target graphics writes the actual\r
- * character codes instead of glyph outlines (PDFGraphics2D, SVGGraphics2D, etc.)\r
- *\r
- * {@link #TEXT_AS_SHAPES} means to render via\r
- * {@link java.awt.font.TextLayout#draw(java.awt.Graphics2D, float, float)}.\r
- * This mode draws glyphs as shapes and provides some advanced capabilities such as\r
- * justification and font substitution. Use it if the target graphics is an image.\r
- *\r
- */\r
- public static final XSLFRenderingHint TEXT_RENDERING_MODE = new XSLFRenderingHint(4);\r
-\r
- /**\r
- * draw text via {@link java.awt.Graphics2D#drawString(java.text.AttributedCharacterIterator, float, float)}\r
- */\r
- public static final int TEXT_AS_CHARACTERS = 1;\r
-\r
- /**\r
- * draw text via {@link java.awt.font.TextLayout#draw(java.awt.Graphics2D, float, float)}\r
- */\r
- public static final int TEXT_AS_SHAPES = 2;\r
-\r
- @Internal\r
- static final XSLFRenderingHint GROUP_TRANSFORM = new XSLFRenderingHint(5);\r
-\r
- /**\r
- * Use this object to resolve unknown / missing fonts when rendering slides\r
- */\r
- public static final XSLFRenderingHint FONT_HANDLER = new XSLFRenderingHint(6);\r
-\r
-}\r
==================================================================== */
package org.apache.poi.xwpf.model;
+import org.apache.poi.util.Removal;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
/**
* Base class for XWPF paragraphs
- *
- * @author Yury Batrakov (batrakov at gmail.com)
+ *
+ * @deprecated 3.16 beta1. This class isn't used ...
*/
+@Deprecated
+@Removal(version="3.18")
public class XMLParagraph {
protected CTP paragraph;
+++ /dev/null
-/* ====================================================================
- 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.hslf.exceptions;
-
-/**
- * This exception is thrown when we try to create a record, and the
- * underlying data just doesn't match up
- *
- * @author Nick Burch
- */
-
-public final class InvalidRecordFormatException extends Exception
-{
- public InvalidRecordFormatException(String s) {
- super(s);
- }
-}
import org.apache.poi.sl.usermodel.SlideShowFactory;\r
import org.apache.poi.util.Internal;\r
\r
+/**\r
+ * Helper class which is instantiated by reflection from\r
+ * {@link SlideShowFactory#create(java.io.File)} and similar\r
+ */\r
@Internal\r
public class HSLFSlideShowFactory extends SlideShowFactory {\r
/**\r
+++ /dev/null
-/* ====================================================================
- 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.hsmf.exceptions;
-
-/**
- * Exception for when a directory chunk is not found but is expected.
- * @author Travis Ferguson
- */
-public final class DirectoryChunkNotFoundException extends Exception {
- private static final long serialVersionUID = 1L;
-
- public DirectoryChunkNotFoundException(String directory) {
- super("Directory Chunk " + directory + " was not found!");
- }
-}
import java.io.InputStream;\r
\r
import org.apache.poi.hwmf.usermodel.HwmfPicture;\r
+import org.apache.poi.sl.draw.DrawPictureShape;\r
import org.apache.poi.sl.draw.ImageRenderer;\r
import org.apache.poi.sl.usermodel.PictureData;\r
import org.apache.poi.util.Units;\r
\r
+/**\r
+ * Helper class which is instantiated by {@link DrawPictureShape}\r
+ * via reflection\r
+ */\r
public class HwmfSLImageRenderer implements ImageRenderer {\r
HwmfPicture image = null;\r
double alpha = 0;\r
+++ /dev/null
-/* ====================================================================
- 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.hwpf.model;
-
-import java.lang.ref.SoftReference;
-
-import org.apache.poi.hwpf.sprm.SprmBuffer;
-import org.apache.poi.util.Internal;
-
-@Internal
-public final class CachedPropertyNode
- extends PropertyNode<CachedPropertyNode>
-{
- protected SoftReference<Object> _propCache;
-
- public CachedPropertyNode(int start, int end, SprmBuffer buf)
- {
- super(start, end, buf);
- }
-
- protected void fillCache(Object ref)
- {
- _propCache = new SoftReference<Object>(ref);
- }
-
- protected Object getCacheContents()
- {
- return _propCache == null ? null : _propCache.get();
- }
-
- /**
- * @return This property's property in compressed form.
- */
- public SprmBuffer getSprmBuf()
- {
- return (SprmBuffer)_buf;
- }
-
-
-}
+++ /dev/null
-/* ====================================================================
- 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.hwpf.usermodel;
-
-import org.apache.poi.hwpf.HWPFDocument;
-
-public final class DocumentPosition
- extends Range
-{
- public DocumentPosition(HWPFDocument doc, int pos)
- {
- super(pos, pos, doc);
- }
-
-}