From: Andreas Beeker Date: Thu, 9 Jul 2015 22:46:29 +0000 (+0000) Subject: added ASL header to drawing classes X-Git-Tag: REL_3_13_FINAL~207^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1102414559fdfe86cb3af5a11a94490aa928f704;p=poi.git 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 --- 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 8cc1c92745..b894cd080d 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 fb97180605..ee374602e1 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 a6ec8bcfe7..9f2bb49032 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 69a89555c8..29fdee2dc5 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 f9fc966575..6af2b4b9c1 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 7b78c69aa3..35c844d8d0 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 0000000000..0fee07cf6d --- /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 6eb30eb707..97b3f52147 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 ed237997a6..b8dd7c3f20 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 31f2496b32..60af5f710e 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 452704a757..6b5d0781df 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 72a59b8b60..3d00b4ec6b 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 70307578bf..c2c9b5f680 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 551d0527d6..e4c7e185e8 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 4ff0034eba..bdd65df6b2 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 4f5f631aee..70c54d18f7 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 0000000000..ceb6450d0b --- /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 3c228686f1..89d69223ff 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 4b2c79e378..acb6b4c766 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 c83abbd5a5..6b118617e7 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 2212935115..77927bdc69 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 0000000000..7e2bbf065c --- /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 0000000000..48744ec383 --- /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 ... +}