Search in sources :

Example 36 with EscherSimpleProperty

use of org.apache.poi.ddf.EscherSimpleProperty in project poi by apache.

the class HSLFSimpleShape method getLineBackgroundColor.

/**
     * @return background color of the line. If color is not set returns {@code null}
     */
public Color getLineBackgroundColor() {
    AbstractEscherOptRecord opt = getEscherOptRecord();
    EscherSimpleProperty p = getEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH);
    if (p != null && (p.getPropertyValue() & 0x8) == 0) {
        return null;
    }
    Color clr = getColor(EscherProperties.LINESTYLE__BACKCOLOR, EscherProperties.LINESTYLE__OPACITY, -1);
    return clr == null ? null : clr;
}
Also used : EscherSimpleProperty(org.apache.poi.ddf.EscherSimpleProperty) Color(java.awt.Color) AbstractEscherOptRecord(org.apache.poi.ddf.AbstractEscherOptRecord)

Example 37 with EscherSimpleProperty

use of org.apache.poi.ddf.EscherSimpleProperty in project poi by apache.

the class HSLFSimpleShape method getShadowAngle.

public double getShadowAngle() {
    AbstractEscherOptRecord opt = getEscherOptRecord();
    EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.SHADOWSTYLE__OFFSETX);
    int offX = (prop == null) ? 0 : prop.getPropertyValue();
    prop = getEscherProperty(opt, EscherProperties.SHADOWSTYLE__OFFSETY);
    int offY = (prop == null) ? 0 : prop.getPropertyValue();
    return Math.toDegrees(Math.atan2(offY, offX));
}
Also used : EscherSimpleProperty(org.apache.poi.ddf.EscherSimpleProperty) AbstractEscherOptRecord(org.apache.poi.ddf.AbstractEscherOptRecord) DrawPaint(org.apache.poi.sl.draw.DrawPaint) SolidPaint(org.apache.poi.sl.usermodel.PaintStyle.SolidPaint)

Example 38 with EscherSimpleProperty

use of org.apache.poi.ddf.EscherSimpleProperty in project poi by apache.

the class HSLFFill method getForegroundColor.

/**
     * Foreground color
     */
public Color getForegroundColor() {
    AbstractEscherOptRecord opt = shape.getEscherOptRecord();
    EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST);
    int propVal = (p == null) ? 0 : p.getPropertyValue();
    return (FILL_USE_FILLED.isSet(propVal) && !FILL_FILLED.isSet(propVal)) ? null : shape.getColor(EscherProperties.FILL__FILLCOLOR, EscherProperties.FILL__FILLOPACITY, -1);
}
Also used : EscherSimpleProperty(org.apache.poi.ddf.EscherSimpleProperty) AbstractEscherOptRecord(org.apache.poi.ddf.AbstractEscherOptRecord) DrawPaint(org.apache.poi.sl.draw.DrawPaint) GradientPaint(org.apache.poi.sl.usermodel.PaintStyle.GradientPaint) TexturePaint(org.apache.poi.sl.usermodel.PaintStyle.TexturePaint)

Example 39 with EscherSimpleProperty

use of org.apache.poi.ddf.EscherSimpleProperty in project poi by apache.

the class HSLFTextShape method getWordWrapEx.

/**
     * Returns the value indicating word wrap.
     *
     * @return the value indicating word wrap.
     *  Must be one of the <code>Wrap*</code> constants defined in this class.
     *
     * @see <a href="https://msdn.microsoft.com/en-us/library/dd948168(v=office.12).aspx">MSOWRAPMODE</a>
     */
public int getWordWrapEx() {
    AbstractEscherOptRecord opt = getEscherOptRecord();
    EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.TEXT__WRAPTEXT);
    return prop == null ? WrapSquare : prop.getPropertyValue();
}
Also used : EscherSimpleProperty(org.apache.poi.ddf.EscherSimpleProperty) AbstractEscherOptRecord(org.apache.poi.ddf.AbstractEscherOptRecord)

Example 40 with EscherSimpleProperty

use of org.apache.poi.ddf.EscherSimpleProperty in project poi by apache.

the class HSLFTextShape method getTextRotation.

@Override
public Double getTextRotation() {
    // see 2.4.6 MSOCDIR
    AbstractEscherOptRecord opt = getEscherOptRecord();
    EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.TEXT__FONTROTATION);
    return (prop == null) ? null : (90. * prop.getPropertyValue());
}
Also used : EscherSimpleProperty(org.apache.poi.ddf.EscherSimpleProperty) AbstractEscherOptRecord(org.apache.poi.ddf.AbstractEscherOptRecord)

Aggregations

EscherSimpleProperty (org.apache.poi.ddf.EscherSimpleProperty)48 AbstractEscherOptRecord (org.apache.poi.ddf.AbstractEscherOptRecord)36 EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)8 DrawPaint (org.apache.poi.sl.draw.DrawPaint)8 EscherBSERecord (org.apache.poi.ddf.EscherBSERecord)6 GradientPaint (org.apache.poi.sl.usermodel.PaintStyle.GradientPaint)6 TexturePaint (org.apache.poi.sl.usermodel.PaintStyle.TexturePaint)6 Color (java.awt.Color)5 EscherOptRecord (org.apache.poi.ddf.EscherOptRecord)5 EscherRecord (org.apache.poi.ddf.EscherRecord)4 EscherArrayProperty (org.apache.poi.ddf.EscherArrayProperty)3 EscherSpRecord (org.apache.poi.ddf.EscherSpRecord)3 AffineTransform (java.awt.geom.AffineTransform)2 Rectangle2D (java.awt.geom.Rectangle2D)2 EscherBoolProperty (org.apache.poi.ddf.EscherBoolProperty)2 EscherColorRef (org.apache.poi.ddf.EscherColorRef)2 EscherDgRecord (org.apache.poi.ddf.EscherDgRecord)2 EscherProperty (org.apache.poi.ddf.EscherProperty)2 EscherRGBProperty (org.apache.poi.ddf.EscherRGBProperty)2 Document (org.apache.poi.hslf.record.Document)2