Statistics
| Revision:

gvsig-raster / org.gvsig.raster.georeferencing / trunk / org.gvsig.raster.georeferencing / org.gvsig.raster.georeferencing.swing / org.gvsig.raster.georeferencing.swing.impl / src / main / java / org / gvsig / raster / georeferencing / swing / impl / option / GeorefOptionsDataModelImpl.java @ 1717

History | View | Annotate | Download (8.09 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 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.georeferencing.swing.impl.option;
20

    
21
import java.awt.Color;
22

    
23
import org.gvsig.fmap.dal.coverage.dataset.Buffer;
24
import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
25
import org.gvsig.raster.georeferencing.swing.GeoreferencingOptionsDataModel;
26
import org.gvsig.raster.georeferencing.swing.GeoreferencingSwingLibrary;
27

    
28
/**
29
 * Clase para el almacenamiento de opciones. Contiene propiedades y m?todos para
30
 * su asignaci?n y recuperaci?n.
31
 * 
32
 * 31/01/2008
33
 * @author Nacho Brodin nachobrodin@gmail.com
34
 */
35
public class GeorefOptionsDataModelImpl implements GeoreferencingOptionsDataModel {
36
        //        Opciones
37
        private int                           algorithm                = GeoreferencingSwingLibrary.AFFINE;
38
        private int                           degree                   = GeoreferencingSwingLibrary.DEFAULT_DEGREE;
39
        private Color                         backgroundColor          = Color.BLACK;
40
        private Color                         textColor                = Color.RED;
41
        private boolean                       showNumber               = true;
42
        private boolean                       addErrorsCSV             = false;
43
        private boolean                       centerView               = false;
44
        private double                        threshold                = 2.0;        
45
        private int                           interpolationMethod      = Buffer.INTERPOLATION_NearestNeighbour;
46
        private String                        outFile                  = null;
47
        private int                           type                     = GeoreferencingSwingLibrary.WITH_MAP;
48
        private double                        xCellSize                = 0;
49
        private double                        yCellSize                = 0;
50
        private RasterDataStore               store                    = null;
51
        private String                        selectedView             = null;
52
        
53
        /**
54
         * Obtiene el grado del polin?mio
55
         * @return entero con el valor que representa el grado del polin?mio
56
         */
57
        public int getDegree() {
58
                return degree;
59
        }
60

    
61
        /**
62
         * Asigna el grado del polin?mio
63
         * @param entero con el valor que representa el grado del polin?mio
64
         */
65
        public void setDegree(int optiondegree) {
66
                degree = optiondegree;
67
        }
68

    
69
        /**
70
         * Obtiene el color de los gr?ficos
71
         * @return Color
72
         */
73
        public Color getTextColor() {
74
                return textColor;
75
        }
76

    
77
        /**
78
         * Asigna el color de los gr?ficos
79
         * @param optionTextColor
80
         */
81
        public void setTextColor(Color optionTextColor) {
82
                textColor = optionTextColor;
83
        }
84
        
85
        /**
86
         * Obtiene al algoritmo a utilizar (Transformaci?n af?n, polin?mico, ...)
87
         * Las constantes est?n definidas en la clase Georreferencing
88
         * @return
89
         */
90
        public int getAlgorithm() {
91
                return algorithm;
92
        }
93

    
94
        /**
95
         * Asigna el algoritmo a utilizar (Transformaci?n af?n, polin?mico, ...)
96
         * Las constantes est?n definidas en la clase Georreferencing
97
         * @param
98
         */
99
        public void setAlgorithm(int optionAlgorithm) {
100
                algorithm = optionAlgorithm;
101
        }
102

    
103
        /**
104
         * Obtiene el color de fondo de las vistas
105
         * @return Color
106
         */
107
        public Color getBackgroundColor() {
108
                return backgroundColor;
109
        }
110

    
111
        /**
112
         * Asigna el color de fondo de las vistas
113
         * @param optionBackgroundColor
114
         */
115
        public void setBackgroundColor(Color optionBackgroundColor) {
116
                backgroundColor = optionBackgroundColor;
117
        }
118

    
119
        /**
120
         * Consulta si los errores se escriben en el fichero CSV
121
         * @return true si se escriben en el fichero y false si no se hace
122
         */
123
        public boolean isAddErrorsCSV() {
124
                return addErrorsCSV;
125
        }
126

    
127
        /**
128
         * Asigna el flag que dice si los errores se escriben en el fichero CSV
129
         * @param true para escribirlos en el fichero y false para no hacerlo
130
         */
131
        public void setAddErrorsCSV(boolean addErrorsCSV) {
132
                this.addErrorsCSV = addErrorsCSV;
133
        }
134

    
135
        /**
136
         * Consulta si est? activo el flag de centrar las vistas autom?ticamente sobre
137
         * el punto que est? seleccionado en la tabla.
138
         * @return true para centrar autom?ticamente y false para no hacerlo
139
         */
140
        public boolean isCenterView() {
141
                return centerView;
142
        }
143

    
144
        /**
145
         * Asigna el flag que dice si se centran las vistas autom?ticamente sobre
146
         * el punto que est? seleccionado en la tabla.
147
         * @return true para centrar autom?ticamente y false para no hacerlo
148
         */
149
        public void setCenterView(boolean centerView) {
150
                this.centerView = centerView;
151
        }
152

    
153
        /**
154
         * Consulta el flag que informa si se muestra el n?mero del punto en la vista
155
         * @return true si se muestra y false si no
156
         */
157
        public boolean isShowNumber() {
158
                return showNumber;
159
        }
160

    
161
        /**
162
         * Asigna el flag que dice si se muestra el n?mero del punto en la vista
163
         * @param true para mostrarlo y false para no hacerlo
164
         */
165
        public void setShowNumber(boolean showNumber) {
166
                this.showNumber = showNumber;
167
        }
168

    
169
        /**
170
         * Obtiene el umbral de error a partir del cual se iluminan en rojo en la tabla
171
         * @return double con el valor del umbral
172
         */
173
        public double getThreshold() {
174
                return threshold;
175
        }
176

    
177
        /**
178
         * Asigna el umbral de error a partir del cual se iluminan en rojo en la tabla
179
         * @param double con el valor del umbral
180
         */
181
        public void setThreshold(double threshold) {
182
                this.threshold = threshold;
183
        }
184

    
185
        /**
186
         * Obtiene el m?todo de interpolaci?n del m?todo polinomial
187
         * @return Entero contenido como constante en la clas GridInterpolation
188
         */
189
        public int getInterpolationMethod() {
190
                return interpolationMethod;
191
        }
192

    
193
        /**
194
         * Asigna el m?todo de interpolaci?n del m?todo polinomial
195
         * @param Entero contenido como constante en la clas GridInterpolation
196
         */
197
        public void setInterpolationMethod(int interpolationMethod) {
198
                this.interpolationMethod = interpolationMethod;
199
        }
200
        
201
        /**
202
         * Obtiene el fichero de salida
203
         * @return 
204
         */
205
        public String getOutFile() {
206
                return outFile;
207
        }
208

    
209
        /**
210
         * Asigna el fichero de salida
211
         * @param outputFile
212
         */
213
        public void setOutFile(String outFile) {
214
                this.outFile = outFile;
215
        }
216

    
217
        /**
218
         * Obtiene el tipo de georreferenciaci?n especificado en las constantes de la clase
219
         * georreferencing.
220
         * @return
221
         */
222
        public int getType() {
223
                return type;
224
        }
225

    
226
        /**
227
         * Asigna el tipo de georreferenciaci?n especificado en las constantes de la clase
228
         * georreferencing.
229
         * @param
230
         */
231
        public void setType(int type) {
232
                this.type = type;
233
        }
234
        
235
        /**
236
         * Obtiene el tama?o de celda en X para la georreferenciaci?n con remuestreo
237
         * asignada por el usuario.
238
         * @return
239
         */
240
        public double getXCellSize() {
241
                return xCellSize;
242
        }
243

    
244
        /**
245
         * Asigna el tama?o de celda en X para la georreferenciaci?n con remuestreo 
246
         * asignada por el usuario.
247
         * @param
248
         */
249
        public void setXCellSize(double cellSize) {
250
                this.xCellSize = cellSize;
251
        }
252
        
253
        /**
254
         * Obtiene el tama?o de celda en Y para la georreferenciaci?n con remuestreo
255
         * asignada por el usuario.
256
         * @return
257
         */
258
        public double getYCellSize() {
259
                return yCellSize;
260
        }
261

    
262
        /**
263
         * Asigna el tama?o de celda en Y para la georreferenciaci?n con remuestreo 
264
         * asignada por el usuario.
265
         * @param
266
         */
267
        public void setYCellSize(double cellSize) {
268
                this.yCellSize = cellSize;
269
        }
270

    
271
        public double getThresholdError() {
272
                return threshold;
273
        }
274

    
275
        public void setBackGroundColor(Color c) {
276
                this.backgroundColor = c;
277
        }
278

    
279
        public void setThresholdError(double threshold) {
280
                this.threshold = threshold;
281
        }
282

    
283
        public RasterDataStore getDataStore() {
284
                return store;
285
        }
286

    
287
        public String getSelectedView() {
288
                return selectedView;
289
        }
290
        
291
        public void setSelectedView(String v) {
292
                selectedView = v;
293
        }
294
        
295
        public void setDataStore(RasterDataStore store) {
296
                this.store = store;
297
        }
298
}
299