Search in sources :

Example 1 with Shadow

use of org.apache.poi.sl.usermodel.Shadow in project poi by apache.

the class HSLFSimpleShape method getShadow.

@Override
public Shadow<HSLFShape, HSLFTextParagraph> getShadow() {
    AbstractEscherOptRecord opt = getEscherOptRecord();
    if (opt == null) {
        return null;
    }
    EscherProperty shadowType = opt.lookup(EscherProperties.SHADOWSTYLE__TYPE);
    if (shadowType == null) {
        return null;
    }
    return new Shadow<HSLFShape, HSLFTextParagraph>() {

        @Override
        public SimpleShape<HSLFShape, HSLFTextParagraph> getShadowParent() {
            return HSLFSimpleShape.this;
        }

        @Override
        public double getDistance() {
            return getShadowDistance();
        }

        @Override
        public double getAngle() {
            return getShadowAngle();
        }

        @Override
        public double getBlur() {
            // TODO Auto-generated method stub
            return 0;
        }

        @Override
        public SolidPaint getFillStyle() {
            return DrawPaint.createSolidPaint(getShadowColor());
        }
    };
}
Also used : Shadow(org.apache.poi.sl.usermodel.Shadow) AbstractEscherOptRecord(org.apache.poi.ddf.AbstractEscherOptRecord) EscherProperty(org.apache.poi.ddf.EscherProperty)

Aggregations

AbstractEscherOptRecord (org.apache.poi.ddf.AbstractEscherOptRecord)1 EscherProperty (org.apache.poi.ddf.EscherProperty)1 Shadow (org.apache.poi.sl.usermodel.Shadow)1