Author: kono
Date: 2012-12-18 10:55:10 -0800 (Tue, 18 Dec 2012)
New Revision: 31016

Modified:
   
core3/impl/branches/3.0.0-release/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyTableImpl.java
   
core3/impl/branches/3.0.0-release/network-merge-impl/src/main/java/org/cytoscape/network/merge/internal/util/DefaultAttributeMerger.java
   
core3/impl/branches/3.0.0-release/swing-application-impl/src/main/java/org/cytoscape/internal/view/NetworkViewManager.java
Log:
fixes #1655 String table column will be copied to new merged table.

Modified: 
core3/impl/branches/3.0.0-release/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyTableImpl.java
===================================================================
--- 
core3/impl/branches/3.0.0-release/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyTableImpl.java
       2012-12-18 01:03:01 UTC (rev 31015)
+++ 
core3/impl/branches/3.0.0-release/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyTableImpl.java
       2012-12-18 18:55:10 UTC (rev 31016)
@@ -894,9 +894,9 @@
        private final <T> T getDefaultValue(final String columnName, final T 
defaultValue) {
                if ( defaultValue == null ) {
                        final CyColumn column = this.getColumn(columnName);
-                       if ( column == null )
+                       if ( column == null ) {
                                return null;
-                       else
+                       } else
                                return (T)(column.getDefaultValue());
                } else {
                        return defaultValue;

Modified: 
core3/impl/branches/3.0.0-release/network-merge-impl/src/main/java/org/cytoscape/network/merge/internal/util/DefaultAttributeMerger.java
===================================================================
--- 
core3/impl/branches/3.0.0-release/network-merge-impl/src/main/java/org/cytoscape/network/merge/internal/util/DefaultAttributeMerger.java
    2012-12-18 01:03:01 UTC (rev 31015)
+++ 
core3/impl/branches/3.0.0-release/network-merge-impl/src/main/java/org/cytoscape/network/merge/internal/util/DefaultAttributeMerger.java
    2012-12-18 18:55:10 UTC (rev 31016)
@@ -78,10 +78,10 @@
                        if (colType == ColumnType.STRING) {
                                final String fromValue = 
fromCyRow.get(fromColumn.getName(), String.class);
                                final String o2 = cyRow.get(column.getName(), 
String.class);
+                               
                                if (o2 == null || o2.length() == 0) { // null 
or empty attribute
-                                       
if(!column.getVirtualColumnInfo().isVirtual())
-                                               cyRow.set(column.getName(), 
fromValue);
-                               } else if (fromValue.equals(o2)) { // TODO: 
neccessary?
+                                       cyRow.set(column.getName(), fromValue);
+                               } else if (fromValue.equals(o2)) { // TODO: 
necessary?
                                        // the same, do nothing
                                } else { // attribute conflict
                                        // add to conflict collector
@@ -129,7 +129,9 @@
                                } else { // from list
                                        final ColumnType fromPlain = 
fromColType.toPlain();
                                        final List<?> list = 
fromCyRow.getList(fromColumn.getName(), fromPlain.getType());
-
+                                       if(list == null)
+                                               continue;
+                                       
                                        for (final Object listValue:list) {
                                                if(listValue == null)
                                                        continue;

Modified: 
core3/impl/branches/3.0.0-release/swing-application-impl/src/main/java/org/cytoscape/internal/view/NetworkViewManager.java
===================================================================
--- 
core3/impl/branches/3.0.0-release/swing-application-impl/src/main/java/org/cytoscape/internal/view/NetworkViewManager.java
  2012-12-18 01:03:01 UTC (rev 31015)
+++ 
core3/impl/branches/3.0.0-release/swing-application-impl/src/main/java/org/cytoscape/internal/view/NetworkViewManager.java
  2012-12-18 18:55:10 UTC (rev 31016)
@@ -563,20 +563,23 @@
                for (final RowSetRecord record : records) {
                        if (CyNetwork.NAME.equals(record.getColumn())) {
                                // assume payload collection is for same column
-                               for (final JInternalFrame targetIF : 
iFrameMap.keySet()) {
-                                       final CyNetworkView view = 
iFrameMap.get(targetIF);
-                                       final CyNetwork net = view.getModel();
-                                       
-                                       if (net.getDefaultNetworkTable() == 
source) {
-                                               final String title = 
record.getRow().get(CyNetwork.NAME, String.class);
-                                               // We should guarantee this 
visual property is up to date
-                                               
view.setVisualProperty(BasicVisualLexicon.NETWORK_TITLE, title);
-                                               
-                                               // Do not update the title with 
the new network name if this visual property is locked
-                                               if 
(!view.isValueLocked(BasicVisualLexicon.NETWORK_TITLE))
-                                                       
targetIF.setTitle(title);
-                                               
-                                               return; // assuming just one 
row is set.
+                               synchronized (iFrameMap) {
+                                       for (final JInternalFrame targetIF : 
iFrameMap.keySet()) {
+                                               final CyNetworkView view = 
iFrameMap.get(targetIF);
+                                               final CyNetwork net = 
view.getModel();
+
+                                               if 
(net.getDefaultNetworkTable() == source) {
+                                                       final String title = 
record.getRow().get(CyNetwork.NAME, String.class);
+                                                       // We should guarantee 
this visual property is up to date
+                                                       
view.setVisualProperty(BasicVisualLexicon.NETWORK_TITLE, title);
+
+                                                       // Do not update the 
title with the new network name
+                                                       // if this visual 
property is locked
+                                                       if 
(!view.isValueLocked(BasicVisualLexicon.NETWORK_TITLE))
+                                                               
targetIF.setTitle(title);
+
+                                                       return; // assuming 
just one row is set.
+                                               }
                                        }
                                }
                        }

-- 
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.

Reply via email to