/* * Main.java * * Created on July 13, 2006, 1:39 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package kart; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import javax.persistence.PersistenceUnit; /** Because the IDE, Netbeans, automatically creates ant build files that * use this class in the jar manifest enabling the application to be run * and tested using java -jar "/usr/local/provision/KART/dist/KART.jar", * this class is created. So, even though this class only starts the * GUI and calls the Model's init method, the automatic generation of the * build script makes this class worthwhile. Note that the Model's init * method builds the entire application substrate with database connection * and overlay network connection - ready for application addons. *

* This class is intended to be downloaded to the client's desktop via * JNLP and executed via Java Web Start. * * @author armart3 */ public class Main { //@PersistenceUnit(unitName="SVG_drawings") private static EntityManagerFactory emf; //private static EntityManagerFactory emf;// = Persistence.createEntityManagerFactory("SVG_drawings");; private EntityManager em; /** Creates a new instance of Main */ public Main() { // java.awt.EventQueue.invokeLater(new Runnable() { // public void run() { new KARTgui().setVisible(true); // } // }); Model.getInstance().init(); emf = Persistence.createEntityManagerFactory("SVG_drawings"); em = emf.createEntityManager(); Model.getInstance().setEMF(em); if(getEMF() == null) { System.out.println("kart.Main, emf is null"); } else { System.out.println("kart.Main, emf is NOT null"); } } public EntityManagerFactory getEMF() { return emf; } /** * @param args the command line arguments */ public static void main(String[] args) { new Main(); } }