Author: kono
Date: 2010-08-12 16:16:17 -0700 (Thu, 12 Aug 2010)
New Revision: 21365
Added:
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/CyTableManagerImpl.java
Removed:
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/TableManager.java
Modified:
core3/model-impl/trunk/pom.xml
core3/model-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
core3/model-impl/trunk/src/test/java/org/cytoscape/model/CyTableManagerTest.java
core3/model-impl/trunk/src/test/java/org/cytoscape/model/TestCyNetworkFactory.java
Log:
Class name had been changed for consistency.
Modified: core3/model-impl/trunk/pom.xml
===================================================================
--- core3/model-impl/trunk/pom.xml 2010-08-12 23:01:53 UTC (rev 21364)
+++ core3/model-impl/trunk/pom.xml 2010-08-12 23:16:17 UTC (rev 21365)
@@ -109,12 +109,7 @@
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.cytoscape</groupId>
- <artifactId>event-api</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
+
<dependency>
<groupId>org.cytoscape</groupId>
@@ -133,7 +128,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.1</version>
+ <version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Copied:
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/CyTableManagerImpl.java
(from rev 21345,
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/TableManager.java)
===================================================================
---
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/CyTableManagerImpl.java
(rev 0)
+++
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/CyTableManagerImpl.java
2010-08-12 23:16:17 UTC (rev 21365)
@@ -0,0 +1,93 @@
+
+/*
+ Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+
+package org.cytoscape.model.internal;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.cytoscape.model.CyDataTable;
+import org.cytoscape.model.CyNetwork;
+import org.cytoscape.model.CyTableManager;
+
+/**
+ * An interface describing a factory used for managing
+ * {...@link CyDataTable} objects. This class will be
+ * provided as a service through Spring/OSGi.
+ */
+public class CyTableManagerImpl implements CyTableManager {
+
+ private final Map<String, Map<CyNetwork, Map<String,CyDataTable>>> map;
+
+ public CyTableManagerImpl() {
+ map = new HashMap<String, Map<CyNetwork,
Map<String,CyDataTable>>>();
+ map.put( "NETWORK", new HashMap<CyNetwork,
Map<String,CyDataTable>>() );
+ map.put( "NODE", new HashMap<CyNetwork,
Map<String,CyDataTable>>() );
+ map.put( "EDGE", new HashMap<CyNetwork,
Map<String,CyDataTable>>() );
+ }
+
+
+ public Map<String,CyDataTable> getTableMap(final String
graphObjectType, final CyNetwork network) {
+ if ( network == null || graphObjectType == null )
+ return null;
+
+ Map<CyNetwork, Map<String,CyDataTable>> tmap =
map.get(graphObjectType);
+
+ if ( tmap == null )
+ throw new IllegalArgumentException("no data tables of
type: " + graphObjectType + " exist");
+
+ return map.get(graphObjectType).get(network);
+ }
+
+
+ public void setTableMap(final String graphObjectType, final CyNetwork
network, final Map<String,CyDataTable> tm) {
+ if ( network == null )
+ throw new NullPointerException("CyNetwork is null");
+ if ( graphObjectType == null )
+ throw new NullPointerException("Type is null");
+
+ if ( !map.containsKey(graphObjectType) )
+ map.put(graphObjectType, new HashMap<CyNetwork,
Map<String,CyDataTable>>());
+
+ Map<CyNetwork, Map<String,CyDataTable>> tmap =
map.get(graphObjectType);
+
+ if ( tm == null )
+ tmap.remove(network);
+ else
+ tmap.put(network,tm);
+ }
+
+}
Deleted:
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/TableManager.java
===================================================================
---
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/TableManager.java
2010-08-12 23:01:53 UTC (rev 21364)
+++
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/TableManager.java
2010-08-12 23:16:17 UTC (rev 21365)
@@ -1,93 +0,0 @@
-
-/*
- Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
-
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2.1 of the License, or
- any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
- documentation provided hereunder is on an "as is" basis, and the
- Institute for Systems Biology and the Whitehead Institute
- have no obligations to provide maintenance, support,
- updates, enhancements or modifications. In no event shall the
- Institute for Systems Biology and the Whitehead Institute
- be liable to any party for direct, indirect, special,
- incidental or consequential damages, including lost profits, arising
- out of the use of this software and its documentation, even if the
- Institute for Systems Biology and the Whitehead Institute
- have been advised of the possibility of such damage. See
- the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this library; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
-
-package org.cytoscape.model.internal;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-
-import org.cytoscape.model.CyDataTable;
-import org.cytoscape.model.CyTableManager;
-import org.cytoscape.model.CyNetwork;
-
-/**
- * An interface describing a factory used for managing
- * {...@link CyDataTable} objects. This class will be
- * provided as a service through Spring/OSGi.
- */
-public class TableManager implements CyTableManager {
-
- private final Map<String, Map<CyNetwork, Map<String,CyDataTable>>> map;
-
- public TableManager() {
- map = new HashMap<String, Map<CyNetwork,
Map<String,CyDataTable>>>();
- map.put( "NETWORK", new HashMap<CyNetwork,
Map<String,CyDataTable>>() );
- map.put( "NODE", new HashMap<CyNetwork,
Map<String,CyDataTable>>() );
- map.put( "EDGE", new HashMap<CyNetwork,
Map<String,CyDataTable>>() );
- }
-
- public Map<String,CyDataTable> getTableMap(String type, CyNetwork o) {
- if ( o == null || type == null )
- return null;
-
- Map<CyNetwork, Map<String,CyDataTable>> tmap = map.get(type);
-
- if ( tmap == null )
- throw new IllegalArgumentException("no data tables of
type: " + type + " exist");
-
- return map.get(type).get(o);
- }
-
- public void setTableMap(String type, CyNetwork net,
Map<String,CyDataTable> tm) {
- if ( net == null )
- throw new NullPointerException("CyNetwork is null");
- if ( type == null )
- throw new NullPointerException("Type is null");
-
- if ( !map.containsKey(type) )
- map.put(type, new HashMap<CyNetwork,
Map<String,CyDataTable>>());
-
- Map<CyNetwork, Map<String,CyDataTable>> tmap = map.get(type);
-
- if ( tm == null )
- tmap.remove(net);
- else
- tmap.put(net,tm);
- }
-
-}
Modified:
core3/model-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
===================================================================
---
core3/model-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
2010-08-12 23:01:53 UTC (rev 21364)
+++
core3/model-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
2010-08-12 23:16:17 UTC (rev 21365)
@@ -15,7 +15,7 @@
<context:annotation-config/>
- <bean id="cyTableManager"
class="org.cytoscape.model.internal.TableManager">
+ <bean id="cyTableManager"
class="org.cytoscape.model.internal.CyTableManagerImpl">
</bean>
<bean id="cyNetworkFactory"
class="org.cytoscape.model.internal.CyNetworkFactoryImpl">
Modified:
core3/model-impl/trunk/src/test/java/org/cytoscape/model/CyTableManagerTest.java
===================================================================
---
core3/model-impl/trunk/src/test/java/org/cytoscape/model/CyTableManagerTest.java
2010-08-12 23:01:53 UTC (rev 21364)
+++
core3/model-impl/trunk/src/test/java/org/cytoscape/model/CyTableManagerTest.java
2010-08-12 23:16:17 UTC (rev 21365)
@@ -35,7 +35,7 @@
package org.cytoscape.model;
-import org.cytoscape.model.internal.TableManager;
+import org.cytoscape.model.internal.CyTableManagerImpl;
/**
* DOCUMENT ME!
@@ -47,7 +47,7 @@
*/
public void setUp() {
super.setUp();
- mgr = new TableManager();
+ mgr = new CyTableManagerImpl();
}
/**
Modified:
core3/model-impl/trunk/src/test/java/org/cytoscape/model/TestCyNetworkFactory.java
===================================================================
---
core3/model-impl/trunk/src/test/java/org/cytoscape/model/TestCyNetworkFactory.java
2010-08-12 23:01:53 UTC (rev 21364)
+++
core3/model-impl/trunk/src/test/java/org/cytoscape/model/TestCyNetworkFactory.java
2010-08-12 23:16:17 UTC (rev 21365)
@@ -40,23 +40,29 @@
//import org.cytoscape.model.internal.CyNetworkImpl;
//import org.cytoscape.model.internal.MGraph;
import org.cytoscape.model.internal.ArrayGraph;
-import org.cytoscape.model.internal.TableManager;
+import org.cytoscape.model.internal.CyTableManagerImpl;
import org.cytoscape.event.DummyCyEventHelper;
import org.cytoscape.model.subnetwork.CyRootNetwork;
+import org.junit.Test;
public class TestCyNetworkFactory {
- private TestCyNetworkFactory() {};
+ public TestCyNetworkFactory() {};
public static CyNetwork getInstance() {
//return new CyNetworkImpl(new DummyCyEventHelper());
//return new MGraph(new DummyCyEventHelper());
- return new ArrayGraph(new DummyCyEventHelper(), new
TableManager());
+ return new ArrayGraph(new DummyCyEventHelper(), new
CyTableManagerImpl());
}
public static CyRootNetwork getRootInstance() {
- return new ArrayGraph(new DummyCyEventHelper(), new
TableManager());
+ return new ArrayGraph(new DummyCyEventHelper(), new
CyTableManagerImpl());
}
+
+ @Test
+ public void testFactory() 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.