Author: rozagh
Date: 2012-07-26 14:10:28 -0700 (Thu, 26 Jul 2012)
New Revision: 30004

Modified:
   
core3/impl/trunk/table-browser-impl/src/main/java/org/cytoscape/browser/internal/BrowserTable.java
   
core3/impl/trunk/table-browser-impl/src/main/java/org/cytoscape/browser/internal/BrowserTableModel.java
Log:
Fixes for getting the row value correctly when clickingby converting the row 
index in view to row index in model.

Modified: 
core3/impl/trunk/table-browser-impl/src/main/java/org/cytoscape/browser/internal/BrowserTable.java
===================================================================
--- 
core3/impl/trunk/table-browser-impl/src/main/java/org/cytoscape/browser/internal/BrowserTable.java
  2012-07-26 21:07:36 UTC (rev 30003)
+++ 
core3/impl/trunk/table-browser-impl/src/main/java/org/cytoscape/browser/internal/BrowserTable.java
  2012-07-26 21:10:28 UTC (rev 30004)
@@ -239,7 +239,7 @@
                final Set<CyRow> targetRows = new HashSet<CyRow>();
                for(int i=0; i<selectedRowCount; i++) {
                        //getting the row from data table solves the problem 
with hidden or moved SUID column. However, since the rows might be sorted we 
need to convert the index to model
-                       final ValidatedObjectAndEditString selected = 
(ValidatedObjectAndEditString) btModel.getValueAt(this.convertRowIndexToModel( 
rowsSelected[i]), pKeyName);
+                       final ValidatedObjectAndEditString selected = 
(ValidatedObjectAndEditString) btModel.getValueAt(rowsSelected[i], pKeyName);
                        
targetRows.add(btModel.getRow(selected.getValidatedObject()));
                }
                

Modified: 
core3/impl/trunk/table-browser-impl/src/main/java/org/cytoscape/browser/internal/BrowserTableModel.java
===================================================================
--- 
core3/impl/trunk/table-browser-impl/src/main/java/org/cytoscape/browser/internal/BrowserTableModel.java
     2012-07-26 21:07:36 UTC (rev 30003)
+++ 
core3/impl/trunk/table-browser-impl/src/main/java/org/cytoscape/browser/internal/BrowserTableModel.java
     2012-07-26 21:10:28 UTC (rev 30004)
@@ -152,7 +152,7 @@
 
        
        public Object getValueAt(final int rowIndex, final String columnName) {
-               final CyRow row = mapRowIndexToRow(rowIndex);
+               final CyRow row = 
mapRowIndexToRow(table.convertRowIndexToModel(rowIndex));
                return getValidatedObjectAndEditString(row, columnName);
        }
 
@@ -373,7 +373,7 @@
                final int rowCount = table.getRowCount();
                for(int i=0; i<rowCount; i++) {
                        //getting the row from data table solves the problem 
with hidden or moved SUID column. However, since the rows might be sorted we 
need to convert the index to model
-                       final ValidatedObjectAndEditString tableKey = 
(ValidatedObjectAndEditString)  
btmodel.getValueAt(table.convertRowIndexToModel( i), pKeyName );
+                       final ValidatedObjectAndEditString tableKey = 
(ValidatedObjectAndEditString)  btmodel.getValueAt(i, pKeyName );
                        Long pk = null;
                        try{
                                // TODO: Temp fix: is it a requirement that all 
CyTables have a Long SUID column as PK?

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