diff options
author | PJ Fanning <fanningpj@apache.org> | 2020-12-09 18:04:56 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2020-12-09 18:04:56 +0000 |
commit | 8d54ec7cc7b485fd8866b8612b07beab455a5018 (patch) | |
tree | aef3cad7f6c64c2ec35cb38da76323ec40967fe6 /src/scratchpad | |
parent | 78596d7891bfb8a524fe9991c2ab3b3e6d66a2ad (diff) | |
download | poi-8d54ec7cc7b485fd8866b8612b07beab455a5018.tar.gz poi-8d54ec7cc7b485fd8866b8612b07beab455a5018.zip |
remove more deprecated code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884263 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/scratchpad')
6 files changed, 0 insertions, 163 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java b/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java deleted file mode 100644 index 1375092ac4..0000000000 --- a/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java +++ /dev/null @@ -1,40 +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.model; - - -import org.apache.poi.hslf.usermodel.HSLFGroupShape; -import org.apache.poi.sl.draw.SLGraphics; -import org.apache.poi.util.Removal; - -/** - * Translates Graphics2D calls into PowerPoint. - * @deprecated since 4.0.0 - use SLGraphics - */ -@Deprecated -@Removal(version="5.0.0") -public final class PPGraphics2D extends SLGraphics { - /** - * Construct Java Graphics object which translates graphic calls in ppt drawing layer. - * - * @param group The shape group to write the graphics calls into. - */ - public PPGraphics2D(HSLFGroupShape group){ - super(group); - } -} diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/BitMaskTextProp.java b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/BitMaskTextProp.java index e445eeeaca..706e5ae261 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/BitMaskTextProp.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/BitMaskTextProp.java @@ -25,7 +25,6 @@ import java.util.function.Supplier; import org.apache.poi.util.GenericRecordUtil; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; -import org.apache.poi.util.Removal; /** * Definition of a special kind of property of some text, or its @@ -185,14 +184,6 @@ public abstract class BitMaskTextProp extends TextProp { super.setValue(newVal); } - @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public BitMaskTextProp clone() { - return copy(); - } - /** * @return an identical copy of this, i.e. also the subPropMatches are copied */ diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/HSLFTabStop.java b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/HSLFTabStop.java index 0c340b067e..a8db55e521 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/HSLFTabStop.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/HSLFTabStop.java @@ -26,7 +26,6 @@ import org.apache.poi.common.usermodel.GenericRecord; import org.apache.poi.sl.usermodel.TabStop; import org.apache.poi.util.GenericRecordUtil; import org.apache.poi.util.Internal; -import org.apache.poi.util.Removal; import org.apache.poi.util.Units; @Internal @@ -87,14 +86,6 @@ public class HSLFTabStop implements TabStop, Duplicatable, GenericRecord { } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public HSLFTabStop clone() { - return copy(); - } - - @Override public HSLFTabStop copy() { return new HSLFTabStop(this); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/HSLFTabStopPropCollection.java b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/HSLFTabStopPropCollection.java index 071ceeb188..247077404b 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/HSLFTabStopPropCollection.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/HSLFTabStopPropCollection.java @@ -32,7 +32,6 @@ import org.apache.poi.util.LittleEndianConsts; import org.apache.poi.util.LittleEndianInput; import org.apache.poi.util.LittleEndianOutput; import org.apache.poi.util.LittleEndianOutputStream; -import org.apache.poi.util.Removal; /** * Container for tabstop lists @@ -110,14 +109,6 @@ public class HSLFTabStopPropCollection extends TextProp { } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public HSLFTabStopPropCollection clone() { - return copy(); - } - - @Override public HSLFTabStopPropCollection copy() { return new HSLFTabStopPropCollection(this); } diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/model/AllHSLFModelTests.java b/src/scratchpad/testcases/org/apache/poi/hslf/model/AllHSLFModelTests.java index 26b30ea53c..bf4b10545b 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/model/AllHSLFModelTests.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/model/AllHSLFModelTests.java @@ -32,7 +32,6 @@ import org.junit.runners.Suite; TestMovieShape.class, TestOleEmbedding.class, TestPPFont.class, - TestPPGraphics2D.class, TestSetBoldItalic.class, TestShapes.class, TestSheet.class, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestPPGraphics2D.java b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestPPGraphics2D.java deleted file mode 100644 index cd5c3f7976..0000000000 --- a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestPPGraphics2D.java +++ /dev/null @@ -1,95 +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.model; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.awt.*; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.util.List; - -import org.apache.poi.POIDataSamples; -import org.apache.poi.hslf.usermodel.*; -import org.junit.Before; -import org.junit.Test; - -/** - * Test drawing shapes via Graphics2D - * - * @author Yegor Kozlov - */ -public final class TestPPGraphics2D { - private static POIDataSamples _slTests = POIDataSamples.getSlideShowInstance(); - private HSLFSlideShow ppt; - - @Before - public void setUp() throws Exception { - ppt = new HSLFSlideShow(_slTests.openResourceAsStream("empty.ppt")); - } - - @Test - public void testGraphics() throws Exception { - // Starts off empty - assertTrue(ppt.getSlides().isEmpty()); - - // Add a slide - HSLFSlide slide = ppt.createSlide(); - assertEquals(1, ppt.getSlides().size()); - - // Add some stuff into it - HSLFGroupShape group = new HSLFGroupShape(); - Dimension pgsize = ppt.getPageSize(); - java.awt.Rectangle bounds = new java.awt.Rectangle(0, 0, (int)pgsize.getWidth(), (int)pgsize.getHeight()); - group.setAnchor(bounds); - slide.addShape(group); - - PPGraphics2D graphics = new PPGraphics2D(group); - graphics.setColor(Color.blue); - graphics.draw(new Rectangle(1296, 2544, 1344, 0)); - - graphics.setColor(Color.red); - graphics.setStroke(new BasicStroke((float)2.5)); - graphics.drawLine(500, 500, 1500, 2500); - - graphics.setColor(Color.green); - graphics.setPaint(Color.gray); - graphics.drawOval(4000, 1000, 1000, 1000); - - // Write the file out - ByteArrayOutputStream out = new ByteArrayOutputStream(); - ppt.write(out); - out.close(); - - // And read it back in - ppt = new HSLFSlideShow(new HSLFSlideShowImpl(new ByteArrayInputStream(out.toByteArray()))); - assertEquals(1, ppt.getSlides().size()); - - slide = ppt.getSlides().get(0); - List<HSLFShape> shape = slide.getShapes(); - assertEquals(shape.size(), 1); //group shape - - assertTrue(shape.get(0) instanceof HSLFGroupShape); //group shape - - group = (HSLFGroupShape)shape.get(0); - shape = group.getShapes(); - assertEquals(shape.size(), 3); - } - -} |