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;
}
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;
}
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()]);
}
Aggregations