Revision: 14027
http://gate.svn.sourceforge.net/gate/?rev=14027&view=rev
Author: valyt
Date: 2011-06-15 13:12:04 +0000 (Wed, 15 Jun 2011)
Log Message:
-----------
Guard against invalid row numbers, which sometimes occur during manual annotation.
Modified Paths:
--------------
gate/trunk/src/gate/swing/XJTable.java
Modified: gate/trunk/src/gate/swing/XJTable.java
===================================================================
--- gate/trunk/src/gate/swing/XJTable.java 2011-06-15 09:50:17 UTC (rev 14026)
+++ gate/trunk/src/gate/swing/XJTable.java 2011-06-15 13:12:04 UTC (rev 14027)
@@ -684,13 +684,17 @@
}
public boolean isCellEditable(int rowIndex, int columnIndex){
- return sourceModel.isCellEditable(targetToSource(rowIndex),
- columnIndex);
+ int sourceRow = targetToSource(rowIndex);
+ return sourceRow >= 0 ?
+ sourceModel.isCellEditable(sourceRow, columnIndex) :
+ false;
}
+
public void setValueAt(Object aValue, int rowIndex, int columnIndex){
- sourceModel.setValueAt(aValue, targetToSource(rowIndex),
- columnIndex);
+ int sourceRow = targetToSource(rowIndex);
+ if(sourceRow >= 0) sourceModel.setValueAt(aValue, sourceRow, columnIndex);
}
+
public Object getValueAt(int row, int column){
try{
return sourceModel.getValueAt(targetToSource(row), column);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|