Statistics
| Revision:

svn-gvsig-desktop / branches / v10 / extensions / extNormalization / src / org / gvsig / normalization / gui / INormPanelModel.java @ 28183

History | View | Annotate | Download (5.69 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

    
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2008 Prodevelop S.L. main development
26
 */
27

    
28
package org.gvsig.normalization.gui;
29

    
30
import java.util.List;
31

    
32
import javax.swing.DefaultListModel;
33
import javax.swing.event.ChangeListener;
34

    
35
import org.gvsig.normalization.patterns.Element;
36
import org.gvsig.normalization.patterns.Fieldseparator;
37
import org.gvsig.normalization.patterns.Patternnormalization;
38

    
39
import com.iver.cit.gvsig.project.documents.table.gui.Table;
40

    
41
/**
42
 * Interface of panel model
43
 * 
44
 * @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a>
45
 * @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a>
46
 */
47
public interface INormPanelModel {
48

    
49
        /**
50
         * Normalize the samples and return a 2D array of objects (Strings) to put
51
         * on the output table
52
         * 
53
         * @return matrix with the strings of sample
54
         */
55
        public Object[][] normalizeSamples();
56

    
57
        /**
58
         * Return the name of the field to normalize
59
         * 
60
         * @return name
61
         */
62
        public String getFieldToNormalize();
63

    
64
        /**
65
         * Set the name of the field to normalize
66
         * 
67
         * @param fieldToNormalize
68
         *            name of field
69
         */
70
        public void setFieldToNormalize(String fieldToNormalize);
71

    
72
        /**
73
         * Get samples from the input table
74
         * 
75
         * @return array with strings from the table
76
         */
77
        public String[] getSamplesTable();
78

    
79
        /**
80
         * Get samples from the input file
81
         * 
82
         * @return array with strings from the text file
83
         */
84
        public String[] getSamplesFile();
85

    
86
        /**
87
         * Get the first or random samples from data source (FILE)
88
         */
89
        public void getSamplesFromFile(int numNoRows);
90

    
91
        /**
92
         * Get the default Fieldseparator object for new Fields
93
         * 
94
         * @return
95
         */
96
        public Fieldseparator getDefaultFieldseparators();
97

    
98
        /**
99
         * Delete the address element selected
100
         * 
101
         * @param column
102
         *            number
103
         */
104
        public void deleteField(int column);
105

    
106
        /**
107
         * Add one address element
108
         */
109
        public void addField();
110

    
111
        /**
112
         * Return the names of the new fields
113
         * 
114
         * @return list names
115
         */
116
        public String[] getNewFieldNames();
117

    
118
        /**
119
         * Main method to run the model
120
         * 
121
         * @param normalizationPanel
122
         * 
123
         * @return process ok
124
         */
125
        public boolean runModel(ChangeListener normalizationPanel);
126

    
127
        /**
128
         * This method up one place in the list of the new fields
129
         * 
130
         * @param pos
131
         */
132
        public void fieldUp(int pos);
133

    
134
        /**
135
         * This method down one place in the list of the new fields
136
         * 
137
         * @param pos
138
         */
139
        public void fieldDown(int pos);
140

    
141
        /**
142
         * Set the pattern
143
         * 
144
         * @param pat
145
         *            pattern
146
         */
147
        public void setPattern(Patternnormalization pat);
148

    
149
        /**
150
         * @return the pattern
151
         */
152
        public Patternnormalization getPattern();
153

    
154
        /**
155
         * Load the pattern from xml file
156
         * 
157
         * @return pattern
158
         */
159
        public Patternnormalization loadPatternXML();
160

    
161
        /**
162
         * Make the normalization process in a new table (true) or in the original
163
         * table (false)
164
         * 
165
         * @param inNewTable
166
         */
167
        public void setInNewTable(boolean inNewTable);
168

    
169
        /**
170
         * Return the selected Element in the list of the new Fields
171
         * 
172
         * @param index
173
         * @return
174
         */
175
        public Element getElement(int index);
176

    
177
        /**
178
         * Save the pattern in a XML file
179
         * 
180
         * @return
181
         */
182
        public void savePatternXML();
183

    
184
        /**
185
         * Get all the fields names of the original table
186
         * 
187
         * @return list model
188
         */
189
        public DefaultListModel getAllOriginalFields();
190

    
191
        /**
192
         * Set the relates fields names
193
         * 
194
         * @param array
195
         *            with relate names
196
         */
197
        public void setNameRelateFields(String[] names);
198

    
199
        /**
200
         * get the field names of the original table
201
         * 
202
         * @return fields of the original table
203
         */
204
        public String[] getFieldNamesMainTable();
205

    
206
        /**
207
         * Get the text File name
208
         * 
209
         * @return name file
210
         */
211
        public String getFileName();
212

    
213
        /**
214
         * Set the attribute Don't normalize the first row
215
         * 
216
         * @param first
217
         */
218
        public void setFirstRows(int first);
219

    
220
        /**
221
         * Get Normalize the first row
222
         * 
223
         * @return first row ok
224
         */
225
        public int getFirstRows();
226

    
227
        /**
228
         * Get the table
229
         * 
230
         * @return the tab
231
         */
232
        public Table getTab();
233

    
234
        /**
235
         * Set the table
236
         * 
237
         * @param tab
238
         *            the tab to set
239
         */
240
        public void setTab(Table tab);
241

    
242
        /**
243
         * Get the file strings
244
         * 
245
         * @return list of strings
246
         */
247
        public List getFileChains();
248

    
249
        /**
250
         * Set the list of strngs from file
251
         * 
252
         * @param fileChains
253
         *            the fileChains to set
254
         */
255
        public void setFileChains(List fileChains);
256

    
257
        /**
258
         * Get file name
259
         * 
260
         * @return the nameFile
261
         */
262
        public String getNameFile();
263

    
264
        /**
265
         * Set file name
266
         * 
267
         * @param nameFile
268
         *            the nameFile to set
269
         */
270
        public void setNameFile(String nameFile);
271

    
272
        /**
273
         * Initialize the pattern
274
         */
275
        public void initPattern();
276

    
277
        /**
278
         * Set the file type
279
         * 
280
         * @param file
281
         *            ok
282
         */
283
        public void isFile(boolean file);
284

    
285
        /**
286
         * This method registers the listeners
287
         * 
288
         * @param l
289
         *            listener
290
         */
291
        public void registerListener(ChangeListener l);
292

    
293
}