Package org.docx4j.dml.spreadsheetdrawing

Examples of org.docx4j.dml.spreadsheetdrawing.CTTwoCellAnchor


    org.docx4j.dml.spreadsheetdrawing.ObjectFactory dmlspreadsheetdrawingObjectFactory = new org.docx4j.dml.spreadsheetdrawing.ObjectFactory();
   
    CTDrawing drawing = dmlspreadsheetdrawingObjectFactory.createCTDrawing();
//    JAXBElement<org.docx4j.dml.spreadsheetdrawing.CTDrawing> drawingWrapped = dmlspreadsheetdrawingObjectFactory.createWsDr(drawing);
        // Create object for twoCellAnchor
        CTTwoCellAnchor twocellanchor = dmlspreadsheetdrawingObjectFactory.createCTTwoCellAnchor();
        drawing.getEGAnchor().add( twocellanchor);
            // Create object for clientData
            CTAnchorClientData anchorclientdata = dmlspreadsheetdrawingObjectFactory.createCTAnchorClientData();
            twocellanchor.setClientData(anchorclientdata);
            // Create object for pic
            CTPicture picture = dmlspreadsheetdrawingObjectFactory.createCTPicture();
            twocellanchor.setPic(picture);
    org.docx4j.dml.ObjectFactory dmlObjectFactory = new org.docx4j.dml.ObjectFactory();
                // Create object for blipFill
                CTBlipFillProperties blipfillproperties = dmlObjectFactory.createCTBlipFillProperties();
                picture.setBlipFill(blipfillproperties);
                    // Create object for blip
                    CTBlip blip = dmlObjectFactory.createCTBlip();
                    blipfillproperties.setBlip(blip);
                        blip.setCstate(org.docx4j.dml.STBlipCompression.NONE);
                        blip.setEmbed( imageRelID );
                        // Create object for extLst
                        CTOfficeArtExtensionList officeartextensionlist = dmlObjectFactory.createCTOfficeArtExtensionList();
                        blip.setExtLst(officeartextensionlist);
                            // Create object for ext
                            CTOfficeArtExtension officeartextension = dmlObjectFactory.createCTOfficeArtExtension();
                            officeartextensionlist.getExt().add( officeartextension);
                                officeartextension.setUri( "{28A0092B-C50C-407E-A947-70E740481C1C}");
                        blip.setLink( "");
                    // Create object for stretch
                    CTStretchInfoProperties stretchinfoproperties = dmlObjectFactory.createCTStretchInfoProperties();
                    blipfillproperties.setStretch(stretchinfoproperties);
                        // Create object for fillRect
                        CTRelativeRect relativerect = dmlObjectFactory.createCTRelativeRect();
                        stretchinfoproperties.setFillRect(relativerect);
                            relativerect.setR( new Integer(0) );
                            relativerect.setT( new Integer(0) );
                            relativerect.setL( new Integer(0) );
                            relativerect.setB( new Integer(0) );
                // Create object for spPr
                CTShapeProperties shapeproperties = dmlObjectFactory.createCTShapeProperties();
                picture.setSpPr(shapeproperties);
                    // Create object for xfrm
                    CTTransform2D transform2d = dmlObjectFactory.createCTTransform2D();
                    shapeproperties.setXfrm(transform2d);
                        transform2d.setRot( new Integer(0) );
                        // Create object for off
                        CTPoint2D point2d = dmlObjectFactory.createCTPoint2D();
                        transform2d.setOff(point2d);
                            point2d.setY( 0 );
                            point2d.setX( 0 );
                        // Create object for ext
                        CTPositiveSize2D positivesize2d = dmlObjectFactory.createCTPositiveSize2D();
                        transform2d.setExt(positivesize2d);
                            positivesize2d.setCx( 714375 );
                            positivesize2d.setCy( 714375 );
                    // Create object for prstGeom
                    CTPresetGeometry2D presetgeometry2d = dmlObjectFactory.createCTPresetGeometry2D();
                    shapeproperties.setPrstGeom(presetgeometry2d);
                        // Create object for avLst
                        CTGeomGuideList geomguidelist = dmlObjectFactory.createCTGeomGuideList();
                        presetgeometry2d.setAvLst(geomguidelist);
                        presetgeometry2d.setPrst(org.docx4j.dml.STShapeType.RECT);
                // Create object for nvPicPr
                CTPictureNonVisual picturenonvisual = dmlspreadsheetdrawingObjectFactory.createCTPictureNonVisual();
                picture.setNvPicPr(picturenonvisual);
                    // Create object for cNvPr
                    CTNonVisualDrawingProps nonvisualdrawingprops = dmlObjectFactory.createCTNonVisualDrawingProps();
                    picturenonvisual.setCNvPr(nonvisualdrawingprops);
                        nonvisualdrawingprops.setDescr( "");
                        nonvisualdrawingprops.setName( "Picture 1");
                        nonvisualdrawingprops.setId( 2 );
                    // Create object for cNvPicPr
                    CTNonVisualPictureProperties nonvisualpictureproperties = dmlObjectFactory.createCTNonVisualPictureProperties();
                    picturenonvisual.setCNvPicPr(nonvisualpictureproperties);
                        // Create object for picLocks
                        CTPictureLocking picturelocking = dmlObjectFactory.createCTPictureLocking();
                        nonvisualpictureproperties.setPicLocks(picturelocking);
                picture.setMacro( "");
            // Create object for to
            CTMarker marker = dmlspreadsheetdrawingObjectFactory.createCTMarker();
            twocellanchor.setTo(marker);
              marker.setCol(1);
                marker.setColOff( 104775 );
              marker.setRow(3);
                marker.setRowOff( 142875 );
            // Create object for from
            CTMarker marker2 = dmlspreadsheetdrawingObjectFactory.createCTMarker();
            twocellanchor.setFrom(marker2);
              marker2.setCol(0);
                marker2.setColOff( 0 );
              marker2.setRow(0);
                marker2.setRowOff( 0 );
            twocellanchor.setEditAs(org.docx4j.dml.spreadsheetdrawing.STEditAs.ONE_CELL);

//    return drawingWrapped;
            return drawing;
   
View Full Code Here


        }
    }

    protected void shiftChart(Document.ChartWrapper chart, Range templateRange, Range firstResultRange) {
        Offset offset = calculateOffset(templateRange, firstResultRange);
        CTTwoCellAnchor anchor = chart.getAnchor();
        anchor.getFrom().setRow(anchor.getFrom().getRow() + offset.downOffset);
        anchor.getFrom().setCol(anchor.getFrom().getCol() + offset.rightOffset);
        anchor.getTo().setRow(anchor.getTo().getRow() + offset.downOffset);
        anchor.getTo().setCol(anchor.getTo().getCol() + offset.rightOffset);
    }
View Full Code Here

                    Drawing drawing = (Drawing) parent;
                    CTDrawing ctDrawing = drawing.getJaxbElement();
                    Object anchorObj = ctDrawing.getEGAnchor().get(chartNum++);

                    Range range = null;
                    CTTwoCellAnchor ctTwoCellAnchor = null;
                    if (anchorObj instanceof CTTwoCellAnchor) {
                        ctTwoCellAnchor = (CTTwoCellAnchor) anchorObj;
                        CTMarker from = ctTwoCellAnchor.getFrom();
                        CTMarker to = ctTwoCellAnchor.getTo();
                        String sheetName = worksheets.get(worksheets.size() - 1).name;
                        range = new Range(sheetName, from.getCol() + 1, from.getRow() + 1, to.getCol() + 1, to.getRow() + 1);
                    }

                    chartSpaces.put(range, new ChartWrapper((CTChartSpace) o, drawing, ctTwoCellAnchor));
View Full Code Here

    org.docx4j.dml.spreadsheetdrawing.ObjectFactory dmlspreadsheetdrawingObjectFactory = new org.docx4j.dml.spreadsheetdrawing.ObjectFactory();
   
    CTDrawing drawing = dmlspreadsheetdrawingObjectFactory.createCTDrawing();
//    JAXBElement<org.docx4j.dml.spreadsheetdrawing.CTDrawing> drawingWrapped = dmlspreadsheetdrawingObjectFactory.createWsDr(drawing);
        // Create object for twoCellAnchor
        CTTwoCellAnchor twocellanchor = dmlspreadsheetdrawingObjectFactory.createCTTwoCellAnchor();
        drawing.getEGAnchor().add( twocellanchor);
            // Create object for clientData
            CTAnchorClientData anchorclientdata = dmlspreadsheetdrawingObjectFactory.createCTAnchorClientData();
            twocellanchor.setClientData(anchorclientdata);
            // Create object for pic
            CTPicture picture = dmlspreadsheetdrawingObjectFactory.createCTPicture();
            twocellanchor.setPic(picture);
    org.docx4j.dml.ObjectFactory dmlObjectFactory = new org.docx4j.dml.ObjectFactory();
                // Create object for blipFill
                CTBlipFillProperties blipfillproperties = dmlObjectFactory.createCTBlipFillProperties();
                picture.setBlipFill(blipfillproperties);
                    // Create object for blip
                    CTBlip blip = dmlObjectFactory.createCTBlip();
                    blipfillproperties.setBlip(blip);
                        blip.setCstate(org.docx4j.dml.STBlipCompression.NONE);
                        blip.setEmbed( imageRelID );
                        // Create object for extLst
                        CTOfficeArtExtensionList officeartextensionlist = dmlObjectFactory.createCTOfficeArtExtensionList();
                        blip.setExtLst(officeartextensionlist);
                            // Create object for ext
                            CTOfficeArtExtension officeartextension = dmlObjectFactory.createCTOfficeArtExtension();
                            officeartextensionlist.getExt().add( officeartextension);
                                officeartextension.setUri( "{28A0092B-C50C-407E-A947-70E740481C1C}");
                        blip.setLink( "");
                    // Create object for stretch
                    CTStretchInfoProperties stretchinfoproperties = dmlObjectFactory.createCTStretchInfoProperties();
                    blipfillproperties.setStretch(stretchinfoproperties);
                        // Create object for fillRect
                        CTRelativeRect relativerect = dmlObjectFactory.createCTRelativeRect();
                        stretchinfoproperties.setFillRect(relativerect);
                            relativerect.setR( new Integer(0) );
                            relativerect.setT( new Integer(0) );
                            relativerect.setL( new Integer(0) );
                            relativerect.setB( new Integer(0) );
                // Create object for spPr
                CTShapeProperties shapeproperties = dmlObjectFactory.createCTShapeProperties();
                picture.setSpPr(shapeproperties);
                    // Create object for xfrm
                    CTTransform2D transform2d = dmlObjectFactory.createCTTransform2D();
                    shapeproperties.setXfrm(transform2d);
                        transform2d.setRot( new Integer(0) );
                        // Create object for off
                        CTPoint2D point2d = dmlObjectFactory.createCTPoint2D();
                        transform2d.setOff(point2d);
                            point2d.setY( 0 );
                            point2d.setX( 0 );
                        // Create object for ext
                        CTPositiveSize2D positivesize2d = dmlObjectFactory.createCTPositiveSize2D();
                        transform2d.setExt(positivesize2d);
                            positivesize2d.setCx( 714375 );
                            positivesize2d.setCy( 714375 );
                    // Create object for prstGeom
                    CTPresetGeometry2D presetgeometry2d = dmlObjectFactory.createCTPresetGeometry2D();
                    shapeproperties.setPrstGeom(presetgeometry2d);
                        // Create object for avLst
                        CTGeomGuideList geomguidelist = dmlObjectFactory.createCTGeomGuideList();
                        presetgeometry2d.setAvLst(geomguidelist);
                        presetgeometry2d.setPrst(org.docx4j.dml.STShapeType.RECT);
                // Create object for nvPicPr
                CTPictureNonVisual picturenonvisual = dmlspreadsheetdrawingObjectFactory.createCTPictureNonVisual();
                picture.setNvPicPr(picturenonvisual);
                    // Create object for cNvPr
                    CTNonVisualDrawingProps nonvisualdrawingprops = dmlObjectFactory.createCTNonVisualDrawingProps();
                    picturenonvisual.setCNvPr(nonvisualdrawingprops);
                        nonvisualdrawingprops.setDescr( "");
                        nonvisualdrawingprops.setName( "Picture 1");
                        nonvisualdrawingprops.setId( 2 );
                    // Create object for cNvPicPr
                    CTNonVisualPictureProperties nonvisualpictureproperties = dmlObjectFactory.createCTNonVisualPictureProperties();
                    picturenonvisual.setCNvPicPr(nonvisualpictureproperties);
                        // Create object for picLocks
                        CTPictureLocking picturelocking = dmlObjectFactory.createCTPictureLocking();
                        nonvisualpictureproperties.setPicLocks(picturelocking);
                picture.setMacro( "");
            // Create object for to
            CTMarker marker = dmlspreadsheetdrawingObjectFactory.createCTMarker();
            twocellanchor.setTo(marker);
              marker.setCol(1);
                marker.setColOff( 104775 );
              marker.setRow(3);
                marker.setRowOff( 142875 );
            // Create object for from
            CTMarker marker2 = dmlspreadsheetdrawingObjectFactory.createCTMarker();
            twocellanchor.setFrom(marker2);
              marker2.setCol(0);
                marker2.setColOff( 0 );
              marker2.setRow(0);
                marker2.setRowOff( 0 );
            twocellanchor.setEditAs(org.docx4j.dml.spreadsheetdrawing.STEditAs.ONE_CELL);

//    return drawingWrapped;
            return drawing;
   
View Full Code Here

TOP

Related Classes of org.docx4j.dml.spreadsheetdrawing.CTTwoCellAnchor

Copyright © 2018 www.massapicom. 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.