/[schmitzm]/trunk/src/skrueger/RasterLegendData.java
ViewVC logotype

Annotation of /trunk/src/skrueger/RasterLegendData.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 382 - (hide annotations)
Fri Sep 4 17:02:58 2009 UTC (15 years, 5 months ago) by alfonx
Original Path: branches/1.0-gt2-2.6/src/skrueger/RasterLegendData.java
File size: 2729 byte(s)
* ImagePyramidReader and ImageMosaicReader now work with URLs again.
1 alfonx 244 /*******************************************************************************
2     * Copyright (c) 2009 Martin O. J. Schmitz.
3     *
4     * This file is part of the SCHMITZM library - a collection of utility
5 alfonx 256 * classes based on Java 1.6, focusing (not only) on Java Swing
6 alfonx 244 * and the Geotools library.
7     *
8     * The SCHMITZM project is hosted at:
9     * http://wald.intevation.org/projects/schmitzm/
10     *
11     * This program is free software; you can redistribute it and/or
12     * modify it under the terms of the GNU Lesser General Public License
13     * as published by the Free Software Foundation; either version 3
14     * of the License, or (at your option) any later version.
15     *
16     * This program is distributed in the hope that it will be useful,
17     * but WITHOUT ANY WARRANTY; without even the implied warranty of
18     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19     * GNU General Public License for more details.
20     *
21     * You should have received a copy of the GNU Lesser General Public License (license.txt)
22     * along with this program; if not, write to the Free Software
23     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24     * or try this link: http://www.gnu.org/licenses/lgpl.html
25     *
26     * Contributors:
27     * Martin O. J. Schmitz - initial API and implementation
28     * Stefan A. Krüger - additional utility classes
29     ******************************************************************************/
30     package skrueger;
31     import java.util.Arrays;
32     import java.util.HashMap;
33     import java.util.LinkedList;
34     import java.util.List;
35    
36     import org.apache.log4j.Logger;
37    
38     import skrueger.i8n.Translation;
39    
40     /**
41     * Holds all the additional information needed to paint a Legend for a RasterLayer.
42     * So far, only Legends for one-band raster layers are supported.
43     *
44     * @author <a href="mailto:[email protected]">Stefan Alfons Kr&uuml;ger</a>
45     *
46     */
47     public class RasterLegendData extends HashMap<Double, Translation> {
48     static private final Logger LOGGER = Logger.getLogger(RasterLegendData.class);
49     private Boolean paintGaps = false;
50    
51     public Boolean isPaintGaps() {
52     return paintGaps;
53     }
54    
55     public void setPaintGaps(boolean paintPaps) {
56     this.paintGaps = paintPaps;
57     }
58    
59     /**
60     * {@link #paintGaps} defines, if gaps should be painted between the legends colors,
61     * indicating nominal values in the raster (e.g. classifications)
62     */
63     public RasterLegendData(boolean paintGaps) {
64     this.paintGaps = paintGaps;
65     }
66    
67     public boolean getPaintGaps() {
68     return paintGaps ;
69     }
70    
71     public List<Double> getSortedKeys(){
72     Object[] array = keySet().toArray();
73    
74     Arrays.sort(array);
75    
76     final LinkedList<Double> linkedList = new LinkedList<Double>();
77     for (Object o : array){
78     linkedList.add( (Double)o);
79     }
80    
81     return linkedList;
82    
83     }
84     }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26