File:  [Public] / java / classes / org / w3c / rdfpic / Main.java
Revision 1.1: download - view: text, annotated - select for diffs
Mon Jul 29 14:11:54 2002 UTC (22 years, 9 months ago) by nheninge
Branches: MAIN
CVS tags: rel-2-2, HEAD
*** empty log message ***

package org.w3c.rdfpic;
import org.w3c.rdfpic.ui.*;
import org.w3c.rdfpic.core.*;
import java.net.URL;
import java.net.MalformedURLException;
import java.io.*;

/**
 * Rdfpic is a program to attach meta-data to images (currently jpeg's).
 * It is split up into two parts, the UI, and the core.  Class Main initializes
 * those two parts to work with each other, and selects any files listed on the
 * command line.
 * @author Eamon Nerbonne, Nadia Heninger
 * @version 3.0
 */
public class Main
{
    /**
     * Loads the UI (SimpleUI) and the core (RdfPicCore) and loads the files
     * listed on the command line
     * @param args The command line arguments.
     */
    public static void main(String[] args) throws Exception
    {
	URL[] schemas,pics;
	schemas = new URL[4];
	schemas[0] = Main.class.getResource("DC.rdf");
	schemas[1] = Main.class.getResource("Technical.rdf");
	schemas[2] = Main.class.getResource("Exif.rdf");
	schemas[3] = Main.class.getResource("Foaf.rdf");
	URL prefs = Main.class.getResource("prefs.rdf");

	    pics = new URL[args.length];
	    for(int i=0;i<args.length;i++) 
		{
		    try {
			pics[i]=new URL(args[i]);
		    } catch (MalformedURLException mue) {
			pics[i]=new URL("file","",args[i]);
		    }
		}
	    if(System.getProperty("org.xml.sax.parser") == null) {
		System.getProperties().put("org.xml.sax.parser", "com.microstar.xml.SAXDriver");
	    }
	    RdfPicCore core = new RdfPicCore(prefs, new SchemaTxtDrv(),schemas,pics);
	    SimpleUI ui = new SimpleUI();
	    ui.go(core);
    }
}

Webmaster