Search in sources :

Example 1 with ObjRecord

use of org.apache.poi.hssf.record.ObjRecord in project poi by apache.

the class HSSFComment method cloneShape.

@Override
protected HSSFShape cloneShape() {
    TextObjectRecord txo = (TextObjectRecord) getTextObjectRecord().cloneViaReserialise();
    EscherContainerRecord spContainer = new EscherContainerRecord();
    byte[] inSp = getEscherContainer().serialize();
    spContainer.fillFields(inSp, 0, new DefaultEscherRecordFactory());
    ObjRecord obj = (ObjRecord) getObjRecord().cloneViaReserialise();
    NoteRecord note = (NoteRecord) getNoteRecord().cloneViaReserialise();
    return new HSSFComment(spContainer, obj, txo, note);
}
Also used : TextObjectRecord(org.apache.poi.hssf.record.TextObjectRecord) NoteRecord(org.apache.poi.hssf.record.NoteRecord) ObjRecord(org.apache.poi.hssf.record.ObjRecord) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) DefaultEscherRecordFactory(org.apache.poi.ddf.DefaultEscherRecordFactory)

Example 2 with ObjRecord

use of org.apache.poi.hssf.record.ObjRecord in project poi by apache.

the class HSSFPicture method cloneShape.

@Override
protected HSSFShape cloneShape() {
    EscherContainerRecord spContainer = new EscherContainerRecord();
    byte[] inSp = getEscherContainer().serialize();
    spContainer.fillFields(inSp, 0, new DefaultEscherRecordFactory());
    ObjRecord obj = (ObjRecord) getObjRecord().cloneViaReserialise();
    return new HSSFPicture(spContainer, obj);
}
Also used : ObjRecord(org.apache.poi.hssf.record.ObjRecord) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) DefaultEscherRecordFactory(org.apache.poi.ddf.DefaultEscherRecordFactory)

Example 3 with ObjRecord

use of org.apache.poi.hssf.record.ObjRecord in project poi by apache.

the class HSSFComment method createObjRecord.

@Override
protected ObjRecord createObjRecord() {
    ObjRecord obj = new ObjRecord();
    CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
    c.setObjectType(OBJECT_TYPE_COMMENT);
    c.setLocked(true);
    c.setPrintable(true);
    c.setAutofill(false);
    c.setAutoline(true);
    NoteStructureSubRecord u = new NoteStructureSubRecord();
    EndSubRecord e = new EndSubRecord();
    obj.addSubRecord(c);
    obj.addSubRecord(u);
    obj.addSubRecord(e);
    return obj;
}
Also used : CommonObjectDataSubRecord(org.apache.poi.hssf.record.CommonObjectDataSubRecord) EndSubRecord(org.apache.poi.hssf.record.EndSubRecord) ObjRecord(org.apache.poi.hssf.record.ObjRecord) NoteStructureSubRecord(org.apache.poi.hssf.record.NoteStructureSubRecord)

Example 4 with ObjRecord

use of org.apache.poi.hssf.record.ObjRecord in project poi by apache.

the class HSSFSimpleShape method createObjRecord.

@Override
protected ObjRecord createObjRecord() {
    ObjRecord obj = new ObjRecord();
    CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
    c.setLocked(true);
    c.setPrintable(true);
    c.setAutofill(true);
    c.setAutoline(true);
    EndSubRecord e = new EndSubRecord();
    obj.addSubRecord(c);
    obj.addSubRecord(e);
    return obj;
}
Also used : CommonObjectDataSubRecord(org.apache.poi.hssf.record.CommonObjectDataSubRecord) EndSubRecord(org.apache.poi.hssf.record.EndSubRecord) ObjRecord(org.apache.poi.hssf.record.ObjRecord)

Example 5 with ObjRecord

use of org.apache.poi.hssf.record.ObjRecord in project poi by apache.

the class TestSheet method testCreateAggregate.

@Test
public void testCreateAggregate() {
    String msoDrawingRecord1 = "0F 00 02 F0 20 01 00 00 10 00 08 F0 08 00 00 00 \n" + "03 00 00 00 02 04 00 00 0F 00 03 F0 08 01 00 00 \n" + "0F 00 04 F0 28 00 00 00 01 00 09 F0 10 00 00 00 \n" + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n" + "02 00 0A F0 08 00 00 00 00 04 00 00 05 00 00 00 \n" + "0F 00 04 F0 64 00 00 00 42 01 0A F0 08 00 00 00 \n" + "01 04 00 00 00 0A 00 00 73 00 0B F0 2A 00 00 00 \n" + "BF 00 08 00 08 00 44 01 04 00 00 00 7F 01 00 00 \n" + "01 00 BF 01 00 00 11 00 C0 01 40 00 00 08 FF 01 \n" + "10 00 10 00 BF 03 00 00 08 00 00 00 10 F0 12 00 \n" + "00 00 00 00 01 00 54 00 05 00 45 00 01 00 88 03 \n" + "05 00 94 00 00 00 11 F0 00 00 00 00";
    String msoDrawingRecord2 = "0F 00 04 F0 64 00 00 00 42 01 0A F0 08 00 00 00 " + "02 04 00 00 80 0A 00 00 73 00 0B F0 2A 00 00 00 " + "BF 00 08 00 08 00 44 01 04 00 00 00 7F 01 00 00 " + "01 00 BF 01 00 00 11 00 C0 01 40 00 00 08 FF 01 " + "10 00 10 00 BF 03 00 00 08 00 00 00 10 F0 12 00 " + "00 00 00 00 01 00 8D 03 05 00 E4 00 03 00 4D 03 " + "0B 00 0C 00 00 00 11 F0 00 00 00 00";
    DrawingRecord d1 = new DrawingRecord();
    d1.setData(HexRead.readFromString(msoDrawingRecord1));
    ObjRecord r1 = new ObjRecord();
    DrawingRecord d2 = new DrawingRecord();
    d2.setData(HexRead.readFromString(msoDrawingRecord2));
    TextObjectRecord r2 = new TextObjectRecord();
    r2.setStr(new HSSFRichTextString("Aggregated"));
    NoteRecord n2 = new NoteRecord();
    List<Record> recordStream = new ArrayList<Record>();
    recordStream.add(InternalSheet.createBOF());
    recordStream.add(d1);
    recordStream.add(r1);
    recordStream.add(createWindow2Record());
    recordStream.add(EOFRecord.instance);
    confirmAggregatedRecords(recordStream);
    recordStream = new ArrayList<Record>();
    recordStream.add(InternalSheet.createBOF());
    recordStream.add(d1);
    recordStream.add(r1);
    recordStream.add(d2);
    recordStream.add(r2);
    recordStream.add(createWindow2Record());
    recordStream.add(EOFRecord.instance);
    confirmAggregatedRecords(recordStream);
    recordStream = new ArrayList<Record>();
    recordStream.add(InternalSheet.createBOF());
    recordStream.add(d1);
    recordStream.add(r1);
    recordStream.add(d2);
    recordStream.add(r2);
    recordStream.add(n2);
    recordStream.add(createWindow2Record());
    recordStream.add(EOFRecord.instance);
    confirmAggregatedRecords(recordStream);
}
Also used : TextObjectRecord(org.apache.poi.hssf.record.TextObjectRecord) HSSFRichTextString(org.apache.poi.hssf.usermodel.HSSFRichTextString) NoteRecord(org.apache.poi.hssf.record.NoteRecord) ArrayList(java.util.ArrayList) ObjRecord(org.apache.poi.hssf.record.ObjRecord) StringRecord(org.apache.poi.hssf.record.StringRecord) GutsRecord(org.apache.poi.hssf.record.GutsRecord) MergeCellsRecord(org.apache.poi.hssf.record.MergeCellsRecord) DrawingRecord(org.apache.poi.hssf.record.DrawingRecord) NoteRecord(org.apache.poi.hssf.record.NoteRecord) Record(org.apache.poi.hssf.record.Record) ObjRecord(org.apache.poi.hssf.record.ObjRecord) EOFRecord(org.apache.poi.hssf.record.EOFRecord) RowRecord(org.apache.poi.hssf.record.RowRecord) ColumnInfoRecord(org.apache.poi.hssf.record.ColumnInfoRecord) WindowTwoRecord(org.apache.poi.hssf.record.WindowTwoRecord) EscherDggRecord(org.apache.poi.ddf.EscherDggRecord) TextObjectRecord(org.apache.poi.hssf.record.TextObjectRecord) IndexRecord(org.apache.poi.hssf.record.IndexRecord) BOFRecord(org.apache.poi.hssf.record.BOFRecord) NumberRecord(org.apache.poi.hssf.record.NumberRecord) MulBlankRecord(org.apache.poi.hssf.record.MulBlankRecord) UncalcedRecord(org.apache.poi.hssf.record.UncalcedRecord) DimensionsRecord(org.apache.poi.hssf.record.DimensionsRecord) BlankRecord(org.apache.poi.hssf.record.BlankRecord) FormulaRecord(org.apache.poi.hssf.record.FormulaRecord) HSSFRichTextString(org.apache.poi.hssf.usermodel.HSSFRichTextString) DrawingRecord(org.apache.poi.hssf.record.DrawingRecord) Test(org.junit.Test)

Aggregations

ObjRecord (org.apache.poi.hssf.record.ObjRecord)17 TextObjectRecord (org.apache.poi.hssf.record.TextObjectRecord)10 Test (org.junit.Test)10 EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)9 NoteRecord (org.apache.poi.hssf.record.NoteRecord)7 CommonObjectDataSubRecord (org.apache.poi.hssf.record.CommonObjectDataSubRecord)6 EscherDggRecord (org.apache.poi.ddf.EscherDggRecord)5 EscherRecord (org.apache.poi.ddf.EscherRecord)5 DrawingRecord (org.apache.poi.hssf.record.DrawingRecord)5 EOFRecord (org.apache.poi.hssf.record.EOFRecord)5 Record (org.apache.poi.hssf.record.Record)5 WindowTwoRecord (org.apache.poi.hssf.record.WindowTwoRecord)5 ContinueRecord (org.apache.poi.hssf.record.ContinueRecord)4 EscherAggregate (org.apache.poi.hssf.record.EscherAggregate)4 RecordBase (org.apache.poi.hssf.record.RecordBase)4 RowRecordsAggregate (org.apache.poi.hssf.record.aggregates.RowRecordsAggregate)4 HSSFSheet (org.apache.poi.hssf.usermodel.HSSFSheet)4 HSSFWorkbook (org.apache.poi.hssf.usermodel.HSSFWorkbook)4 DefaultEscherRecordFactory (org.apache.poi.ddf.DefaultEscherRecordFactory)3 EndSubRecord (org.apache.poi.hssf.record.EndSubRecord)3