Package org.cy3sbml

Class SessionData

java.lang.Object
org.cy3sbml.SessionData
All Implemented Interfaces:
org.cytoscape.event.CyListener, org.cytoscape.session.events.SessionAboutToBeSavedListener, org.cytoscape.session.events.SessionLoadedListener

public class SessionData extends Object implements org.cytoscape.session.events.SessionAboutToBeSavedListener, org.cytoscape.session.events.SessionLoadedListener
Saves the cy3sbml data of a Cytoscape session and restores it when the session is loaded.

The Network2SBMLMapper (with the SBML documents) and the Network2CofactorMapper are written with Java serialization, the COMBINE archives of the documents as JSON. SUIDs are not stable across sessions, so the restored mappings are translated to the SUIDs of the loaded session. The SBML files of the documents are also written into the session, for the user; they are not read on restore.

A session file can come from anywhere, so the deserialization only accepts the classes the mappers consist of.

  • Constructor Summary

    Constructors
    Constructor
    Description
    SessionData(SBMLManager sbmlManager, CofactorManager cofactorManager)
    Saves the mappers of the SBMLManager and the CofactorManager and restores the loaded mappers in them.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deletes the temporary files of the last saved session, called when the app stops.
    void
    handleEvent(org.cytoscape.session.events.SessionAboutToBeSavedEvent event)
    Adds the cy3sbml files to the session that is about to be saved.
    void
    handleEvent(org.cytoscape.session.events.SessionLoadedEvent event)
    Restores the cy3sbml data of the loaded session.
    void
    saveSessionData(org.cytoscape.session.events.SessionAboutToBeSavedEvent event)
    Writes the cy3sbml data into a temporary directory and adds the files to the session.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SessionData

      public SessionData(SBMLManager sbmlManager, CofactorManager cofactorManager)
      Saves the mappers of the SBMLManager and the CofactorManager and restores the loaded mappers in them.
      Parameters:
      sbmlManager - the manager of the SBML documents and their mappings
      cofactorManager - the manager of the cofactor clones
  • Method Details

    • handleEvent

      public void handleEvent(org.cytoscape.session.events.SessionAboutToBeSavedEvent event)
      Adds the cy3sbml files to the session that is about to be saved.
      Specified by:
      handleEvent in interface org.cytoscape.session.events.SessionAboutToBeSavedListener
    • handleEvent

      public void handleEvent(org.cytoscape.session.events.SessionLoadedEvent event)
      Restores the cy3sbml data of the loaded session.
      Specified by:
      handleEvent in interface org.cytoscape.session.events.SessionLoadedListener
    • saveSessionData

      public void saveSessionData(org.cytoscape.session.events.SessionAboutToBeSavedEvent event)
      Writes the cy3sbml data into a temporary directory and adds the files to the session. Cytoscape copies them into the session file after the event, so the directory is kept until the next save or dispose().
      Parameters:
      event - the event of the session that is about to be saved
    • dispose

      public void dispose()
      Deletes the temporary files of the last saved session, called when the app stops.