diff options
author | Yegor Kozlov <yegor@apache.org> | 2011-10-28 14:25:53 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2011-10-28 14:25:53 +0000 |
commit | b1cb335834fc9c89102540dcde439d4186462e6b (patch) | |
tree | 8f5ef9720704dd7b12696b2b9c103148a68dc098 /src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java | |
parent | d3ca235708e88ba575d276d41dcaf3b0b4093c67 (diff) | |
download | poi-b1cb335834fc9c89102540dcde439d4186462e6b.tar.gz poi-b1cb335834fc9c89102540dcde439d4186462e6b.zip |
more progress with PPTX2PNG: support for gradient and texture fill, also refactored usages of colors in drawingML
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1190347 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java')
-rw-r--r-- | src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java index 837529a90b..8838fa3e41 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java @@ -17,19 +17,11 @@ package org.apache.poi.xslf.usermodel;
-import org.apache.poi.openxml4j.opc.PackagePart;
-import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.util.Units;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTBackground;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTBackgroundProperties;
import org.openxmlformats.schemas.drawingml.x2006.main.CTOuterShadowEffect;
-import org.openxmlformats.schemas.drawingml.x2006.main.CTPresetColor;
-import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.geom.Rectangle2D;
-import java.awt.geom.AffineTransform;
-import java.awt.image.BufferedImage;
/**
* Represents a shadow of a shape. For now supports only outer shadows.
@@ -49,8 +41,8 @@ public class XSLFShadow extends XSLFSimpleShape { public void draw(Graphics2D graphics) {
Shape outline = _parent.getOutline();
- Color parentFillColor = _parent.getFillColor();
- Color parentLineColor = _parent.getLineColor();
+ Paint parentFillColor = _parent.getFill(graphics);
+ Paint parentLineColor = _parent.getLinePaint(graphics);
double angle = getAngle();
double dist = getDistance();
@@ -120,16 +112,6 @@ public class XSLFShadow extends XSLFSimpleShape { public Color getFillColor() {
XSLFTheme theme = getSheet().getTheme();
CTOuterShadowEffect ct = (CTOuterShadowEffect)getXmlObject();
- if(ct.isSetSchemeClr()) {
- return theme.getSchemeColor(ct.getSchemeClr());
- }
- else if (ct.isSetPrstClr()) {
- return theme.getPresetColor(ct.getPrstClr());
- }
- else if (ct.isSetSrgbClr()) {
- return theme.getSrgbColor(ct.getSrgbClr());
- }
-
- return null;
+ return ct == null ? null : new XSLFColor(ct, theme).getColor();
}
}
\ No newline at end of file |