Author: mes
Date: 2010-09-22 15:11:38 -0700 (Wed, 22 Sep 2010)
New Revision: 21975
Added:
core3/session-api/trunk/src/main/java/org/cytoscape/session/CySession.java
Modified:
core3/session-api/trunk/
core3/session-api/trunk/pom.xml
core3/session-api/trunk/src/main/java/org/cytoscape/session/CySessionManager.java
Log:
added CySession
Property changes on: core3/session-api/trunk
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.classpath
.project
Modified: core3/session-api/trunk/pom.xml
===================================================================
--- core3/session-api/trunk/pom.xml 2010-09-22 21:52:47 UTC (rev 21974)
+++ core3/session-api/trunk/pom.xml 2010-09-22 22:11:38 UTC (rev 21975)
@@ -111,6 +111,11 @@
<artifactId>viewmodel-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.cytoscape</groupId>
+ <artifactId>vizmap-api</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>presentation-api</artifactId>
Added:
core3/session-api/trunk/src/main/java/org/cytoscape/session/CySession.java
===================================================================
--- core3/session-api/trunk/src/main/java/org/cytoscape/session/CySession.java
(rev 0)
+++ core3/session-api/trunk/src/main/java/org/cytoscape/session/CySession.java
2010-09-22 22:11:38 UTC (rev 21975)
@@ -0,0 +1,38 @@
+package org.cytoscape.session;
+
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.cytoscape.model.CyNetwork;
+import org.cytoscape.model.CyTable;
+import org.cytoscape.view.model.CyNetworkView;
+import org.cytoscape.view.vizmap.VisualStyle;
+
+/**
+ * A session is an immutable snapshot of the data contents of Cytoscape.
+ * Sessions are only meant for saving and restoring the state of Cytoscape
+ * and are not meant to be used interactively for anything besides
+ * writing, reading, and restoring from session files.
+ * <br/>
+ * Using the data returned from the various methods in a CySession object
+ * should be sufficient to recreate all aspects of Cytoscape at the time
+ * the session was created.
+ */
+public interface CySession {
+
+ String getSessionName();
+
+ Set<CyNetwork> getNetworks();
+
+ Set<CyNetworkView> getNetworkViews();
+
+ Set<CyTable> getTables();
+
+ Set<VisualStyle> getVisualStyles();
+
+ Map<String,Properties> getProperties();
+
+ String getFileName();
+
+}
Modified:
core3/session-api/trunk/src/main/java/org/cytoscape/session/CySessionManager.java
===================================================================
---
core3/session-api/trunk/src/main/java/org/cytoscape/session/CySessionManager.java
2010-09-22 21:52:47 UTC (rev 21974)
+++
core3/session-api/trunk/src/main/java/org/cytoscape/session/CySessionManager.java
2010-09-22 22:11:38 UTC (rev 21975)
@@ -2,10 +2,12 @@
/**
- * This interface merely captures what was in Cytoscape.java and serves
- * as a placeholder until we're able to think about sessions properly.
+ * This class primarily acts as a listener and tracks the state of
+ * the Cytoscape application. This state can be interogated at any
+ * time and the result is an immutable CySession object suitable
+ * for serialization. Likewise, setting a new session will replace
+ * the current session with a new one.
*/
-//TODO uhh, implement this
public interface CySessionManager {
enum State {
@@ -15,14 +17,10 @@
CLOSED,
}
- String getCurrentSessionFileName();
-
- void setCurrentSessionFileName(String newName);
-
- void setSessionState(int state);
-
- int getSessionstate();
-
- void createNewSession();
+ State getCurrentSessionState();
+
+ CySession getCurrentSession();
+
+ void setCurrentSession(CySession session);
}
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.