Examples of EscherSpRecord


Examples of org.apache.poi.ddf.EscherSpRecord

        return group;
     }

    public static Shape createSimpeShape(EscherContainerRecord spContainer, Shape parent){
        Shape shape = null;
        EscherSpRecord spRecord = spContainer.getChildById(EscherSpRecord.RECORD_ID);

        int type = spRecord.getShapeType();
        switch (type){
            case ShapeTypes.TextBox:
                shape = new TextBox(spContainer, parent);
                break;
            case ShapeTypes.HostControl:
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

        dg.setOptions((short)(dgId << 4));
        dgg.setDrawingsSaved(dgg.getDrawingsSaved() + 1);
        dgg.setMaxDrawingGroupId(dgId);

        for (EscherContainerRecord c : dgContainer.getChildContainers()) {
            EscherSpRecord spr = null;
            switch(c.getRecordId()){
                case EscherContainerRecord.SPGR_CONTAINER:
                    EscherContainerRecord dc = (EscherContainerRecord)c.getChild(0);
                    spr = dc.getChildById(EscherSpRecord.RECORD_ID);
                    break;
                case EscherContainerRecord.SP_CONTAINER:
                    spr = c.getChildById(EscherSpRecord.RECORD_ID);
                    break;
            }
            if(spr != null) spr.setShapeId(allocateShapeId());
        }

        //PPT doen't increment the number of saved shapes for group descriptor and background
        dg.setNumShapes(1);
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

    protected EscherContainerRecord createSpContainer(boolean isChild) {
        _escherContainer = new EscherContainerRecord();
        _escherContainer.setRecordId( EscherContainerRecord.SP_CONTAINER );
        _escherContainer.setOptions((short)15);

        EscherSpRecord sp = new EscherSpRecord();
        int flags = EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE;
        if (isChild) flags |= EscherSpRecord.FLAG_CHILD;
        sp.setFlags(flags);
        _escherContainer.addChildRecord(sp);

        EscherOptRecord opt = new EscherOptRecord();
        opt.setRecordId(EscherOptRecord.RECORD_ID);
        _escherContainer.addChildRecord(opt);
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

     * Whether the shape is horizontally flipped
     *
     * @return whether the shape is horizontally flipped
     */
     public boolean getFlipHorizontal(){
        EscherSpRecord spRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID);
        return (spRecord.getFlags()& EscherSpRecord.FLAG_FLIPHORIZ) != 0;
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

     * Whether the shape is vertically flipped
     *
     * @return whether the shape is vertically flipped
     */
    public boolean getFlipVertical(){
        EscherSpRecord spRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID);
        return (spRecord.getFlags()& EscherSpRecord.FLAG_FLIPVERT) != 0;
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

       
        // create picture shape, which need to be minimal modified for oleshapes
        HSSFPicture shape = new HSSFPicture(null, anchor);
        shape.setPictureIndex(pictureIndex);
        EscherContainerRecord spContainer = shape.getEscherContainer();
        EscherSpRecord spRecord = spContainer.getChildById(EscherSpRecord.RECORD_ID);
        spRecord.setFlags(spRecord.getFlags() |  EscherSpRecord.FLAG_OLESHAPE);
       
        HSSFObjectData oleShape = new HSSFObjectData(spContainer, obj, oleRoot);
        addShape(oleShape);
        onCreate(oleShape);
       
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

            }
            if(_txtrun == null) {
                logger.log(POILogger.WARN, "text run not found for OutlineTextRefAtom.TextIndex=" + idx);
            }
        } else {
            EscherSpRecord escherSpRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID);
            int shapeId = escherSpRecord.getShapeId();
            if(runs != null) for (int i = 0; i < runs.length; i++) {
                if(runs[i].getShapeId() == shapeId){
                    _txtrun = runs[i];
                    break;
                }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

                    for(Iterator<EscherRecord> spIt = cp.getChildRecords().iterator(); spIt.hasNext();) {
                        EscherContainerRecord shapeContainer = (EscherContainerRecord)spIt.next();
                        for(EscherRecord shapeChildRecord : shapeContainer.getChildRecords()) {
                            int recordId = shapeChildRecord.getRecordId();
                            if (recordId == EscherSpRecord.RECORD_ID){
                                EscherSpRecord sp = (EscherSpRecord)shapeChildRecord;
                                int shapeId = drawingManager.allocateShapeId((short)dgId, dg);
                                //allocateShapeId increments the number of shapes. roll back to the previous value
                                dg.setNumShapes(dg.getNumShapes()-1);
                                sp.setShapeId(shapeId);
                            } else if (recordId == EscherOptRecord.RECORD_ID){
                                EscherOptRecord opt = (EscherOptRecord)shapeChildRecord;
                                EscherSimpleProperty prop = (EscherSimpleProperty)opt.lookup(
                                        EscherProperties.BLIP__BLIPTODISPLAY );
                                if (prop != null){
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

            throws Exception
    {
        DrawingGroupRecord r = new DrawingGroupRecord();
        assertEquals(4, r.getRecordSize());

        EscherSpRecord sp = new EscherSpRecord();
        sp.setRecordId(EscherSpRecord.RECORD_ID);
        sp.setOptions((short) 0x1111);
        sp.setFlags(-1);
        sp.setShapeId(-1);
        EscherContainerRecord dggContainer = new EscherContainerRecord();
        dggContainer.setOptions((short) 0x000F);
        dggContainer.setRecordId((short) 0xF000);
        dggContainer.addChildRecord(sp);
View Full Code Here

Examples of org.apache.poi.ddf.EscherSpRecord

        EscherContainerRecord container1 = new EscherContainerRecord();
        EscherContainerRecord spContainer1 = new EscherContainerRecord();
        EscherContainerRecord spContainer2 = new EscherContainerRecord();
        EscherContainerRecord spContainer3 = new EscherContainerRecord();
        EscherSpRecord sp1 = new EscherSpRecord();
        EscherSpRecord sp2 = new EscherSpRecord();
        EscherSpRecord sp3 = new EscherSpRecord();
        EscherClientDataRecord d2 = new EscherClientDataRecord();
        EscherClientDataRecord d3 = new EscherClientDataRecord();

        container1.setOptions( (short) 0x000F );
        spContainer1.setOptions( (short) 0x000F );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.