Statistics
| Revision:

gvsig-raster / org.gvsig.raster.tools / trunk / org.gvsig.raster.tools / org.gvsig.raster.tools.app.basic / src / main / java / org / gvsig / raster / tools / app / basic / raster / bean / stretchselector / StretchSelectorData.java @ 2480

History | View | Annotate | Download (3.23 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
5
* 
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
* 
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
* GNU General Public License for more details.
15
* 
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
* MA  02110-1301, USA.
20
* 
21
*/
22
package org.gvsig.raster.tools.app.basic.raster.bean.stretchselector;
23

    
24
import java.util.Observable;
25

    
26
/**
27
 * Modelo de datos para el componente de selecci?n de lista de tramos.
28
 * 
29
 * 06/08/2008
30
 * @author Nacho Brodin nachobrodin@gmail.com
31
 */
32
public class StretchSelectorData extends Observable {
33
        private String         size                 = "255";
34
        private String         number               = "1";
35
        private String         min                  = "0";
36
        private String         max                  = "255";
37
        
38
        /**
39
         * Devuelve el n?mero de tramos
40
         * @return
41
         */
42
        public int getStretchNumber() {
43
                try {
44
                        return (int)Double.parseDouble(number);
45
                } catch (NumberFormatException e) {
46
                        return 0;
47
                }
48
        }
49
        
50
        /**
51
         * Devuelve el tama?o de tramo
52
         * @return
53
         */
54
        public double getStretchSize() {
55
                try {
56
                        return Double.parseDouble(size);
57
                } catch (NumberFormatException e) {
58
                        return 0;
59
                }
60
        }
61
        
62
        /**
63
         * Devuelve el minimo
64
         * @return
65
         */
66
        public double getMinimum() {
67
                try {
68
                        return Double.parseDouble(min);
69
                } catch (NumberFormatException e) {
70
                        return 0;
71
                }
72
        }
73

    
74
        /**
75
         * Devuelve el maximo
76
         * @return
77
         */
78
        public double getMaximum() {
79
                try {
80
                        return Double.parseDouble(max);
81
                } catch (NumberFormatException e) {
82
                        return 0;
83
                }
84
        }
85
        
86
        /**
87
         * Obtiene el valor m?ximo del intervalo
88
         * @return 
89
         */
90
        public String getMax() {
91
                return max;
92
        }
93

    
94
        /**
95
         * Asigna el valor m?ximo del intervalo
96
         * @param max
97
         */
98
        public void setMax(String max) {
99
                this.max = max;
100
        }
101

    
102
        /**
103
         * Obtiene el valor m?nimo del intervalo
104
         * @return
105
         */
106
        public String getMin() {
107
                return min;
108
        }
109

    
110
        /**
111
         * Asigna el valor m?nimo del intervalo
112
         * @param min
113
         */
114
        public void setMin(String min) {
115
                this.min = min;
116
        }
117

    
118
        /**
119
         * Obtiene el valor del tama?o de intervalo
120
         * @return
121
         */
122
        public String getIntervalSize() {
123
                return size;
124
        }
125
        
126
        /**
127
         * Asigna el valor de tama?o de intervalo
128
         * @param interval
129
         */
130
        public void setIntervalSize(String size) {
131
                this.size = size;
132
                updateObservers();
133
        }
134
        
135
        /**
136
         * Obtiene el n?mero de intervalos
137
         * @return
138
         */
139
        public String getNumber() {
140
                return number;
141
        }
142
        
143
        /**
144
         * Asigna el n?mero de intervalos
145
         * @param number
146
         */
147
        public void setNumber(String number) {
148
                this.number = number;
149
                updateObservers();
150
        }
151
        
152
        /**
153
         * Actualiza datos y llama al update de los observadores
154
         */
155
        public void updateObservers() {
156
                setChanged();
157
                notifyObservers();
158
        }
159
}