FileDocCategorySizeDatePackage
Digitizer.javaAPI DocExample1858Thu Mar 25 21:34:30 GMT 2004None

Digitizer

public class Digitizer extends JComponent
Digitizer - load an Image and let you click on it.

Fields Summary
Container
cp
ImageView
iv
Constructors Summary
public Digitizer(String fname)
Construct an Digitizer viewer, given a filename.


		// GUI SETUP

		cp = this;
		cp.setLayout(new GridLayout(1, 0, 10, 10));

		iv = new ImageView("foo");
		cp.add(iv);

		JList list = new JList();
		cp.add(list);

		Grapher gr = new Grapher();
		cp.add(gr);

		// EVENT SETUP
		MouseClicker mickey = new MouseClicker();
		iv.addMouseListener(mickey);
		iv.addMouseMotionListener(mickey);
	
Methods Summary
public voidloadImage()

		iv.loadImage();
	
public static voidmain(java.lang.String[] arg)

		System.out.println("Digitizer 0.0");
		if (arg.length != 1) {
			System.err.println("Usage: Digitizer file [...]");
		} else {
			for (int i=0; i<arg.length; i++) {
				JFrame jf = new JFrame("Digitizer");
				Digitizer d = new Digitizer(arg[i]);
				jf.getContentPane().add(d);
				d.loadImage();
				jf.pack();
				jf.setVisible(true);
			}
		}