Author: jm
Date: 2010-10-28 08:14:32 -0700 (Thu, 28 Oct 2010)
New Revision: 22544
Modified:
core3/sbml-impl/trunk/src/main/java/org/cytoscape/sbml/internal/SBMLFileFilter.java
core3/sbml-impl/trunk/src/main/java/org/cytoscape/sbml/internal/SBMLNetworkViewReader.java
core3/sbml-impl/trunk/src/test/java/org/cytoscape/sbml/internal/SBMLFileFilterTest.java
core3/sbml-impl/trunk/src/test/java/org/cytoscape/sbml/internal/SBMLNetworkViewReaderTest.java
Log:
Fixed API breakage in sbml-impl
Modified:
core3/sbml-impl/trunk/src/main/java/org/cytoscape/sbml/internal/SBMLFileFilter.java
===================================================================
---
core3/sbml-impl/trunk/src/main/java/org/cytoscape/sbml/internal/SBMLFileFilter.java
2010-10-28 00:46:21 UTC (rev 22543)
+++
core3/sbml-impl/trunk/src/main/java/org/cytoscape/sbml/internal/SBMLFileFilter.java
2010-10-28 15:14:32 UTC (rev 22544)
@@ -39,12 +39,12 @@
}
@Override
- public boolean accept(URI uri, DataCategory category) {
+ public boolean accepts(URI uri, DataCategory category) {
if (!category.equals(DataCategory.NETWORK)) {
return false;
}
try {
- return accept(getInputStream(uri.toURL()), category);
+ return accepts(getInputStream(uri.toURL()), category);
} catch (IOException e) {
Logger logger = LoggerFactory.getLogger(getClass());
logger.error("Error while checking header", e);
//$NON-NLS-1$
@@ -69,7 +69,7 @@
}
@Override
- public boolean accept(InputStream stream, DataCategory category) {
+ public boolean accepts(InputStream stream, DataCategory category) {
if (!category.equals(DataCategory.NETWORK)) {
return false;
}
Modified:
core3/sbml-impl/trunk/src/main/java/org/cytoscape/sbml/internal/SBMLNetworkViewReader.java
===================================================================
---
core3/sbml-impl/trunk/src/main/java/org/cytoscape/sbml/internal/SBMLNetworkViewReader.java
2010-10-28 00:46:21 UTC (rev 22543)
+++
core3/sbml-impl/trunk/src/main/java/org/cytoscape/sbml/internal/SBMLNetworkViewReader.java
2010-10-28 15:14:32 UTC (rev 22544)
@@ -88,7 +88,7 @@
for (Species species : model.getListOfSpecies()) {
CyNode node = network.addNode();
speciesById.put(species.getId(), node);
- CyRow attributes = node.attrs();
+ CyRow attributes = node.getCyRow();
checkNodeSchema(attributes);
attributes.set(NODE_NAME_ATTR_LABEL, species.getName());
attributes.set(SBML_TYPE_ATTR, SBML_TYPE_SPECIES);
@@ -109,7 +109,7 @@
for (Reaction reaction : model.getListOfReactions()) {
CyNode node = network.addNode();
reactionsById.put(reaction.getId(), node);
- CyRow attributes = node.attrs();
+ CyRow attributes = node.getCyRow();
checkNodeSchema(attributes);
String name = reaction.getName();
if (name == null) {
@@ -123,7 +123,7 @@
for (SpeciesReference product :
reaction.getListOfProducts()) {
CyNode sourceNode =
speciesById.get(product.getSpecies());
CyEdge edge = network.addEdge(sourceNode, node,
true);
- CyRow edgeAttributes = edge.attrs();
+ CyRow edgeAttributes = edge.getCyRow();
checkEdgeSchema(edgeAttributes);
edgeAttributes.set(INTERACTION_TYPE_ATTR,
INTERACTION_TYPE_REACTION_PRODUCT);
}
@@ -131,7 +131,7 @@
for (SpeciesReference reactant :
reaction.getListOfReactants()) {
CyNode sourceNode =
speciesById.get(reactant.getSpecies());
CyEdge edge = network.addEdge(sourceNode, node,
true);
- CyRow edgeAttributes = edge.attrs();
+ CyRow edgeAttributes = edge.getCyRow();
checkEdgeSchema(edgeAttributes);
edgeAttributes.set(INTERACTION_TYPE_ATTR,
INTERACTION_TYPE_REACTION_REACTANT);
}
@@ -139,7 +139,7 @@
for (ModifierSpeciesReference modifier :
reaction.getListOfModifiers()) {
CyNode sourceNode =
speciesById.get(modifier.getSpecies());
CyEdge edge = network.addEdge(sourceNode, node,
true);
- CyRow edgeAttributes = edge.attrs();
+ CyRow edgeAttributes = edge.getCyRow();
checkEdgeSchema(edgeAttributes);
edgeAttributes.set(INTERACTION_TYPE_ATTR,
INTERACTION_TYPE_REACTION_MODIFIER);
}
@@ -177,8 +177,8 @@
}
private <T> void checkSchema(CyRow attributes, String attributeName,
Class<T> type) {
- if (!attributes.contains(attributeName, type)) {
- attributes.getDataTable().createColumn(attributeName,
type, false);
+ if (attributes.getType(attributeName) == null) {
+ attributes.getDataTable().createColumn(attributeName,
type);
}
}
Modified:
core3/sbml-impl/trunk/src/test/java/org/cytoscape/sbml/internal/SBMLFileFilterTest.java
===================================================================
---
core3/sbml-impl/trunk/src/test/java/org/cytoscape/sbml/internal/SBMLFileFilterTest.java
2010-10-28 00:46:21 UTC (rev 22543)
+++
core3/sbml-impl/trunk/src/test/java/org/cytoscape/sbml/internal/SBMLFileFilterTest.java
2010-10-28 15:14:32 UTC (rev 22544)
@@ -44,7 +44,7 @@
@Test
public void testAcceptSBMLLevel2() throws Exception {
File file = new File("src/test/resources/BIOMD0000000003.xml");
- assertTrue(filter.accept(new FileInputStream(file),
DataCategory.NETWORK));
- assertTrue(filter.accept(file.toURI(), DataCategory.NETWORK));
+ assertTrue(filter.accepts(new FileInputStream(file),
DataCategory.NETWORK));
+ assertTrue(filter.accepts(file.toURI(), DataCategory.NETWORK));
}
}
Modified:
core3/sbml-impl/trunk/src/test/java/org/cytoscape/sbml/internal/SBMLNetworkViewReaderTest.java
===================================================================
---
core3/sbml-impl/trunk/src/test/java/org/cytoscape/sbml/internal/SBMLNetworkViewReaderTest.java
2010-10-28 00:46:21 UTC (rev 22543)
+++
core3/sbml-impl/trunk/src/test/java/org/cytoscape/sbml/internal/SBMLNetworkViewReaderTest.java
2010-10-28 15:14:32 UTC (rev 22544)
@@ -66,14 +66,14 @@
CyNode cyclin = findNodeById("C", model);
assertNotNull(cyclin);
- CyRow attributes = cyclin.attrs();
+ CyRow attributes = cyclin.getCyRow();
assertEquals("Cyclin",
attributes.get(SBMLNetworkViewReader.NODE_NAME_ATTR_LABEL, String.class));
assertEquals((Double) 0.01,
attributes.get(SBMLNetworkViewReader.SBML_INITIAL_CONCENTRATION_ATTR,
Double.class));
}
private CyNode findNodeById(String sbmlId, CyNetwork network) {
for (CyNode node : network.getNodeList()) {
- CyRow attributes = node.attrs();
+ CyRow attributes = node.getCyRow();
String id =
attributes.get(SBMLNetworkViewReader.SBML_ID_ATTR, String.class);
if (id.equals(sbmlId)) {
return node;
--
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.