Author: kono
Date: 2011-08-16 15:15:03 -0700 (Tue, 16 Aug 2011)
New Revision: 26579
Removed:
core3/impl/trunk/core-task-impl/networkTest
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
core3/impl/trunk/io-impl/src/main/java/org/cytoscape/io/internal/util/UnrecognizedVisualPropertyManager.java
core3/impl/trunk/io-impl/src/test/java/org/cytoscape/io/internal/read/datatable/CSVCyReaderTest.java
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArrayGraph.java
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/CyTableManagerTest.java
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/CyTableTest.java
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/TableTestSupportTest.java
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapPropertyBuilder.java
Log:
fixes #346 Hard-coded SUID strings are replaced by Identifiable.SUID.
Deleted: core3/impl/trunk/core-task-impl/networkTest
===================================================================
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
===================================================================
---
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
2011-08-16 21:30:25 UTC (rev 26578)
+++
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
2011-08-16 22:15:03 UTC (rev 26579)
@@ -89,6 +89,7 @@
import org.cytoscape.model.CyTable;
import org.cytoscape.model.CyTableFactory;
import org.cytoscape.model.CyTableManager;
+import org.cytoscape.model.Identifiable;
import org.cytoscape.model.subnetwork.CyRootNetworkFactory;
import org.cytoscape.model.subnetwork.CySubNetwork;
import org.cytoscape.spacial.SpacialEntry2DEnumerator;
@@ -430,11 +431,11 @@
this.dropEmptySpaceTFs = dropEmptySpaceTFs;
this.manager = manager;
- final CyTable nodeCAM = dataFactory.createTable("node view",
"SUID", Long.class, false, false);
+ final CyTable nodeCAM = dataFactory.createTable("node view",
Identifiable.SUID, Long.class, false, false);
nodeCAM.createColumn("hidden", Boolean.class, false);
tableMgr.getTableMap(CyNode.class, networkModel).put("VIEW",
nodeCAM);
- final CyTable edgeCAM = dataFactory.createTable("edge view",
"SUID", Long.class, false, false);
+ final CyTable edgeCAM = dataFactory.createTable("edge view",
Identifiable.SUID, Long.class, false, false);
edgeCAM.createColumn("hidden", Boolean.class, false);
tableMgr.getTableMap(CyEdge.class, networkModel).put("VIEW",
edgeCAM);
Modified:
core3/impl/trunk/io-impl/src/main/java/org/cytoscape/io/internal/util/UnrecognizedVisualPropertyManager.java
===================================================================
---
core3/impl/trunk/io-impl/src/main/java/org/cytoscape/io/internal/util/UnrecognizedVisualPropertyManager.java
2011-08-16 21:30:25 UTC (rev 26578)
+++
core3/impl/trunk/io-impl/src/main/java/org/cytoscape/io/internal/util/UnrecognizedVisualPropertyManager.java
2011-08-16 22:15:03 UTC (rev 26579)
@@ -11,6 +11,7 @@
import org.cytoscape.model.CyTableEntry;
import org.cytoscape.model.CyTableFactory;
import org.cytoscape.model.CyTableManager;
+import org.cytoscape.model.Identifiable;
import org.cytoscape.model.SUIDFactory;
import org.cytoscape.model.CyTable.SavePolicy;
import org.cytoscape.view.model.CyNetworkView;
@@ -23,8 +24,8 @@
public static final String RENDERER_TABLE_TITLE =
"UnrecognizedRenderer";
public static final String VISUAL_PROPERTY_TABLE_TITLE =
"UnrecognizedVisualProperties";
- private static final String RENDERER_TABLE_PK = "SUID";
- private static final String VISUAL_PROPERTY_TABLE_PK = "SUID";
+ private static final String RENDERER_TABLE_PK = Identifiable.SUID;
+ private static final String VISUAL_PROPERTY_TABLE_PK =
Identifiable.SUID;
private final CyTableFactory tableFactory;
private final CyTableManager tableMgr;
Modified:
core3/impl/trunk/io-impl/src/test/java/org/cytoscape/io/internal/read/datatable/CSVCyReaderTest.java
===================================================================
---
core3/impl/trunk/io-impl/src/test/java/org/cytoscape/io/internal/read/datatable/CSVCyReaderTest.java
2011-08-16 21:30:25 UTC (rev 26578)
+++
core3/impl/trunk/io-impl/src/test/java/org/cytoscape/io/internal/read/datatable/CSVCyReaderTest.java
2011-08-16 22:15:03 UTC (rev 26579)
@@ -12,6 +12,7 @@
import org.cytoscape.model.CyRow;
import org.cytoscape.model.CyTable;
+import org.cytoscape.model.Identifiable;
import org.cytoscape.model.CyTable.Mutability;
import org.cytoscape.model.CyTableFactory;
import org.cytoscape.model.TableTestSupport;
@@ -53,7 +54,7 @@
assertEquals(2, table.getRowCount());
CyRow row = table.getRow(5L);
assertNotNull(row);
- Long value = row.get("SUID", Long.class);
+ Long value = row.get(Identifiable.SUID, Long.class);
assertEquals((Long) 5L, value);
assertTrue(table.isPublic());
assertEquals(Mutability.MUTABLE, table.getMutability());
Modified:
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArrayGraph.java
===================================================================
---
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArrayGraph.java
2011-08-16 21:30:25 UTC (rev 26578)
+++
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArrayGraph.java
2011-08-16 22:15:03 UTC (rev 26579)
@@ -44,6 +44,7 @@
import org.cytoscape.model.CyTable;
import org.cytoscape.model.CyTableEntry;
import org.cytoscape.model.CyTableFactory;
+import org.cytoscape.model.Identifiable;
import org.cytoscape.model.SUIDFactory;
import org.cytoscape.model.subnetwork.CyRootNetwork;
import org.cytoscape.model.subnetwork.CySubNetwork;
@@ -106,10 +107,10 @@
netAttrMgr = new HashMap<String, CyTable>();
netAttrMgr.put(CyNetwork.DEFAULT_ATTRS,
- tableFactory.createTable(suid + " network",
"SUID", Long.class,
+ tableFactory.createTable(suid + " network",
Identifiable.SUID, Long.class,
publicTables, false));
netAttrMgr.put(CyNetwork.HIDDEN_ATTRS,
- tableFactory.createTable(suid + " network",
"SUID", Long.class, false,
+ tableFactory.createTable(suid + " network",
Identifiable.SUID, Long.class, false,
false));
netAttrMgr.get(CyNetwork.DEFAULT_ATTRS).createColumn(CyTableEntry.NAME,
String.class,
@@ -119,10 +120,10 @@
nodeAttrMgr = new HashMap<String, CyTable>();
nodeAttrMgr.put(CyNetwork.DEFAULT_ATTRS,
- tableFactory.createTable(suid + " node",
"SUID", Long.class,
+ tableFactory.createTable(suid + " node",
Identifiable.SUID, Long.class,
publicTables, false));
nodeAttrMgr.put(CyNetwork.HIDDEN_ATTRS,
- tableFactory.createTable(suid + " node",
"SUID", Long.class,
+ tableFactory.createTable(suid + " node",
Identifiable.SUID, Long.class,
false, false));
nodeAttrMgr.get(CyNetwork.DEFAULT_ATTRS).createColumn(CyTableEntry.NAME,
@@ -132,10 +133,10 @@
edgeAttrMgr = new HashMap<String, CyTable>();
edgeAttrMgr.put(CyNetwork.DEFAULT_ATTRS,
- tableFactory.createTable(suid + " edge",
"SUID", Long.class,
+ tableFactory.createTable(suid + " edge",
Identifiable.SUID, Long.class,
publicTables, false));
edgeAttrMgr.put(CyNetwork.HIDDEN_ATTRS,
- tableFactory.createTable(suid + " edge",
"SUID", Long.class,
+ tableFactory.createTable(suid + " edge",
Identifiable.SUID, Long.class,
false, false));
edgeAttrMgr.get(CyNetwork.DEFAULT_ATTRS).createColumn(CyTableEntry.NAME,
Modified:
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/CyTableManagerTest.java
===================================================================
---
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/CyTableManagerTest.java
2011-08-16 21:30:25 UTC (rev 26578)
+++
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/CyTableManagerTest.java
2011-08-16 22:15:03 UTC (rev 26579)
@@ -37,6 +37,7 @@
import org.cytoscape.equations.internal.interpreter.InterpreterImpl;
import org.cytoscape.event.CyEventHelper;
import org.cytoscape.event.DummyCyEventHelper;
+import org.cytoscape.model.Identifiable;
import org.cytoscape.model.CyTable.SavePolicy;
import org.cytoscape.model.internal.ArrayGraph;
import org.cytoscape.model.internal.CyTableFactoryImpl;
@@ -80,9 +81,9 @@
public void tableWithVirtColumnDeletionTest() {
CyEventHelper eventHelper = new DummyCyEventHelper();
final Interpreter interpreter = new InterpreterImpl();
- CyTable table = new CyTableImpl("homer", "SUID", Long.class,
true, true, SavePolicy.SESSION_FILE,
+ CyTable table = new CyTableImpl("homer", Identifiable.SUID,
Long.class, true, true, SavePolicy.SESSION_FILE,
eventHelper, interpreter);
- CyTable table2 = new CyTableImpl("marge", "SUID", Long.class,
true, true, SavePolicy.SESSION_FILE,
+ CyTable table2 = new CyTableImpl("marge", Identifiable.SUID,
Long.class, true, true, SavePolicy.SESSION_FILE,
eventHelper, interpreter);
table.createColumn("x", Long.class, false);
Modified:
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/CyTableTest.java
===================================================================
---
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/CyTableTest.java
2011-08-16 21:30:25 UTC (rev 26578)
+++
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/CyTableTest.java
2011-08-16 22:15:03 UTC (rev 26579)
@@ -40,6 +40,7 @@
import org.cytoscape.equations.internal.EquationParserImpl;
import org.cytoscape.equations.internal.interpreter.InterpreterImpl;
import org.cytoscape.event.DummyCyEventHelper;
+import org.cytoscape.model.Identifiable;
import org.cytoscape.model.CyTable.SavePolicy;
import org.cytoscape.model.internal.CyTableImpl;
import org.cytoscape.model.events.RowSetRecord;
@@ -57,10 +58,10 @@
public void setUp() {
eventHelper = new DummyCyEventHelper();
final Interpreter interpreter = new InterpreterImpl();
- table = new CyTableImpl("homer", "SUID", Long.class, true,
true, SavePolicy.SESSION_FILE,
+ table = new CyTableImpl("homer", Identifiable.SUID, Long.class,
true, true, SavePolicy.SESSION_FILE,
eventHelper, interpreter);
attrs = table.getRow(1L);
- table2 = new CyTableImpl("marge", "SUID", Long.class, true,
true, SavePolicy.SESSION_FILE,
+ table2 = new CyTableImpl("marge", Identifiable.SUID,
Long.class, true, true, SavePolicy.SESSION_FILE,
eventHelper, interpreter);
}
Modified:
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/TableTestSupportTest.java
===================================================================
---
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/TableTestSupportTest.java
2011-08-16 21:30:25 UTC (rev 26578)
+++
core3/impl/trunk/model-impl/impl/src/test/java/org/cytoscape/model/TableTestSupportTest.java
2011-08-16 22:15:03 UTC (rev 26579)
@@ -1,6 +1,7 @@
package org.cytoscape.model;
+import org.cytoscape.model.Identifiable;
import org.junit.Before;
import org.junit.After;
@@ -25,8 +26,8 @@
@Before
public void setUp() {
eventHelper = support.getDummyCyEventHelper();
- table = factory.createTable(Integer.toString(
rand.nextInt(10000) ), "SUID", Long.class, false, true);
- table2 = factory.createTable(Integer.toString(
rand.nextInt(10000) ), "SUID", Long.class, false, true);
+ table = factory.createTable(Integer.toString(
rand.nextInt(10000) ), Identifiable.SUID, Long.class, false, true);
+ table2 = factory.createTable(Integer.toString(
rand.nextInt(10000) ), Identifiable.SUID, Long.class, false, true);
attrs = table.getRow(1l);
}
Modified:
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapPropertyBuilder.java
===================================================================
---
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapPropertyBuilder.java
2011-08-16 21:30:25 UTC (rev 26578)
+++
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapPropertyBuilder.java
2011-08-16 22:15:03 UTC (rev 26579)
@@ -49,6 +49,7 @@
import org.cytoscape.model.CyTable;
import org.cytoscape.model.CyTableEntry;
import org.cytoscape.model.CyTableManager;
+import org.cytoscape.model.Identifiable;
import org.cytoscape.view.model.VisualProperty;
import org.cytoscape.view.vizmap.VisualMappingFunction;
import org.cytoscape.view.vizmap.VisualMappingFunctionFactory;
@@ -242,7 +243,7 @@
id =
go.getCyRow().get(CyTableEntry.NAME, String.class);
- if (attrName.equals("SUID"))
+ if (attrName.equals(Identifiable.SUID))
value = go.getSUID();
else if
(attrClass.isAssignableFrom(List.class))
value =
go.getCyRow().getList(attrName, column.getListElementType());
--
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.