#60331 - Remove deprecated classes (POI 3.16)

- remove orphaned classes immediately, which are quite likely not used anymore
- deprecated the rest

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1774842 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
kiwiwings 2016-12-18 03:26:13 +00:00
parent 43c8f44c2c
commit 0ff9cbb0f9
15 changed files with 21 additions and 649 deletions

View File

@ -1,33 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.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
}

View File

@ -17,6 +17,13 @@
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;

View File

@ -1,45 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.ss.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);
}
}

View File

@ -1,119 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.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);
}
}

View File

@ -1,43 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.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;
}
}

View File

@ -1,39 +0,0 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.apache.poi.xslf.usermodel;
/**
* Manages fonts when rendering slides.
*
* Use this class to handle unknown / missing fonts or to substitute fonts
*/
public interface XSLFFontManager {
/**
* select a font to be used to paint text
*
* @param typeface the font family as defined in the .pptx file.
* This can be unknown or missing in the graphic environment.
*
* @return the font to be used to paint text
*/
String getRendererableFont(String typeface, int pitchFamily);
}

View File

@ -1,136 +0,0 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.apache.poi.xslf.usermodel;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.imageio.ImageIO;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.util.Beta;
/**
* For now this class renders only images supported by the javax.imageio.ImageIO
* framework. Subclasses can override this class to support other formats, for
* example, Use Apache batik to render WMF:
*
* <pre>
* <code>
* public class MyImageRendener extends XSLFImageRendener{
* public boolean drawImage(Graphics2D graphics, XSLFPictureData data, Rectangle2D anchor){
* boolean ok = super.drawImage(graphics, data, anchor);
* if(!ok){
* // see what type of image we are
* String contentType = data.getPackagePart().getContentType();
* if(contentType.equals("image/wmf")){
* // use Apache Batik to handle WMF
* // see http://xmlgraphics.apache.org/batik/
* }
*
* }
* return ok;
* }
* }
* </code>
* </pre>
*
* and then pass this class to your instance of java.awt.Graphics2D:
*
* <pre>
* <code>
* graphics.setRenderingHint(XSLFRenderingHint.IMAGE_RENDERER, new MyImageRendener());
* </code>
* </pre>
*
* @author Yegor Kozlov
*/
@Beta
public class XSLFImageRenderer {
/**
* Render picture data into the supplied graphics
*
* @return true if the picture data was successfully rendered
*/
public boolean drawImage(Graphics2D graphics, XSLFPictureData data,
Rectangle2D anchor) {
return drawImage(graphics, data, anchor, null);
}
/**
* Render picture data into the supplied graphics
*
* @return true if the picture data was successfully rendered
*/
public boolean drawImage(Graphics2D graphics, XSLFPictureData data,
Rectangle2D anchor, Insets clip) {
boolean isClipped = true;
if (clip == null) {
isClipped = false;
clip = new Insets(0,0,0,0);
}
BufferedImage img;
try {
img = ImageIO.read(data.getPackagePart().getInputStream());
} catch (Exception e) {
return false;
}
if(img == null) {
return false;
}
int iw = img.getWidth();
int ih = img.getHeight();
double cw = (100000-clip.left-clip.right) / 100000.0;
double ch = (100000-clip.top-clip.bottom) / 100000.0;
double sx = anchor.getWidth()/(iw*cw);
double sy = anchor.getHeight()/(ih*ch);
double tx = anchor.getX()-(iw*sx*clip.left/100000.0);
double ty = anchor.getY()-(ih*sy*clip.top/100000.0);
AffineTransform at = new AffineTransform(sx, 0, 0, sy, tx, ty) ;
Shape clipOld = graphics.getClip();
if (isClipped) graphics.clip(anchor.getBounds2D());
graphics.drawRenderedImage(img, at);
graphics.setClip(clipOld);
return true;
}
/**
* Create a buffered image from the supplied package part.
* This method is called to create texture paints.
*
* @return a <code>BufferedImage</code> containing the decoded
* contents of the input, or <code>null</code>.
*/
public BufferedImage readImage(PackagePart packagePart) throws IOException {
return ImageIO.read(packagePart.getInputStream());
}
}

View File

@ -1,85 +0,0 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.apache.poi.xslf.usermodel;
import org.apache.poi.util.Internal;
import java.awt.RenderingHints;
/**
*
* @author Yegor Kozlov
*/
public class XSLFRenderingHint extends RenderingHints.Key {
public XSLFRenderingHint(int i){
super(i);
}
@Override
public boolean isCompatibleValue(Object val) {
return true;
}
public static final XSLFRenderingHint GSAVE = new XSLFRenderingHint(1);
public static final XSLFRenderingHint GRESTORE = new XSLFRenderingHint(2);
/**
* Use a custom image rendener
*
* @see XSLFImageRenderer
*/
public static final XSLFRenderingHint IMAGE_RENDERER = new XSLFRenderingHint(3);
/**
* how to render text:
*
* {@link #TEXT_AS_CHARACTERS} (default) means to draw via
* {@link java.awt.Graphics2D#drawString(java.text.AttributedCharacterIterator, float, float)}.
* This mode draws text as characters. Use it if the target graphics writes the actual
* character codes instead of glyph outlines (PDFGraphics2D, SVGGraphics2D, etc.)
*
* {@link #TEXT_AS_SHAPES} means to render via
* {@link java.awt.font.TextLayout#draw(java.awt.Graphics2D, float, float)}.
* This mode draws glyphs as shapes and provides some advanced capabilities such as
* justification and font substitution. Use it if the target graphics is an image.
*
*/
public static final XSLFRenderingHint TEXT_RENDERING_MODE = new XSLFRenderingHint(4);
/**
* draw text via {@link java.awt.Graphics2D#drawString(java.text.AttributedCharacterIterator, float, float)}
*/
public static final int TEXT_AS_CHARACTERS = 1;
/**
* draw text via {@link java.awt.font.TextLayout#draw(java.awt.Graphics2D, float, float)}
*/
public static final int TEXT_AS_SHAPES = 2;
@Internal
static final XSLFRenderingHint GROUP_TRANSFORM = new XSLFRenderingHint(5);
/**
* Use this object to resolve unknown / missing fonts when rendering slides
*/
public static final XSLFRenderingHint FONT_HANDLER = new XSLFRenderingHint(6);
}

View File

@ -16,13 +16,16 @@
==================================================================== */
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;

View File

@ -1,32 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.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);
}
}

View File

@ -24,6 +24,10 @@ import org.apache.poi.sl.usermodel.SlideShow;
import org.apache.poi.sl.usermodel.SlideShowFactory;
import org.apache.poi.util.Internal;
/**
* Helper class which is instantiated by reflection from
* {@link SlideShowFactory#create(java.io.File)} and similar
*/
@Internal
public class HSLFSlideShowFactory extends SlideShowFactory {
/**

View File

@ -1,30 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.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!");
}
}

View File

@ -29,10 +29,15 @@ import java.io.IOException;
import java.io.InputStream;
import org.apache.poi.hwmf.usermodel.HwmfPicture;
import org.apache.poi.sl.draw.DrawPictureShape;
import org.apache.poi.sl.draw.ImageRenderer;
import org.apache.poi.sl.usermodel.PictureData;
import org.apache.poi.util.Units;
/**
* Helper class which is instantiated by {@link DrawPictureShape}
* via reflection
*/
public class HwmfSLImageRenderer implements ImageRenderer {
HwmfPicture image = null;
double alpha = 0;

View File

@ -1,55 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.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;
}
}

View File

@ -1,30 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.hwpf.HWPFDocument;
public final class DocumentPosition
extends Range
{
public DocumentPosition(HWPFDocument doc, int pos)
{
super(pos, pos, doc);
}
}