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
ConstructorsConstructorDescriptionSessionData(SBMLManager sbmlManager, CofactorManager cofactorManager) Saves the mappers of the SBMLManager and the CofactorManager and restores the loaded mappers in them. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Deletes the temporary files of the last saved session, called when the app stops.voidhandleEvent(org.cytoscape.session.events.SessionAboutToBeSavedEvent event) Adds the cy3sbml files to the session that is about to be saved.voidhandleEvent(org.cytoscape.session.events.SessionLoadedEvent event) Restores the cy3sbml data of the loaded session.voidsaveSessionData(org.cytoscape.session.events.SessionAboutToBeSavedEvent event) Writes the cy3sbml data into a temporary directory and adds the files to the session.
-
Constructor Details
-
SessionData
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 mappingscofactorManager- 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:
handleEventin interfaceorg.cytoscape.session.events.SessionAboutToBeSavedListener
-
handleEvent
public void handleEvent(org.cytoscape.session.events.SessionLoadedEvent event) Restores the cy3sbml data of the loaded session.- Specified by:
handleEventin interfaceorg.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 ordispose().- 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.
-