Ejemplo n.º 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;
  }
Ejemplo n.º 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;
  }
Ejemplo n.º 3
0
 public ItemTableModel getItemTableModel() {
   return m_SceneManager.getItemModel();
 }
Ejemplo n.º 4
0
 public SceneTableModel getSceneTableModel() {
   return m_SceneManager.getSceneModel();
 }