/[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 244 - (show annotations)
Wed Jul 29 09:33:33 2009 UTC (15 years, 7 months ago) by alfonx
Original Path: trunk/src/skrueger/RasterLegendData.java
File size: 2741 byte(s)
* Updated all .java and .properties headers with a recent LGPL 3.0 and a link to the project webpage.
1 /*******************************************************************************
2 * Copyright (c) 2009 Martin O. J. Schmitz.
3 *
4 * This file is part of the SCHMITZM library - a collection of utility
5 * classes based on Java 1.6, focussing (not only) on Java Swing
6 * 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 super();
65 this.paintGaps = paintGaps;
66 }
67
68 public boolean getPaintGaps() {
69 return paintGaps ;
70 }
71
72 public List<Double> getSortedKeys(){
73 Object[] array = keySet().toArray();
74
75 Arrays.sort(array);
76
77 final LinkedList<Double> linkedList = new LinkedList<Double>();
78 for (Object o : array){
79 linkedList.add( (Double)o);
80 }
81
82 return linkedList;
83
84 }
85 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26