try { browser=ingenias.generator.browser.BrowserImp.initialise(file); Set<Object> keys =browser.getState().prop.keySet(); this.prop=browser.getState().prop;
private Vector<String> getDifferences() { try { Browser bimp=BrowserImp.initialise(watchedFile.getCanonicalPath()); ModelJGraph.enableAllListeners(); // a browser initialised through the initialise method is assumed to be //linked to no gui. Therefore, the persistence does load the spec without any listeners // and this prevents some runtime exception due to the event managers acting over elements in the specification // which were not layered out. This causes the listeners to be disabled by default, which is handled by // a static var. So, loading a new spec in headless mode causes a gui to ignore events. //return !BrowserImp.compare(bimp, new BrowserImp(ide.getIds())); Vector<String> diffs2 = BrowserImp.findAllDifferences(bimp, new BrowserImp(ide.getIds())); Vector<String> diffs1=BrowserImp.findAllDifferences(new BrowserImp(ide.getIds()),bimp); diffs1.addAll(diffs2); if (diffs1.size()>0) System.out.println("aqui"); return diffs1; } catch (UnknowFormat e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (DamagedFormat e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (CannotLoad e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return new Vector<String>(); }
private boolean differentContent() { try { Browser bimp=BrowserImp.initialise(watchedFile.getCanonicalPath()); ModelJGraph.enableAllListeners(); // a browser initialised through the initialise method is assumed to be //linked to no gui. Therefore, the persistence does load the spec without any listeners // and this prevents some runtime exception due to the event managers acting over elements in the specification // which were not layered out. This causes the listeners to be disabled by default, which is handled by // a static var. So, loading a new spec in headless mode causes a gui to ignore events. //return !BrowserImp.compare(bimp, new BrowserImp(ide.getIds())); Vector<String> diffs2 = BrowserImp.findAllDifferences(bimp, new BrowserImp(ide.getIds())); Vector<String> diffs1=BrowserImp.findAllDifferences(new BrowserImp(ide.getIds()),bimp); return !diffs2.isEmpty() || !diffs1.isEmpty(); } catch (UnknowFormat e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (DamagedFormat e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (CannotLoad e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return false; }
public IDE launchIDE(String args[]){ IDEState ids=IDEState.emptyIDEState(); try { ingenias.generator.browser.BrowserImp.initialise(ids); } catch (Exception e) { e.printStackTrace(); } ; GUIResources resources=null; IDE ide=this; resources=ide.getResources(); Log.initInstance(new PrintWriter(new TextAreaOutputStream(resources.getModuleOutput())), new PrintWriter(new TextAreaOutputStream(resources.getLogs()))); ide.updateIDEState(ids); //ide.initialiseActionHandlers(); ide.validate(); ide.setLocationByPlatform(true); ide.pack(); ide.setVisible(true); ide.setTitle("IDK-INGENME"); CheckChangesInFile ccif=new CheckChangesInFile(ide); this.addWindowListener(ccif); ccif.start(); if (args.length != 0 && !args[0].equalsIgnoreCase("testing")) { new LoadFileSwingTask(new File(args[0]),ide,ide.getIds(),resources).execute(); } return ide; }