@Override protected ObjRecord createObjRecord() { ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord c = new CommonObjectDataSubRecord(); c.setObjectType(HSSFTextbox.OBJECT_TYPE_TEXT); c.setLocked(true); c.setPrintable(true); c.setAutofill(true); c.setAutoline(true); EndSubRecord e = new EndSubRecord(); obj.addSubRecord(c); obj.addSubRecord(e); return obj; }
.append("0x").append(HexDump.toHex( getObjectType ())) .append(" (").append( getObjectType() ).append(" )"); buffer.append(System.getProperty("line.separator")); buffer.append(" .objectId = ") .append("0x").append(HexDump.toHex( getObjectId ())) .append(" (").append( getObjectId() ).append(" )"); buffer.append(System.getProperty("line.separator")); buffer.append(" .option = ") .append("0x").append(HexDump.toHex( getOption ())) .append(" (").append( getOption() ).append(" )"); buffer.append(System.getProperty("line.separator")); buffer.append(" .locked = ").append(isLocked()).append('\n'); buffer.append(" .printable = ").append(isPrintable()).append('\n'); buffer.append(" .autofill = ").append(isAutofill()).append('\n'); buffer.append(" .autoline = ").append(isAutoline()).append('\n'); buffer.append(" .reserved1 = ") .append("0x").append(HexDump.toHex( getReserved1 ())) .append(" (").append( getReserved1() ).append(" )"); buffer.append(System.getProperty("line.separator")); buffer.append(" .reserved2 = ") .append("0x").append(HexDump.toHex( getReserved2 ())) .append(" (").append( getReserved2() ).append(" )"); buffer.append(System.getProperty("line.separator")); buffer.append(" .reserved3 = ") .append("0x").append(HexDump.toHex( getReserved3 ())) .append(" (").append( getReserved3() ).append(" )"); buffer.append(System.getProperty("line.separator"));
/** * @param shapeId - global shapeId which must be set to EscherSpRecord */ void setShapeId(int shapeId){ EscherSpRecord spRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID); spRecord.setShapeId(shapeId); CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) _objRecord.getSubRecords().get(0); cod.setObjectId((short) (shapeId%1024)); }
/** * Constructs a picture object. */ public HSSFPicture( HSSFShape parent, HSSFAnchor anchor ) { super( parent, anchor ); super.setShapeType(OBJECT_TYPE_PICTURE); CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) getObjRecord().getSubRecords().get(0); cod.setObjectType(CommonObjectDataSubRecord.OBJECT_TYPE_PICTURE); }
@Override public CommonObjectDataSubRecord clone() { CommonObjectDataSubRecord rec = new CommonObjectDataSubRecord(); rec.field_1_objectType = field_1_objectType; rec.field_2_objectId = field_2_objectId; rec.field_3_option = field_3_option; rec.field_4_reserved1 = field_4_reserved1; rec.field_5_reserved2 = field_5_reserved2; rec.field_6_reserved3 = field_6_reserved3; return rec; }
subrecords.add(cmo); while (true) { SubRecord subRecord = SubRecord.createSubRecord(subRecStream, cmo.getObjectType()); subrecords.add(subRecord); if (subRecord.isTerminating()) {
if (sub instanceof CommonObjectDataSubRecord) { CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord) sub; if (cmo.getObjectType() == CommonObjectDataSubRecord.OBJECT_TYPE_COMMENT) { rec = it.next(); if (rec instanceof TextObjectRecord) { noteTxo.put(cmo.getObjectId(), (TextObjectRecord) rec); break;
@Override public void serialize(LittleEndianOutput out) { out.writeShort(sid); out.writeShort(getDataSize()); out.writeShort(field_1_objectType); out.writeShort(field_2_objectId); out.writeShort(field_3_option); out.writeInt(field_4_reserved1); out.writeInt(field_5_reserved2); out.writeInt(field_6_reserved3); }
/** * Creates the low-level records for a comment. * * @param hssfShape The highlevel shape. * @param shapeId The shape id to use for this shape. */ public CommentShape( HSSFComment hssfShape, int shapeId ) { super(hssfShape, shapeId); _note = createNoteRecord(hssfShape, shapeId); ObjRecord obj = getObjRecord(); List<SubRecord> records = obj.getSubRecords(); int cmoIdx = 0; for (int i = 0; i < records.size(); i++) { Object r = records.get(i); if (r instanceof CommonObjectDataSubRecord){ //modify autofill attribute inherited from <code>TextObjectRecord</code> CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord)r; cmo.setAutofill(false); cmoIdx = i; } } //add NoteStructure sub record //we don't know it's format, for now the record data is empty NoteStructureSubRecord u = new NoteStructureSubRecord(); obj.addSubRecord(cmoIdx+1, u); }
public HSSFCombobox(HSSFShape parent, HSSFAnchor anchor) { super(parent, anchor); super.setShapeType(OBJECT_TYPE_COMBO_BOX); CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) getObjRecord().getSubRecords().get(0); cod.setObjectType(CommonObjectDataSubRecord.OBJECT_TYPE_COMBO_BOX); }
return new CommonObjectDataSubRecord(in, secondUShort); case EmbeddedObjectRefSubRecord.sid: return new EmbeddedObjectRefSubRecord(in, secondUShort);
switch (cmo.getObjectType()) { case CommonObjectDataSubRecord.OBJECT_TYPE_PICTURE: shape = new HSSFPicture(container, objRecord);
public void serialize(LittleEndianOutput out) { out.writeShort(sid); out.writeShort(getDataSize()); out.writeShort(field_1_objectType); out.writeShort(field_2_objectId); out.writeShort(field_3_option); out.writeInt(field_4_reserved1); out.writeInt(field_5_reserved2); out.writeInt(field_6_reserved3); }
/** * Creates the low-level records for a comment. * * @param hssfShape The highlevel shape. * @param shapeId The shape id to use for this shape. */ public CommentShape( HSSFComment hssfShape, int shapeId ) { super(hssfShape, shapeId); _note = createNoteRecord(hssfShape, shapeId); ObjRecord obj = getObjRecord(); List<SubRecord> records = obj.getSubRecords(); int cmoIdx = 0; for (int i = 0; i < records.size(); i++) { Object r = records.get(i); if (r instanceof CommonObjectDataSubRecord){ //modify autofill attribute inherited from <code>TextObjectRecord</code> CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord)r; cmo.setAutofill(false); cmoIdx = i; } } //add NoteStructure sub record //we don't know it's format, for now the record data is empty NoteStructureSubRecord u = new NoteStructureSubRecord(); obj.addSubRecord(cmoIdx+1, u); }
@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; }
.append("0x").append(HexDump.toHex( getObjectType ())) .append(" (").append( getObjectType() ).append(" )"); buffer.append(System.getProperty("line.separator")); buffer.append(" .objectId = ") .append("0x").append(HexDump.toHex( getObjectId ())) .append(" (").append( getObjectId() ).append(" )"); buffer.append(System.getProperty("line.separator")); buffer.append(" .option = ") .append("0x").append(HexDump.toHex( getOption ())) .append(" (").append( getOption() ).append(" )"); buffer.append(System.getProperty("line.separator")); buffer.append(" .locked = ").append(isLocked()).append('\n'); buffer.append(" .printable = ").append(isPrintable()).append('\n'); buffer.append(" .autofill = ").append(isAutofill()).append('\n'); buffer.append(" .autoline = ").append(isAutoline()).append('\n'); buffer.append(" .reserved1 = ") .append("0x").append(HexDump.toHex( getReserved1 ())) .append(" (").append( getReserved1() ).append(" )"); buffer.append(System.getProperty("line.separator")); buffer.append(" .reserved2 = ") .append("0x").append(HexDump.toHex( getReserved2 ())) .append(" (").append( getReserved2() ).append(" )"); buffer.append(System.getProperty("line.separator")); buffer.append(" .reserved3 = ") .append("0x").append(HexDump.toHex( getReserved3 ())) .append(" (").append( getReserved3() ).append(" )"); buffer.append(System.getProperty("line.separator"));
private HSSFComment(HSSFShape parent, HSSFAnchor anchor, NoteRecord note) { super(parent, anchor); _note = note; //default color for comments setFillColor(0x08000050); //by default comments are hidden setVisible(false); setAuthor(""); CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) getObjRecord().getSubRecords().get(0); cod.setObjectType(CommonObjectDataSubRecord.OBJECT_TYPE_COMMENT); }
@Override void setShapeId(int shapeId) { if(shapeId > 65535) { throw new IllegalArgumentException("Cannot add more than " + 65535 + " shapes"); } super.setShapeId(shapeId); CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) getObjRecord().getSubRecords().get(0); cod.setObjectId(shapeId); _note.setShapeId(shapeId); }
@Override public CommonObjectDataSubRecord clone() { CommonObjectDataSubRecord rec = new CommonObjectDataSubRecord(); rec.field_1_objectType = field_1_objectType; rec.field_2_objectId = field_2_objectId; rec.field_3_option = field_3_option; rec.field_4_reserved1 = field_4_reserved1; rec.field_5_reserved2 = field_5_reserved2; rec.field_6_reserved3 = field_6_reserved3; return rec; }
if (cell instanceof CommonObjectDataSubRecord) { CommonObjectDataSubRecord obj= (CommonObjectDataSubRecord) sub; if (obj.getObjectType() == CommonObjectDataSubRecord.OBJECT_TYPE_TEXT) { // Check the obj for the value of text box } }