ISBets21MAUBRY
3cf4057e97448d401b49261033b8ab566105944e
ISBets21MAUBRY / eclipse-workspace / ISBets21MAUBRY / src / main / java / gui / ApplicationLauncher.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
package gui; import java.net.URL; import java.util.Locale; import javax.swing.UIManager; import javax.xml.namespace.QName; import javax.xml.ws.Service; import businessLogic.BLFacade; import businessLogic.BLFacadeImplementation; import configuration.ConfigXML; import dataAccess.DataAccess; public class ApplicationLauncher { public static void main(String[] args) { ConfigXML c = ConfigXML.getInstance(); System.out.println(c.getLocale()); Locale.setDefault(new Locale(c.getLocale())); System.out.println("Locale: " + Locale.getDefault()); LoginGUI a = new LoginGUI(); a.setVisible(true); try { BLFacade appFacadeInterface; // UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"); // UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); if (c.isBusinessLogicLocal()) { // In this option the DataAccess is created by FacadeImplementationWS // appFacadeInterface=new BLFacadeImplementation(); // In this option, you can parameterize the DataAccess (e.g. a Mock DataAccess // object) DataAccess da = new DataAccess(c.getDataBaseOpenMode().equals("initialize")); appFacadeInterface = new BLFacadeImplementation(da); } else { // If remote String serviceName = "http://" + c.getBusinessLogicNode() + ":" + c.getBusinessLogicPort() + "/ws/" + c.getBusinessLogicName() + "?wsdl"; // URL url = new URL("http://localhost:9999/ws/ruralHouses?wsdl"); URL url = new URL(serviceName); // 1st argument refers to wsdl document above // 2nd argument is service name, refer to wsdl document above // QName qname = new QName("http://businessLogic/", "FacadeImplementationWSService"); QName qname = new QName("http://businessLogic/", "BLFacadeImplementationService"); Service service = Service.create(url, qname); appFacadeInterface = service.getPort(BLFacade.class); } /* * if (c.getDataBaseOpenMode().equals("initialize")) * appFacadeInterface.initializeBD(); */ LoginGUI.setBusinessLogic(appFacadeInterface); } catch (Exception e) { // a.jLabelSelectOption.setText("Error: " + e.toString()); // a.jLabelSelectOption.setForeground(Color.RED); e.printStackTrace(); System.out.println("Error in ApplicationLauncher: " + e.toString()); } // a.pack(); } } |
Commits for ISBets21MAUBRYeclipse-workspace/ISBets21MAUBRY/src/main/java/gui/ApplicationLauncher.java
Revision | Author | Commited | Message |
---|---|---|---|
3cf405 ... | porkipig | Sun 16 May, 2021 19:27:29 +0000 | IteraciĆ³n 3(VersiĆ³n sin idiomas) |