Search in sources :

Example 1 with EscherPropertyFactory

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

the class HSLFShapeFactory method createShapeGroup.

public static HSLFGroupShape createShapeGroup(EscherContainerRecord spContainer, ShapeContainer<HSLFShape, HSLFTextParagraph> parent) {
    boolean isTable = false;
    EscherContainerRecord ecr = (EscherContainerRecord) spContainer.getChild(0);
    EscherRecord opt = HSLFShape.getEscherChild(ecr, RecordTypes.EscherUserDefined);
    if (opt != null) {
        EscherPropertyFactory f = new EscherPropertyFactory();
        List<EscherProperty> props = f.createProperties(opt.serialize(), 8, opt.getInstance());
        for (EscherProperty ep : props) {
            if (ep.getPropertyNumber() == EscherProperties.GROUPSHAPE__TABLEPROPERTIES && ep instanceof EscherSimpleProperty && (((EscherSimpleProperty) ep).getPropertyValue() & 1) == 1) {
                isTable = true;
                break;
            }
        }
    }
    HSLFGroupShape group;
    if (isTable) {
        group = new HSLFTable(spContainer, parent);
    } else {
        group = new HSLFGroupShape(spContainer, parent);
    }
    return group;
}
Also used : EscherSimpleProperty(org.apache.poi.ddf.EscherSimpleProperty) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) EscherRecord(org.apache.poi.ddf.EscherRecord) EscherPropertyFactory(org.apache.poi.ddf.EscherPropertyFactory) EscherProperty(org.apache.poi.ddf.EscherProperty)

Aggregations

EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)1 EscherProperty (org.apache.poi.ddf.EscherProperty)1 EscherPropertyFactory (org.apache.poi.ddf.EscherPropertyFactory)1 EscherRecord (org.apache.poi.ddf.EscherRecord)1 EscherSimpleProperty (org.apache.poi.ddf.EscherSimpleProperty)1