aboutsummaryrefslogtreecommitdiffstats
path: root/src/scratchpad
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2015-07-09 22:46:29 +0000
committerAndreas Beeker <kiwiwings@apache.org>2015-07-09 22:46:29 +0000
commit1102414559fdfe86cb3af5a11a94490aa928f704 (patch)
treecd163d00cd822feab1a1e21b3d18ddb2d7356782 /src/scratchpad
parent3cab0825131d36705c058c2e011c9918c8addfdf (diff)
downloadpoi-1102414559fdfe86cb3af5a11a94490aa928f704.tar.gz
poi-1102414559fdfe86cb3af5a11a94490aa928f704.zip
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
Diffstat (limited to 'src/scratchpad')
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java3
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawBackground.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawConnectorShape.java26
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java12
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawGroupShape.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawPictureShape.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawSlide.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawTableShape.java27
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java17
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java31
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/usermodel/ConnectorShape.java22
-rw-r--r--src/scratchpad/src/org/apache/poi/sl/usermodel/TableShape.java22
20 files changed, 362 insertions, 2 deletions
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<T extends ConnectorShape> extends DrawSimpleShape<T> {
+ 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<? 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);
}
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<T extends TableShape> extends DrawShape<T> {
+ // 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<T extends TextShape<? extends TextParagraph<? extends TextRun>>> extends DrawSimpleShape<T> {
@@ -146,6 +164,17 @@ public class DrawTextShape<T extends TextShape<? extends TextParagraph<? extends
// 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);
+ }
}
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 ...
+}