/*

Persistent Systems Private Limited, Pune, India (website - http://www.pspl.co.in)

Permission is hereby granted, without written agreement and without
license or royalty fees, to use, copy, modify, and distribute this
software and its documentation for any purpose, provided that this
copyright notice and the following paragraph appears in all
copies of this software.

DISCLAIMER OF WARRANTY.
-----------------------
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
IN NO EVENT SHALL THE RIGHTHOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

*/


/**
 * <p>Title: VOPlot Launcher class</p>
 * <p>Description: Simple class to demonstrate the usage of the external interface to VOPlot</p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: PSPL </p>
 * @author K. D. Balaji
 * @version 1.0
 */

package voi.ui;
 
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowListener;
import java.awt.event.WindowEvent;
import java.io.InputStream;
import java.io.FileInputStream;
import java.io.*;
import java.util.Vector;
import com.jvt.applets.ColumnInfo;
import com.jvt.applets.PlotVOApplet;
import com.jvt.applets.VOPlotExternalApps;

public class VOPlotLauncher
{

  public VOPlotLauncher()
  {
	    JPanel panel = null;
	    VOPlotExternalApps voExtApp = null;
	    //**************** Load a VOTable from a File *****************************
	    // Create an instance of a class which is a subclass of the java.io.InputStream Object
	    // for the reading the VOTable.
	    panel = new JPanel();
	    panel.setLayout(new BorderLayout());
	    // Call the static method addVOPlot(Panel) of PlotVOApplet class to create a new VOPlot object and
	    // add it the panel passed as argument to the function.
	    voExtApp = PlotVOApplet.addVOPlot(panel);
	    final JFrame frame = new JFrame("VOPlot frame");
	    frame.getContentPane().add(panel, BorderLayout.CENTER);
	    frame.pack();
	    frame.setVisible(true);
	    frame.setDefaultCloseOperation (JFrame.DISPOSE_ON_CLOSE);
	    frame.addWindowListener(new WindowAdapter()
	    {
		    public void windowClosing(WindowEvent e)
		    {
			    frame.dispose ();
		    }
	    });
    
    frame.show();
  }
}
