Return-Path: X-Original-To: apmail-poi-commits-archive@minotaur.apache.org Delivered-To: apmail-poi-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 812F3177AE for ; Thu, 28 May 2015 11:13:24 +0000 (UTC) Received: (qmail 96461 invoked by uid 500); 28 May 2015 11:13:24 -0000 Delivered-To: apmail-poi-commits-archive@poi.apache.org Received: (qmail 96427 invoked by uid 500); 28 May 2015 11:13:24 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 96418 invoked by uid 99); 28 May 2015 11:13:24 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2015 11:13:24 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 51D7CAC06FB for ; Thu, 28 May 2015 11:13:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1682209 - in /poi/trunk/src: java/org/apache/poi/sl/usermodel/ ooxml/java/org/apache/poi/xslf/usermodel/ ooxml/testcases/org/apache/poi/xslf/usermodel/ scratchpad/src/org/apache/poi/hslf/model/ Date: Thu, 28 May 2015 11:13:24 -0000 To: commits@poi.apache.org From: nick@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150528111324.51D7CAC06FB@hades.apache.org> Author: nick Date: Thu May 28 11:13:23 2015 New Revision: 1682209 URL: http://svn.apache.org/r1682209 Log: Pull out the parts of TextPainter needed by XSLF from HSLF to common-SL in core #57963 Added: poi/trunk/src/java/org/apache/poi/sl/usermodel/TextPainter.java Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextPainter.java Added: poi/trunk/src/java/org/apache/poi/sl/usermodel/TextPainter.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/usermodel/TextPainter.java?rev=1682209&view=auto ============================================================================== --- poi/trunk/src/java/org/apache/poi/sl/usermodel/TextPainter.java (added) +++ poi/trunk/src/java/org/apache/poi/sl/usermodel/TextPainter.java Thu May 28 11:13:23 2015 @@ -0,0 +1,62 @@ +/* ==================================================================== + 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.sl.usermodel; + +import java.awt.RenderingHints; +import java.text.AttributedString; + +/** + * Common parent for painting Text into a Graphics2D object + * for rendering + */ +public interface TextPainter { + public static final Key KEY_FONTFALLBACK = new Key(50, "Font fallback map"); + public static final Key KEY_FONTMAP = new Key(51, "Font map"); + + public static class TextElement { + public AttributedString _text; + public int _textOffset; + public AttributedString _bullet; + public int _bulletOffset; + public int _align; + public float ascent, descent; + public float advance; + public int textStartIndex, textEndIndex; + } + + public static class Key extends RenderingHints.Key { + String description; + + public Key(int paramInt, String paramString) { + super(paramInt); + this.description = paramString; + } + + public final int getIndex() { + return intKey(); + } + + public final String toString() { + return this.description; + } + + public boolean isCompatibleValue(Object paramObject) { + return true; + } + } +} Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java?rev=1682209&r1=1682208&r2=1682209&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java Thu May 28 11:13:23 2015 @@ -29,7 +29,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import org.apache.poi.hslf.model.TextPainter; +import org.apache.poi.sl.model.TextPainter; import org.apache.poi.util.Beta; import org.apache.poi.util.Internal; import org.apache.poi.util.Units; Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java?rev=1682209&r1=1682208&r2=1682209&view=diff ============================================================================== --- poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java (original) +++ poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java Thu May 28 11:13:23 2015 @@ -25,7 +25,7 @@ import java.awt.image.BufferedImage; import java.util.HashMap; import java.util.Map; -import org.apache.poi.hslf.model.TextPainter; +import org.apache.poi.sl.model.TextPainter; import org.apache.poi.util.JvmBugs; import org.apache.poi.xslf.XSLFTestDataSamples; import org.junit.Test; Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextPainter.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextPainter.java?rev=1682209&r1=1682208&r2=1682209&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextPainter.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextPainter.java Thu May 28 11:13:23 2015 @@ -20,7 +20,6 @@ package org.apache.poi.hslf.model; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; -import java.awt.RenderingHints; import java.awt.font.FontRenderContext; import java.awt.font.LineBreakMeasurer; import java.awt.font.TextAttribute; @@ -41,13 +40,8 @@ import org.apache.poi.util.POILogger; /** * Paint text into java.awt.Graphics2D - * - * @author Yegor Kozlov */ -public final class TextPainter { - public static final Key KEY_FONTFALLBACK = new Key(50, "Font fallback map"); - public static final Key KEY_FONTMAP = new Key(51, "Font map"); - +public final class TextPainter implements org.apache.poi.sl.usermodel.TextPainter { protected POILogger logger = POILogFactory.getLogger(this.getClass()); /** @@ -383,36 +377,4 @@ public final class TextPainter { TextElement[] elems = new TextElement[lines.size()]; return lines.toArray(elems); } - - public static class TextElement { - public AttributedString _text; - public int _textOffset; - public AttributedString _bullet; - public int _bulletOffset; - public int _align; - public float ascent, descent; - public float advance; - public int textStartIndex, textEndIndex; - } - - public static class Key extends RenderingHints.Key { - String description; - - public Key(int paramInt, String paramString) { - super(paramInt); - this.description = paramString; - } - - public final int getIndex() { - return intKey(); - } - - public final String toString() { - return this.description; - } - - public boolean isCompatibleValue(Object paramObject) { - return true; - } - } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org