br.usp.ime.klava.segmentit.util
Class ImageIOUtils

java.lang.Object
  extended by br.usp.ime.klava.segmentit.util.ImageIOUtils

public class ImageIOUtils
extends java.lang.Object

Provides utility methods to open and save images.

Author:
Bruno Klava

Constructor Summary
ImageIOUtils()
           
 
Method Summary
static java.awt.image.BufferedImage open(java.awt.Component parent)
          Displays a JFileChooser to open a BufferedImage.
static java.awt.image.BufferedImage open(java.awt.Component parent, java.lang.String title)
          Displays a JFileChooser to open a BufferedImage.
static java.io.File[] openFiles()
          Displays a JFileChooser to open multiple BufferedImages.
static void save(java.lang.String title, java.awt.image.BufferedImage image, java.awt.Component parent)
          Displays a JFileChooser to save image.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageIOUtils

public ImageIOUtils()
Method Detail

save

public static void save(java.lang.String title,
                        java.awt.image.BufferedImage image,
                        java.awt.Component parent)
Displays a JFileChooser to save image.

Parameters:
title - a title for the JFileChooser window
image - a BufferedImage to be saved
parent - the parent Component of the JFileChooser (may be null)

open

public static java.awt.image.BufferedImage open(java.awt.Component parent,
                                                java.lang.String title)
Displays a JFileChooser to open a BufferedImage.

Parameters:
title - a title for the JFileChooser window
parent - the parent Component of the JFileChooser (may be null)
Returns:
a BufferedImage or null if no file was selected

open

public static java.awt.image.BufferedImage open(java.awt.Component parent)
Displays a JFileChooser to open a BufferedImage.

Parameters:
parent - the parent Component of the JFileChooser (may be null)
Returns:
a BufferedImage or null if no file was selected

openFiles

public static java.io.File[] openFiles()
Displays a JFileChooser to open multiple BufferedImages.

Returns:
an array of BufferedImages or null if no file was selected