Exemple #1
0
  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;
  }
Exemple #2
0
  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;
  }
Exemple #3
0
 public ItemTableModel getItemTableModel() {
   return m_SceneManager.getItemModel();
 }
Exemple #4
0
 public SceneTableModel getSceneTableModel() {
   return m_SceneManager.getSceneModel();
 }