Class XSSFVMLDrawing
- java.lang.Object
-
- org.apache.poi.ooxml.POIXMLDocumentPart
-
- 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
-
-
Field Summary
Fields Modifier and Type Field Description static QName
QNAME_VMLDRAWING
to actually process the namespace-less vmldrawing, we've introduced a proxy namespace.
-
Constructor Summary
Constructors Modifier Constructor Description protected
XSSFVMLDrawing()
Create a new SpreadsheetML drawingprotected
XSSFVMLDrawing(PackagePart part)
Construct a SpreadsheetML drawing from a package part
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
commit()
Save the content in the underlying package part.com.microsoft.schemas.vml.CTShape
findCommentShape(int row, int col)
Find a shape with ClientData of type "NOTE" and the specified row and columnorg.apache.poi.schemas.vmldrawing.XmlDocument
getDocument()
protected List<XmlObject>
getItems()
com.microsoft.schemas.vml.CTShape
newCommentShape()
This method is for internal POI use only.protected void
read(InputStream is)
protected boolean
removeCommentShape(int row, int col)
protected void
write(OutputStream out)
-
Methods inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommitted, toString
-
-
-
-
Field Detail
-
QNAME_VMLDRAWING
public static final QName QNAME_VMLDRAWING
to actually process the namespace-less vmldrawing, we've introduced a proxy namespace. this namespace is active in-memory, but will be removed on saving to the file
-
-
Constructor Detail
-
XSSFVMLDrawing
protected XSSFVMLDrawing()
Create a new SpreadsheetML drawing- See Also:
XSSFSheet.createDrawingPatriarch()
-
XSSFVMLDrawing
protected XSSFVMLDrawing(PackagePart part) throws IOException, XmlException
Construct a SpreadsheetML drawing from a package part- Parameters:
part
- the package part holding the drawing data, the content type must beapplication/vnd.openxmlformats-officedocument.drawing+xml
- Throws:
IOException
XmlException
- Since:
- POI 3.14-Beta1
-
-
Method Detail
-
getDocument
public org.apache.poi.schemas.vmldrawing.XmlDocument getDocument()
-
read
protected void read(InputStream is) throws IOException, XmlException
- Throws:
IOException
XmlException
-
write
protected void write(OutputStream out) throws IOException
- Throws:
IOException
-
commit
protected void commit() throws 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(); try (OutputStream out = part.getOutputStream()) { XmlObject bean = getXmlBean(); //the "model" which holds changes in memory bean.save(out, DEFAULT_XML_OPTIONS); } }
- Overrides:
commit
in classPOIXMLDocumentPart
- Throws:
IOException
- a subclass may throw an IOException if the changes can't be committed
-
newCommentShape
@Internal public com.microsoft.schemas.vml.CTShape newCommentShape()
This method is for internal POI use only.
-
findCommentShape
public com.microsoft.schemas.vml.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)
-
-