public boolean saveSceneManager(String fileName) { XStream xstream = new XStream(new StaxDriver()); PrintStream outFile; boolean saved = true; try { outFile = new PrintStream(new FileOutputStream(fileName)); outFile.print(xstream.toXML(m_SceneManager.getSceneGraph())); outFile.println(); outFile.print(xstream.toXML(m_SceneManager.getItemList())); outFile.close(); } catch (Exception ex) { saved = false; } return saved; }
public SceneManager loadSceneManager(String fileName) { String sXmlSceneInput = ""; String sXmlItemInput = ""; try { XStream xstream = new XStream(new StaxDriver()); Scanner input = new Scanner(new File(fileName)); if (input.hasNextLine()) sXmlSceneInput += input.nextLine(); if (input.hasNextLine()) sXmlItemInput += input.nextLine(); input.close(); m_SceneManager.setSceneGraph((ArrayList<Scene>) xstream.fromXML(sXmlSceneInput)); m_SceneManager.setItemList((ArrayList<Item>) xstream.fromXML(sXmlItemInput)); } catch (Exception ex) { } return m_SceneManager; }
public ItemTableModel getItemTableModel() { return m_SceneManager.getItemModel(); }
public SceneTableModel getSceneTableModel() { return m_SceneManager.getSceneModel(); }