Search in sources :

Example 66 with AbstractEscherOptRecord

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

the class HSLFTextShape method setTextRotation.

@Override
public void setTextRotation(Double rotation) {
    AbstractEscherOptRecord opt = getEscherOptRecord();
    if (rotation == null) {
        opt.removeEscherProperty(EscherProperties.TEXT__FONTROTATION);
    } else {
        int rot = (int) (Math.round(rotation / 90.) % 4L);
        setEscherProperty(EscherProperties.TEXT__FONTROTATION, rot);
    }
}
Also used : AbstractEscherOptRecord(org.apache.poi.ddf.AbstractEscherOptRecord)

Example 67 with AbstractEscherOptRecord

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

the class HSLFTableCell method createSpContainer.

@Override
protected EscherContainerRecord createSpContainer(boolean isChild) {
    EscherContainerRecord ecr = super.createSpContainer(isChild);
    AbstractEscherOptRecord opt = getEscherOptRecord();
    setEscherProperty(opt, EscherProperties.TEXT__TEXTID, 0);
    setEscherProperty(opt, EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x20000);
    setEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST, 0x150001);
    setEscherProperty(opt, EscherProperties.SHADOWSTYLE__SHADOWOBSURED, 0x20000);
    setEscherProperty(opt, EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x40000);
    return ecr;
}
Also used : EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) AbstractEscherOptRecord(org.apache.poi.ddf.AbstractEscherOptRecord)

Example 68 with AbstractEscherOptRecord

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

the class TestBackground method getFillPictureRefCount.

private int getFillPictureRefCount(HSLFShape shape, HSLFFill fill) {
    AbstractEscherOptRecord opt = shape.getEscherOptRecord();
    EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__PATTERNTEXTURE);
    if (p != null) {
        int idx = p.getPropertyValue();
        HSLFSheet sheet = shape.getSheet();
        HSLFSlideShow ppt = sheet.getSlideShow();
        Document doc = ppt.getDocumentRecord();
        EscherContainerRecord dggContainer = doc.getPPDrawingGroup().getDggContainer();
        EscherContainerRecord bstore = HSLFShape.getEscherChild(dggContainer, EscherContainerRecord.BSTORE_CONTAINER);
        List<EscherRecord> lst = bstore.getChildRecords();
        return ((EscherBSERecord) lst.get(idx - 1)).getRef();
    }
    return 0;
}
Also used : EscherSimpleProperty(org.apache.poi.ddf.EscherSimpleProperty) HSLFSheet(org.apache.poi.hslf.usermodel.HSLFSheet) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) EscherRecord(org.apache.poi.ddf.EscherRecord) Document(org.apache.poi.hslf.record.Document) AbstractEscherOptRecord(org.apache.poi.ddf.AbstractEscherOptRecord) HSLFSlideShow(org.apache.poi.hslf.usermodel.HSLFSlideShow) EscherBSERecord(org.apache.poi.ddf.EscherBSERecord)

Aggregations

AbstractEscherOptRecord (org.apache.poi.ddf.AbstractEscherOptRecord)68 EscherSimpleProperty (org.apache.poi.ddf.EscherSimpleProperty)36 DrawPaint (org.apache.poi.sl.draw.DrawPaint)13 Color (java.awt.Color)8 GradientPaint (org.apache.poi.sl.usermodel.PaintStyle.GradientPaint)7 TexturePaint (org.apache.poi.sl.usermodel.PaintStyle.TexturePaint)7 EscherArrayProperty (org.apache.poi.ddf.EscherArrayProperty)6 EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)6 SolidPaint (org.apache.poi.sl.usermodel.PaintStyle.SolidPaint)6 EscherBSERecord (org.apache.poi.ddf.EscherBSERecord)4 Rectangle2D (java.awt.geom.Rectangle2D)3 EscherColorRef (org.apache.poi.ddf.EscherColorRef)3 EscherComplexProperty (org.apache.poi.ddf.EscherComplexProperty)3 EscherRecord (org.apache.poi.ddf.EscherRecord)3 EscherSpRecord (org.apache.poi.ddf.EscherSpRecord)3 AffineTransform (java.awt.geom.AffineTransform)2 EscherProperty (org.apache.poi.ddf.EscherProperty)2 Document (org.apache.poi.hslf.record.Document)2 Test (org.junit.Test)2 Insets (java.awt.Insets)1