/*
Program to display coordinates of handwriting and apply a boxcar filter
interactively. The XY coordinates are loaded via a URL.

Copyright, Lambert Schomaker/NICI, March 1996.

Please, refer to the author when using this code by:

Schomaker, L.R.B. (1993).
Using Stroke- or Character-based Self-organiZing Maps
in the Recognition of On-line, Connected Cursive Script.
{\em Pattern Recognition}, 26(3), 443-450.

Schomaker, L.R.B., & Teulings, H.-L. (1990).
A Handwriting Recognition System based on the Properties and Architectures 
of the Human Motor System.
{\em Proceedings of the International Workshop on Frontiers in Handwriting
Recognition (IWFHR)}. (pp. 195-211). Montreal: CENPARMI Concordia.
 */

import java.awt.*;
import java.applet.*;


/*
 * Can be run either as a standalone application by
 * typing "java hwrfilter" or as an applet in the AppletViewer.
 */

public class hwrfilter extends Applet {
    hwrFilterPanel pc;

    public void init() {
	setLayout(new BorderLayout());
	pc = new hwrFilterPanel(true,true,true);
	add("Center", pc);
        pc.canvas.Hin = new hwrCoord(1);
    }

    public void start() {
	pc.controls.enable();
    }

    public void stop() {
	pc.controls.disable();
    }

    public boolean handleEvent(Event e) {
	if (e.id == Event.WINDOW_DESTROY) {
	    System.exit(0);
        }
	return false;
    }

    public static void main(String args[]) {
	Frame f = new Frame("hwrfilter");
	hwrfilter hwrFilter = new hwrfilter();

	hwrFilter.init();           /* Read the ink data etc. */

	hwrFilter.start();          /* Enable the control events */

	f.add("Center", hwrFilter); /* Put the hwrFilter object on the frame */
                                   /* In the middle, that is. */
	f.resize(500, 300);        /* Size in pixels. Words are wider than high */
	f.show();                  /* Show it all */
    }
}
   

/* end hwrfilter.java */

