public void clear() { try { SwingUtilities.invokeAndWait( new Runnable() { public void run() { if (ProjectContainer.this.lastProject != null) { ProjectContainer.this.lastProject.dispose(); ProjectContainer.this.lastProject = null; } ProjectContainer.this.projectName = null; } }); } catch (Exception e) { e.printStackTrace(); } }
public Project getProject(String name) { if ((name != null ? name.equals(this.projectName) : name == this.projectName)) { return this.lastProject; } else { Project p = TestMain.loadProject(new File(name)); if (this.lastProject != null) { try { SwingUtilities.invokeAndWait( new Runnable() { public void run() { ProjectContainer.this.lastProject.dispose(); } }); } catch (Exception e) { e.printStackTrace(); } } this.lastProject = p; this.projectName = name; return p; } }