If trying to retrieve a row at or above the row-length of the current tab, just return an empty string, as it's not probably going to get rendered anyway. I'm sadly confident this is due to a bug, but one that I can't fix right now.
- ~
- jbidwatcher
- trunk
- src
- com
- jbidwatcher
- ui
- table
- Transformation.java
| Transformation.java |
|---|
mrs 1 package com.jbidwatcher.ui.table; cyberfox 2 cyberfox 3 /* cyberfox 4 * Copyright (c) 2000-2007, CyberFOX Software, Inc. All Rights Reserved. cyberfox 5 * cyberfox 6 * Developed by mrs (Morgan Schweers) cyberfox 7 */ cyberfox 8 cyberfox 9 /** cyberfox 10 * Created by IntelliJ IDEA. cyberfox 11 * User: Morgan Schweers cyberfox 12 * Date: Mar 18, 2005 cyberfox 13 * Time: 1:40:30 AM cyberfox 14 * cyberfox 15 */ mrs 16 public class Transformation extends BaseTransformation mrs 17 { cyberfox 18 Transformation() { } cyberfox 19 mrs 20 Transformation(BaseTransformation chain) { cyberfox 21 super(chain); cyberfox 22 } cyberfox 23 cyberfox 24 public synchronized int getRowCount() { cyberfox 25 if (!checkRowModel()) { cyberfox 26 initializeRows(m_tm); cyberfox 27 postInitialize(); cyberfox 28 } cyberfox 29 return m_row_xform.size(); cyberfox 30 } cyberfox 31 cyberfox 32 public synchronized Object getValueAt(int row, int col) { cyberfox 33 if (!checkRowModel()) { cyberfox 34 initializeRows(m_tm); cyberfox 35 postInitialize(); cyberfox 36 } mrs 37 mrs 38 // If the row is later than the current max rows, then ignore it; it shouldn't be rendered anyway. This may be a bug. :( mrs 39 if(row >= m_row_xform.size()) return ""; mrs 40 cyberfox 41 int newrow = m_row_xform.get(row); cyberfox 42 int newcol = col; cyberfox 43 if(col != -1) { cyberfox 44 if(!checkColumnModel()) { cyberfox 45 initializeColumns(m_tm); cyberfox 46 } cyberfox 47 newcol = m_col_xform.get(col); cyberfox 48 } cyberfox 49 cyberfox 50 return m_tm.getValueAt(newrow, newcol); cyberfox 51 } cyberfox 52 mrs 53 public synchronized int compare(int row1, int row2, ColumnStateList columnStateList) { cyberfox 54 if (!checkRowModel()) { cyberfox 55 initializeRows(m_tm); cyberfox 56 postInitialize(); cyberfox 57 } cyberfox 58 int newrow1 = m_row_xform.get(row1); cyberfox 59 int newrow2 = m_row_xform.get(row2); cyberfox 60 cyberfox 61 return m_tm.compare(newrow1, newrow2, columnStateList); cyberfox 62 } cyberfox 63 cyberfox 64 public synchronized void delete(int row) { cyberfox 65 if (!checkRowModel()) { cyberfox 66 initializeRows(m_tm); cyberfox 67 postInitialize(); cyberfox 68 } cyberfox 69 m_tm.delete(getInt(m_row_xform, row)); cyberfox 70 m_row_xform.remove(row); cyberfox 71 initializeRows(m_tm); cyberfox 72 postInitialize(); cyberfox 73 } cyberfox 74 cyberfox 75 public synchronized int insert(Object newObj) { cyberfox 76 if (!checkRowModel()) { cyberfox 77 initializeRows(m_tm); cyberfox 78 postInitialize(); cyberfox 79 } cyberfox 80 int newRow = m_tm.insert(newObj); cyberfox 81 m_row_xform.add(newRow); cyberfox 82 return m_row_xform.size()-1; cyberfox 83 } cyberfox 84 }
Check out the code: svn co jbidwatcher/trunk/src/com/jbidwatcher/ui/table/Transformation.java
