Author: pwang
Date: 2012-03-26 14:26:04 -0700 (Mon, 26 Mar 2012)
New Revision: 28650
Added:
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyIdentifiable.java
Removed:
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTableEntry.java
Modified:
core3/api/trunk/core-task-api/src/main/java/org/cytoscape/task/MapNetworkAttrTask.java
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/events/GroupChangedEvent.java
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyEdge.java
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetwork.java
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetworkTableManager.java
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNode.java
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTable.java
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyEdgeTest.java
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyNetworkTableManagerTest.java
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyNetworkTest.java
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/DummyGraphObject.java
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/subnetwork/AbstractCySubNetworkTest.java
core3/api/trunk/session-api/src/main/java/org/cytoscape/session/CySession.java
core3/api/trunk/session-api/src/test/java/org/cytoscape/session/CySessionTest.java
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/CyNetworkView.java
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/View.java
core3/api/trunk/vizmap-api/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java
core3/api/trunk/vizmap-api/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java
core3/api/trunk/vizmap-gui-api/src/main/java/org/cytoscape/view/vizmap/gui/editor/EditorManager.java
Log:
Fixed bug#810
Modified:
core3/api/trunk/core-task-api/src/main/java/org/cytoscape/task/MapNetworkAttrTask.java
===================================================================
---
core3/api/trunk/core-task-api/src/main/java/org/cytoscape/task/MapNetworkAttrTask.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/core-task-api/src/main/java/org/cytoscape/task/MapNetworkAttrTask.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -13,7 +13,7 @@
import org.cytoscape.model.CyNetworkManager;
import org.cytoscape.model.CyTable;
import org.cytoscape.model.CyColumn;
-import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.model.CyIdentifiable;
import org.cytoscape.model.subnetwork.CyRootNetworkManager;
import org.cytoscape.model.subnetwork.CyRootNetwork;
import org.cytoscape.work.AbstractTask;
@@ -53,7 +53,7 @@
return "Map Table";
}
- private final Class<? extends CyTableEntry> type; // Must be node or
edge!
+ private final Class<? extends CyIdentifiable> type; // Must be node or
edge!
private final CyTable newGlobalTable;
private final CyNetworkManager networkManager;
private final CyApplicationManager applicationManager;
@@ -68,7 +68,7 @@
* @param networkManager The network manager used to access the list of
all networks.
* @param applicationManager The application manager used to access the
current network.
*/
- public MapNetworkAttrTask(final Class<? extends CyTableEntry> type,
+ public MapNetworkAttrTask(final Class<? extends CyIdentifiable> type,
final CyTable newGlobalTable,
String mappingKey,
final CyNetworkManager networkManager,
@@ -88,20 +88,20 @@
/**
- * Constructor. Will attempt to map existing tables based on the {@link
CyTableEntry#NAME}
+ * Constructor. Will attempt to map existing tables based on the {@link
CyIdentifiable#NAME}
* column.
* @param type The type of table to map to, either CyNode.class or
CyEdge.class.
* @param newGlobalTable The table to be mapped.
* @param networkManager The network manager used to access the list of
all networks.
* @param applicationManager The application manager used to access the
current network.
*/
- public MapNetworkAttrTask(final Class<? extends CyTableEntry> type,
+ public MapNetworkAttrTask(final Class<? extends CyIdentifiable> type,
final CyTable newGlobalTable,
final CyNetworkManager networkManager,
final CyApplicationManager applicationManager,
final
CyRootNetworkManager rootNetworkManager)
{
-
this(type,newGlobalTable,CyTableEntry.NAME,networkManager,applicationManager,rootNetworkManager);
+
this(type,newGlobalTable,CyNetwork.NAME,networkManager,applicationManager,rootNetworkManager);
}
@@ -126,7 +126,7 @@
final CyRootNetwork rootNetwork =
rootNetworkManager.getRootNetwork(currentNetwork);
targetTables.add(type == CyNode.class ?
rootNetwork.getSharedNodeTable()
:
rootNetwork.getSharedEdgeTable());
- if ( mappingKey.equals(CyTableEntry.NAME) )
+ if ( mappingKey.equals(CyNetwork.NAME) )
mappingKey = CyRootNetwork.SHARED_NAME;
} else if (selection.equals(ALL_SHARED)) {
final Set<CyNetwork> networks =
networkManager.getNetworkSet();
@@ -136,7 +136,7 @@
for (final CyRootNetwork rootNetwork : rootNetworks)
targetTables.add(type == CyNode.class ?
rootNetwork.getSharedNodeTable()
:
rootNetwork.getSharedEdgeTable());
- if ( mappingKey.equals(CyTableEntry.NAME) )
+ if ( mappingKey.equals(CyNetwork.NAME) )
mappingKey = CyRootNetwork.SHARED_NAME;
} else {
// don't map it to anything!
Modified:
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/events/GroupChangedEvent.java
===================================================================
---
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/events/GroupChangedEvent.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/events/GroupChangedEvent.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -6,7 +6,7 @@
import org.cytoscape.group.CyGroup;
import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNode;
-import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.model.CyIdentifiable;
/**
* This event signals that a group has changed, either by adding or
@@ -19,7 +19,7 @@
NODE_ADDED, INTERNAL_EDGE_ADDED, EXTERNAL_EDGE_ADDED,
NODES_ADDED, NODES_REMOVED, EDGES_ADDED, EDGES_REMOVED }
- private CyTableEntry whatChanged;
+ private CyIdentifiable whatChanged;
private List<CyNode> nodeList;
private ChangeType change;
@@ -44,7 +44,7 @@
throw new IllegalArgumentException("the
\"whatChanged\" parameter must be a list of nodes for NODES_ADDED or
NODES_REMOVED!");
} else if ((whatChanged instanceof CyEdge) ||
(whatChanged instanceof CyNode)) {
- this.whatChanged = (CyTableEntry) whatChanged;
+ this.whatChanged = (CyIdentifiable) whatChanged;
} else {
throw new IllegalArgumentException("the \"whatChanged\"
parameter must be a node or an edge!");
}
@@ -56,7 +56,7 @@
*
* @return the CyTableEntry (CyNode or CyEdge) that was added or
removed.
*/
- public CyTableEntry getChangedObject() {
+ public CyIdentifiable getChangedObject() {
return whatChanged;
}
Modified:
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyEdge.java
===================================================================
--- core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyEdge.java
2012-03-26 19:19:14 UTC (rev 28649)
+++ core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyEdge.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -41,7 +41,7 @@
* and edges.
* @CyAPI.Api.Interface
*/
-public interface CyEdge extends CyTableEntry {
+public interface CyEdge extends CyIdentifiable {
/**
* A String column created by default for every CyEdge that
Copied:
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyIdentifiable.java
(from rev 28646,
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTableEntry.java)
===================================================================
---
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyIdentifiable.java
(rev 0)
+++
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyIdentifiable.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -0,0 +1,49 @@
+/*
+ Copyright (c) 2008, 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ 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;
+
+
+/**
+ * CyTableEntry is an interface that indicates that the implementing
+ * object can be considered a key into a table. In general, table
+ * entries will be things like nodes, edges, and networks..
+ * @CyAPI.Api.Interface
+ */
+public interface CyIdentifiable {
+
+ /**
+ * This will be used as column name of SUID.
+ */
+ String SUID = "SUID";
+
+ /**
+ * Returns the SUID of the implementing object.
+ * @return the SUID of the implementing object.
+ */
+ Long getSUID();
+}
Modified:
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetwork.java
===================================================================
--- core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetwork.java
2012-03-26 19:19:14 UTC (rev 28649)
+++ core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetwork.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -39,7 +39,7 @@
* be directed, undirected, or both.
* @CyAPI.Api.Interface
*/
-public interface CyNetwork extends CyTableEntry {
+public interface CyNetwork extends CyIdentifiable {
/**
* A boolean column created by default for every CyNode or CyEdge that
* holds the selection state of the entry.
@@ -63,7 +63,14 @@
* see {@link CyTableManager} for more information.
*/
String HIDDEN_ATTRS = "HIDDEN";
+
+ /**
+ * A String column created by default for every CyNetwork that
+ * holds the name of the entry.
+ */
+ String NAME = "name";
+
/**
* This method is used to create and add a node to this network.
*
@@ -299,7 +306,7 @@
* @param tableName the name of the table from which to extract the
row..
* @return the row in the table of the specified name for this object.
*/
- CyRow getRow(CyTableEntry entry, String tableName);
+ CyRow getRow(CyIdentifiable entry, String tableName);
/**
* A convenience method that returns the row in the default table
@@ -310,6 +317,6 @@
* @param entry The entry (node, edge, network) whose row we're looking
for.
* @return the row in the default table for this object.
*/
- CyRow getRow(CyTableEntry entry);
+ CyRow getRow(CyIdentifiable entry);
}
Modified:
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetworkTableManager.java
===================================================================
---
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetworkTableManager.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetworkTableManager.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -11,31 +11,31 @@
/**
* Associates the given table to the network using the specified
namespace and type.
* @param network the {@link CyNetwork} to associate the given table to.
- * @param type Type of {@link CyTableEntry} associated with the table.
+ * @param type Type of {@link CyIdentifiable} associated with the table.
* @param namespace The name of the table relative to the network.
* @param table the table to associate to the network with the
specified namespace and type.
*/
- void setTable(CyNetwork network, Class<? extends CyTableEntry> type,
String namespace, CyTable table);
+ void setTable(CyNetwork network, Class<? extends CyIdentifiable> type,
String namespace, CyTable table);
/**
* Returns the table with the specified namespace and type from the
* network.
* @param network the network to check for the table.
- * @param type Type of {@link CyTableEntry} associated with the table.
+ * @param type Type of {@link CyIdentifiable} associated with the table.
* @param namespace The name of the table relative to the network.
* @return the table with the specified namespace and type from the
* network.
*/
- CyTable getTable(CyNetwork network, Class<? extends CyTableEntry> type,
String namespace);
+ CyTable getTable(CyNetwork network, Class<? extends CyIdentifiable>
type, String namespace);
/**
* Removes the table with the specified namespace and type from
* the network.
* @param network the network to remove the table from.
- * @param type Type of {@link CyTableEntry} associated with the table.
+ * @param type Type of {@link CyIdentifiable} associated with the table.
* @param namespace The name of the table relative to the network.
*/
- void removeTable(CyNetwork network, Class<? extends CyTableEntry> type,
String namespace);
+ void removeTable(CyNetwork network, Class<? extends CyIdentifiable>
type, String namespace);
/**
* Returns a read-only map of all of the tables for the specified type
@@ -45,7 +45,7 @@
* @return a read-only map of all the tables for the specified type
* from the network.
*/
- Map<String, CyTable> getTables(CyNetwork network, Class<? extends
CyTableEntry> type);
+ Map<String, CyTable> getTables(CyNetwork network, Class<? extends
CyIdentifiable> type);
/**
* Clears all the network-table relationships.
Modified:
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNode.java
===================================================================
--- core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNode.java
2012-03-26 19:19:14 UTC (rev 28649)
+++ core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNode.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -37,7 +37,7 @@
* of nodes and edges.
* @CyAPI.Api.Interface
*/
-public interface CyNode extends CyTableEntry {
+public interface CyNode extends CyIdentifiable {
/**
* An index of this node within this network. The index is guaranteed
to
Modified:
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTable.java
===================================================================
--- core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTable.java
2012-03-26 19:19:14 UTC (rev 28649)
+++ core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTable.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -41,7 +41,7 @@
* types.
* @CyAPI.Api.Interface
*/
-public interface CyTable extends CyTableEntry {
+public interface CyTable extends CyIdentifiable {
/**
* Mutability of the table specifies whether or not it is able to be
deleted..
*
Deleted:
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTableEntry.java
===================================================================
---
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTableEntry.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyTableEntry.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -1,54 +0,0 @@
-/*
- Copyright (c) 2008, 2010, The Cytoscape Consortium (www.cytoscape.org)
-
- 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;
-
-
-/**
- * CyTableEntry is an interface that indicates that the implementing
- * object can be considered a key into a table. In general, table
- * entries will be things like nodes, edges, and networks..
- * @CyAPI.Api.Interface
- */
-public interface CyTableEntry {
- /**
- * A String column created by default for every CyTableEntry that
- * holds the name of the entry.
- */
- String NAME = "name";
-
- /**
- * This will be used as column name of SUID.
- */
- String SUID = "SUID";
-
- /**
- * Returns the SUID of the implementing object.
- * @return the SUID of the implementing object.
- */
- Long getSUID();
-}
Modified:
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyEdgeTest.java
===================================================================
---
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyEdgeTest.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyEdgeTest.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -110,7 +110,7 @@
CyNode n2 = net.addNode();
CyEdge e1 = net.addEdge(n1,n2,true);
- assertEquals(String.class,
net.getRow(e1).getTable().getColumn(CyTableEntry.NAME).getType());
+ assertEquals(String.class,
net.getRow(e1).getTable().getColumn(CyNetwork.NAME).getType());
assertEquals(Boolean.class,
net.getRow(e1).getTable().getColumn(CyNetwork.SELECTED).getType());
assertEquals(String.class,
Modified:
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyNetworkTableManagerTest.java
===================================================================
---
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyNetworkTableManagerTest.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyNetworkTableManagerTest.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -117,7 +117,7 @@
@Test
public void testRemoveDefaultTables() throws Exception {
- for (Class<? extends CyTableEntry> type : new Class[] {
CyNetwork.class, CyNode.class, CyEdge.class }) {
+ for (Class<? extends CyIdentifiable> type : new Class[] {
CyNetwork.class, CyNode.class, CyEdge.class }) {
try {
mgr.removeTable(goodNetwork, type,
CyNetwork.DEFAULT_ATTRS);
fail();
@@ -128,7 +128,7 @@
@Test
public void testSetDefaultTables() throws Exception {
- for (Class<? extends CyTableEntry> type : new Class[] {
CyNetwork.class, CyNode.class, CyEdge.class }) {
+ for (Class<? extends CyIdentifiable> type : new Class[] {
CyNetwork.class, CyNode.class, CyEdge.class }) {
try {
mgr.setTable(goodNetwork, type,
CyNetwork.DEFAULT_ATTRS, table1);
fail();
Modified:
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyNetworkTest.java
===================================================================
---
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyNetworkTest.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/AbstractCyNetworkTest.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -865,24 +865,24 @@
@Test
public void testDefaultAttributes() {
- assertEquals(String.class,
net.getRow(net).getTable().getColumn(CyTableEntry.NAME).getType());
+ assertEquals(String.class,
net.getRow(net).getTable().getColumn(CyNetwork.NAME).getType());
}
@Test
public void testGetDefaultNetworkTable() {
assertNotNull(net.getDefaultNetworkTable());
- assertEquals(String.class,
net.getDefaultNetworkTable().getColumn(CyTableEntry.NAME).getType());
+ assertEquals(String.class,
net.getDefaultNetworkTable().getColumn(CyNetwork.NAME).getType());
}
@Test
public void testGetDefaultNodeTable() {
assertNotNull(net.getDefaultNodeTable());
- assertEquals(String.class,
net.getDefaultNodeTable().getColumn(CyTableEntry.NAME).getType());
+ assertEquals(String.class,
net.getDefaultNodeTable().getColumn(CyNetwork.NAME).getType());
}
@Test
public void testGetDefaultEdgeTable() {
assertNotNull(net.getDefaultEdgeTable());
- assertEquals(String.class,
net.getDefaultEdgeTable().getColumn(CyTableEntry.NAME).getType());
+ assertEquals(String.class,
net.getDefaultEdgeTable().getColumn(CyNetwork.NAME).getType());
}
}
Modified:
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/DummyGraphObject.java
===================================================================
---
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/DummyGraphObject.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/DummyGraphObject.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -36,7 +36,7 @@
package org.cytoscape.model;
-public class DummyGraphObject implements CyTableEntry {
+public class DummyGraphObject implements CyIdentifiable {
private static long suidBase = 0;
Modified:
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/subnetwork/AbstractCySubNetworkTest.java
===================================================================
---
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/subnetwork/AbstractCySubNetworkTest.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/model-api/src/test/java/org/cytoscape/model/subnetwork/AbstractCySubNetworkTest.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -37,7 +37,7 @@
import org.cytoscape.event.CyListener;
import org.cytoscape.model.CyTable;
-import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.model.CyIdentifiable;
import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
@@ -366,13 +366,13 @@
@Test
public void testNodeAddedInSubnetworkHasNameAttr() {
n1 = root.addNode();
- root.getRow(n1).set(CyTableEntry.NAME,"homer");
+ root.getRow(n1).set(CyNetwork.NAME,"homer");
sub = root.addSubNetwork();
sub.addNode(n1);
List<CyNode> subNodes = sub.getNodeList();
- assertEquals( "homer",
sub.getRow(subNodes.get(0)).get(CyTableEntry.NAME,String.class) );
+ assertEquals( "homer",
sub.getRow(subNodes.get(0)).get(CyNetwork.NAME,String.class) );
}
@Test
@@ -392,7 +392,7 @@
n1 = root.addNode();
n2 = root.addNode();
e1 = root.addEdge(n1,n2,true);
- root.getRow(e1).set(CyTableEntry.NAME,"homer");
+ root.getRow(e1).set(CyNetwork.NAME,"homer");
sub = root.addSubNetwork();
sub.addNode(n1);
@@ -400,7 +400,7 @@
sub.addEdge(e1);
List<CyEdge> subEdges = sub.getEdgeList();
- assertEquals( "homer",
sub.getRow(subEdges.get(0)).get(CyTableEntry.NAME,String.class) );
+ assertEquals( "homer",
sub.getRow(subEdges.get(0)).get(CyNetwork.NAME,String.class) );
}
@Test
Modified:
core3/api/trunk/session-api/src/main/java/org/cytoscape/session/CySession.java
===================================================================
---
core3/api/trunk/session-api/src/main/java/org/cytoscape/session/CySession.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/session-api/src/main/java/org/cytoscape/session/CySession.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -37,7 +37,7 @@
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
-import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.model.CyIdentifiable;
import org.cytoscape.model.CyTableMetadata;
import org.cytoscape.property.CyProperty;
import org.cytoscape.view.model.CyNetworkView;
@@ -74,7 +74,7 @@
private final Set<CyProperty<?>> properties;
private final Set<VisualStyle> visualStyles;
private final Map<String, List<File>> appFiles;
- private final Map<Class<? extends CyTableEntry>, Map<Object, ? extends
CyTableEntry>> objectMap;
+ private final Map<Class<? extends CyIdentifiable>, Map<Object, ?
extends CyIdentifiable>> objectMap;
private static final Logger logger =
LoggerFactory.getLogger(CySession.class);
@@ -89,7 +89,7 @@
appFiles = Collections.unmodifiableMap( b.appFiles == null ?
new HashMap<String, List<File>>() : b.appFiles );
if (b.objectMap == null)
- objectMap = Collections.unmodifiableMap(new
HashMap<Class<? extends CyTableEntry>, Map<Object, ? extends CyTableEntry>>());
+ objectMap = Collections.unmodifiableMap(new
HashMap<Class<? extends CyIdentifiable>, Map<Object, ? extends
CyIdentifiable>>());
else
objectMap = Collections.unmodifiableMap(b.objectMap);
}
@@ -107,7 +107,7 @@
private Set<CyProperty<?>> properties;
private Set<VisualStyle> visualStyles;
private Map<String, List<File>> appFiles;
- private Map<Class<? extends CyTableEntry>, Map<Object, ?
extends CyTableEntry>> objectMap;
+ private Map<Class<? extends CyIdentifiable>, Map<Object, ?
extends CyIdentifiable>> objectMap;
/**
* Returns a complete instance of CySession based upon the
methods called on this instance of Builder.
@@ -194,11 +194,11 @@
/**
* Returns an instance of Builder that has at least been
configured with the specified old ID maps.
- * @param map A map of {@link CyTableEntry} types to maps that
have former identifiers as keys and {@link CyNode}s,
+ * @param map A map of {@link CyIdentifiable} types to maps
that have former identifiers as keys and {@link CyNode}s,
* {@link CyEdge}s, {@link CyNetwork}s or {@link
CyNetworkView}s as values.
* @return An instance of Builder that has at least been
configured with the specified map.
*/
- public Builder objectMap(final Map<Class<? extends
CyTableEntry>, Map<Object, ? extends CyTableEntry>> map) {
+ public Builder objectMap(final Map<Class<? extends
CyIdentifiable>, Map<Object, ? extends CyIdentifiable>> map) {
this.objectMap = map;
return this;
}
@@ -256,7 +256,7 @@
* @return An object ({@link CyNode}, {@link CyEdge}, {@link CyNetwork}
or {@link CyNetworkView}) given its former
* SUID.
*/
- public <T extends CyTableEntry> T getObject(Long oldSUID, Class<T>
type) {
+ public <T extends CyIdentifiable> T getObject(Long oldSUID, Class<T>
type) {
return getObjectInternal(oldSUID, type);
}
@@ -271,14 +271,14 @@
* @return An object ({@link CyNode}, {@link CyEdge}, {@link CyNetwork}
or {@link CyNetworkView}) given its former
* identifier.
*/
- public <T extends CyTableEntry> T getObject(String oldId, Class<T>
type) {
+ public <T extends CyIdentifiable> T getObject(String oldId, Class<T>
type) {
return getObjectInternal(oldId, type);
}
@SuppressWarnings("unchecked")
- private <T extends CyTableEntry> T getObjectInternal(Object oldId,
Class<T> type) {
+ private <T extends CyIdentifiable> T getObjectInternal(Object oldId,
Class<T> type) {
T tableEntry = null;
- Map<Object, ? extends CyTableEntry> objByIdMap =
objectMap.get(type);
+ Map<Object, ? extends CyIdentifiable> objByIdMap =
objectMap.get(type);
if (objByIdMap != null) {
Object obj = objByIdMap.get(oldId);
Modified:
core3/api/trunk/session-api/src/test/java/org/cytoscape/session/CySessionTest.java
===================================================================
---
core3/api/trunk/session-api/src/test/java/org/cytoscape/session/CySessionTest.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/session-api/src/test/java/org/cytoscape/session/CySessionTest.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -20,7 +20,7 @@
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
import org.cytoscape.model.CyTable;
-import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.model.CyIdentifiable;
import org.cytoscape.model.CyTableMetadata;
import org.cytoscape.property.CyProperty;
import org.cytoscape.property.SimpleCyProperty;
@@ -265,7 +265,7 @@
CyEdge e1 = mock(CyEdge.class);
edgeMap.put(new Long(3), e1);
- Map<Class<? extends CyTableEntry>, Map<Object, ? extends
CyTableEntry>> objMap = new HashMap<Class<? extends CyTableEntry>, Map<Object,
? extends CyTableEntry>>();
+ Map<Class<? extends CyIdentifiable>, Map<Object, ? extends
CyIdentifiable>> objMap = new HashMap<Class<? extends CyIdentifiable>,
Map<Object, ? extends CyIdentifiable>>();
objMap.put(CyNetwork.class, netMap);
objMap.put(CyNetworkView.class, viewMap);
objMap.put(CyNode.class, nodeMap);
Modified:
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/CyNetworkView.java
===================================================================
---
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/CyNetworkView.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/CyNetworkView.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -39,7 +39,7 @@
import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
-import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.model.CyIdentifiable;
/**
*
@@ -87,7 +87,7 @@
*
* @return All view objects in this network including network view
itself.
*/
- Collection<View<? extends CyTableEntry>> getAllViews();
+ Collection<View<? extends CyIdentifiable>> getAllViews();
/**
Modified:
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/View.java
===================================================================
---
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/View.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/View.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -34,7 +34,7 @@
*/
package org.cytoscape.view.model;
-import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.model.CyIdentifiable;
/**
@@ -47,7 +47,7 @@
* In the future versions, Attributes can be this parameter.
* @CyAPI.Api.Interface
*/
-public interface View<S> extends CyTableEntry {
+public interface View<S> extends CyIdentifiable {
/**
* Assign a value to the given Visual Property of this view.
Modified:
core3/api/trunk/vizmap-api/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java
===================================================================
---
core3/api/trunk/vizmap-api/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/vizmap-api/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -35,7 +35,7 @@
package org.cytoscape.view.vizmap;
import org.cytoscape.model.CyTable;
-import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.model.CyIdentifiable;
import org.cytoscape.model.CyRow;
import org.cytoscape.view.model.View;
import org.cytoscape.view.model.VisualProperty;
@@ -111,5 +111,5 @@
* @param view target View model to be updated. View should be one of
the
* following: Node, Edge, or Network.
*/
- void apply(final CyRow row, final View<? extends CyTableEntry> view);
+ void apply(final CyRow row, final View<? extends CyIdentifiable> view);
}
Modified:
core3/api/trunk/vizmap-api/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java
===================================================================
---
core3/api/trunk/vizmap-api/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/vizmap-api/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -36,7 +36,7 @@
import java.util.Collection;
-import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.model.CyIdentifiable;
import org.cytoscape.view.model.CyNetworkView;
import org.cytoscape.view.model.View;
import org.cytoscape.view.model.VisualProperty;
@@ -150,6 +150,6 @@
*
* @param viewObject
*/
- void apply(final View<? extends CyTableEntry> view);
+ void apply(final View<? extends CyIdentifiable> view);
}
Modified:
core3/api/trunk/vizmap-gui-api/src/main/java/org/cytoscape/view/vizmap/gui/editor/EditorManager.java
===================================================================
---
core3/api/trunk/vizmap-gui-api/src/main/java/org/cytoscape/view/vizmap/gui/editor/EditorManager.java
2012-03-26 19:19:14 UTC (rev 28649)
+++
core3/api/trunk/vizmap-gui-api/src/main/java/org/cytoscape/view/vizmap/gui/editor/EditorManager.java
2012-03-26 21:26:04 UTC (rev 28650)
@@ -43,7 +43,7 @@
import java.util.Map;
import org.cytoscape.model.CyTable;
-import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.model.CyIdentifiable;
import org.cytoscape.view.model.VisualProperty;
import org.cytoscape.view.vizmap.VisualStyle;
import org.cytoscape.view.vizmap.mappings.ContinuousMapping;
@@ -155,7 +155,7 @@
*
* @return selector
*/
- public PropertyEditor getDataTableComboBoxEditor(final Class<? extends
CyTableEntry> targetObjectType);
+ public PropertyEditor getDataTableComboBoxEditor(final Class<? extends
CyIdentifiable> targetObjectType);
/**
--
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.