Examples of EscherSimpleProperty


Examples of org.apache.poi.ddf.EscherSimpleProperty

        EscherRecord opt = Shape.getEscherChild((EscherContainerRecord)spContainer.getChild(0), (short)0xF122);
        if(opt != null){
            try {
                EscherPropertyFactory f = new EscherPropertyFactory();
                List props = f.createProperties( opt.serialize(), 8, opt.getInstance() );
                EscherSimpleProperty p = (EscherSimpleProperty)props.get(0);
                if(p.getPropertyNumber() == 0x39F && p.getPropertyValue() == 1){
                    group = new Table(spContainer, parent);
                } else {
                    group = new ShapeGroup(spContainer, parent);
                }
            } catch (Exception e){
View Full Code Here

Examples of org.apache.poi.ddf.EscherSimpleProperty

     *
     * @return the type of alignment
     */
    public int getVerticalAlignment(){
        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
        EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__ANCHORTEXT);
        int valign = TextShape.AnchorTop;
        if (prop == null){
            /**
             * If vertical alignment was not found in the shape properties then try to
             * fetch the master shape and search for the align property there.
             */
            int type = getTextRun().getRunType();
            MasterSheet master = getSheet().getMasterSheet();
            if(master != null){
                TextShape masterShape = master.getPlaceholderByTextType(type);
                if(masterShape != null) valign = masterShape.getVerticalAlignment();
            } else {
                //not found in the master sheet. Use the hardcoded defaults.
                switch (type){
                     case TextHeaderAtom.TITLE_TYPE:
                     case TextHeaderAtom.CENTER_TITLE_TYPE:
                         valign = TextShape.AnchorMiddle;
                         break;
                     default:
                         valign = TextShape.AnchorTop;
                         break;
                 }
            }
        } else {
            valign = prop.getPropertyValue();
        }
        return valign;
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSimpleProperty

     *
     * @return the type of alignment
     */
    public int getVerticalAlignment(){
        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
        EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__ANCHORTEXT);
        int valign = TextShape.AnchorTop;
        if (prop == null){
            /**
             * If vertical alignment was not found in the shape properties then try to
             * fetch the master shape and search for the align property there.
             */
            int type = getTextRun().getRunType();
            MasterSheet master = getSheet().getMasterSheet();
            if(master != null){
                TextShape masterShape = master.getPlaceholderByTextType(type);
                if(masterShape != null) valign = masterShape.getVerticalAlignment();
            } else {
                //not found in the master sheet. Use the hardcoded defaults.
                switch (type){
                     case TextHeaderAtom.TITLE_TYPE:
                     case TextHeaderAtom.CENTER_TITLE_TYPE:
                         valign = TextShape.AnchorMiddle;
                         break;
                     default:
                         valign = TextShape.AnchorTop;
                         break;
                 }
            }
        } else {
            valign = prop.getPropertyValue();
        }
        return valign;
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSimpleProperty

     *
     * @return the botom margin
     */
    public float getMarginBottom(){
        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
        EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__TEXTBOTTOM);
        int val = prop == null ? EMU_PER_INCH/20 : prop.getPropertyValue();
        return (float)val/EMU_PER_POINT;
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSimpleProperty

     *
     * @return the left margin
     */
    public float getMarginLeft(){
        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
        EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__TEXTLEFT);
        int val = prop == null ? EMU_PER_INCH/10 : prop.getPropertyValue();
        return (float)val/EMU_PER_POINT;
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSimpleProperty

     *
     * @return the right margin
     */
    public float getMarginRight(){
        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
        EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__TEXTRIGHT);
        int val = prop == null ? EMU_PER_INCH/10 : prop.getPropertyValue();
        return (float)val/EMU_PER_POINT;
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSimpleProperty

     *
     * @return the top margin
     */
    public float getMarginTop(){
        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
        EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__TEXTTOP);
        int val = prop == null ? EMU_PER_INCH/20 : prop.getPropertyValue();
        return (float)val/EMU_PER_POINT;
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSimpleProperty

     * @return the value indicating word wrap.
     *  Must be one of the <code>Wrap*</code> constants defined in this class.
     */
    public int getWordWrap(){
        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
        EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__WRAPTEXT);
        return prop == null ? WrapSquare : prop.getPropertyValue();
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSimpleProperty

    /**
     * @return id for the text.
     */
    public int getTextId(){
        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
        EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__TEXTID);
        return prop == null ? 0 : prop.getPropertyValue();
    }
View Full Code Here

Examples of org.apache.poi.ddf.EscherSimpleProperty

                                //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){
                                    int pictureIndex = prop.getPropertyValue();
                                    // increment reference count for pictures
                                    EscherBSERecord bse = getBSERecord(pictureIndex);
                                    bse.setRef(bse.getRef() + 1);
                                }
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.