Package com.extentech.formats.OOXML

Examples of com.extentech.formats.OOXML.OneCellAnchor


                          String f= t.getEmbedFilename();
                          int rId= writeExOOXMLFile(new String[]{"image", mediaDir + "/", externalDir + f}, drContentList);
                          t.setEmbed("rId" + rId);                       
                     }
                 } else if (o instanceof OneCellAnchor) {
                     OneCellAnchor oca= (OneCellAnchor)o;
                     drawing.append(oca.getOOXML());
                     // TODO: trap embedded images as in twoCellAnchor
                      //drContentList.add(new String[] { "/" + mediaDir + "/"+ imageName, "image"});
                 }
                 drawing.append("\r\n");
             }
View Full Code Here


                         } else {   // TESTING!
                             Logger.logErr("OOXMLAdapter.parseDrawingXML: Unknown twoCellAnchor type");
                         }
                     } else if (tnm.equals("oneCellAnchor")) {  // unclear if this can be root of charts and images as well as shapes
                         lastTag.push(tnm);
                         OneCellAnchor oca= (OneCellAnchor) OneCellAnchor.parseOOXML(xpp, lastTag, bk).cloneElement();
                         if (oca.hasImage()) {
                             String s= oca.getEmbed()// rid of embedded object
                             if (s.indexOf("rId")==0) { // should!
                                String imgFile= OOXMLReader.parsePathForZip(OOXMLReader.getFilename(drawingFiles, s), parentDir);
                                ZipEntry img= new ZipEntry(imgFile);
                                BufferedInputStream is= new BufferedInputStream
                                (OOXMLReader.wrapInputStream(zip.getInputStream(img)));
                                ImageHandle im= new ImageHandle(is, this);
                                this.insertImage(im);                          
                                im.setName(oca.getName());
                                im.setShapeName(oca.getDescr());
                                im.setBounds(oca.getBounds());        // must do after insert
                                im.setSpPr(oca.getSppr());          // set image shape properties
                                im.update();                        // update underlying image record with set data
                             }
                         } else if (oca.hasChart()) {
                             String s= oca.getEmbed();
                             if (s.indexOf("rId")==0) { // should!
                                String chart= OOXMLReader.getFilename(drawingFiles, s);
                                String name= oca.getName();
                                if (name==null || name.equals("null")) {
                                    name="Untitled Chart";
                                }
                                ChartHandle ch= bk.createChart(name, bk.getWorkSheet(this.getSheetName()));
                                ch.setRelativeBounds(oca.getBounds());
                                //ch.setChartTitle(name);
                                chart= OOXMLReader.parsePathForZip(chart, parentDir);
                                ZipEntry chFile= new ZipEntry(chart);
                                ch.parseOOXML(OOXMLReader.wrapInputStream(zip.getInputStream(chFile)));
                             }
                         } else if (oca.hasShape()) {                           
                             this.addOOXMLShape(oca);     // just store shape for later output since prev. versions do not handle shapes                          
                         } else {   // TESTING!
                             Logger.logErr("OOXMLAdapter.parseDrawingXML: Unknown oneCellAnchor type");
                         }
                     } else if (tnm.equals("userShapes")) {  // drawings ONTOP of charts = Reference to Chart Drawing Part
View Full Code Here

TOP

Related Classes of com.extentech.formats.OOXML.OneCellAnchor

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.