public SceneVO createNewScene(String name) { SceneVO vo = new SceneVO(); vo.sceneName = name; ProjectManager projectManager = facade.retrieveProxy(ProjectManager.NAME); try { String projPath = projectManager.getCurrentWorkingPath() + "/" + projectManager.currentProjectVO.projectName; FileUtils.writeStringToFile( new File(projPath + "/project.dt"), projectManager.currentProjectInfoVO.constructJsonString(), "utf-8"); FileUtils.writeStringToFile( new File(projPath + "/scenes/" + vo.sceneName + ".dt"), vo.constructJsonString(), "utf-8"); projectManager.currentProjectInfoVO.scenes.add(vo); } catch (IOException e) { e.printStackTrace(); } return vo; }
public void saveScene(SceneVO vo) { ProjectManager projectManager = facade.retrieveProxy(ProjectManager.NAME); try { FileUtils.writeStringToFile( new File( projectManager.getCurrentWorkingPath() + "/" + projectManager.currentProjectVO.projectName + "/scenes/" + vo.sceneName + ".dt"), vo.constructJsonString(), "utf-8"); } catch (IOException e) { e.printStackTrace(); } }