Search in sources :

Example 6 with EscherTextboxRecord

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

the class HSSFSimpleShape method getOrCreateTextObjRecord.

private TextObjectRecord getOrCreateTextObjRecord() {
    if (getTextObjectRecord() == null) {
        _textObjectRecord = createTextObjRecord();
    }
    EscherTextboxRecord escherTextbox = getEscherContainer().getChildById(EscherTextboxRecord.RECORD_ID);
    if (null == escherTextbox) {
        escherTextbox = new EscherTextboxRecord();
        escherTextbox.setRecordId(EscherTextboxRecord.RECORD_ID);
        escherTextbox.setOptions((short) 0x0000);
        getEscherContainer().addChildRecord(escherTextbox);
        getPatriarch().getBoundAggregate().associateShapeToObjRecord(escherTextbox, _textObjectRecord);
    }
    return _textObjectRecord;
}
Also used : EscherTextboxRecord(org.apache.poi.ddf.EscherTextboxRecord)

Example 7 with EscherTextboxRecord

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

the class HSSFSimpleShape method createSpContainer.

@Override
protected EscherContainerRecord createSpContainer() {
    EscherContainerRecord spContainer = new EscherContainerRecord();
    spContainer.setRecordId(EscherContainerRecord.SP_CONTAINER);
    spContainer.setOptions((short) 0x000F);
    EscherSpRecord sp = new EscherSpRecord();
    sp.setRecordId(EscherSpRecord.RECORD_ID);
    sp.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE);
    sp.setVersion((short) 0x2);
    EscherClientDataRecord clientData = new EscherClientDataRecord();
    clientData.setRecordId(EscherClientDataRecord.RECORD_ID);
    clientData.setOptions((short) (0x0000));
    EscherOptRecord optRecord = new EscherOptRecord();
    optRecord.setEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEDASHING, LINESTYLE_SOLID));
    optRecord.setEscherProperty(new EscherBoolProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080008));
    //        optRecord.setEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEWIDTH, LINEWIDTH_DEFAULT));
    optRecord.setEscherProperty(new EscherRGBProperty(EscherProperties.FILL__FILLCOLOR, FILL__FILLCOLOR_DEFAULT));
    optRecord.setEscherProperty(new EscherRGBProperty(EscherProperties.LINESTYLE__COLOR, LINESTYLE__COLOR_DEFAULT));
    optRecord.setEscherProperty(new EscherBoolProperty(EscherProperties.FILL__NOFILLHITTEST, NO_FILLHITTEST_FALSE));
    optRecord.setEscherProperty(new EscherBoolProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080008));
    optRecord.setEscherProperty(new EscherShapePathProperty(EscherProperties.GEOMETRY__SHAPEPATH, EscherShapePathProperty.COMPLEX));
    optRecord.setEscherProperty(new EscherBoolProperty(EscherProperties.GROUPSHAPE__PRINT, 0x080000));
    optRecord.setRecordId(EscherOptRecord.RECORD_ID);
    EscherTextboxRecord escherTextbox = new EscherTextboxRecord();
    escherTextbox.setRecordId(EscherTextboxRecord.RECORD_ID);
    escherTextbox.setOptions((short) 0x0000);
    spContainer.addChildRecord(sp);
    spContainer.addChildRecord(optRecord);
    spContainer.addChildRecord(getAnchor().getEscherAnchor());
    spContainer.addChildRecord(clientData);
    spContainer.addChildRecord(escherTextbox);
    return spContainer;
}
Also used : EscherBoolProperty(org.apache.poi.ddf.EscherBoolProperty) EscherSimpleProperty(org.apache.poi.ddf.EscherSimpleProperty) EscherSpRecord(org.apache.poi.ddf.EscherSpRecord) EscherTextboxRecord(org.apache.poi.ddf.EscherTextboxRecord) EscherClientDataRecord(org.apache.poi.ddf.EscherClientDataRecord) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) EscherShapePathProperty(org.apache.poi.ddf.EscherShapePathProperty) EscherOptRecord(org.apache.poi.ddf.EscherOptRecord) EscherRGBProperty(org.apache.poi.ddf.EscherRGBProperty)

Example 8 with EscherTextboxRecord

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

the class PPDrawing method findInDgContainer.

private EscherTextboxWrapper[] findInDgContainer(final EscherContainerRecord dgContainer) {
    final List<EscherTextboxWrapper> found = new LinkedList<EscherTextboxWrapper>();
    final EscherContainerRecord spgrContainer = findFirstEscherContainerRecordOfType(RecordTypes.EscherSpgrContainer, dgContainer);
    final EscherContainerRecord[] spContainers = findAllEscherContainerRecordOfType(RecordTypes.EscherSpContainer, spgrContainer);
    for (EscherContainerRecord spContainer : spContainers) {
        EscherSpRecord sp = (EscherSpRecord) findFirstEscherRecordOfType(RecordTypes.EscherSp, spContainer);
        EscherTextboxRecord clientTextbox = (EscherTextboxRecord) findFirstEscherRecordOfType(RecordTypes.EscherClientTextbox, spContainer);
        if (null == clientTextbox) {
            continue;
        }
        EscherTextboxWrapper w = new EscherTextboxWrapper(clientTextbox);
        StyleTextProp9Atom nineAtom = findInSpContainer(spContainer);
        w.setStyleTextProp9Atom(nineAtom);
        if (null != sp) {
            w.setShapeId(sp.getShapeId());
        }
        found.add(w);
    }
    return found.toArray(new EscherTextboxWrapper[found.size()]);
}
Also used : EscherSpRecord(org.apache.poi.ddf.EscherSpRecord) EscherTextboxRecord(org.apache.poi.ddf.EscherTextboxRecord) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) LinkedList(java.util.LinkedList)

Aggregations

EscherTextboxRecord (org.apache.poi.ddf.EscherTextboxRecord)8 EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)4 EscherSpRecord (org.apache.poi.ddf.EscherSpRecord)4 EscherRecord (org.apache.poi.ddf.EscherRecord)3 EscherTextboxWrapper (org.apache.poi.hslf.record.EscherTextboxWrapper)2 LinkedList (java.util.LinkedList)1 DefaultEscherRecordFactory (org.apache.poi.ddf.DefaultEscherRecordFactory)1 EscherBoolProperty (org.apache.poi.ddf.EscherBoolProperty)1 EscherClientDataRecord (org.apache.poi.ddf.EscherClientDataRecord)1 EscherOptRecord (org.apache.poi.ddf.EscherOptRecord)1 EscherRGBProperty (org.apache.poi.ddf.EscherRGBProperty)1 EscherShapePathProperty (org.apache.poi.ddf.EscherShapePathProperty)1 EscherSimpleProperty (org.apache.poi.ddf.EscherSimpleProperty)1 HSLFEscherRecordFactory (org.apache.poi.hslf.record.HSLFEscherRecordFactory)1 PPDrawing (org.apache.poi.hslf.record.PPDrawing)1 Record (org.apache.poi.hslf.record.Record)1 StyleTextPropAtom (org.apache.poi.hslf.record.StyleTextPropAtom)1 TextBytesAtom (org.apache.poi.hslf.record.TextBytesAtom)1 TextCharsAtom (org.apache.poi.hslf.record.TextCharsAtom)1 ShapeType (org.apache.poi.sl.usermodel.ShapeType)1