package jlowplugin;

import jlowplugin.ui.AladinJlowFrame;

import cds.aladin.*;

public class JlowPlugin extends AladinPlugin {

	
	private static AladinJlowFrame frame;
	
	private static String VERSION = "1.0";
	
	public String menu() {

		return "Jlow";
	}
 
	public String description() {
		return "PLUGIN JLOW: Graphical tool for Aladin worflow generation\n\n"
				+ "This plugin use \n"
				+ "JLOW 2.4 library "
				+ "(See http://cdsweb.u-strasbg.fr/cdsdevcorner/jlow2.0.html)\n"
				+ ", JGraph (See http://www.jgraph.com),\n"
				+ ", KXML2 (See http://www.kxml.org),\n"
				+ "and Commons Loggins (See http://commons.apache.org/logging)\n";
	}

	public String author() {
		return "Cyril Pestel / Thomas Boch [CDS]";
	}

	public String version() {
		return "1.0 - October 2007";
	}
	
	public String category() {
    	return "Workflow";
    }
        public String url() {
        	return "http://aladin.u-strasbg.fr/java/Plugins/JlowPlugin-src.jar";
        }
    
    public String url() {
    	return "http://aladin.u-strasbg.fr/java/Plugins/JlowPlugin-src.jar";
    }
	
	public void exec() throws AladinException {
		try {
			if(frame==null)
				 frame = new AladinJlowFrame(aladin);
			
			frame.setTitle("Aladin workflow builder v. "+VERSION+" - Using JLOW library");
			frame.setVisible(true);
			frame.getSplitHpane().setDividerLocation(0.8);

		} catch( Exception e ) { 
			Aladin.warning("Plugin error: "+e.getMessage()); 
			e.printStackTrace();
		}
	}
}
