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/testcases/org/apache/poi/hslf | |
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/testcases/org/apache/poi/hslf')
-rw-r--r-- | src/scratchpad/testcases/org/apache/poi/hslf/model/AllHSLFModelTests.java | 1 | ||||
-rw-r--r-- | src/scratchpad/testcases/org/apache/poi/hslf/model/TestPPGraphics2D.java | 95 |
2 files changed, 0 insertions, 96 deletions
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); - } - -} |