/* * Created on Jul 20, 2004 */ package imageprocessing; import java.awt.Color; import java.awt.Container; import java.awt.FlowLayout; import javax.swing.JFrame; /** A frame for displaying and controlling PGM and PPM images. * You should not have to modify this class, but if you wish you can improve * the format, layout, color scheme, etc. * @author dickey */ public class ImageFrame extends JFrame { private static final Color backgroundColor = new Color(255, 240, 180); /** Create and show a window with two image panels and a button panel. * * @param ipanel_1 An image panel (must not be null) * @param ipanel_2 An image panel (must not be null) (should be a different from the first) * @param ip An image processor object (must not be null) * @param filters An array of filters; the array can have zero-length, * but should not be null. */ public ImageFrame(AbstractImagePanel ipanel_1, AbstractImagePanel ipanel_2, IImageProcessor ip, IImageFilter[] filters) { super(); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container contents = this.getContentPane(); contents.setLayout(new FlowLayout()); contents.setBackground(backgroundColor); contents.add(ipanel_1); contents.add(ipanel_2); ImageButtonPanel buttons = new ImageButtonPanel(ip, filters, ipanel_1, ipanel_2); buttons.setBackground(backgroundColor); contents.add(buttons); this.pack(); this.show(); } }