Author: mes
Date: 2010-10-08 11:51:14 -0700 (Fri, 08 Oct 2010)
New Revision: 22193
Added:
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionAboutToBeSavedEvent.java
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionAboutToBeSavedListener.java
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionLoadedEvent.java
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionLoadedListener.java
Removed:
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionAboutToBeSavedEvent.java
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionAboutToBeSavedListener.java
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionLoadedEvent.java
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionLoadedListener.java
Log:
moved session events into appropriate package
Deleted:
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionAboutToBeSavedEvent.java
===================================================================
---
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionAboutToBeSavedEvent.java
2010-10-08 18:47:51 UTC (rev 22192)
+++
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionAboutToBeSavedEvent.java
2010-10-08 18:51:14 UTC (rev 22193)
@@ -1,64 +0,0 @@
-
-package org.cytoscape.session;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.io.File;
-
-import org.cytoscape.event.AbstractCyEvent;
-
-/**
- * This event is fired synchronously by the CySessionManager at beginning of
the
- * {...@link CySessionManager#getCySession()} method. The intent is to allow
- * listeners to provide information to this event object or to update their
- * state before that state is interrogated by the CySessionManager.
- */
-public final class SessionAboutToBeSavedEvent extends
AbstractCyEvent<CySessionManager> {
- final Map<String,List<File>> pluginFileListMap;
-
- // TODO should the source be the session manager
- public SessionAboutToBeSavedEvent(final CySessionManager source) {
- super(source, SessionAboutToBeSavedListener.class);
-
- pluginFileListMap = new HashMap<String,List<File>>();
- }
-
- /**
- * @param pluginName The name of the plugin that these files should be
stored for.
- * @param files The list of File objects to be stored in the session
file.
- */
- public void addPluginFiles(final String pluginName, List<File> files)
throws Exception {
- // Throw checked Exceptions here to force plugin authors to
deal with
- // problems they might create.
- if ( pluginName == null )
- throw new Exception("plugin name is null");
-
- if ( pluginName == "" )
- throw new Exception("plugin name is empty");
-
- if ( pluginFileListMap.containsKey( pluginName ) )
- throw new Exception("The plugin file list already
contains a list of files identified by the name: " + pluginName);
-
- if ( files == null )
- throw new Exception("file list is null");
-
- // allow empty lists
-
- pluginFileListMap.put(pluginName, new ArrayList<File>(files));
- }
-
- /**
- * This method is not meant to be used by listeners for this event,
- * although you can and no harm should come to you.
- * @return A map of plugin names to lists of files to be stored in the
- * session for that plugin.
- */
- public Map<String,List<File>> getPluginFileListMap() {
- // Make the return value immutable so that listeners
- // can't mess with us.
- return Collections.unmodifiableMap( pluginFileListMap );
- }
-}
Deleted:
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionAboutToBeSavedListener.java
===================================================================
---
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionAboutToBeSavedListener.java
2010-10-08 18:47:51 UTC (rev 22192)
+++
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionAboutToBeSavedListener.java
2010-10-08 18:51:14 UTC (rev 22193)
@@ -1,18 +0,0 @@
-
-package org.cytoscape.session;
-
-import org.cytoscape.event.CyListener;
-
-/**
- * Any object that needs to know that a CySession is about to be
- * created listen to this event. Additionally, plugins can set
- * a list of files to be saved in the CySession using the
- * appropriate method in the SessionAboutToBeSavedEvent.
- */
-public interface SessionAboutToBeSavedListener extends CyListener {
-
- /**
- * @param e The event that the listener is listening for.
- */
- public void handleEvent(SessionAboutToBeSavedEvent e);
-}
Deleted:
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionLoadedEvent.java
===================================================================
---
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionLoadedEvent.java
2010-10-08 18:47:51 UTC (rev 22192)
+++
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionLoadedEvent.java
2010-10-08 18:51:14 UTC (rev 22193)
@@ -1,40 +0,0 @@
-
-package org.cytoscape.session;
-
-import org.cytoscape.event.AbstractCyEvent;
-
-/**
- * This event is fired after a new session has been set in the
- * {...@link CySessionManager#setCurrentCySession(session,filename)}
- * method and is used to notify interested parties in the change
- * of state.
- */
-public final class SessionLoadedEvent extends
AbstractCyEvent<CySessionManager> {
-
- private final CySession session;
- private final String fileName;
-
- /**
- * @param source The CySessionManager that is the source of this event.
- * @param session The CySession object that was just loaded.
- */
- public SessionLoadedEvent(final CySessionManager source, CySession
session, String fileName) {
- super(source,SessionLoadedListener.class);
- this.session = session;
- this.fileName = fileName;
- }
-
- /**
- * @return The session that was just loaded.
- */
- public CySession getLoadedSession() {
- return session;
- }
-
- /**
- * @return The file name of the session just loaded.
- */
- public String getLoadedFileName() {
- return fileName;
- }
-}
Deleted:
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionLoadedListener.java
===================================================================
---
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionLoadedListener.java
2010-10-08 18:47:51 UTC (rev 22192)
+++
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionLoadedListener.java
2010-10-08 18:51:14 UTC (rev 22193)
@@ -1,11 +0,0 @@
-
-package org.cytoscape.session;
-
-import org.cytoscape.event.CyListener;
-
-/**
- *
- */
-public interface SessionLoadedListener extends CyListener {
- public void handleEvent(SessionLoadedEvent e);
-}
Copied:
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionAboutToBeSavedEvent.java
(from rev 22192,
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionAboutToBeSavedEvent.java)
===================================================================
---
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionAboutToBeSavedEvent.java
(rev 0)
+++
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionAboutToBeSavedEvent.java
2010-10-08 18:51:14 UTC (rev 22193)
@@ -0,0 +1,67 @@
+
+package org.cytoscape.session.events;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.io.File;
+
+import org.cytoscape.session.CySession;
+import org.cytoscape.session.CySessionManager;
+
+import org.cytoscape.event.AbstractCyEvent;
+
+/**
+ * This event is fired synchronously by the CySessionManager at beginning of
the
+ * {...@link CySessionManager#getCySession()} method. The intent is to allow
+ * listeners to provide information to this event object or to update their
+ * state before that state is interrogated by the CySessionManager.
+ */
+public final class SessionAboutToBeSavedEvent extends
AbstractCyEvent<CySessionManager> {
+ final Map<String,List<File>> pluginFileListMap;
+
+ // TODO should the source be the session manager
+ public SessionAboutToBeSavedEvent(final CySessionManager source) {
+ super(source, SessionAboutToBeSavedListener.class);
+
+ pluginFileListMap = new HashMap<String,List<File>>();
+ }
+
+ /**
+ * @param pluginName The name of the plugin that these files should be
stored for.
+ * @param files The list of File objects to be stored in the session
file.
+ */
+ public void addPluginFiles(final String pluginName, List<File> files)
throws Exception {
+ // Throw checked Exceptions here to force plugin authors to
deal with
+ // problems they might create.
+ if ( pluginName == null )
+ throw new Exception("plugin name is null");
+
+ if ( pluginName == "" )
+ throw new Exception("plugin name is empty");
+
+ if ( pluginFileListMap.containsKey( pluginName ) )
+ throw new Exception("The plugin file list already
contains a list of files identified by the name: " + pluginName);
+
+ if ( files == null )
+ throw new Exception("file list is null");
+
+ // allow empty lists
+
+ pluginFileListMap.put(pluginName, new ArrayList<File>(files));
+ }
+
+ /**
+ * This method is not meant to be used by listeners for this event,
+ * although you can and no harm should come to you.
+ * @return A map of plugin names to lists of files to be stored in the
+ * session for that plugin.
+ */
+ public Map<String,List<File>> getPluginFileListMap() {
+ // Make the return value immutable so that listeners
+ // can't mess with us.
+ return Collections.unmodifiableMap( pluginFileListMap );
+ }
+}
Copied:
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionAboutToBeSavedListener.java
(from rev 22192,
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionAboutToBeSavedListener.java)
===================================================================
---
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionAboutToBeSavedListener.java
(rev 0)
+++
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionAboutToBeSavedListener.java
2010-10-08 18:51:14 UTC (rev 22193)
@@ -0,0 +1,18 @@
+
+package org.cytoscape.session.events;
+
+import org.cytoscape.event.CyListener;
+
+/**
+ * Any object that needs to know that a CySession is about to be
+ * created listen to this event. Additionally, plugins can set
+ * a list of files to be saved in the CySession using the
+ * appropriate method in the SessionAboutToBeSavedEvent.
+ */
+public interface SessionAboutToBeSavedListener extends CyListener {
+
+ /**
+ * @param e The event that the listener is listening for.
+ */
+ public void handleEvent(SessionAboutToBeSavedEvent e);
+}
Copied:
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionLoadedEvent.java
(from rev 22192,
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionLoadedEvent.java)
===================================================================
---
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionLoadedEvent.java
(rev 0)
+++
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionLoadedEvent.java
2010-10-08 18:51:14 UTC (rev 22193)
@@ -0,0 +1,43 @@
+
+package org.cytoscape.session.events;
+
+import org.cytoscape.session.CySession;
+import org.cytoscape.session.CySessionManager;
+
+import org.cytoscape.event.AbstractCyEvent;
+
+/**
+ * This event is fired after a new session has been set in the
+ * {...@link CySessionManager#setCurrentCySession(session,filename)}
+ * method and is used to notify interested parties in the change
+ * of state.
+ */
+public final class SessionLoadedEvent extends
AbstractCyEvent<CySessionManager> {
+
+ private final CySession session;
+ private final String fileName;
+
+ /**
+ * @param source The CySessionManager that is the source of this event.
+ * @param session The CySession object that was just loaded.
+ */
+ public SessionLoadedEvent(final CySessionManager source, CySession
session, String fileName) {
+ super(source,SessionLoadedListener.class);
+ this.session = session;
+ this.fileName = fileName;
+ }
+
+ /**
+ * @return The session that was just loaded.
+ */
+ public CySession getLoadedSession() {
+ return session;
+ }
+
+ /**
+ * @return The file name of the session just loaded.
+ */
+ public String getLoadedFileName() {
+ return fileName;
+ }
+}
Copied:
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionLoadedListener.java
(from rev 22177,
core3/session-api/trunk/src/main/java/org/cytoscape/session/SessionLoadedListener.java)
===================================================================
---
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionLoadedListener.java
(rev 0)
+++
core3/session-api/trunk/src/main/java/org/cytoscape/session/events/SessionLoadedListener.java
2010-10-08 18:51:14 UTC (rev 22193)
@@ -0,0 +1,11 @@
+
+package org.cytoscape.session.events;
+
+import org.cytoscape.event.CyListener;
+
+/**
+ *
+ */
+public interface SessionLoadedListener extends CyListener {
+ public void handleEvent(SessionLoadedEvent e);
+}
--
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.