[Schmitzm-commits] r399 - branches/1.0-gt2-2.6/src/skrueger

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Sep 14 13:48:44 CEST 2009


Author: mojays
Date: 2009-09-14 13:48:44 +0200 (Mon, 14 Sep 2009)
New Revision: 399

Modified:
   branches/1.0-gt2-2.6/src/skrueger/RasterLegendData.java
Log:


Modified: branches/1.0-gt2-2.6/src/skrueger/RasterLegendData.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/RasterLegendData.java	2009-09-14 11:42:49 UTC (rev 398)
+++ branches/1.0-gt2-2.6/src/skrueger/RasterLegendData.java	2009-09-14 11:48:44 UTC (rev 399)
@@ -33,8 +33,6 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
 
 import org.apache.log4j.Logger;
 import org.geotools.coverage.grid.GridCoverage2D;
@@ -52,7 +50,7 @@
  * @author <a href="mailto:skpublic at wikisquare.de">Stefan Alfons Kr&uuml;ger</a>
  *
  */
-public class RasterLegendData extends TreeMap<Double, Translation> {
+public class RasterLegendData extends HashMap<Double, Translation> {
 	static private final Logger LOGGER = Logger.getLogger(RasterLegendData.class);
 	private Boolean paintGaps = false;
 
@@ -76,27 +74,27 @@
 		return paintGaps ;
 	}
 
-//	public List<Double> getSortedKeys(){
-//		Object[] array = keySet().toArray();
-//
-//		Arrays.sort(array);
-//
-//		final LinkedList<Double> linkedList = new LinkedList<Double>();
-//		for (Object o : array){
-//			linkedList.add( (Double)o);
-//		}
-//
-//		return linkedList;
-//
-//	}
+	public List<Double> getSortedKeys(){
+		Object[] array = keySet().toArray();
 
+		Arrays.sort(array);
+
+		final LinkedList<Double> linkedList = new LinkedList<Double>();
+		for (Object o : array){
+			linkedList.add( (Double)o);
+		}
+
+		return linkedList;
+
+	}
+
     /**
      * Creates a sample {@link GridCoverage2D} (size 1x1, WGS84) for each
      * legend value.  These rasters can be used to do visualize the
      * legend item in the corresponding color via {@link GridCoverageRenderer}.
      */
-    public SortedMap<Double, GridCoverage2D> createSampleRasters() {
-      SortedMap<Double, GridCoverage2D> sampleRaster = new TreeMap<Double, GridCoverage2D>();
+    public Map<Double, GridCoverage2D> createSampleRasters() {
+      Map<Double, GridCoverage2D> sampleRaster = new HashMap<Double, GridCoverage2D>();
       
       for (Double rasterValue : keySet()) {
         GridCoverage2D grid = GridUtil.GRID_FAC.create(



More information about the Schmitzm-commits mailing list