From: James M. <jma...@us...> - 2001-12-02 13:47:14
|
Update of /cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/geotools In directory usw-pr-cvs1:/tmp/cvs-serv12943/uk/ac/leeds/ccg/geotools Modified Files: ClassificationShader.java Log Message: Reimplemetned the 'show counts' option for the keys Index: ClassificationShader.java =================================================================== RCS file: /cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/geotools/ClassificationShader.java,v retrieving revision 1.14 retrieving revision 1.15 diff -w -C2 -d -r1.14 -r1.15 *** ClassificationShader.java 2001/11/15 12:47:53 1.14 --- ClassificationShader.java 2001/12/02 13:47:11 1.15 *************** *** 64,68 **** */ public void setRange(GeoData d){ ! double temp = d.getMissingValueCode(); if(temp!=missingCode){ --- 64,69 ---- */ public void setRange(GeoData d){ ! System.out.println("Replacing data "+data+" with new one "+d); ! data=d;//not sure if this is a good idea... double temp = d.getMissingValueCode(); if(temp!=missingCode){ *************** *** 118,124 **** Iterator binList = classifier.getBins().iterator(); int i=1; while(binList.hasNext()){ Bin bin = (Bin)binList.next(); ! RangeItem k = new RangeItem(bin,color.getColor(i),bin.toString()); System.out.println("Adding "+k); keys.addElement(k); --- 119,131 ---- Iterator binList = classifier.getBins().iterator(); int i=1; + + ClassifierStats stats = new ClassifierStats(); + int binCounts[] = stats.countForEachBin(classifier,data); + String countString = ""; while(binList.hasNext()){ Bin bin = (Bin)binList.next(); ! ! if(this.showInCatCount) countString = " ["+binCounts[i-1]+"]"; ! RangeItem k = new RangeItem(bin,color.getColor(i),bin.toString()+ countString); System.out.println("Adding "+k); keys.addElement(k); |