Class PictureUtil

java.lang.Object
  extended byPictureUtil

public class PictureUtil
extends java.lang.Object

PictureUtil - a class for displaying Picture's. Each new picture is displayed in a separate frame, layed out in a grid on the screen.

Motivated by the JavaPicture class from Georgia Tech's Media Computation class

Author:
Ben Bederson, Bill Pugh Copyright (C) 2003 University of Maryland
See Also:
Picture, PictureColor, Image

Constructor Summary
PictureUtil()
           
 
Method Summary
static void save(Picture picture, java.lang.String fileName)
          Saves the specified picture to the specified file as a JPEG image.
static void show(Picture picture)
          Displays a picture.
static void show(Picture picture, java.lang.String title)
          Displays a picture with title
static void showException(java.lang.Exception ex)
          Internal utility method to display exceptions to the screen in a pop-up window.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PictureUtil

public PictureUtil()
Method Detail

show

public static void show(Picture picture,
                        java.lang.String title)
Displays a picture with title

Parameters:
picture - The picture to show
title - The title in the window frame

show

public static void show(Picture picture)
Displays a picture. Title is extracted from class name of picture.

Parameters:
picture - The picture to show

save

public static void save(Picture picture,
                        java.lang.String fileName)
Saves the specified picture to the specified file as a JPEG image. The file can be specified as an absolute path, or a relative path (in which case it will get saved in a location relative to where this program is run from. If the file doesn't end in ".jpg", then that extension will be added.

Parameters:
picture - The picture to be saved
fileName - The name of the file to save the picture in.

showException

public static void showException(java.lang.Exception ex)
Internal utility method to display exceptions to the screen in a pop-up window.

Parameters:
ex - The exception