From ee53e203c081adad79b46fbc0cbf8915318b0727 Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Thu, 9 Jul 2015 22:46:29 +0000 Subject: [PATCH] added ASL header to drawing classes fixed a few rendering NPEs added dummy interfaces for table / connector shapes git-svn-id: https://svn.apache.org/repos/asf/poi/branches/common_sl@1690185 13f79535-47bb-0310-9956-ffa450edef68 --- .../xslf/usermodel/XSLFConnectorShape.java | 4 ++- .../poi/xslf/usermodel/XSLFSimpleShape.java | 2 +- .../apache/poi/xslf/usermodel/XSLFTable.java | 3 +- .../apache/poi/hslf/usermodel/HSLFTable.java | 3 +- .../org/apache/poi/sl/draw/DrawAutoShape.java | 17 ++++++++++ .../apache/poi/sl/draw/DrawBackground.java | 17 ++++++++++ .../poi/sl/draw/DrawConnectorShape.java | 26 ++++++++++++++++ .../org/apache/poi/sl/draw/DrawFactory.java | 12 +++++++ .../apache/poi/sl/draw/DrawFreeformShape.java | 17 ++++++++++ .../apache/poi/sl/draw/DrawGroupShape.java | 17 ++++++++++ .../apache/poi/sl/draw/DrawMasterSheet.java | 17 ++++++++++ .../apache/poi/sl/draw/DrawPictureShape.java | 17 ++++++++++ .../src/org/apache/poi/sl/draw/DrawShape.java | 17 ++++++++++ .../src/org/apache/poi/sl/draw/DrawSheet.java | 17 ++++++++++ .../apache/poi/sl/draw/DrawSimpleShape.java | 17 ++++++++++ .../src/org/apache/poi/sl/draw/DrawSlide.java | 17 ++++++++++ .../apache/poi/sl/draw/DrawTableShape.java | 27 ++++++++++++++++ .../org/apache/poi/sl/draw/DrawTextBox.java | 17 ++++++++++ .../apache/poi/sl/draw/DrawTextFragment.java | 17 ++++++++++ .../apache/poi/sl/draw/DrawTextParagraph.java | 17 ++++++++++ .../org/apache/poi/sl/draw/DrawTextShape.java | 31 ++++++++++++++++++- .../poi/sl/usermodel/ConnectorShape.java | 22 +++++++++++++ .../apache/poi/sl/usermodel/TableShape.java | 22 +++++++++++++ 23 files changed, 368 insertions(+), 5 deletions(-) create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawConnectorShape.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawTableShape.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/ConnectorShape.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/TableShape.java diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java index 8cc1c9274..b894cd080 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java @@ -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.presentationml.x2006.main.CTConnectorNonVisual * @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 XSLFSimpleShape { /** * @param shapeId 1-based shapeId */ + @SuppressWarnings("unused") static CTConnector prototype(int shapeId) { CTConnector ct = CTConnector.Factory.newInstance(); CTConnectorNonVisual nvSpPr = ct.addNewNvCxnSpPr(); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java index fb9718060..ee374602e 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java @@ -77,7 +77,7 @@ public abstract class XSLFSimpleShape extends XSLFShape implements SimpleShape { protected CTTransform2D getXfrm() { PropertyFetcher fetcher = new PropertyFetcher() { public boolean fetch(XSLFShape shape) { - CTShapeProperties pr = getSpPr(); + CTShapeProperties pr = shape.getSpPr(); if (pr.isSetXfrm()) { setValue(pr.getXfrm()); return true; diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java index a6ec8bcfe..9f2bb4903 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java @@ -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.presentationml.x2006.main.CTGraphicalObjectFra * * @author Yegor Kozlov */ -public class XSLFTable extends XSLFGraphicFrame implements Iterable { +public class XSLFTable extends XSLFGraphicFrame implements Iterable, TableShape { static String TABLE_URI = "http://schemas.openxmlformats.org/drawingml/2006/table"; private CTTable _table; diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java index 69a89555c..29fdee2dc 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java @@ -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; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java index f9fc96657..6af2b4b9c 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java @@ -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.*; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawBackground.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawBackground.java index 7b78c69aa..35c844d8d 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawBackground.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawBackground.java @@ -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.*; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawConnectorShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawConnectorShape.java new file mode 100644 index 000000000..0fee07cf6 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawConnectorShape.java @@ -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 extends DrawSimpleShape { + public DrawConnectorShape(T shape) { + super(shape); + } +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java index 6eb30eb70..97b3f5214 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java @@ -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>)shape); } else if (shape instanceof MasterSheet) { @@ -106,6 +110,14 @@ public class DrawFactory { return new DrawFreeformShape(shape); } + public DrawConnectorShape getDrawable(T shape) { + return new DrawConnectorShape(shape); + } + + public DrawTableShape getDrawable(T shape) { + return new DrawTableShape(shape); + } + public >> DrawTextShape getDrawable(T shape) { return new DrawTextShape(shape); } diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java index ed237997a..b8dd7c3f2 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java @@ -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.*; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawGroupShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawGroupShape.java index 31f2496b3..60af5f710 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawGroupShape.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawGroupShape.java @@ -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; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java index 452704a75..6b5d0781d 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java @@ -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.*; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawPictureShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawPictureShape.java index 72a59b8b6..3d00b4ec6 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawPictureShape.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawPictureShape.java @@ -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; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java index 70307578b..c2c9b5f68 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java @@ -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; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java index 551d0527d..e4c7e185e 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java @@ -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; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java index 4ff0034eb..bdd65df6b 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java @@ -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.*; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawSlide.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawSlide.java index 4f5f631ae..70c54d18f 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawSlide.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawSlide.java @@ -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; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTableShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTableShape.java new file mode 100644 index 000000000..ceb6450d0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTableShape.java @@ -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 extends DrawShape { + // to be implemented ... + public DrawTableShape(T shape) { + super(shape); + } +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java index 3c228686f..89d69223f 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java @@ -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.*; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java index 4b2c79e37..acb6b4c76 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java @@ -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; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java index c83abbd5a..6b118617e 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java @@ -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; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java index 221293511..77927bdc6 100644 --- a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java @@ -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>> extends DrawSimpleShape { @@ -146,6 +164,17 @@ public class DrawTextShape fontMap = (Map)graphics.getRenderingHint(Drawable.FONT_MAP); + if (fontMap == null) fontMap = new HashMap(); + fontMap.put("Calibri", "Lucida Sans"); + fontMap.put("Cambria", "Lucida Bright"); + graphics.setRenderingHint(Drawable.FONT_MAP, fontMap); + } } diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/ConnectorShape.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/ConnectorShape.java new file mode 100644 index 000000000..7e2bbf065 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/ConnectorShape.java @@ -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 { + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/TableShape.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/TableShape.java new file mode 100644 index 000000000..48744ec38 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/TableShape.java @@ -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 ... +}