Author: rodche
Date: 2012-04-04 09:55:45 -0700 (Wed, 04 Apr 2012)
New Revision: 28735
Modified:
csplugins/trunk/toronto/rodche/cpathsquared-impl/pom.xml
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/CPath2CytoscapeWebService.java
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/CPath2Factory.java
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/CyActivator.java
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ExecuteGetRecordByCPathIdTask.java
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ViewNetworkNeighborhoodTask.java
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/AttributeUtil.java
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/BioPaxUtil.java
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/BinarySifVisualStyleFactory.java
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/DownloadDetails.java
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/SearchQueryPanel.java
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/SearchResultsPanel.java
Log:
Updated according to the latest Cy3 API rev.
Modified: csplugins/trunk/toronto/rodche/cpathsquared-impl/pom.xml
===================================================================
--- csplugins/trunk/toronto/rodche/cpathsquared-impl/pom.xml 2012-04-03
23:20:21 UTC (rev 28734)
+++ csplugins/trunk/toronto/rodche/cpathsquared-impl/pom.xml 2012-04-04
16:55:45 UTC (rev 28735)
@@ -34,11 +34,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.cytoscape</groupId>
- <artifactId>webservice-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.cytoscape</groupId>
<artifactId>viewmodel-api</artifactId>
<scope>provided</scope>
@@ -69,6 +64,12 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.cytoscape</groupId>
+ <artifactId>webservice-swing-api</artifactId>
+ <version>3.0.0-alpha8-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
@@ -91,9 +92,13 @@
<dependency>
<groupId>org.biopax.paxtools</groupId>
<artifactId>paxtools-core</artifactId>
- <version>4.1.1</version>
+ <version>4.1.4-SNAPSHOT</version>
</dependency>
-
+ <dependency>
+ <groupId>org.biopax.paxtools</groupId>
+ <artifactId>biopax-converter</artifactId>
+ <version>4.1.4-SNAPSHOT</version>
+ </dependency>
<!-- Spring Dependencies to embed (temporary; must use/start Spring
EBR bundles instead) -->
<dependency>
<groupId>org.springframework</groupId>
Modified:
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/CPath2CytoscapeWebService.java
===================================================================
---
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/CPath2CytoscapeWebService.java
2012-04-03 23:20:21 UTC (rev 28734)
+++
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/CPath2CytoscapeWebService.java
2012-04-04 16:55:45 UTC (rev 28735)
@@ -14,7 +14,7 @@
import org.cytoscape.cpathsquared.internal.view.TabUi;
import org.cytoscape.io.webservice.NetworkImportWebServiceClient;
import org.cytoscape.io.webservice.SearchWebServiceClient;
-import org.cytoscape.io.webservice.client.AbstractWebServiceClient;
+import org.cytoscape.io.webservice.swing.AbstractWebServiceGUIClient;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.work.Task;
import org.cytoscape.work.TaskIterator;
@@ -26,8 +26,8 @@
/**
* CPath Web Service, integrated into the Cytoscape Web Services Framework.
*/
-public class CPath2CytoscapeWebService extends AbstractWebServiceClient
- implements NetworkImportWebServiceClient,
SearchWebServiceClient<Object>
+public class CPath2CytoscapeWebService extends AbstractWebServiceGUIClient
+ implements NetworkImportWebServiceClient, SearchWebServiceClient<Object>
{
private static final Logger LOGGER =
LoggerFactory.getLogger(CPath2CytoscapeWebService.class);
@@ -54,9 +54,8 @@
}
@Override
- public TaskIterator createTaskIterator() {
- String query = "";
- Task task = new CPath2NetworkImportTask(query,
OutputFormat.BINARY_SIF);
+ public TaskIterator createTaskIterator(Object query) {
+ Task task = new CPath2NetworkImportTask((String) query,
OutputFormat.BINARY_SIF);
return new TaskIterator(task);
}
Modified:
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/CPath2Factory.java
===================================================================
---
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/CPath2Factory.java
2012-04-03 23:20:21 UTC (rev 28734)
+++
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/CPath2Factory.java
2012-04-04 16:55:45 UTC (rev 28735)
@@ -85,6 +85,11 @@
public TaskIterator createTaskIterator() {
return new TaskIterator(tasks);
}
+
+ @Override
+ public boolean isReady() {
+ return true; //TODO really? ;)
+ }
};
}
Modified:
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/CyActivator.java
===================================================================
---
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/CyActivator.java
2012-04-03 23:20:21 UTC (rev 28734)
+++
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/CyActivator.java
2012-04-04 16:55:45 UTC (rev 28735)
@@ -37,7 +37,7 @@
public void start(BundleContext bc) {
CySwingApplication cySwingApplicationRef =
getService(bc,CySwingApplication.class);
- TaskManager taskManagerRef = getService(bc,TaskManager.class);
+ TaskManager<?,?> taskManagerRef =
getService(bc,TaskManager.class);
OpenBrowser openBrowserRef = getService(bc,OpenBrowser.class);
CyNetworkManager cyNetworkManagerRef =
getService(bc,CyNetworkManager.class);
CyApplicationManager cyApplicationManagerRef =
getService(bc,CyApplicationManager.class);
Modified:
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ExecuteGetRecordByCPathIdTask.java
===================================================================
---
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ExecuteGetRecordByCPathIdTask.java
2012-04-03 23:20:21 UTC (rev 28734)
+++
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ExecuteGetRecordByCPathIdTask.java
2012-04-04 16:55:45 UTC (rev 28735)
@@ -34,7 +34,9 @@
import org.cytoscape.model.CyNode;
import org.cytoscape.model.CyRow;
import org.cytoscape.session.CyNetworkNaming;
+import org.cytoscape.view.layout.CyLayoutAlgorithm;
import org.cytoscape.view.layout.CyLayoutAlgorithmManager;
+import org.cytoscape.view.layout.CyLayoutContext;
import org.cytoscape.view.model.CyNetworkView;
import org.cytoscape.view.vizmap.VisualStyle;
import org.cytoscape.work.AbstractTask;
@@ -163,10 +165,10 @@
}
CyLayoutAlgorithmManager layoutManager =
CPath2Factory.getCyLayoutAlgorithmManager();
- TaskFactory tf = layoutManager.getDefaultLayout();
- TaskIterator ti = tf.createTaskIterator();
- Task task = ti.next();
- insertTasksAfterCurrentTask(new Task[] {task});
+ CyLayoutAlgorithm<CyLayoutContext> layout =
layoutManager.getDefaultLayout();
+ CyLayoutContext context = layout.createLayoutContext();
+ context.setNetworkView(view);
+
insertTasksAfterCurrentTask(layout.createTaskIterator(context));
} catch (IOException e) {
throw new Exception("Failed to retrieve records.", e);
@@ -212,7 +214,7 @@
final CyNetwork cyNetwork = view.getModel();
// Set the Quick Find Default Index
- AttributeUtil.set(cyNetwork, cyNetwork,
"quickfind.default_index", CyNode.NAME, String.class);
+ AttributeUtil.set(cyNetwork, cyNetwork,
"quickfind.default_index", CyNetwork.NAME, String.class);
// Specify that this is a BINARY_NETWORK
AttributeUtil.set(cyNetwork, cyNetwork, "BIOPAX_NETWORK",
Boolean.TRUE, Boolean.class);
@@ -281,7 +283,7 @@
Map<String, CyNode> nodes = new HashMap<String,
CyNode>();
for (int j = 0; j < currentList.size(); j++) {
CyNode node = currentList.get(j);
- String name =
cyNetwork.getRow(node).get(CyNode.NAME, String.class);
+ String name =
cyNetwork.getRow(node).get(CyNetwork.NAME, String.class);
nodes.put(name, node);
ids[j] = name;
}
@@ -330,7 +332,7 @@
int counter = 0;
for (CyNode node : cyNetwork.getNodeList()) {
CyRow row = cyNetwork.getRow(node);
- String label = row.get(CyNode.NAME, String.class);
+ String label = row.get(CyNetwork.NAME, String.class);
// If we already have details on this node, skip it.
if (label == null) {
Modified:
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ViewNetworkNeighborhoodTask.java
===================================================================
---
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ViewNetworkNeighborhoodTask.java
2012-04-03 23:20:21 UTC (rev 28734)
+++
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ViewNetworkNeighborhoodTask.java
2012-04-04 16:55:45 UTC (rev 28735)
@@ -45,7 +45,7 @@
CyNode cyNode = nodeView.getModel();
CyRow nodeRow = cyNetwork.getRow(cyNode);
String biopaxID = nodeRow.get(BioPaxUtil.BIOPAX_RDF_ID, String.class);
- String neighborhoodParam = "Neighborhood: " + nodeRow.get(CyNode.NAME,
String.class);
+ String neighborhoodParam = "Neighborhood: " +
nodeRow.get(CyNetwork.NAME, String.class);
// encode some parts of the url
try {
Modified:
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/AttributeUtil.java
===================================================================
---
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/AttributeUtil.java
2012-04-03 23:20:21 UTC (rev 28734)
+++
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/AttributeUtil.java
2012-04-04 16:55:45 UTC (rev 28735)
@@ -7,15 +7,15 @@
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyRow;
import org.cytoscape.model.CyTable;
-import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.model.CyIdentifiable;
public class AttributeUtil {
- public static void set(CyNetwork network, CyTableEntry entry, String
name, Object value, Class<?> type) {
+ public static void set(CyNetwork network, CyIdentifiable entry, String
name, Object value, Class<?> type) {
set(network, entry, null, name, value, type);
}
- public static void copyAttributes(CyNetwork network, CyTableEntry
source, CyTableEntry target) {
+ public static void copyAttributes(CyNetwork network, CyIdentifiable
source, CyIdentifiable target) {
CyRow sourceRow = network.getRow(source);
for (Entry<String, Object> entry :
sourceRow.getAllValues().entrySet()) {
String key = entry.getKey();
@@ -31,7 +31,7 @@
}
}
- public static void set(CyNetwork network, CyTableEntry entry, String
tableName, String name, Object value, Class<?> type) {
+ public static void set(CyNetwork network, CyIdentifiable entry, String
tableName, String name, Object value, Class<?> type) {
CyRow row = (tableName==null) ? network.getRow(entry) :
network.getRow(entry,tableName);
CyTable table = row.getTable();
CyColumn column = table.getColumn(name);
Modified:
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/BioPaxUtil.java
===================================================================
---
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/BioPaxUtil.java
2012-04-03 23:20:21 UTC (rev 28734)
+++
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/BioPaxUtil.java
2012-04-04 16:55:45 UTC (rev 28735)
@@ -722,7 +722,7 @@
setChemicalModificationAttributes(network, node,
chemicalModificationsWrapper);
}
// update the name (also used for node's label and quick find)
- AttributeUtil.set(network, node, CyNode.NAME, name,
String.class);
+ AttributeUtil.set(network, node, CyNetwork.NAME, name,
String.class);
// traverse to create the rest of attr.
bpeAutoMapper.traverse(element, null);
Modified:
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/BinarySifVisualStyleFactory.java
===================================================================
---
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/BinarySifVisualStyleFactory.java
2012-04-03 23:20:21 UTC (rev 28734)
+++
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/BinarySifVisualStyleFactory.java
2012-04-04 16:55:45 UTC (rev 28735)
@@ -4,8 +4,10 @@
import java.awt.Paint;
import org.cytoscape.cpathsquared.internal.util.BioPaxUtil;
+import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
import org.cytoscape.view.presentation.property.ArrowShapeVisualProperty;
+import org.cytoscape.view.presentation.property.BasicVisualLexicon;
import org.cytoscape.view.presentation.property.NodeShapeVisualProperty;
import org.cytoscape.view.presentation.property.values.ArrowShape;
import org.cytoscape.view.presentation.property.values.NodeShape;
@@ -172,9 +174,9 @@
private void createNodeLabel(VisualStyle style) {
- // create pass through mapper for node labels
+ // create pass through mapper for node labels
style.addVisualMappingFunction(passthroughFactory
- .createVisualMappingFunction(
- CyNode.NAME, String.class,
null, NODE_LABEL));
+ .createVisualMappingFunction(CyNetwork.NAME,
String.class, null,
+ BasicVisualLexicon.NODE_LABEL));
}
}
Modified:
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/DownloadDetails.java
===================================================================
---
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/DownloadDetails.java
2012-04-03 23:20:21 UTC (rev 28734)
+++
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/DownloadDetails.java
2012-04-04 16:55:45 UTC (rev 28735)
@@ -136,10 +136,10 @@
format = OutputFormat.BINARY_SIF;
}
- TaskManager taskManager = CPath2Factory.getTaskManager();
+ TaskManager<?,?> taskManager = CPath2Factory.getTaskManager();
TaskFactory taskFactory = CPath2Factory.newTaskFactory(
new ExecuteGetRecordByCPathIdTask(ids, format,
networkTitle));
- taskManager.execute(taskFactory);
+ taskManager.execute(taskFactory.createTaskIterator());
}
}
Modified:
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/SearchQueryPanel.java
===================================================================
---
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/SearchQueryPanel.java
2012-04-03 23:20:21 UTC (rev 28734)
+++
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/SearchQueryPanel.java
2012-04-04 16:55:45 UTC (rev 28735)
@@ -221,7 +221,7 @@
};
TaskFactory search = CPath2Factory.newTaskFactory(new
ExecuteSearchTask(
keyword.trim(), organisms, datasources, handler));
- CPath2Factory.getTaskManager().execute(search);
+
CPath2Factory.getTaskManager().execute(search.createTaskIterator());
}
}
Modified:
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/SearchResultsPanel.java
===================================================================
---
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/SearchResultsPanel.java
2012-04-03 23:20:21 UTC (rev 28734)
+++
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/view/SearchResultsPanel.java
2012-04-04 16:55:45 UTC (rev 28735)
@@ -222,7 +222,7 @@
TaskFactory taskFactory = CPath2Factory.newTaskFactory(new
ExecuteGetRecordByCPathIdTask(
new String[]{internalId}, format, title));
- CPath2Factory.getTaskManager().execute(taskFactory);
+
CPath2Factory.getTaskManager().execute(taskFactory.createTaskIterator());
} catch (IndexOutOfBoundsException e) {
// Ignore TODO strange...
--
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.