You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2015/07/10 00:46:29 UTC

svn commit: r1690185 - in /poi/branches/common_sl/src: ooxml/java/org/apache/poi/xslf/usermodel/ scratchpad/src/org/apache/poi/hslf/usermodel/ scratchpad/src/org/apache/poi/sl/draw/ scratchpad/src/org/apache/poi/sl/usermodel/

Author: kiwiwings
Date: Thu Jul  9 22:46:29 2015
New Revision: 1690185

URL: http://svn.apache.org/r1690185
Log:
added ASL header to drawing classes
fixed a few rendering NPEs
added dummy interfaces for table / connector shapes

Added:
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawConnectorShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTableShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/ConnectorShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/TableShape.java
Modified:
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawBackground.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawGroupShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawPictureShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSlide.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java Thu Jul  9 22:46:29 2015
@@ -19,6 +19,7 @@
 
 package org.apache.poi.xslf.usermodel;
 
+import org.apache.poi.sl.usermodel.ConnectorShape;
 import org.apache.poi.util.Beta;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps;
@@ -34,7 +35,7 @@ import org.openxmlformats.schemas.presen
  * @author Yegor Kozlov
  */
 @Beta
-public class XSLFConnectorShape extends XSLFSimpleShape {
+public class XSLFConnectorShape extends XSLFSimpleShape implements ConnectorShape {
 
     /*package*/ XSLFConnectorShape(CTConnector shape, XSLFSheet sheet) {
         super(shape, sheet);
@@ -43,6 +44,7 @@ public class XSLFConnectorShape extends
     /**
      * @param shapeId 1-based shapeId
      */
+    @SuppressWarnings("unused")
     static CTConnector prototype(int shapeId) {
         CTConnector ct = CTConnector.Factory.newInstance();
         CTConnectorNonVisual nvSpPr = ct.addNewNvCxnSpPr();

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java Thu Jul  9 22:46:29 2015
@@ -77,7 +77,7 @@ public abstract class XSLFSimpleShape ex
     protected CTTransform2D getXfrm() {
         PropertyFetcher<CTTransform2D> fetcher = new PropertyFetcher<CTTransform2D>() {
             public boolean fetch(XSLFShape shape) {
-                CTShapeProperties pr = getSpPr();
+                CTShapeProperties pr = shape.getSpPr();
                 if (pr.isSetXfrm()) {
                     setValue(pr.getXfrm());
                     return true;

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java Thu Jul  9 22:46:29 2015
@@ -27,6 +27,7 @@ import java.util.List;
 import javax.xml.namespace.QName;
 
 import org.apache.poi.POIXMLException;
+import org.apache.poi.sl.usermodel.TableShape;
 import org.apache.poi.util.Internal;
 import org.apache.poi.util.Units;
 import org.apache.xmlbeans.XmlCursor;
@@ -45,7 +46,7 @@ import org.openxmlformats.schemas.presen
  *
  * @author Yegor Kozlov
  */
-public class XSLFTable extends XSLFGraphicFrame implements Iterable<XSLFTableRow> {
+public class XSLFTable extends XSLFGraphicFrame implements Iterable<XSLFTableRow>, TableShape {
     static String TABLE_URI = "http://schemas.openxmlformats.org/drawingml/2006/table";
 
     private CTTable _table;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java Thu Jul  9 22:46:29 2015
@@ -21,6 +21,7 @@ import org.apache.poi.ddf.*;
 import org.apache.poi.hslf.model.Line;
 import org.apache.poi.hslf.usermodel.*;
 import org.apache.poi.sl.usermodel.ShapeContainer;
+import org.apache.poi.sl.usermodel.TableShape;
 import org.apache.poi.util.LittleEndian;
 
 import java.util.*;
@@ -32,7 +33,7 @@ import java.awt.*;
  *
  * @author Yegor Kozlov
  */
-public final class HSLFTable extends HSLFGroupShape {
+public final class HSLFTable extends HSLFGroupShape implements TableShape {
 
     protected static final int BORDER_TOP = 1;
     protected static final int BORDER_RIGHT = 2;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import org.apache.poi.sl.usermodel.*;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawBackground.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawBackground.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawBackground.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawBackground.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import java.awt.*;

Added: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawConnectorShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawConnectorShape.java?rev=1690185&view=auto
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawConnectorShape.java (added)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawConnectorShape.java Thu Jul  9 22:46:29 2015
@@ -0,0 +1,26 @@
+/* ====================================================================
+   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.draw;
+
+import org.apache.poi.sl.usermodel.*;
+
+public class DrawConnectorShape<T extends ConnectorShape> extends DrawSimpleShape<T> {
+    public DrawConnectorShape(T shape) {
+        super(shape);
+    }
+}

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java Thu Jul  9 22:46:29 2015
@@ -75,6 +75,10 @@ public class DrawFactory {
             return getDrawable((PictureShape)shape);
         } else if (shape instanceof Background) {
             return getDrawable((Background)shape);
+        } else if (shape instanceof ConnectorShape) {
+            return getDrawable((ConnectorShape)shape);
+        } else if (shape instanceof TableShape) {
+            return getDrawable((TableShape)shape);
         } else if (shape instanceof Slide) {
             return getDrawable((Slide<? extends Shape, ? extends SlideShow, ? extends Notes<?,?>>)shape);
         } else if (shape instanceof MasterSheet) {
@@ -106,6 +110,14 @@ public class DrawFactory {
         return new DrawFreeformShape<T>(shape);
     }
 
+    public <T extends ConnectorShape> DrawConnectorShape<T> getDrawable(T shape) {
+        return new DrawConnectorShape<T>(shape);
+    }
+    
+    public <T extends TableShape> DrawTableShape<T> getDrawable(T shape) {
+        return new DrawTableShape<T>(shape);
+    }
+    
     public <T extends TextShape<? extends TextParagraph<? extends TextRun>>> DrawTextShape<T> getDrawable(T shape) {
         return new DrawTextShape<T>(shape);
     }

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import org.apache.poi.sl.usermodel.*;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawGroupShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawGroupShape.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawGroupShape.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawGroupShape.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import java.awt.Graphics2D;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import org.apache.poi.sl.usermodel.*;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawPictureShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawPictureShape.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawPictureShape.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawPictureShape.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import java.awt.Graphics2D;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import java.awt.Graphics2D;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import java.awt.Dimension;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import java.awt.*;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSlide.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSlide.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSlide.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSlide.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import java.awt.Graphics2D;

Added: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTableShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTableShape.java?rev=1690185&view=auto
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTableShape.java (added)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTableShape.java Thu Jul  9 22:46:29 2015
@@ -0,0 +1,27 @@
+/* ====================================================================
+   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.draw;
+
+import org.apache.poi.sl.usermodel.*;
+
+public class DrawTableShape<T extends TableShape> extends DrawShape<T> {
+    // to be implemented ...
+    public DrawTableShape(T shape) {
+        super(shape);
+    }
+}

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import org.apache.poi.sl.usermodel.*;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import java.awt.Graphics2D;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java Thu Jul  9 22:46:29 2015
@@ -1,3 +1,20 @@
+/* ====================================================================
+   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.draw;
 
 import java.awt.Color;

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java?rev=1690185&r1=1690184&r2=1690185&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java Thu Jul  9 22:46:29 2015
@@ -1,13 +1,31 @@
+/* ====================================================================
+   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.draw;
 
 import java.awt.Graphics2D;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Rectangle2D;
 import java.awt.image.BufferedImage;
-import java.util.Iterator;
+import java.util.*;
 
 import org.apache.poi.sl.usermodel.*;
 import org.apache.poi.sl.usermodel.TextParagraph.BulletStyle;
+import org.apache.poi.util.JvmBugs;
 
 public class DrawTextShape<T extends TextShape<? extends TextParagraph<? extends TextRun>>> extends DrawSimpleShape<T> {
 
@@ -146,6 +164,17 @@ public class DrawTextShape<T extends Tex
         // dry-run in a 1x1 image and return the vertical advance
         BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
         Graphics2D graphics = img.createGraphics();
+        fixFonts(graphics);
         return drawParagraphs(graphics, 0, 0);
     }
+    
+    @SuppressWarnings("unchecked")
+    private static void fixFonts(Graphics2D graphics) {
+        if (!JvmBugs.hasLineBreakMeasurerBug()) return;
+        Map<String,String> fontMap = (Map<String,String>)graphics.getRenderingHint(Drawable.FONT_MAP);
+        if (fontMap == null) fontMap = new HashMap<String,String>();
+        fontMap.put("Calibri", "Lucida Sans");
+        fontMap.put("Cambria", "Lucida Bright");
+        graphics.setRenderingHint(Drawable.FONT_MAP, fontMap);        
+    }
 }

Added: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/ConnectorShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/ConnectorShape.java?rev=1690185&view=auto
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/ConnectorShape.java (added)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/ConnectorShape.java Thu Jul  9 22:46:29 2015
@@ -0,0 +1,22 @@
+/* ====================================================================
+   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;
+
+public interface ConnectorShape extends SimpleShape {
+
+}

Added: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/TableShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/TableShape.java?rev=1690185&view=auto
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/TableShape.java (added)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/TableShape.java Thu Jul  9 22:46:29 2015
@@ -0,0 +1,22 @@
+/* ====================================================================
+   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;
+
+public interface TableShape extends Shape {
+    // to be defined ...
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org