@OpenApiAll
public class ImageExporter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
EMF
EMF image format.
|
static int |
EPS
EPS image format.
|
static int |
JPEG
JPEG image format.
|
static int |
PNG
PNG image format.
|
static int |
SVG
SVG image format.
|
static int |
SVG_NO_BOUNDS_CHANGE
.
|
static int |
TIFF
TIFF image format.
|
static int |
WMF
WMF image format.
|
Constructor and Description |
---|
ImageExporter() |
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
export(DiagramPresentationElement diagram,
boolean justSelected)
Exports diagram into the BufferedImage.
|
static java.awt.image.BufferedImage |
export(DiagramPresentationElement diagram,
boolean justSelected,
int scalePercent)
Exports diagram into the BufferedImage.
|
static java.awt.Rectangle |
export(DiagramPresentationElement diagram,
int format,
java.io.File file)
Exports diagram into given format image.
|
static java.awt.Rectangle |
export(DiagramPresentationElement diagram,
int format,
java.io.File file,
boolean justSelected)
Exports diagram into given format image.
|
static java.awt.Rectangle |
export(DiagramPresentationElement diagram,
int format,
java.io.File file,
boolean justSelected,
boolean saveBackground)
Exports diagram into given format image.
|
static java.awt.Rectangle |
export(DiagramPresentationElement diagram,
int format,
java.io.File file,
boolean justSelected,
int dpi,
int scalePercent)
Exports diagram into given format image.
|
static java.awt.Rectangle |
export(DiagramPresentationElement diagram,
int format,
java.io.File file,
boolean justSelected,
ProgressStatus progressStatus)
Exports diagram into given format image.
|
static java.awt.image.BufferedImage |
export(PresentationElement element,
int scalePercent)
Exports single PresentationElement (for example Class) into the BufferedImage.
|
static java.awt.Rectangle |
export(PresentationElement element,
int format,
java.io.File file,
int dpi,
int scalePercent)
Exports single PresentationElement(for example Class) into the given format image.
|
static boolean |
isSelectedSymbolsExportable(DiagramPresentationElement diagram)
Checks if any selected symbol (in given diagram) can be exported into image.
|
public static final int JPEG
public static final int PNG
public static final int WMF
public static final int EPS
public static final int SVG
public static final int EMF
public static final int TIFF
public static final int SVG_NO_BOUNDS_CHANGE
@CheckForNull public static java.awt.image.BufferedImage export(DiagramPresentationElement diagram, boolean justSelected) throws java.io.IOException
diagram
- the given diagram.justSelected
- export only selected symbols in the diagram. If diagram does not have selected symbols, all symbols are exportedjava.io.IOException
- in case of some io error.@CheckForNull public static java.awt.image.BufferedImage export(DiagramPresentationElement diagram, boolean justSelected, int scalePercent) throws java.io.IOException
diagram
- the given diagram.justSelected
- export only selected symbols in the diagram. If diagram does not have selected symbols, all symbols are exportedscalePercent
- defines scaling the output image to given percentage. Value of 100 does not scale image.java.io.IOException
- in case of some io error.public static java.awt.Rectangle export(DiagramPresentationElement diagram, int format, java.io.File file) throws java.io.IOException
diagram
- the given diagram.format
- format of the image.file
- the output filejava.io.IOException
- in case of some io error.public static java.awt.Rectangle export(DiagramPresentationElement diagram, int format, java.io.File file, boolean justSelected) throws java.io.IOException
diagram
- the given diagram.format
- format of the image.file
- the output filejustSelected
- export only selected symbols in the diagram. If diagram does not have selected symbols, all symbols are exportedjava.io.IOException
- in case of some io error.@CheckForNull public static java.awt.Rectangle export(DiagramPresentationElement diagram, int format, java.io.File file, boolean justSelected, @CheckForNull ProgressStatus progressStatus) throws java.io.IOException
diagram
- the given diagram.format
- format of the image.file
- the output filejustSelected
- export only selected symbols in the diagram. If diagram does not have selected symbols, all symbols are exportedprogressStatus
- instance of ProgressStatus
can be null.java.io.IOException
- in case of some io error.public static java.awt.Rectangle export(DiagramPresentationElement diagram, int format, java.io.File file, boolean justSelected, boolean saveBackground) throws java.io.IOException
diagram
- the given diagram.format
- format of the image.file
- the output filejustSelected
- export only selected symbols in the diagram. If diagram does not have selected symbols, all symbols are exportedsaveBackground
- save diagram background in image.java.io.IOException
- in case of some io error.public static java.awt.Rectangle export(DiagramPresentationElement diagram, int format, java.io.File file, boolean justSelected, int dpi, int scalePercent) throws java.io.IOException
diagram
- the given diagram.format
- format of the image.file
- the output filejustSelected
- export only selected symbols in the diagram. If diagram does not have selected symbols, all symbols are exporteddpi
- sets the DPI flag in output image. Parameter is ignored for vector images.scalePercent
- defines scaling the output image to given percentage. Value of 100 does not scale image. Is ignored by WMF file format.java.io.IOException
- in case of some io error.public static boolean isSelectedSymbolsExportable(DiagramPresentationElement diagram)
diagram
- given diagram.true
- if any of selected symbols can be exported; otherwise - false
.@CheckForNull public static java.awt.Rectangle export(PresentationElement element, int format, java.io.File file, int dpi, int scalePercent) throws java.io.IOException
element
- the given presentation element.format
- format of the image.file
- the output filedpi
- sets the DPI flag in output image. Parameter is ignored for vector images.scalePercent
- defines scaling the output image to given percentage. Value of 100 does not scale image. Is ignored by WMF file format.java.io.IOException
- in case of some io error.@CheckForNull public static java.awt.image.BufferedImage export(PresentationElement element, int scalePercent) throws java.io.IOException
element
- the given element.scalePercent
- defines scaling the output image to given percentage. Value of 100 does not scale image.java.io.IOException
- in case of some io error.