Revision 44542

View differences:

trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.fmap.control/src/main/java/org/gvsig/fmap/mapcontrol/dal/feature/swing/table/FeatureTableModel.java
50 50
import org.gvsig.fmap.dal.feature.paging.FeaturePagingHelper;
51 51
import org.gvsig.fmap.dal.swing.DALSwingLocator;
52 52
import org.gvsig.tools.exception.BaseException;
53
import org.gvsig.tools.logger.FilteredLogger;
53 54
import org.gvsig.tools.observer.ComplexNotification;
54 55
import org.gvsig.tools.observer.ComplexObserver;
55 56
import org.gvsig.tools.observer.Observable;
......
68 69
public class FeatureTableModel extends AbstractTableModel implements ComplexObserver {
69 70

  
70 71

  
71
	private static final Logger logger = LoggerFactory
72
	private static final Logger LOGGER = LoggerFactory
72 73
			.getLogger(FeatureTableModel.class);
73

  
74
        
74 75
    private static final long serialVersionUID = -2488157521902851301L;
75 76

  
76 77
    private FeaturePagingHelper helper;
......
79 80
    private EditableFeature editableFeature;
80 81

  
81 82
    private boolean selectionLocked=false;
83
    private final FilteredLogger filterlogger;
82 84

  
83 85
    /**
84 86
     * Constructs a TableModel from the features of a FeatureStore, with the
......
127 129
     */
128 130
    protected FeatureTableModel(FeaturePagingHelper helper) {
129 131
        this.helper = helper;
132
        this.filterlogger = new FilteredLogger(LOGGER, "SimpleFeaturesTableModel", 10);
133
        this.filterlogger.setInterval(30000);
130 134
        initialize();
131 135
    }
132 136

  
......
147 151
	            return (int) totalSize;
148 152
	        }
149 153
    	} catch (ConcurrentDataModificationException e) {
150
			logger.debug("Error while getting the total size of the set", e);
154
			LOGGER.debug("Error while getting the total size of the set", e);
151 155
			return 0;
152 156
		}
153 157
    }
......
155 159
    public Object getValueAt(int rowIndex, int columnIndex) {
156 160
        // Get the Feature at row "rowIndex", and return the value of the
157 161
        // attribute at "columnIndex"
158
        Feature feature = getFeatureAt(rowIndex);
159
        if( feature==null ) {
162
        try {
163
            Feature feature = getFeatureAt(rowIndex);
164
            if (feature == null) {
165
                return null;
166
            }
167
            Object value;
168
            value = getFeatureValue(feature, columnIndex);
169
            return value;
170
        } catch (Throwable ex) {
171
            filterlogger.warn("Not been able to retrieve feature value", ex);
160 172
            return null;
161 173
        }
162
        Object value = getFeatureValue(feature, columnIndex);
163
        return value;
164 174
    }
165 175

  
166 176
    /**
......
292 302
        try {
293 303
            fireTableStructureChanged();
294 304
        } catch (Exception e) {
295
            logger.warn("Couldn't reload changed table");
305
            LOGGER.warn("Couldn't reload changed table");
296 306
        }finally{
297 307
            //The locked selection is unlocked.
298 308
            selectionLocked=false;
......
346 356
                return;
347 357
            }
348 358
            this.stop();
349
            logger.info("DelayAction.run["+this.state+"] begin");
359
            LOGGER.info("DelayAction.run["+this.state+"] begin");
350 360
            switch(this.state) {
351 361
            case STATE_NEED_RELOADALL:
352 362
                reloadAll();
......
377 387
                getHelper().setSelectionUp(true);
378 388
            }
379 389
            this.reset();
380
            logger.info("DelayAction.run["+this.state+"] end");
390
            LOGGER.info("DelayAction.run["+this.state+"] end");
381 391
        }
382 392

  
383 393
        public void nextState(int nextstate) {
......
544 554
        try {
545 555
            this.getHelper().reload();
546 556
        } catch (BaseException ex) {
547
            logger.warn("Can't reload paging-helper.", ex);
557
            LOGGER.warn("Can't reload paging-helper.", ex);
548 558
        }
549 559
    }
550 560

  
......
655 665
            try {
656 666
                fireTableDataChanged();
657 667
            } catch (Exception e) {
658
                logger.warn("Couldn't reload changed table");
668
                LOGGER.warn("Couldn't reload changed table");
659 669
            }finally{
660 670
                //The locked selection is unlocked.
661 671
                selectionLocked=false;

Also available in: Unified diff