org.odftoolkit.simple
public class GraphicsDocument extends Document
Modifier and Type | Class and Description |
---|---|
static class |
GraphicsDocument.OdfMediaType
This enum contains all possible media types of GraphicsDocument
documents.
|
Document.ScriptType
OdfSchemaDocument.OdfXMLFile
OdfPackageDocument.Resource
mContentDom, mDocumentStyles, mMetaDom, mSettingsDom, mStylesDom
mDocumentMediaType, mDocumentPathInPackage, mPackage, ROOT_DOCUMENT_PATH
Modifier | Constructor and Description |
---|---|
protected |
GraphicsDocument(OdfPackage pkg,
String internalPath,
GraphicsDocument.OdfMediaType odfMediaType)
To avoid data duplication a new document is only created, if not already
opened.
|
Modifier and Type | Method and Description |
---|---|
void |
changeMode(GraphicsDocument.OdfMediaType mediaType)
Changes the document to the given mediatype.
|
OfficeDrawingElement |
getContentRoot()
Get the content root of a graphics document.
|
OdfElement |
getTableContainerElement()
Get the ODF element which can have
|
static GraphicsDocument |
loadDocument(File file)
Creates an GraphicsDocument from the OpenDocument provided by a File.
|
static GraphicsDocument |
loadDocument(InputStream inputStream)
Creates an GraphicsDocument from the OpenDocument provided by a resource
Stream.
|
static GraphicsDocument |
loadDocument(String documentPath)
Loads an GraphicsDocument from the provided path.
|
static GraphicsDocument |
newGraphicsDocument()
Creates an empty graphics document.
|
static GraphicsDocument |
newGraphicsTemplateDocument()
Creates an empty graphics template.
|
addTable, addTable, close, getComponentMap, getContentRoot, getEmbeddedDocument, getEmbeddedDocuments, getEmbeddedDocuments, getLocale, getOdfMediaType, getOfficeMetadata, getScriptType, getSectionByName, getSectionIterator, getTableBuilder, getTableByName, getTableContainerImpl, getTableList, insertDocument, loadDocument, loadDocument, loadDocument, loadDocument, LoadTableTemplateFromForeignTable, loadTemplate, newImage, removeElementLinkedResource, save, save, save, setLocale, setLocale, setOdfMediaType, setPassword, toString
getBaseURI, getBookmarkRDFMetadata, getContentDom, getContentStream, getDocumentStyles, getFileDom, getInContentMetadata, getInContentMetadataFromCache, getManifestRDFMetadata, getMasterPages, getMetaDom, getMetaStream, getOfficeMasterStyles, getOrCreateDocumentStyles, getRDFMetadata, getSettingsDom, getSettingsStream, getStylesDom, getStylesStream, getTables, getXMLFilePath
flushDoms, getDocumentPath, getFileDom, getMediaTypeString, getPackage, getXMLFileMetadata, isExternalReference, isRootDocument, loadSubDocument, normalizeDocumentPath, removeDocument, save, setMediaTypeString
protected GraphicsDocument(OdfPackage pkg, String internalPath, GraphicsDocument.OdfMediaType odfMediaType)
public static GraphicsDocument newGraphicsDocument() throws Exception
Exception
- - if the document could not be createdpublic static GraphicsDocument newGraphicsTemplateDocument() throws Exception
Exception
- - if the template could not be createdpublic static GraphicsDocument loadDocument(InputStream inputStream) throws Exception
Since an InputStream does not provide the arbitrary (non sequentiell) read access needed by GraphicsDocument, the InputStream is cached. This usually takes more time compared to the other createInternalDocument methods. An advantage of caching is that there are no problems overwriting an input file.
If the resource stream is not a ODF graphics document, ClassCastException might be thrown.
inputStream
- - the InputStream of the ODF graphics document.Exception
- - if the document could not be created.public static GraphicsDocument loadDocument(String documentPath) throws Exception
GraphicsDocument relies on the file being available for read access over the whole lifecycle of GraphicsDocument.
If the resource stream is not a ODF graphics document, ClassCastException might be thrown.
documentPath
- - the path from where the document can be loadedException
- - if the document could not be created.public static GraphicsDocument loadDocument(File file) throws Exception
GraphicsDocument relies on the file being available for read access over the whole lifecycle of GraphicsDocument.
If the resource stream is not a ODF graphics document, ClassCastException might be thrown.
file
- - a file representing the ODF graphics document.Exception
- - if the document could not be created.public OfficeDrawingElement getContentRoot() throws Exception
getContentRoot
in class Document
Exception
- if the file DOM could not be created.public void changeMode(GraphicsDocument.OdfMediaType mediaType)
mediaType
- the related ODF mimetypepublic OdfElement getTableContainerElement()
TableContainer
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.