root / trunk / libraries / libRaster / src / org / gvsig / raster / datastruct / ColorItem.java @ 12504
History | View | Annotate | Download (2.49 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*/
|
19 |
package org.gvsig.raster.datastruct; |
20 |
|
21 |
import java.awt.Color; |
22 |
/**
|
23 |
* Valor minimo para un item de una tabla de color. Este tendr? que pixel afecta,
|
24 |
* nombre de esa clase, color y como estar? interpolado con el siguiente.
|
25 |
*
|
26 |
* @version 04/07/2007
|
27 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
|
28 |
*/
|
29 |
public class ColorItem { |
30 |
private double value = 0.0f; |
31 |
private String nameClass = null; |
32 |
private Color color = Color.black; |
33 |
private int interpolated = 50; |
34 |
|
35 |
/**
|
36 |
* Devuelve el color
|
37 |
* @return
|
38 |
*/
|
39 |
public Color getColor() { |
40 |
return color;
|
41 |
} |
42 |
|
43 |
/**
|
44 |
* Definir el color
|
45 |
* @param color
|
46 |
*/
|
47 |
public void setColor(Color color) { |
48 |
this.color = color;
|
49 |
} |
50 |
|
51 |
/**
|
52 |
* Devuelve el valor de interpolaci?n con el siguiente color.
|
53 |
* L?mites: 0..100
|
54 |
* @return
|
55 |
*/
|
56 |
public int getInterpolated() { |
57 |
return interpolated;
|
58 |
} |
59 |
|
60 |
/**
|
61 |
* Definir el valor de interpolaci?n. Si es mayor a 100 o menor a 0 se pone
|
62 |
* entre los valores correctos.
|
63 |
* @param interpolated
|
64 |
*/
|
65 |
public void setInterpolated(int interpolated) { |
66 |
this.interpolated = interpolated;
|
67 |
if (this.interpolated > 100) |
68 |
this.interpolated = 100; |
69 |
if (this.interpolated < 0) |
70 |
this.interpolated = 0; |
71 |
} |
72 |
|
73 |
/**
|
74 |
* Obtener en que valor estar? dicho color
|
75 |
* @return
|
76 |
*/
|
77 |
public double getValue() { |
78 |
return value;
|
79 |
} |
80 |
|
81 |
/**
|
82 |
* Definir el valor del ColorItem.
|
83 |
* @param value
|
84 |
*/
|
85 |
public void setValue(double value) { |
86 |
this.value = value;
|
87 |
} |
88 |
|
89 |
/**
|
90 |
* Devuelve el nombre de la clase
|
91 |
* @return
|
92 |
*/
|
93 |
public String getNameClass() { |
94 |
return nameClass;
|
95 |
} |
96 |
|
97 |
/**
|
98 |
* Define el nombre de la clase
|
99 |
* @param nameClass
|
100 |
*/
|
101 |
public void setNameClass(String nameClass) { |
102 |
this.nameClass = nameClass;
|
103 |
} |
104 |
} |