FileDocCategorySizeDatePackage
EscherTextboxWrapper.javaAPI DocApache Poi 3.0.13411Thu May 31 18:45:28 BST 2007org.apache.poi.hslf.record

EscherTextboxWrapper

public class EscherTextboxWrapper extends RecordContainer
A wrapper around a DDF (Escher) EscherTextbox Record. Causes the DDF Record to be accessible as if it were a HSLF record. Note: when asked to write out, will simply put any child records correctly into the Escher layer. A call to the escher layer to write out (by the parent PPDrawing) will do the actual write out
author
Nick Burch

Fields Summary
private EscherTextboxRecord
_escherRecord
private long
_type
private int
shapeId
Constructors Summary
public EscherTextboxWrapper(EscherTextboxRecord textbox)
Creates the wrapper for the given DDF Escher Record and children

		_escherRecord = textbox;
		_type = (long)_escherRecord.getRecordId();

		// Find the child records in the escher data
		byte[] data = _escherRecord.getData();
		_children = Record.findChildRecords(data,0,data.length);
	
public EscherTextboxWrapper()
Creates a new, empty wrapper for DDF Escher Records and their children

		_escherRecord = new EscherTextboxRecord();
		_escherRecord.setRecordId(EscherTextboxRecord.RECORD_ID);
		_escherRecord.setOptions((short)15);

		_children = new Record[0];
	
Methods Summary
public org.apache.poi.ddf.EscherTextboxRecordgetEscherRecord()
Returns the underlying DDF Escher Record

 return _escherRecord; 
public longgetRecordType()
Return the type of the escher record (normally in the 0xFnnn range)

 return _type; 
public intgetShapeId()

return
Shape ID

        return shapeId;
    
public voidsetShapeId(int id)

param
id Shape ID

        shapeId = id;
    
public voidwriteOut(java.io.OutputStream out)
Stores the data for the child records back into the Escher layer. Doesn't actually do the writing out, that's left to the Escher layer to do. Must be called before writeOut/serialize is called on the underlying Escher object!

		// Write out our children, and stuff them into the Escher layer

		// Grab the children's data
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		for(int i=0; i<_children.length; i++) {
			_children[i].writeOut(baos);
		}
		byte[] data = baos.toByteArray();

		// Save in the escher layer
		_escherRecord.setData(data);