Author: kono
Date: 2010-07-15 12:38:43 -0700 (Thu, 15 Jul 2010)
New Revision: 20938

Modified:
   
coreplugins/trunk/TableImport/src/edu/ucsd/bioeng/coreplugin/tableImport/ui/AttributePreviewTableCellRenderer.java
   
coreplugins/trunk/TableImport/src/edu/ucsd/bioeng/coreplugin/tableImport/ui/ImportTextTableDialog.java
   
coreplugins/trunk/TableImport/src/edu/ucsd/bioeng/coreplugin/tableImport/ui/PreviewTablePanel.java
Log:
Bug ID 0001867: "Import attribute table match counts not set" was fixed.

Modified: 
coreplugins/trunk/TableImport/src/edu/ucsd/bioeng/coreplugin/tableImport/ui/AttributePreviewTableCellRenderer.java
===================================================================
--- 
coreplugins/trunk/TableImport/src/edu/ucsd/bioeng/coreplugin/tableImport/ui/AttributePreviewTableCellRenderer.java
  2010-07-15 16:53:23 UTC (rev 20937)
+++ 
coreplugins/trunk/TableImport/src/edu/ucsd/bioeng/coreplugin/tableImport/ui/AttributePreviewTableCellRenderer.java
  2010-07-15 19:38:43 UTC (rev 20938)
@@ -83,10 +83,11 @@
  *
  */
 public class AttributePreviewTableCellRenderer extends 
DefaultTableCellRenderer {
-       /**
-        * 
-        */
+       
+       private static final long serialVersionUID = -8441554470062692796L;
+       
        public static final int PARAMETER_NOT_EXIST = -1;
+       
        private final static String DEF_LIST_DELIMITER = PIPE.toString();
        private int keyInFile;
        private List<Integer> aliases;

Modified: 
coreplugins/trunk/TableImport/src/edu/ucsd/bioeng/coreplugin/tableImport/ui/ImportTextTableDialog.java
===================================================================
--- 
coreplugins/trunk/TableImport/src/edu/ucsd/bioeng/coreplugin/tableImport/ui/ImportTextTableDialog.java
      2010-07-15 16:53:23 UTC (rev 20937)
+++ 
coreplugins/trunk/TableImport/src/edu/ucsd/bioeng/coreplugin/tableImport/ui/ImportTextTableDialog.java
      2010-07-15 19:38:43 UTC (rev 20938)
@@ -2733,7 +2733,7 @@
                        rightMessage = "File Size Unknown (Remote Data Source)";
                }
 
-               setStatusBar("Key Matched: "
+               setStatusBar("Key-Value Matched: "
                             + 
previewPanel.checkKeyMatch(primaryKeyComboBox.getSelectedIndex()),
                             centerMessage, rightMessage);
        }

Modified: 
coreplugins/trunk/TableImport/src/edu/ucsd/bioeng/coreplugin/tableImport/ui/PreviewTablePanel.java
===================================================================
--- 
coreplugins/trunk/TableImport/src/edu/ucsd/bioeng/coreplugin/tableImport/ui/PreviewTablePanel.java
  2010-07-15 16:53:23 UTC (rev 20937)
+++ 
coreplugins/trunk/TableImport/src/edu/ucsd/bioeng/coreplugin/tableImport/ui/PreviewTablePanel.java
  2010-07-15 19:38:43 UTC (rev 20938)
@@ -79,6 +79,7 @@
 import javax.swing.JTabbedPane;
 import javax.swing.JTable;
 import javax.swing.ListCellRenderer;
+import javax.swing.ListModel;
 import javax.swing.SwingConstants;
 import javax.swing.SwingUtilities;
 import javax.swing.border.Border;
@@ -150,11 +151,11 @@
         * GUI Components
         */
        private JLabel legendLabel;
-       private javax.swing.JLabel aliasLabel;
-       private javax.swing.JLabel primaryKeyLabel;
+       private JLabel aliasLabel;
+       private JLabel primaryKeyLabel;
        private JLabel ontologyTermLabel;
        private JLabel taxonomyLabel;
-       private javax.swing.JLabel instructionLabel;
+       private JLabel instructionLabel;
        private JLabel rightArrowLabel;
        private JLabel fileTypeLabel;
        private JScrollPane previewScrollPane;
@@ -740,7 +741,6 @@
                        logger.debug("Sheet name = " + wb.getSheetName(0) + ", 
ROW = "
                                        + sheet.rowIterator().hasNext());
 
-                       logger.debug("TS = " + sheet.toString());
                        newModel = parseExcel(sourceURL, size, curRenderer, 
sheet,
                                        startLine);
 
@@ -1119,13 +1119,15 @@
         * @param targetColumn
         * @return
         */
-       public int checkKeyMatch(int targetColumn) {
-               final List fileKeyList = Arrays
-                               .asList(((DefaultListModel) 
keyPreviewList.getModel())
-                                               .toArray());
+       public int checkKeyMatch(final int targetColumn) {
+               final DefaultListModel listModel = (DefaultListModel) 
keyPreviewList.getModel();
+               final Object[] data = listModel.toArray();
+               
+               final List<Object> fileKeyList = Arrays.asList(data);
+               
                int matched = 0;
 
-               TableModel curModel = getPreviewTable().getModel();
+               final TableModel curModel = getPreviewTable().getModel();
 
                try {
                        curModel.getValueAt(0, targetColumn);
@@ -1133,12 +1135,12 @@
                        return 0;
                }
 
-               for (int i = 0; i < curModel.getRowCount(); i++) {
-                       if (fileKeyList.contains(curModel.getValueAt(i, 
targetColumn))) {
+               final int rowCount = curModel.getRowCount();
+               for (int i = 0; i < rowCount; i++) {
+                       final Object val = curModel.getValueAt(i, 
targetColumn);                         
+                       if (val != null && fileKeyList.contains(val))
                                matched++;
-                       }
                }
-
                return matched;
        }
 

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