package webcam;

import java.util.Collection;
import java.util.HashSet;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.WindowConstants;
import jp.ac.kyutech.ai.ylab.shiva.utils.nativecapable.*;

public class WebcamBroadcasterApplication {
	public static void main(String[] args) {
		NativeCapableApplication nca = new NativeCapableApplication();
		NativeCapableModuleBuilder builder = new NativeCapableModuleBuilder(
				nca,
				"jp.ac.kyutech.ai.ylab.shiva.webcambroadcaster.WebcamBroadcaster");
		Collection<String> col = new HashSet<String>();
		col.add("java.");
		col.add("sun.reflect.");
		col.add("javax.swing.");
		col.add("javax.xml.");
		col.add("org.w3c.dom.");
		col.add("sun.java2d.");
		col.add("sun.awt.");
		col.add("com.sun.org.apache.xerces.");
		builder.setTargetPackages(col);
		builder.setDelegateTargets(true);
		final NativeCapableModule module = builder.newModule();
		module.initModule();
		nca.add(module.getRootComponent());
		nca.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
		nca.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				module.destroyModule();
			}
		});
		nca.setBounds(100, 100, 640, 480);
		nca.setVisible(true);
		module.startModule();
	}
}