package com.oozinoz.ui;

//import com.sun.java.swing.*;
import javax.swing.*;
import javax.swing.border.*;
//import java.util.*;
import java.awt.*;
import java.awt.event.*;

/*
 * Copyright (c) 2001 Steven J. Metsker.
 * 
 * Steve Metsker makes no representations or warranties about
 * the fitness of this software for any particular purpose, 
 * including the implied warranty of merchantability.
 *
 * Please use this software as you wish with the sole
 * restriction that you may not claim that you wrote it.
 */
/**
 * This utility class provides an interface that makes the 
 * Swing subsystem easy to use.
 * 
 * @author Steven J. Metsker
 */
public class SwingFacade 
{
/**
 * Create a titled border with the given title.
 *
 * @param title the words to show in the title border tab
 * @return a (beveled) titled border with the given title
 */
public static TitledBorder createTitledBorder(String title)
{
	TitledBorder tb =
		BorderFactory.createTitledBorder(
			BorderFactory.createBevelBorder(BevelBorder.RAISED),
			title,
			TitledBorder.LEFT,
			TitledBorder.TOP);
	tb.setTitleColor(Color.black);
	tb.setTitleFont(getStandardFont());
	return tb;
}
/**
 * Create a new panel that wraps a titled border around a 
 * given panel.
 *
 * @param title the words to show in the title border tab
 * @param in the panel that the border goes around
 * @return a (beveled) titled border with the given title
 */
public static JPanel createTitledPanel(
	String title,
	JPanel in)
{
	JPanel out = new JPanel();
	out.add(in);
	out.setBorder(createTitledBorder(title));
	return out;
}
/**
 * Create a standard font for GUI use.
 *
 * @return a standard font for GUI use
 */
public static Font getStandardFont()
{
	return new Font("Dialog", Font.PLAIN, 18);
}
/**
 * Display the given component within a frame.
 *
 * @param component the component to display
 * @param title the window title for the frame
 * @return the frame
 */
public static JFrame launch(Component c, String title)
{
	JFrame frame = new JFrame(title);
	frame.getContentPane().add(c);
	listen(frame);
	frame.pack();
	frame.setVisible(true);
	return frame;
}
/**
 * Set up an exit listener for a supplied frame.
 *
 * @param frame the frame whose closing will trigger a
 *              system exit
 */
public static void listen(Frame f) 
{
	f.addWindowListener
		(new WindowAdapter() 
			{
				public void windowClosing(WindowEvent e) 
				{
					System.exit(0);
				}
			}
		);
}
}

@@ -1,29 +1,4 @@
-package com.oozinoz.ui;%0A%0A
 //im
@@ -146,1763 +146,603 @@
 *;%0A%0A
-/*%0A * Copyright (c) 2001 Steven J. Metsker.%0A * %0A * Steve Metsker makes no representations or warranties about%0A * the fitness of this software for any particular purpose, %0A * including the implied warranty of merchantability.%0A *%0A * Please use this software as you wish with the sole%0A * restriction that you may not claim that you wrote it.%0A */%0A/**%0A * This utility class provides an interface that makes the %0A * Swing subsystem easy to use.%0A * %0A * @author Steven J. Metsker%0A */%0Apublic class SwingFacade %0A%7B%0A/**%0A * Create a titled border with the given title.%0A *%0A * @param title the words to show in the title border tab%0A * @return a (beveled) titled border with the given title%0A */%0Apublic static TitledBorder createTitledBorder(String title)%0A%7B%0A%09TitledBorder tb =%0A%09%09BorderFactory.createTitledBorder(%0A%09%09%09BorderFactory.createBevelBorder(BevelBorder.RAISED),%0A%09%09%09title,%0A%09%09%09TitledBorder.LEFT,%0A%09%09%09TitledBorder.TOP);%0A%09tb.setTitleColor(Color.black);%0A%09tb.setTitleFont(getStandardFont());%0A%09return tb;%0A%7D%0A/**%0A * Create a new panel that wraps a titled border around a %0A * given panel.%0A *%0A * @param title the words to show in the title border tab%0A * @param in the panel that the border goes around%0A * @return a (beveled) titled border with the given title%0A */%0Apublic static JPanel createTitledPanel(%0A%09String title,%0A%09JPanel in)%0A%7B%0A%09JPanel out = new JPanel();%0A%09out.add(in);%0A%09out.setBorder(createTitledBorder(title));%0A%09return out;%0A%7D%0A/**%0A * Create a standard font for GUI use.%0A *%0A * @return a standard font for GUI use%0A */%0Apublic static Font getStandardFont()%0A%7B%0A%09return new Font(%22Dialog%22, Font.PLAIN, 18);%0A%7D%0A/**%0A * Display the given component within a frame.%0A *%0A * @param component the component to display%0A * @param title the window title for the frame%0A * @return the frame%0A */
+public class SwingFacade %0A%7B%0A%0Apublic static TitledBorder createTitledBorder(String title)%0A%7B%0A%09TitledBorder tb =%0A%09%09BorderFactory.createTitledBorder(%0A%09%09%09BorderFactory.createBevelBorder(BevelBorder.RAISED),%0A%09%09%09title,%0A%09%09%09TitledBorder.LEFT,%0A%09%09%09TitledBorder.TOP);%0A%09tb.setTitleColor(Color.black);%0A%09tb.setTitleFont(getStandardFont());%0A%09return tb;%0A%7D%0A%0Apublic static JPanel createTitledPanel(%0A%09String title,%0A%09JPanel in)%0A%7B%0A%09JPanel out = new JPanel();%0A%09out.add(in);%0A%09out.setBorder(createTitledBorder(title));%0A%09return out;%0A%7D%0A%0Apublic static Font getStandardFont()%0A%7B%0A%09return new Font(%22Dialog%22, Font.PLAIN, 18);%0A%7D%0A
 %0Apub
@@ -939,150 +939,8 @@
 ;%0A%7D%0A
-/**%0A * Set up an exit listener for a supplied frame.%0A *%0A * @param frame the frame whose closing will trigger a%0A *              system exit%0A */
 %0Apub

Update SwingFacade.java