Package org.moeaframework.analysis.plot
Class ImageUtils
java.lang.Object
org.moeaframework.analysis.plot.ImageUtils
Utility for creating images from charts.
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<ImageFileType>
Returns a list of supported image formats.static void
Saves the chart to an image file.static void
Saves the chart to an image file.static void
save
(org.jfree.chart.JFreeChart chart, File file, ImageFileType fileType, int width, int height) Saves the chart to an image file.static void
Saves the chart to an image file.static boolean
Returnstrue
if saving to the SVG format is supported.
-
Method Details
-
save
Saves the chart to an image file. The type of image is determined from the filename extension, which must match one of the supported file types inImageFileType
.- Parameters:
chart
- the chart to savefilename
- the filename- Throws:
IOException
- if an I/O error occurred
-
save
Saves the chart to an image file. The type of image is determined from the filename extension, which must match one of the supported file types inImageFileType
.- Parameters:
chart
- the chart to savefile
- the file- Throws:
IOException
- if an I/O error occurred
-
save
public static void save(org.jfree.chart.JFreeChart chart, File file, int width, int height) throws IOException Saves the chart to an image file. The format must match one of the supported file types inImageFileType
.- Parameters:
chart
- the chart to savefile
- the filewidth
- the image widthheight
- the image height- Throws:
IOException
- if an I/O error occurred
-
save
public static void save(org.jfree.chart.JFreeChart chart, File file, ImageFileType fileType, int width, int height) throws IOException Saves the chart to an image file.- Parameters:
chart
- the chart to savefile
- the filefileType
- the image file formatwidth
- the image widthheight
- the image height- Throws:
IOException
- if an I/O error occurred
-
supportsSVG
public static boolean supportsSVG()Returnstrue
if saving to the SVG format is supported. This requires the JFreeSVG library to be setup on the classpath.- Returns:
true
if saving to the SVG format is supported;false
otherwise
-
getSupportedImageFormats
Returns a list of supported image formats.- Returns:
- a list of supported image formats
-