From: James M. <jma...@us...> - 2001-11-21 13:37:31
|
Update of /cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/geotools In directory usw-pr-cvs1:/tmp/cvs-serv10594/uk/ac/leeds/ccg/geotools Modified Files: ShapefileReader.java Log Message: Threaded loading has been disabled as it is causing too many problems Index: ShapefileReader.java =================================================================== RCS file: /cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/geotools/ShapefileReader.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ShapefileReader.java 2001/11/19 18:17:07 1.31 --- ShapefileReader.java 2001/11/21 13:37:28 1.32 *************** *** 87,90 **** --- 87,98 ---- loader.start(); + //the following block of code effectivly dissables the threaded loading system for now + try{ + loader.join(); + } + catch(InterruptedException ie){ + System.err.println("Shapefile not loaded by loader "+ie); + } + System.out.println("Shapefile Constructor Finished - tread loading disabled"); } *************** *** 234,241 **** --- 242,254 ---- SimpleGeoData data; String colName; + int col; public AddDataWhenReady(SimpleGeoData data,String colName){ this.data = data; this.colName = colName; } + public AddDataWhenReady(SimpleGeoData data,int col){ + this.data = data; + this.colName = colName; + } public void run(){ System.out.println("Waiting for data loader to finish"); *************** *** 249,255 **** System.out.println("Apparently data loader has now finished"); if(colName !=null){ ! int col = dbf.getFieldNumber(colName); if(col>=0){ ! readData(data,col); } else{ --- 262,269 ---- System.out.println("Apparently data loader has now finished"); if(colName !=null){ ! col = dbf.getFieldNumber(colName); ! } if(col>=0){ ! readDataNow(data,col); } else{ *************** *** 258,262 **** map.notifyLayerChangedListeners(LayerChangedEvent.DATA); ! } } } --- 272,276 ---- map.notifyLayerChangedListeners(LayerChangedEvent.DATA); ! } } *************** *** 462,467 **** } - public GeoData readData(SimpleGeoData data,int col){ if(dbf.getFieldType(col)=='C'){ --- 476,486 ---- } public GeoData readData(SimpleGeoData data,int col){ + AddDataWhenReady dataWatch = new AddDataWhenReady(data,col); + dataWatch.start(); + return data; + } + + private GeoData readDataNow(SimpleGeoData data,int col){ if(dbf.getFieldType(col)=='C'){ |