Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- private FairCenter fc;
- public Main(FairCenter fc) {
- this.fc = fc;
- }
- private static final String XML_FILE_NAME = "FairCenter.xml";
- private static final String BIN_FILE_NAME = "FairCenter.bin";
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- try {
- FairCenter fc = new FairCenter();
- cenasParaTirar(fc);
- String fN = "C:\\Users\\david\\Desktop\\DataImport\\csv\\exposicao1_v0.1.csv";
- String fName2 = "C:\\Users\\david\\Desktop\\DataImport\\csv\\exposicao1_stands_v0.1.csv";
- // fc.exportObjectToXMLFile(fc, XML_FILE_NAME);
- // FairCenter nf = (FairCenter)fc.importContentFromXMLtoObject(XML_FILE_NAME);
- MainWindow mainWindow = new MainWindow(fc);
- // System.out.println(nf);
- // try {
- // // Se já existir o documento .bin esse ficheiro que é lido.
- // if (new File(BIN_FILE_NAME).exists()) {
- //
- //// fc = FairCenter.persistenceMecanismoOutput(BIN_FILE_NAME);
- //
- // }
- //
- // } catch (Exception e) {
- //
- // e.printStackTrace();
- //
- // } finally {
- // cenasParaTirar(fc);
- // System.out.println("ola");
- // new MainWindow(fc);
- //
- // }
- //
- } catch (NullPointerException ex) {
- Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- private static void cenasParaTirar(FairCenter fc) {
- try {
- User u = new User("name", "email@123.pt", "po", "Password1@.", "Lisbon", "English"); //organizer
- User u1 = new User("name1", "email2p@123.pt", "jo", "Password1.", "Brasilia", ""); // fae
- User u2 = new User("name2", "email22@123.pt", "joanes", "Password1.", "Brasilia", ""); // fae
- User u3 = new User("name3", "emaill2@123.pt", "tu", "Password1.");
- User u4 = new User("name4", "emailll2@123.pt", "te", "Password1.");
- User u5 = new User("name5", "emalil2@123.pt", "tp", "Password1.");
- User u7 = new User("em", "lll@123.pt", "em", "Password1.");
- FAE fae1 = new FAE(u);
- FAE fae = new FAE(u1);
- FAE fae2 = new FAE(u2);
- fc.getUsersRegistry().registerUser(u);
- fc.getUsersRegistry().registerUser(u1);
- fc.getUsersRegistry().registerUser(u2);
- fc.getUsersRegistry().registerUser(u3);
- fc.getUsersRegistry().registerUser(u4);
- fc.getUsersRegistry().registerUser(u5);
- fc.getUsersRegistry().registerUser(u7);
- fc.confirmUserRegistry(u);
- fc.confirmUserRegistry(u1);
- fc.confirmUserRegistry(u2);
- fc.confirmUserRegistry(u7);
- EventManager eM = new EventManager(u7);
- fc.getEventManagerRegistry().addGestor(eM);
- Organizer o = new Organizer(u);
- Organizer o2 = new Organizer(u2);
- Date d1 = Date.dataAtual(); // 2017/06/22
- Date d2 = new Date(2018, 7, 22);
- Date d3 = new Date(2018, 8, 22);
- Congress e = new Congress(o, o2, "Google Apps", "googleDesc", d1, d3, "Porto", d2);
- Congress e1 = new Congress(o2, o, "Critical Software Apps", "Cdesc", d1, d3, "Porto", d2);
- Congress e2 = new Congress(o, o2, "Mindera Apps", "Mdesc", d1, d3, "Porto", d2);
- Exhibition e3 = new Exhibition(o, o2, "Apple Apps", "greenDesc", d1, d3, "Porto", d2);
- Stand s = new Stand(10);
- Stand s1 = new Stand(11);
- Stand s2 = new Stand(12);
- Stand s3 = new Stand(13);
- Stand s4 = new Stand(14);
- Stand s5 = new Stand(15);
- Stand s6 = new Stand(16);
- Stand s7 = new Stand(17);
- Stand s8 = new Stand(18);
- Stand s9 = new Stand(19);
- StandsList event3SandList = e3.getlStands();
- event3SandList.addStand(s);
- event3SandList.addStand(s1);
- event3SandList.addStand(s2);
- event3SandList.addStand(s3);
- event3SandList.addStand(s4);
- event3SandList.addStand(s5);
- event3SandList.addStand(s6);
- event3SandList.addStand(s7);
- event3SandList.addStand(s8);
- event3SandList.addStand(s9);
- e3.getlFAE().registFAE(fae);
- e3.getlFAE().registFAE(fae2);
- List<Keyword> lista = new ArrayList<>();
- lista.add(new Keyword("Bonecos"));
- lista.add(new Keyword("Animais"));
- lista.add(new Keyword("Minderas"));
- lista.add(new Keyword("Kimeras"));
- lista.add(new Keyword("Carverna"));
- lista.add(new Keyword("XXX"));
- lista.add(new Keyword("Super"));
- lista.add(new Keyword("maga"));
- List<Keyword> lista1 = new ArrayList<>();
- lista1.add(new Keyword("paulo1"));
- lista1.add(new Keyword("paulo2"));
- lista1.add(new Keyword("jorge1"));
- lista1.add(new Keyword("jorge"));
- lista1.add(new Keyword("jorge4"));
- lista1.add(new Keyword("maga1"));
- lista1.add(new Keyword("maga2"));
- lista1.add(new Keyword("maga3"));
- Application app = new Application("Google", "ghdfsaasf@live.com.pt", 911797032, 2, 32, lista1, "Representative", "Description", new ArrayList<Product>());
- Application app1 = new Application("Liga Portuguesa", "ghdasf@live.com.pt", 911797032, 2, 7032, lista, o.getUser().getUsername(), "Description", new ArrayList<Product>());
- Application app2 = new Application("app2", "app2@live.com.pt", 911797032, 2, 32, lista1, "Representative", "Description", new ArrayList<Product>());
- Ratings ratings1 = new Ratings(3, 3, 3, 3);
- Ratings ratings2 = new Ratings(3, 3, 3, 3);
- Ratings ratings3 = new Ratings(5, 5, 5, 5);
- Decision dec1 = new Decision(app, fae, true, "justificativeText", ratings1);
- Decision dec2 = new Decision(app1, fae1, true, "justificativeText", ratings2);
- Decision dec3 = new Decision(app2, fae1, false, "justificativeText", ratings3);
- e.getlFAE().getFaeList().add(fae);
- e.getlFAE().getFaeList().add(fae1);
- e.getlFAE().getFaeList().add(fae2);
- e1.getlFAE().getFaeList().add(fae);
- e1.getlFAE().getFaeList().add(fae1);
- e1.getlFAE().getFaeList().add(fae2);
- Atribution a = new Atribution(fae, app);
- Atribution a1 = new Atribution(fae, app1);
- Atribution a2 = new Atribution(fae1, app1);
- Atribution a3 = new Atribution(fae2, app);
- Atribution a4 = new Atribution(fae1, app1);
- Atribution a5 = new Atribution(fae, app2);
- e.getAtributionList().getlAtribution().add(a);
- e.getAtributionList().getlAtribution().add(a1);
- e.getAtributionList().getlAtribution().add(a2);
- e.getAtributionList().getlAtribution().add(a3);
- e.getAtributionList().getlAtribution().add(a4);
- e.getAtributionList().getlAtribution().add(a5);
- e1.getAtributionList().getlAtribution().add(a);
- e1.getAtributionList().getlAtribution().add(a1);
- e1.getAtributionList().getlAtribution().add(a2);
- e1.getAtributionList().getlAtribution().add(a3);
- e1.getAtributionList().getlAtribution().add(a4);
- e1.getAtributionList().getlAtribution().add(a5);
- app.setDecision(dec1);
- app1.setDecision(dec2);
- app2.setDecision(dec3);
- app.registerDecision();
- app1.registerDecision();
- app2.registerDecision();
- e.getApplicationsList().addApplication(app);
- e.getApplicationsList().addApplication(app1);
- e.getApplicationsList().addApplication(app2);
- e1.getApplicationsList().addApplication(app);
- e1.getApplicationsList().addApplication(app1);
- e1.getApplicationsList().addApplication(app2);
- fc.getEventRegistry().getEventList().add(e);
- fc.getEventRegistry().getEventList().add(e1);
- fc.getEventRegistry().getEventList().add(e2);
- fc.getEventRegistry().getEventList().add(e3);
- // new UC32_ImportEventDataFromFileController(fc, u7);
- // FairCenter fairCenter = (FairCenter) fc.importContentFromXMLtoObject(XML_FILE_NAME);
- // List<User> ul = fairCenter.getUsersRegistry().getlNonResistedUsers();
- // try {
- // Exhibition importedEx = Exhibition.importContentFromCSVtoObject("exposicao1_v0.1.csv");
- // System.out.println(importedEx);
- // }catch (Exception ex) {
- // Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
- // }
- //
- // new MainWindow(fc);
- // fc.exportObjectToXMLFile(fc, XML_FILE_NAME);
- // try {
- // // Se já existir o documento .xml esse ficheiro que é lido.
- // if (new File(XML_FILE_NAME).exists()) {
- //
- // fc = (FairCenter) fc.importContentFromXMLtoObject();
- //
- // }
- //
- // } catch (Exception e) {
- //
- // e.printStackTrace();
- //
- // } finally {
- // System.out.println("ola");
- // new MainWindow(fc);
- //
- // }
- //
- } catch (Exception ex) {
- Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement