• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to properly serialize & deserialize state of app and refresh/update stage or stage scene

 
Petr Omáčka
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we have code like jigsaw game at link http://download.oracle.com/otndocs/products/javafx/2/samples/Ensemble/index.html#SAMPLES/Graphics/Puzzle Pieces. What is the proper way of serialization and deserialization of its state? I am mean exactly the save & load function in any game.

I am thinking that I should extend all related classes with Serializable or Externalizable, all related objects each should be serialized in separate file and deserialization should be done as composition from small deserialized objects to the (containing) larger deserialized ones.

But I am not sure if this solution is the correct one. Especially if it is the most easy one.

Then there is also another problem. Java stage or stage scene are not refreshable/updatable. I have found some solutions how to change scene via FXML and FXMLLoader class but I think it is no possible to create FXML in this case.

Last problem relates to fact that after proper deserialization of topmost object state the stage or the stage group should be updated with this “loaded” object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic