FileDocCategorySizeDatePackage
AutoShape.javaAPI DocApache Poi 3.0.12627Sun Mar 11 12:59:30 GMT 2007org.apache.poi.hslf.model

AutoShape

public class AutoShape extends SimpleShape
Represents a autoshape in a PowerPoint drawing
author
Yegor Kozlov

Fields Summary
Constructors Summary
protected AutoShape(EscherContainerRecord escherRecord, Shape parent)

        super(escherRecord, parent);
    
public AutoShape(int type, Shape parent)

        super(null, parent);
        _escherContainer = createSpContainer(type, parent instanceof ShapeGroup);
    
public AutoShape(int type)

        this(type, null);
    
Methods Summary
protected org.apache.poi.ddf.EscherContainerRecordcreateSpContainer(int shapeType, boolean isChild)

        EscherContainerRecord spcont = super.createSpContainer(isChild);

        EscherSpRecord spRecord = spcont.getChildById(EscherSpRecord.RECORD_ID);
        short type = (short)((shapeType << 4) | 0x2);
        spRecord.setOptions(type);

        //set default properties for an autoshape
        EscherOptRecord opt = (EscherOptRecord)getEscherChild(spcont, EscherOptRecord.RECORD_ID);

        opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.FILL__FILLCOLOR, 0x8000004));
        opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.FILL__FILLBACKCOLOR, 0x8000000));
        opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.FILL__NOFILLHITTEST, 0x100010));
        opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__COLOR, 0x8000001));
        opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80008));
        opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.SHADOWSTYLE__COLOR, 0x8000002));

        return spcont;