Author: clopes
Date: 2011-12-02 16:05:52 -0800 (Fri, 02 Dec 2011)
New Revision: 27685
Modified:
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/BasicCyFileFilter.java
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/write/CyNetworkViewWriterFactory.java
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/write/CyNetworkViewWriterManager.java
Log:
Made it possible to get a CyNetworkViewWriter that can serialize a CyNetwork
(without a network view).
Modified:
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/BasicCyFileFilter.java
===================================================================
---
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/BasicCyFileFilter.java
2011-12-03 00:02:50 UTC (rev 27684)
+++
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/BasicCyFileFilter.java
2011-12-03 00:05:52 UTC (rev 27685)
@@ -22,10 +22,10 @@
*/
public class BasicCyFileFilter implements CyFileFilter {
- private final Set<String> extensions;
- private final Set<String> contentTypes;
- private final String description;
- private final StreamUtil streamUtil;
+ protected final Set<String> extensions;
+ protected final Set<String> contentTypes;
+ protected final String description;
+ protected final StreamUtil streamUtil;
/** Type of data that this filter applies to. */
protected final DataCategory category;
private static final Logger logger =
LoggerFactory.getLogger(BasicCyFileFilter.class);
Modified:
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/write/CyNetworkViewWriterFactory.java
===================================================================
---
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/write/CyNetworkViewWriterFactory.java
2011-12-03 00:02:50 UTC (rev 27684)
+++
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/write/CyNetworkViewWriterFactory.java
2011-12-03 00:05:52 UTC (rev 27685)
@@ -1,5 +1,6 @@
package org.cytoscape.io.write;
+import org.cytoscape.model.CyNetwork;
import org.cytoscape.view.model.CyNetworkView;
/**
@@ -10,6 +11,14 @@
public interface CyNetworkViewWriterFactory extends CyWriterFactory {
/**
+ * Specifies the {@link CyNetwork} to be written by the
+ * {@link CyWriter} Task generated by this factory. This method must
be called
+ * prior to calling the getWriter() method.
+ * @param view The {@link CyNetworkView} to be written.
+ */
+ void setNetwork(CyNetwork network);
+
+ /**
* Specifies the {@link CyNetworkView} to be written by the
* {@link CyWriter} Task generated by this factory. This method must
be called
* prior to calling the getWriter() method.
Modified:
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/write/CyNetworkViewWriterManager.java
===================================================================
---
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/write/CyNetworkViewWriterManager.java
2011-12-03 00:02:50 UTC (rev 27684)
+++
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/write/CyNetworkViewWriterManager.java
2011-12-03 00:05:52 UTC (rev 27685)
@@ -34,11 +34,13 @@
*/
package org.cytoscape.io.write;
-import org.cytoscape.view.model.CyNetworkView;
-import org.cytoscape.io.CyFileFilter;
import java.io.File;
import java.io.OutputStream;
+import org.cytoscape.io.CyFileFilter;
+import org.cytoscape.model.CyNetwork;
+import org.cytoscape.view.model.CyNetworkView;
+
/**
* A {@link org.cytoscape.io.write.CyWriterManager} specific to writing
* {@link org.cytoscape.view.model.CyNetworkView} objects.
@@ -47,12 +49,36 @@
public interface CyNetworkViewWriterManager extends CyWriterManager {
/**
- * Returns the {@link org.cytoscape.io.write.CyWriter} Task that will
attempt to write the specified view to the
+ * Returns the {@link CyWriter} Task that will attempt to write the
specified network to the
+ * specified file of the specified file type.
+ * @param network The {@link org.cytoscape.model.CyNetwork} to be
written.
+ * @param filter The {@link org.cytoscape.io.CyFileFilter} that defines
the type of file to be written.
+ * @param file The file to be written.
+ * @return The {@link CyWriter} Task that will attempt to write the
specified network to the
* specified file of the specified file type.
+ * @throws Exception
+ */
+ CyWriter getWriter(CyNetwork network, CyFileFilter filter, File file)
throws Exception;
+
+ /**
+ * Returns the {@link CyWriter} Task that will attempt to write the
specified network to the
+ * specified output steam of the specified file type.
+ * @param network The {@link org.cytoscape.model.CyNetwork} to be
written.
+ * @param filter The {@link org.cytoscape.io.CyFileFilter} that defines
the type of file to be written.
+ * @param os The output steam to be written.
+ * @return The {@link CyWriter} Task that will attempt to write the
specified network to the
+ * specified output steam of the specified file type.
+ * @throws Exception
+ */
+ CyWriter getWriter(CyNetwork network, CyFileFilter filter, OutputStream
os) throws Exception;
+
+ /**
+ * Returns the {@link CyWriter} Task that will attempt to write the
specified view to the
+ * specified file of the specified file type.
* @param view The {@link org.cytoscape.view.model.CyNetworkView} to be
written.
* @param filter The {@link org.cytoscape.io.CyFileFilter} that defines
the type of file to be written.
* @param file The file to be written.
- * @return The {@link org.cytoscape.io.write.CyWriter} Task that will
attempt to write the specified view to the
+ * @return The {@link CyWriter} Task that will attempt to write the
specified view to the
* specified file of the specified file type.
* @throws Exception
*/
--
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.