org.apache.poi.xssf.usermodel
Class XSSFVMLDrawing

java.lang.Object
  extended by org.apache.poi.POIXMLDocumentPart
      extended by org.apache.poi.xssf.usermodel.XSSFVMLDrawing

public final class XSSFVMLDrawing
extends POIXMLDocumentPart

Represents a SpreadsheetML VML drawing.

In Excel 2007 VML drawings are used to describe properties of cell comments, although the spec says that VML is deprecated:

The VML format is a legacy format originally introduced with Office 2000 and is included and fully defined in this Standard for backwards compatibility reasons. The DrawingML format is a newer and richer format created with the goal of eventually replacing any uses of VML in the Office Open XML formats. VML should be considered a deprecated format included in Office Open XML for legacy reasons only and new applications that need a file format for drawings are strongly encouraged to use preferentially DrawingML

Warning - Excel is known to put invalid XML into these files! For example, >br< without being closed or escaped crops up.

See 6.4 VML - SpreadsheetML Drawing in Office Open XML Part 4 - Markup Language Reference.pdf

Author:
Yegor Kozlov

Field Summary
 
Fields inherited from class org.apache.poi.POIXMLDocumentPart
DEFAULT_XML_OPTIONS
 
Constructor Summary
protected XSSFVMLDrawing()
          Create a new SpreadsheetML drawing
protected XSSFVMLDrawing(PackagePart part, PackageRelationship rel)
          Construct a SpreadsheetML drawing from a package part
 
Method Summary
protected  void commit()
          Save the content in the underlying package part.
protected  schemasMicrosoftComVml.CTShape findCommentShape(int row, int col)
          Find a shape with ClientData of type "NOTE" and the specified row and column
protected  java.util.List<org.apache.xmlbeans.XmlObject> getItems()
           
protected  schemasMicrosoftComVml.CTShape newCommentShape()
           
protected  void read(java.io.InputStream is)
           
protected  boolean removeCommentShape(int row, int col)
           
protected  void write(java.io.OutputStream out)
           
 
Methods inherited from class org.apache.poi.POIXMLDocumentPart
addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationId, getRelations, getTargetPart, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, read, rebase, removeRelation, removeRelation, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XSSFVMLDrawing

protected XSSFVMLDrawing()
Create a new SpreadsheetML drawing

See Also:
XSSFSheet.createDrawingPatriarch()

XSSFVMLDrawing

protected XSSFVMLDrawing(PackagePart part,
                         PackageRelationship rel)
                  throws java.io.IOException,
                         org.apache.xmlbeans.XmlException
Construct a SpreadsheetML drawing from a package part

Parameters:
part - the package part holding the drawing data, the content type must be application/vnd.openxmlformats-officedocument.drawing+xml
rel - the package relationship holding this drawing, the relationship type must be http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing
Throws:
java.io.IOException
org.apache.xmlbeans.XmlException
Method Detail

read

protected void read(java.io.InputStream is)
             throws java.io.IOException,
                    org.apache.xmlbeans.XmlException
Throws:
java.io.IOException
org.apache.xmlbeans.XmlException

getItems

protected java.util.List<org.apache.xmlbeans.XmlObject> getItems()

write

protected void write(java.io.OutputStream out)
              throws java.io.IOException
Throws:
java.io.IOException

commit

protected void commit()
               throws java.io.IOException
Description copied from class: POIXMLDocumentPart
Save the content in the underlying package part. Default implementation is empty meaning that the package part is left unmodified. Sub-classes should override and add logic to marshal the "model" into Ooxml4J. For example, the code saving a generic XML entry may look as follows:

 protected void commit() throws IOException {
   PackagePart part = getPackagePart();
   OutputStream out = part.getOutputStream();
   XmlObject bean = getXmlBean(); //the "model" which holds changes in memory
   bean.save(out, DEFAULT_XML_OPTIONS);
   out.close();
 }
  

Overrides:
commit in class POIXMLDocumentPart
Throws:
java.io.IOException

newCommentShape

protected schemasMicrosoftComVml.CTShape newCommentShape()

findCommentShape

protected schemasMicrosoftComVml.CTShape findCommentShape(int row,
                                                          int col)
Find a shape with ClientData of type "NOTE" and the specified row and column

Returns:
the comment shape or null

removeCommentShape

protected boolean removeCommentShape(int row,
                                     int col)


Copyright 2012 The Apache Software Foundation or its licensors, as applicable.