/[schmitzm]/branches/1.0-gt2-2.6/src/skrueger/RasterLegendData.java
ViewVC logotype

Contents of /branches/1.0-gt2-2.6/src/skrueger/RasterLegendData.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (show annotations)
Tue Feb 24 22:43:52 2009 UTC (16 years ago) by mojays
Original Path: trunk/src/skrueger/RasterLegendData.java
File size: 1381 byte(s)
First Commit, corresponds to Revision 1008 of Wikisquare-SVN
includes:
- schmitzm.* (except schmitzm.test)
- org.geotools.* (all overridden classes)
- skrueger.geotools
- skrueger.i8n
- skrueger.swing
- appl.data.LateLoadable (dependency in SCHMITZM)
- appl.data.LoadingException (dependency in SCHMITZM)
- appl.util.RasterMetaData (dependency in SCHMITZM)

1 package skrueger;
2 import java.util.Arrays;
3 import java.util.HashMap;
4 import java.util.LinkedList;
5 import java.util.List;
6
7 import org.apache.log4j.Logger;
8
9 import skrueger.i8n.Translation;
10
11 /**
12 * Holds all the additional information needed to paint a Legend for a RasterLayer.
13 * So far, only Legends for one-band raster layers are supported.
14 *
15 * @author <a href="mailto:[email protected]">Stefan Alfons Kr&uuml;ger</a>
16 *
17 */
18 public class RasterLegendData extends HashMap<Double, Translation> {
19 static private final Logger LOGGER = Logger.getLogger(RasterLegendData.class);
20 private Boolean paintGaps = false;
21
22 public Boolean isPaintGaps() {
23 return paintGaps;
24 }
25
26 public void setPaintGaps(boolean paintPaps) {
27 this.paintGaps = paintPaps;
28 }
29
30 /**
31 * {@link #paintGaps} defines, if gaps should be painted between the legends colors,
32 * indicating nominal values in the raster (e.g. classifications)
33 */
34 public RasterLegendData(boolean paintGaps) {
35 super();
36 this.paintGaps = paintGaps;
37 }
38
39 public boolean getPaintGaps() {
40 return paintGaps ;
41 }
42
43 public List<Double> getSortedKeys(){
44 Object[] array = keySet().toArray();
45
46 Arrays.sort(array);
47
48 final LinkedList<Double> linkedList = new LinkedList<Double>();
49 for (Object o : array){
50 linkedList.add( (Double)o);
51 }
52
53 return linkedList;
54
55 }
56 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26