/** * Create a new TextBox. This constructor is used when a new shape is created. * * @param parent the parent of this Shape. For example, if this text box is a cell * in a table then the parent is Table. */ public HSLFTextShape(ShapeContainer<HSLFShape,HSLFTextParagraph> parent){ super(null, parent); createSpContainer(parent instanceof HSLFGroupShape); }
/** * Create a new TextBox and initialize its internal structures * * @return the created <code>EscherContainerRecord</code> which holds shape data */ @Override protected EscherContainerRecord createSpContainer(boolean isChild){ EscherContainerRecord ecr = super.createSpContainer(isChild); setShapeType(ShapeType.TEXT_BOX); //set default properties for a TextBox setEscherProperty(EscherProperties.FILL__FILLCOLOR, 0x8000004); setEscherProperty(EscherProperties.FILL__FILLBACKCOLOR, 0x8000000); setEscherProperty(EscherProperties.FILL__NOFILLHITTEST, 0x100000); setEscherProperty(EscherProperties.LINESTYLE__COLOR, 0x8000001); setEscherProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80000); setEscherProperty(EscherProperties.SHADOWSTYLE__COLOR, 0x8000002); // init paragraphs getTextParagraphs(); return ecr; }
protected EscherContainerRecord createSpContainer(ShapeType shapeType, boolean isChild){ EscherContainerRecord ecr = super.createSpContainer(isChild); setShapeType(shapeType); //set default properties for an autoshape setEscherProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x40000); setEscherProperty(EscherProperties.FILL__FILLCOLOR, 0x8000004); setEscherProperty(EscherProperties.FILL__FILLCOLOR, 0x8000004); setEscherProperty(EscherProperties.FILL__FILLBACKCOLOR, 0x8000000); setEscherProperty(EscherProperties.FILL__NOFILLHITTEST, 0x100010); setEscherProperty(EscherProperties.LINESTYLE__COLOR, 0x8000001); setEscherProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80008); setEscherProperty(EscherProperties.SHADOWSTYLE__COLOR, 0x8000002); return ecr; }
@Override protected EscherContainerRecord createSpContainer(boolean isChild){ EscherContainerRecord ecr = super.createSpContainer(isChild); setShapeType(ShapeType.LINE); EscherSpRecord spRecord = ecr.getChildById(EscherSpRecord.RECORD_ID); short type = (short)((ShapeType.LINE.nativeId << 4) | 0x2); spRecord.setOptions(type); //set default properties for a line AbstractEscherOptRecord opt = getEscherOptRecord(); //default line properties setEscherProperty(opt, EscherProperties.GEOMETRY__SHAPEPATH, 4); setEscherProperty(opt, EscherProperties.GEOMETRY__FILLOK, 0x10000); setEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST, 0x100000); setEscherProperty(opt, EscherProperties.LINESTYLE__COLOR, 0x8000001); setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0xA0008); setEscherProperty(opt, EscherProperties.SHADOWSTYLE__COLOR, 0x8000002); return ecr; }