Package com.independentsoft.office.odf.drawing

# Class Image

java.lang.Object
com.independentsoft.office.odf.drawing.FrameContentElement
com.independentsoft.office.odf.drawing.Image

All Implemented Interfaces:
  `IContentElement`

public class Image extends FrameContentElement
Represents an image.

- ## Field Summary

  ### Fields inherited from class com.independentsoft.office.odf.drawing.FrameContentElement

  `parent`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Image()`
  Instantiates a new image.
  `Image​(InternalXMLStreamReader reader)`
  Instantiates a new image.
  `Image​(String filePath)`
  Instantiates a new image.
  `Image​(String fileName, byte[] buffer)`
  Instantiates a new image.
  `Image​(String fileName, InputStream inputStream)`
  Instantiates a new image.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add​(IDrawText drawText)`
  Adds a IDrawText object to the content.
  `void`
  `add​(List list)`
  Adds a List object to the content.
  `void`
  `add​(Paragraph paragraph)`
  Adds a Paragraph object to the content.
  `Image`
  `clone()`
  Creates a new object that is a deep copy of the current instance.
  `byte[]`
  `getBuffer()`
  Gets the buffer.
  `List<IDrawText>`
  `getContent()`
  Contains a collection of IDrawText objects.
  `List<IContentElement>`
  `getContentElements()`
  Returns all content elements.
  `String`
  `getFileName()`
  Gets the file name.
  `String`
  `getFilter()`
  Gets the filter name for an image.
  `InputStream`
  `getInputStream()`
  Gets the input stream.
  `IContentElement`
  `getParent()`
  Returns the parent content element.
  `void`
  `load​(String filePath)`
  Load.
  `void`
  `load​(String fileName, byte[] buffer)`
  Load.
  `void`
  `load​(String fileName, InputStream inputStream)`
  Load.
  `void`
  `save​(OutputStream outputStream)`
  Save.
  `void`
  `save​(String filePath)`
  Save.
  `void`
  `save​(String filePath, boolean overwrite)`
  Save.
  `void`
  `setBuffer​(byte[] buffer)`
  Sets the buffer.
  `void`
  `setFileName​(String fileName)`
  Sets the file name.
  `void`
  `setFilter​(String filter)`
  Sets the filter name for an image.
  `void`
  `setParent​(IContentElement parent)`
  Sets the parent content element.
  `String`
  `toString()`
  Converts the value of the current Image object to its equivalent string representation.

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Image

    public Image()
    Instantiates a new image.

  - ### Image

    public Image​(String filePath) throws IOException
    Instantiates a new image.
    Parameters:
      `filePath` - the file path
    Throws:
      `IOException` - Signals that an I/O exception has occurred.

  - ### Image

    public Image​(String fileName, InputStream inputStream) throws IOException
    Instantiates a new image.
    Parameters:
      `fileName` - the file name
      `inputStream` - the input stream
    Throws:
      `IOException` - Signals that an I/O exception has occurred.

  - ### Image

    public Image​(String fileName, byte[] buffer)
    Instantiates a new image.
    Parameters:
      `fileName` - the file name
      `buffer` - the buffer

  - ### Image

    public Image​(InternalXMLStreamReader reader) throws XMLStreamException
    Instantiates a new image.
    Parameters:
      `reader` - the reader
    Throws:
      `XMLStreamException` - the xML stream exception

- ## Method Details

  - ### load

    public void load​(String filePath) throws IOException
    Load.
    Parameters:
      `filePath` - the file path
    Throws:
      `IOException` - Signals that an I/O exception has occurred.

  - ### load

    public void load​(String fileName, InputStream inputStream) throws IOException
    Load.
    Parameters:
      `fileName` - the file name
      `inputStream` - the input stream
    Throws:
      `IOException` - Signals that an I/O exception has occurred.

  - ### load

    public void load​(String fileName, byte[] buffer)
    Load.
    Parameters:
      `fileName` - the file name
      `buffer` - the buffer

  - ### save

    public void save​(String filePath) throws IOException
    Save.
    Parameters:
      `filePath` - the file path
    Throws:
      `IOException` - Signals that an I/O exception has occurred.

  - ### save

    public void save​(String filePath, boolean overwrite) throws IOException
    Save.
    Parameters:
      `filePath` - the file path
      `overwrite` - the overwrite
    Throws:
      `IOException` - Signals that an I/O exception has occurred.

  - ### save

    public void save​(OutputStream outputStream) throws IOException
    Save.
    Parameters:
      `outputStream` - the output stream
    Throws:
      `IOException` - Signals that an I/O exception has occurred.

  - ### getInputStream

    public InputStream getInputStream()
    Gets the input stream.
    Returns:
      the input stream

  - ### add

    public void add​(List list)
    Adds a List object to the content.
    Parameters:
      `list` - the list

  - ### add

    public void add​(Paragraph paragraph)
    Adds a Paragraph object to the content.
    Parameters:
      `paragraph` - the paragraph

  - ### add

    public void add​(IDrawText drawText)
    Adds a IDrawText object to the content.
    Parameters:
      `drawText` - the draw text

  - ### getContentElements

    public List<IContentElement> getContentElements()
    Returns all content elements.
    Specified by:
      `getContentElements` in interface `IContentElement`
    Specified by:
      `getContentElements` in class `FrameContentElement`
    Returns:
      A collection of content elements.

  - ### getParent

    public IContentElement getParent()
    Returns the parent content element.
    Specified by:
      `getParent` in interface `IContentElement`
    Overrides:
      `getParent` in class `FrameContentElement`
    Returns:
      the parent

  - ### setParent

    public void setParent​(IContentElement parent)
    Sets the parent content element.
    Specified by:
      `setParent` in interface `IContentElement`
    Overrides:
      `setParent` in class `FrameContentElement`
    Parameters:
      `parent` - the new parent

  - ### clone

    public Image clone()
    Creates a new object that is a deep copy of the current instance.
    Specified by:
      `clone` in interface `IContentElement`
    Specified by:
      `clone` in class `FrameContentElement`
    Returns:
      A new object that is a copy of this instance.

  - ### toString

    public String toString()
    Converts the value of the current Image object to its equivalent string representation.
    Overrides:
      `toString` in class `Object`
    Returns:
      the string

  - ### getContent

    public List<IDrawText> getContent()
    Contains a collection of IDrawText objects.
    Returns:
      the content

  - ### getFilter

    public String getFilter()
    Gets the filter name for an image. This attribute contains the internal filter name that an consumer has used to load the graphic.
    Returns:
      the filter

  - ### setFilter

    public void setFilter​(String filter)
    Sets the filter name for an image. This attribute contains the internal filter name that an consumer has used to load the graphic.
    Parameters:
      `filter` - the new filter

  - ### getFileName

    public String getFileName()
    Gets the file name.
    Returns:
      the file name

  - ### setFileName

    public void setFileName​(String fileName)
    Sets the file name.
    Parameters:
      `fileName` - the new file name

  - ### getBuffer

    public byte[] getBuffer()
    Gets the buffer.
    Returns:
      the buffer

  - ### setBuffer

    public void setBuffer​(byte[] buffer)
    Sets the buffer.
    Parameters:
      `buffer` - the new buffer