Blame view

src/main/java/eu/omp/irap/vespa/epntapclient/gui/ParamField.java 21.7 KB
506d0c0b   Nathanael Jourdane   Add licence heade...
1
2
3
4
5
/*
 * This file is a part of EpnTAPClient.
 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
1e543ea0   Nathanael Jourdane   Code clean-up
6
 *
506d0c0b   Nathanael Jourdane   Add licence heade...
7
8
9
10
11
12
13
14
15
16
 * This program is free software: you can
 * redistribute it and/or modify it under the terms of the GNU General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
 * version. This program is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE. See the GNU General Public License for more details. You should have received a copy of
 * the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */

6dd0d332   Nathanael Jourdane   The controller do...
17
package eu.omp.irap.vespa.epntapclient.gui;
eb483599   Nathanael Jourdane   Add missing Param...
18
19
20

import java.awt.Color;
import java.awt.Dimension;
a99d92fa   Nathanael Jourdane   Add JComboBox for...
21
22
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
eb483599   Nathanael Jourdane   Add missing Param...
23
24
25
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
e7647bba   Nathanael Jourdane   change query to g...
26
import java.util.ArrayList;
e7647bba   Nathanael Jourdane   change query to g...
27
import java.util.List;
eb483599   Nathanael Jourdane   Add missing Param...
28
import java.util.Locale;
b6627be6   Nathanael Jourdane   Improve Exceptions
29
import java.util.logging.Level;
5d3c344e   Nathanael Jourdane   Use Java logging ...
30
import java.util.logging.Logger;
eb483599   Nathanael Jourdane   Add missing Param...
31
32

import javax.swing.BoxLayout;
f00cb6bb   Nathanael Jourdane   Add a JComboBox f...
33
import javax.swing.JComboBox;
eb483599   Nathanael Jourdane   Add missing Param...
34
35
36
37
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
eb483599   Nathanael Jourdane   Add missing Param...
38
39
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
eb483599   Nathanael Jourdane   Add missing Param...
40

05b140ed   Nathanael Jourdane   TargetNameField J...
41
42
43
44
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

05b140ed   Nathanael Jourdane   TargetNameField J...
45
import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableConnection;
d3a65e87   Nathanael Jourdane   Improve Javadoc.
46
import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException;
05b140ed   Nathanael Jourdane   TargetNameField J...
47

a227a22d   Nathanael Jourdane   Add comments.
48
/**
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
49
50
51
52
 * A field used to set a service parameter to build the query (in the parameter panel). ParamField
 * is an abstract method and all type of parameter field should extend it. See
 * https://voparis-confluence.obspm.fr/display/VES/4+-+EPN-TAP+queries to get all parameters
 * details.
1e543ea0   Nathanael Jourdane   Code clean-up
53
 *
a227a22d   Nathanael Jourdane   Add comments.
54
55
 * @author N. Jourdane
 */
eb483599   Nathanael Jourdane   Add missing Param...
56
public abstract class ParamField extends JPanel {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
57

1e543ea0   Nathanael Jourdane   Code clean-up
58
59
	/** The serial version UID. */
	private static final long serialVersionUID = 1L;
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
60

5d3c344e   Nathanael Jourdane   Use Java logging ...
61
	/** The logger for the class ParamField. */
869d1749   Nathanael Jourdane   remove unused log...
62
	protected static final Logger logger = Logger.getLogger(ParamField.class.getName());
eb483599   Nathanael Jourdane   Add missing Param...
63

a227a22d   Nathanael Jourdane   Add comments.
64
	/** The minimum width of the field. */
68ae1315   Nathanael Jourdane   Improve GUI appar...
65
	private static final int MIN_FIELD_WIDTH = 30;
1e543ea0   Nathanael Jourdane   Code clean-up
66

a227a22d   Nathanael Jourdane   Add comments.
67
	/** The preferred field height. */
68ae1315   Nathanael Jourdane   Improve GUI appar...
68
	private static final int FIELD_HEIGHT = 20;
1e543ea0   Nathanael Jourdane   Code clean-up
69

a227a22d   Nathanael Jourdane   Add comments.
70
	/** The maximum width of the field. */
68ae1315   Nathanael Jourdane   Improve GUI appar...
71
	private static final int MAX_FIELD_WIDTH = 400;
1e543ea0   Nathanael Jourdane   Code clean-up
72

a227a22d   Nathanael Jourdane   Add comments.
73
	/** The preferred label width. */
68ae1315   Nathanael Jourdane   Improve GUI appar...
74
75
	private static final int LABEL_WIDTH = 140;

a227a22d   Nathanael Jourdane   Add comments.
76
	/** The URL of the resolver used for the `target name` field. */
05b140ed   Nathanael Jourdane   TargetNameField J...
77
	private static final String RESOLVER_URL = "http://voparis-registry.obspm.fr/ssodnet/1/autocomplete";
1e543ea0   Nathanael Jourdane   Code clean-up
78

a227a22d   Nathanael Jourdane   Add comments.
79
	/** The date format used in the DateRange field */
eb483599   Nathanael Jourdane   Add missing Param...
80
	private static final String DATE_FORMAT = "dd/MM/yyyy";
1e543ea0   Nathanael Jourdane   Code clean-up
81

a227a22d   Nathanael Jourdane   Add comments.
82
	/** The regex used to validate the Date fields */
eb483599   Nathanael Jourdane   Add missing Param...
83
	private static final String DATE_REGEX = "(^(((0[1-9]|1[0-9]|2[0-8])[\\/](0[1-9]|1[012]))|((29|30|31)[\\/](0[13578]|1[02]))|((29|30)[\\/](0[4,6,9]|11)))[\\/](19|[2-9][0-9])\\d\\d$)|(^29[\\/]02[\\/](19|[2-9][0-9])(00|04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96)$)";
1e543ea0   Nathanael Jourdane   Code clean-up
84

a227a22d   Nathanael Jourdane   Add comments.
85
	/** The suffix used in REG-TAP parameters names, indicating that it's a beginning of a range. */
eb483599   Nathanael Jourdane   Add missing Param...
86
	private static final String MIN_SUFFIX = "min";
1e543ea0   Nathanael Jourdane   Code clean-up
87

a227a22d   Nathanael Jourdane   Add comments.
88
	/** The suffix used in REG-TAP parameters names, indicating that it is a end of a range. */
eb483599   Nathanael Jourdane   Add missing Param...
89
90
	private static final String MAX_SUFFIX = "max";

a227a22d   Nathanael Jourdane   Add comments.
91
	/** The main view of the application. */
0f1bce56   Nathanael Jourdane   Use a listerner i...
92
	protected ViewListener viewListener;
1e543ea0   Nathanael Jourdane   Code clean-up
93

a227a22d   Nathanael Jourdane   Add comments.
94
	/** The parameter name of the field */
eb483599   Nathanael Jourdane   Add missing Param...
95
96
	protected String paramName;

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
97

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
98
99
100
	/**
	 * Method constructor for the parameter field abstract class, which do all common action for all
	 * type of field, such as displaying the name of the parameter.
1e543ea0   Nathanael Jourdane   Code clean-up
101
	 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
102
103
104
	 * @param mainView The main view of the application.
	 * @param paramName The name of the parameter.
	 */
0f1bce56   Nathanael Jourdane   Use a listerner i...
105
	public ParamField(ViewListener viewListener, String paramName) {
eb483599   Nathanael Jourdane   Add missing Param...
106
		super();
5af53be7   Nathanael Jourdane   Make the applicat...
107

0f1bce56   Nathanael Jourdane   Use a listerner i...
108
		this.viewListener = viewListener;
5af53be7   Nathanael Jourdane   Make the applicat...
109
110
		this.paramName = paramName;

4ce406a8   Nathanael Jourdane   Add build() class...
111
		buildParamField();
4ce406a8   Nathanael Jourdane   Add build() class...
112
113
114
	}

	private void buildParamField() {
1e543ea0   Nathanael Jourdane   Code clean-up
115
		setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
4ce406a8   Nathanael Jourdane   Add build() class...
116

1e543ea0   Nathanael Jourdane   Code clean-up
117
		setMaximumSize(new Dimension(ParamField.MAX_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
4ce406a8   Nathanael Jourdane   Add build() class...
118

eb483599   Nathanael Jourdane   Add missing Param...
119
120
		String strLabel = paramName.replaceAll("_", " ").trim();
		JLabel label = new JLabel(strLabel.substring(0, 1).toUpperCase() + strLabel.substring(1));
1e543ea0   Nathanael Jourdane   Code clean-up
121
		label.setPreferredSize(new Dimension(ParamField.LABEL_WIDTH, ParamField.FIELD_HEIGHT));
4ce406a8   Nathanael Jourdane   Add build() class...
122

eb483599   Nathanael Jourdane   Add missing Param...
123
		this.add(label);
eb483599   Nathanael Jourdane   Add missing Param...
124
125
	}

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
126

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
127
128
129
	/**
	 * The string field is used for parameter with a `String` class. It is a simple JTextField with
	 * no verification. The parameter is sent to the controller each time it is modified.
1e543ea0   Nathanael Jourdane   Code clean-up
130
	 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
131
132
	 * @author N. Jourdane
	 */
e97b40e8   Nathanael Jourdane   Make ParamField c...
133
	public static class StringField extends ParamField implements TextFieldListener {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
134

1e543ea0   Nathanael Jourdane   Code clean-up
135
136
137
		/** The serial version UID. */
		private static final long serialVersionUID = 1L;

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
138
		/** The JTextField used to put the parameter value. */
667dd80c   Nathanael Jourdane   JTextField as Par...
139
140
		JTextField field;

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
141

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
142
143
		/**
		 * Method constructor for the string field.
1e543ea0   Nathanael Jourdane   Code clean-up
144
		 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
145
146
147
		 * @param mainView The main view of the application.
		 * @param paramName The name of the parameter.
		 */
0f1bce56   Nathanael Jourdane   Use a listerner i...
148
149
		public StringField(ViewListener viewListener, String paramName) {
			super(viewListener, paramName);
667dd80c   Nathanael Jourdane   JTextField as Par...
150
			field = new JTextField();
1e543ea0   Nathanael Jourdane   Code clean-up
151
			ParamField.addChangeListener(this, field);
eb483599   Nathanael Jourdane   Add missing Param...
152
153
154
			this.add(field);
		}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
155
156
157
		/**
		 * This method is called each time the field is modified.
		 */
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
158
159
		@Override
		public void update(JTextField textField) {
fe1e4470   Nathanael Jourdane   Minor code improv...
160
			if (textField.getText().isEmpty()) {
0f1bce56   Nathanael Jourdane   Use a listerner i...
161
				viewListener.onParameterChanged(paramName, null);
eb483599   Nathanael Jourdane   Add missing Param...
162
			} else {
0f1bce56   Nathanael Jourdane   Use a listerner i...
163
				viewListener.onParameterChanged(paramName, textField.getText());
eb483599   Nathanael Jourdane   Add missing Param...
164
165
166
167
			}
		}
	}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
168
169
170
171
	/**
	 * The float field is used for parameter with a `Float` class. It is a JTextField which checks
	 * if the content is a valid float. If the parameter is valid or if it is empty, then the float
	 * value is sent to the controller.
1e543ea0   Nathanael Jourdane   Code clean-up
172
	 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
173
174
	 * @author N. Jourdane
	 */
e97b40e8   Nathanael Jourdane   Make ParamField c...
175
	public static class FloatField extends ParamField implements TextFieldListener {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
176

1e543ea0   Nathanael Jourdane   Code clean-up
177
178
179
		/** The serial version UID. */
		private static final long serialVersionUID = 1L;

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
180
		/** The JTextField used to put the parameter value. */
667dd80c   Nathanael Jourdane   JTextField as Par...
181
182
		JTextField field;

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
183

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
184
185
		/**
		 * Method constructor
1e543ea0   Nathanael Jourdane   Code clean-up
186
		 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
187
188
189
		 * @param mainView The main view of the application.
		 * @param paramName The name of the parameter.
		 */
0f1bce56   Nathanael Jourdane   Use a listerner i...
190
191
		public FloatField(ViewListener viewListener, String paramName) {
			super(viewListener, paramName);
667dd80c   Nathanael Jourdane   JTextField as Par...
192
			field = new JTextField();
1e543ea0   Nathanael Jourdane   Code clean-up
193
			ParamField.addChangeListener(this, field);
eb483599   Nathanael Jourdane   Add missing Param...
194
195
196
			this.add(field);
		}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
197
198
199
		/**
		 * This method is called each time the field is modified.
		 */
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
200
201
		@Override
		public void update(JTextField textField) {
fe1e4470   Nathanael Jourdane   Minor code improv...
202
			if (textField.getText().isEmpty()) {
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
203
				textField.setBackground(Color.WHITE);
0f1bce56   Nathanael Jourdane   Use a listerner i...
204
				viewListener.onParameterRemoved(paramName);
eb483599   Nathanael Jourdane   Add missing Param...
205
206
			} else {
				try {
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
207
					float value = Float.parseFloat(textField.getText());
0f1bce56   Nathanael Jourdane   Use a listerner i...
208
					viewListener.onParameterChanged(paramName, value);
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
209
210
211
					textField.setBackground(Color.WHITE);
				} catch (@SuppressWarnings("unused") NumberFormatException e) {
					textField.setBackground(Color.PINK);
eb483599   Nathanael Jourdane   Add missing Param...
212
213
214
215
216
				}
			}
		}
	}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
217
218
219
220
221
	/**
	 * The date range field is used for couples of parameter with both a `Date` type (actually only
	 * `time_min` and `time_max` parameters is concerned for now). These are JTextFields which check
	 * if the content is a valid date, according to DATE_FORMAT. If the parameter is valid or if it
	 * is empty, then the dates value are sent to the controller, in Julian Day format.
1e543ea0   Nathanael Jourdane   Code clean-up
222
	 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
223
224
	 * @author N. Jourdane
	 */
e97b40e8   Nathanael Jourdane   Make ParamField c...
225
	public static class DateRangeField extends ParamField implements TextFieldListener {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
226

1e543ea0   Nathanael Jourdane   Code clean-up
227
228
229
		/** The serial version UID. */
		private static final long serialVersionUID = 1L;

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
230
		/** The JTextField used to put the parameter minimum value of the range. */
667dd80c   Nathanael Jourdane   JTextField as Par...
231
		JTextField fieldMin;
1e543ea0   Nathanael Jourdane   Code clean-up
232

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
233
		/** The JTextField used to put the parameter maximum value of the range. */
667dd80c   Nathanael Jourdane   JTextField as Par...
234
235
		JTextField fieldMax;

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
236

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
237
238
		/**
		 * Method constructor
1e543ea0   Nathanael Jourdane   Code clean-up
239
		 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
240
241
242
		 * @param mainView The main view of the application.
		 * @param paramName The name of the parameter.
		 */
0f1bce56   Nathanael Jourdane   Use a listerner i...
243
244
		public DateRangeField(ViewListener viewListener, String paramName) {
			super(viewListener, paramName);
68ae1315   Nathanael Jourdane   Improve GUI appar...
245
			this.add(new JLabel("min "));
667dd80c   Nathanael Jourdane   JTextField as Par...
246
			fieldMin = new JTextField();
1e543ea0   Nathanael Jourdane   Code clean-up
247
248
249
250
			fieldMin.setName(ParamField.MIN_SUFFIX);
			fieldMin.setPreferredSize(
					new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
			ParamField.addChangeListener(this, fieldMin);
eb483599   Nathanael Jourdane   Add missing Param...
251
252
			this.add(fieldMin);

68ae1315   Nathanael Jourdane   Improve GUI appar...
253
			this.add(new JLabel("max "));
667dd80c   Nathanael Jourdane   JTextField as Par...
254
			fieldMax = new JTextField();
1e543ea0   Nathanael Jourdane   Code clean-up
255
256
257
258
			fieldMax.setName(ParamField.MAX_SUFFIX);
			fieldMax.setPreferredSize(
					new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
			ParamField.addChangeListener(this, fieldMin);
eb483599   Nathanael Jourdane   Add missing Param...
259
260
261
			this.add(fieldMax);
		}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
262
263
264
		/**
		 * This method is called each time the field is modified.
		 */
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
265
		@Override
e97b40e8   Nathanael Jourdane   Make ParamField c...
266
		public void update(JTextField field) {
1e543ea0   Nathanael Jourdane   Code clean-up
267
			DateFormat df = new SimpleDateFormat(ParamField.DATE_FORMAT, Locale.ENGLISH);
fe1e4470   Nathanael Jourdane   Minor code improv...
268
			if (field.getText().isEmpty()) {
eb483599   Nathanael Jourdane   Add missing Param...
269
				field.setBackground(Color.WHITE);
0f1bce56   Nathanael Jourdane   Use a listerner i...
270
				viewListener.onParameterRemoved(paramName + field.getName());
1e543ea0   Nathanael Jourdane   Code clean-up
271
			} else if (field.getText().matches(ParamField.DATE_REGEX)) {
eb483599   Nathanael Jourdane   Add missing Param...
272
273
				try {
					long date = df.parse(field.getText()).getTime();
1e543ea0   Nathanael Jourdane   Code clean-up
274
					date = Math.round(date / 86400000.0 + 2440587.5); // to JD
0f1bce56   Nathanael Jourdane   Use a listerner i...
275
276
					viewListener.onParameterChanged(paramName + field.getName(),
							date);
eb483599   Nathanael Jourdane   Add missing Param...
277
					field.setBackground(Color.WHITE);
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
278
				} catch (@SuppressWarnings("unused") ParseException e) {
eb483599   Nathanael Jourdane   Add missing Param...
279
280
281
282
283
284
285
286
287
					field.setBackground(Color.PINK);
				}
				// TODO: check if date min < date max
			} else {
				field.setBackground(Color.PINK);
			}
		}
	}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
288
289
290
291
	/**
	 * The float range field is used for couples of parameter with both a `Float` class. These are
	 * JTextFields which check if the content is a valid float. If the parameter is valid or if it
	 * is empty, then the float value are sent to the controller.
1e543ea0   Nathanael Jourdane   Code clean-up
292
	 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
293
294
	 * @author N. Jourdane
	 */
e97b40e8   Nathanael Jourdane   Make ParamField c...
295
	public static class FloatRangeField extends ParamField implements TextFieldListener {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
296

1e543ea0   Nathanael Jourdane   Code clean-up
297
298
299
		/** The serial version UID. */
		private static final long serialVersionUID = 1L;

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
300
		/** The JTextField used to put the parameter minimum value of the range. */
41133475   Nathanael Jourdane   build floatRangeF...
301
		JTextField fieldMin;
1e543ea0   Nathanael Jourdane   Code clean-up
302

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
303
		/** The JTextField used to put the parameter maximum value of the range. */
41133475   Nathanael Jourdane   build floatRangeF...
304
		JTextField fieldMax;
eb483599   Nathanael Jourdane   Add missing Param...
305

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
306

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
307
308
		/**
		 * Method constructor
1e543ea0   Nathanael Jourdane   Code clean-up
309
		 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
310
311
312
		 * @param mainView The main view of the application.
		 * @param paramName The name of the parameter.
		 */
0f1bce56   Nathanael Jourdane   Use a listerner i...
313
314
		public FloatRangeField(ViewListener viewListener, String paramName) {
			super(viewListener, paramName);
41133475   Nathanael Jourdane   build floatRangeF...
315
			fieldMin = new JTextField();
1e543ea0   Nathanael Jourdane   Code clean-up
316
317
			fieldMin.setName(ParamField.MIN_SUFFIX);
			ParamField.addChangeListener(this, fieldMin);
eb483599   Nathanael Jourdane   Add missing Param...
318
319
			this.add(fieldMin);

41133475   Nathanael Jourdane   build floatRangeF...
320
			fieldMax = new JTextField();
1e543ea0   Nathanael Jourdane   Code clean-up
321
322
			fieldMax.setName(ParamField.MAX_SUFFIX);
			ParamField.addChangeListener(this, fieldMax);
eb483599   Nathanael Jourdane   Add missing Param...
323
324
			this.add(fieldMax);
		}
41133475   Nathanael Jourdane   build floatRangeF...
325

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
326
327
328
		/**
		 * This method is called each time the field is modified.
		 */
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
329
		@Override
e97b40e8   Nathanael Jourdane   Make ParamField c...
330
		public void update(JTextField field) {
fe1e4470   Nathanael Jourdane   Minor code improv...
331
			if (field.getText().isEmpty()) {
41133475   Nathanael Jourdane   build floatRangeF...
332
				field.setBackground(Color.WHITE);
0f1bce56   Nathanael Jourdane   Use a listerner i...
333
				viewListener.onParameterRemoved(paramName + field.getName());
41133475   Nathanael Jourdane   build floatRangeF...
334
335
			} else {
				try {
0f1bce56   Nathanael Jourdane   Use a listerner i...
336
					viewListener.onParameterChanged(paramName + field.getName(),
e97b40e8   Nathanael Jourdane   Make ParamField c...
337
							Float.parseFloat(field.getText()));
41133475   Nathanael Jourdane   build floatRangeF...
338
					field.setBackground(Color.WHITE);
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
339
				} catch (@SuppressWarnings("unused") NumberFormatException e) {
41133475   Nathanael Jourdane   build floatRangeF...
340
341
342
343
					field.setBackground(Color.PINK);
				}
			}
		}
eb483599   Nathanael Jourdane   Add missing Param...
344
345
	}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
346
347
348
349
350
	/**
	 * The target name field is used only for the `target_name` parameter. It is a ComboBox which is
	 * automatically filled with actual target names which begins by the entered characters, by
	 * asking to an online resolver (RESOLVER_URL). The parameter is sent to the controller each
	 * time it is updated, so it is possible to enter a parameter that the resolver do not know.
1e543ea0   Nathanael Jourdane   Code clean-up
351
	 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
352
353
	 * @author N. Jourdane
	 */
e97b40e8   Nathanael Jourdane   Make ParamField c...
354
	public static class TargetNameField extends ParamField implements TextFieldListener {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
355

1e543ea0   Nathanael Jourdane   Code clean-up
356
357
358
		/** The serial version UID. */
		private static final long serialVersionUID = 1L;

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
359
		/** The comboBox to enter the target_name and display target name propositions. */
f00cb6bb   Nathanael Jourdane   Add a JComboBox f...
360
		JComboBox<String> comboBox;
1e543ea0   Nathanael Jourdane   Code clean-up
361

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
362
		/** The JTextField related to the ComboBox, allowing to listen for text content update. */
667dd80c   Nathanael Jourdane   JTextField as Par...
363
		JTextField field;
1e543ea0   Nathanael Jourdane   Code clean-up
364

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
365
366
367
368
369
		/**
		 * The content of the last entered value. It is used to avoid recursions, because each time
		 * an update event is detected, the resolver is called and the ComboBox is filled with new
		 * values, which trigger a new event.
		 */
f00cb6bb   Nathanael Jourdane   Add a JComboBox f...
370
		String lastContent;
667dd80c   Nathanael Jourdane   JTextField as Par...
371

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
372
		/**
4268557f   Nathanael Jourdane   Fix some Sonar is...
373
374
375
376
		 * This method is called each time the field is modified. A Runnable is used it is
		 * impossible to modify the comboBox from a DocumentEvent.
		 */
		Runnable updateComboBox = new Runnable() {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
377

4268557f   Nathanael Jourdane   Fix some Sonar is...
378
379
380
381
382
383
384
385
			@Override
			public void run() {
				String content = field.getText();
				if (!content.equals(lastContent)) {
					if (content.length() >= 2) {
						lastContent = content;
						comboBox.removeAllItems();
						try {
1e543ea0   Nathanael Jourdane   Code clean-up
386
							for (String s : TargetNameField.getItems(content)) {
4268557f   Nathanael Jourdane   Fix some Sonar is...
387
388
389
								comboBox.addItem(s);
							}
						} catch (CantSendQueryException e) {
1e543ea0   Nathanael Jourdane   Code clean-up
390
391
							ParamField.logger.log(Level.WARNING,
									"Can't get table names for the resolver", e);
4268557f   Nathanael Jourdane   Fix some Sonar is...
392
393
394
						}
						comboBox.getEditor().setItem(content);
					}
fe1e4470   Nathanael Jourdane   Minor code improv...
395
					if (content.isEmpty()) {
0f1bce56   Nathanael Jourdane   Use a listerner i...
396
						viewListener.onParameterRemoved(paramName);
4268557f   Nathanael Jourdane   Fix some Sonar is...
397
					} else {
0f1bce56   Nathanael Jourdane   Use a listerner i...
398
						viewListener.onParameterChanged(paramName, content);
4268557f   Nathanael Jourdane   Fix some Sonar is...
399
400
401
402
403
					}
				}
			}
		};

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
404

4268557f   Nathanael Jourdane   Fix some Sonar is...
405
		/**
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
406
		 * Method constructor
1e543ea0   Nathanael Jourdane   Code clean-up
407
		 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
408
409
410
		 * @param mainView The main view of the application.
		 * @param paramName The name of the parameter.
		 */
0f1bce56   Nathanael Jourdane   Use a listerner i...
411
412
		public TargetNameField(ViewListener viewListener, String paramName) {
			super(viewListener, paramName);
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
413
			comboBox = new JComboBox<>();
1e543ea0   Nathanael Jourdane   Code clean-up
414
415
			comboBox.setPreferredSize(
					new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
68ae1315   Nathanael Jourdane   Improve GUI appar...
416

f00cb6bb   Nathanael Jourdane   Add a JComboBox f...
417
418
			comboBox.setEditable(true);
			field = (JTextField) comboBox.getEditor().getEditorComponent();
1e543ea0   Nathanael Jourdane   Code clean-up
419
			ParamField.addChangeListener(this, field);
f00cb6bb   Nathanael Jourdane   Add a JComboBox f...
420
421
422
			this.add(comboBox);
		}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
423
424
		/**
		 * The method used to get target names propositions by asking to the resolver.
1e543ea0   Nathanael Jourdane   Code clean-up
425
		 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
426
427
		 * @param begining The beginning of the target_name.
		 * @return An array of Strings corresponding to the target names got.
d3a65e87   Nathanael Jourdane   Improve Javadoc.
428
		 * @throws CantSendQueryException If the resolver do not work.
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
429
		 */
d3a65e87   Nathanael Jourdane   Improve Javadoc.
430
		static String[] getItems(String begining) throws CantSendQueryException {
4268557f   Nathanael Jourdane   Fix some Sonar is...
431
			StringBuilder resolverResult;
1e543ea0   Nathanael Jourdane   Code clean-up
432
433
			resolverResult = VOTableConnection.sendGet(ParamField.RESOLVER_URL,
					"q=\"" + begining + "\"");
05b140ed   Nathanael Jourdane   TargetNameField J...
434
435
436
437
438
439
440
			JsonObject root = new JsonParser().parse(resolverResult.toString()).getAsJsonObject();
			int count = Integer.parseInt(root.get("count").toString());
			String[] targetNames = new String[count];
			JsonArray hits = root.getAsJsonArray("hits");
			for (int i = 0; i < count; i++) {
				JsonObject elmt = hits.get(i).getAsJsonObject();
				targetNames[i] = elmt.get("name").toString().replace("\"", "");
05b140ed   Nathanael Jourdane   TargetNameField J...
441
			}
f00cb6bb   Nathanael Jourdane   Add a JComboBox f...
442
			return targetNames;
eb483599   Nathanael Jourdane   Add missing Param...
443
444
		}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
445
		/**
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
446
447
		 * This method is called each time the field is modified.
		 */
53d49e83   Nathanael Jourdane   Fix all Eclipse w...
448
449
		@Override
		public void update(JTextField textField) {
3d80f3c3   Nathanael Jourdane   bugFix: targetNam...
450
			SwingUtilities.invokeLater(updateComboBox);
eb483599   Nathanael Jourdane   Add missing Param...
451
452
453
		}
	}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
454
455
456
457
458
459
	/**
	 * The data product type field is used only for the `dataproduct_type` parameter. It is a
	 * ComboBox filled with a list of static data product types (see
	 * https://voparis-confluence.obspm.fr/display/VES/4+-+EPN-TAP+queries#id-4-EPN-TAPqueries-
	 * __RefHeading__35_312326667_Toc3037660444.2.4DataProductType). The parameter is sent to the
	 * controller each time it is updated.
1e543ea0   Nathanael Jourdane   Code clean-up
460
	 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
461
462
	 * @author N. Jourdane
	 */
eb483599   Nathanael Jourdane   Add missing Param...
463
	public static class DataProductTypeField extends ParamField {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
464

1e543ea0   Nathanael Jourdane   Code clean-up
465
466
467
		/** The serial version UID. */
		private static final long serialVersionUID = 1L;

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
468
		/** The comboBox used to select the data product type. */
77184f22   Nathanael Jourdane   Use enums for Dat...
469
470
		JComboBox<DataProductType> comboBox;

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
471

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
472
473
474
475
		/**
		 * An enumeration of all available data product types. Each values comes with an id because
		 * EPN-TAP table can possibly be filled with the id instead of the name, so the query have
		 * to ask for both of them.
1e543ea0   Nathanael Jourdane   Code clean-up
476
		 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
477
478
479
		 * @author N. Jourdane
		 */
		@SuppressWarnings("javadoc")
77184f22   Nathanael Jourdane   Use enums for Dat...
480
481
		enum DataProductType {
			// @noformat
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
482
483
484
485
			ALL("All", "all"),            IM("Image", "im"),         SP("Spectrum", "sp"),
			DS("Dynamic spectrum", "ds"), SC("Spectral cube", "sc"), PR("Profile", "pr"),
			VO("Volume", "vo"),           MO("Movie", "mo"),         CU("Cube", "cu"),
			TS("Time series", "ts"),      CA("Catalog", "ca"),       SV("Spatial vector", "sv");
77184f22   Nathanael Jourdane   Use enums for Dat...
486
487
			// @format

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
488
			/** The full name of the data product type, such as `Dynamic spectrum`. */
77184f22   Nathanael Jourdane   Use enums for Dat...
489
			private String name = "";
1e543ea0   Nathanael Jourdane   Code clean-up
490

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
491
			/** The id of the data product type, such as `ds`. */
77184f22   Nathanael Jourdane   Use enums for Dat...
492
493
			private String id = "";

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
494

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
495
496
			/**
			 * Method constructor for the enumeration.
1e543ea0   Nathanael Jourdane   Code clean-up
497
			 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
498
499
500
501
			 * @param name The full name of the data product type, such as `Dynamic spectrum`.
			 * @param id The id of the data product type, such as `ds`.
			 */
			DataProductType(String name, String id) {
77184f22   Nathanael Jourdane   Use enums for Dat...
502
				this.name = name;
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
503
				this.id = id;
77184f22   Nathanael Jourdane   Use enums for Dat...
504
505
			}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
506
507
508
509
510
			/**
			 * @return A list of two strings, containing the name (formated for the query) and the
			 *         id, used in the query. A list is used instead of a array because the getQuery
			 *         function ( @see Queries) needs to know the parameter type.
			 */
77184f22   Nathanael Jourdane   Use enums for Dat...
511
512
513
514
515
516
517
518
519
520
521
522
			public List<String> query() {
				List<String> item = new ArrayList<>();
				item.add(name.replace(" ", "-").toLowerCase());
				item.add(id);
				return item;
			}

			@Override
			public String toString() {
				return name;
			}
		}
667dd80c   Nathanael Jourdane   JTextField as Par...
523

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
524

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
525
526
		/**
		 * Method constructor
1e543ea0   Nathanael Jourdane   Code clean-up
527
		 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
528
529
530
		 * @param mainView The main view of the application.
		 * @param paramName The name of the parameter.
		 */
0f1bce56   Nathanael Jourdane   Use a listerner i...
531
532
		public DataProductTypeField(ViewListener viewListener, String paramName) {
			super(viewListener, paramName);
77184f22   Nathanael Jourdane   Use enums for Dat...
533
534
			comboBox = new JComboBox<>(DataProductType.values());
			comboBox.setSelectedItem(DataProductType.ALL);
1e543ea0   Nathanael Jourdane   Code clean-up
535
536
			comboBox.setPreferredSize(
					new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
a99d92fa   Nathanael Jourdane   Add JComboBox for...
537
			comboBox.addActionListener(new ActionListener() {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
538

a99d92fa   Nathanael Jourdane   Add JComboBox for...
539
540
				@Override
				public void actionPerformed(ActionEvent e) {
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
541
					update();
a99d92fa   Nathanael Jourdane   Add JComboBox for...
542
543
544
545
546
				}
			});
			this.add(comboBox);
		}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
547
548
549
550
		/**
		 * This method is called each time the field is modified.
		 */
		void update() {
77184f22   Nathanael Jourdane   Use enums for Dat...
551
552
			DataProductType item = (DataProductType) comboBox.getSelectedItem();
			if (DataProductType.ALL.equals(item)) {
0f1bce56   Nathanael Jourdane   Use a listerner i...
553
				viewListener.onParameterRemoved(paramName);
5af53be7   Nathanael Jourdane   Make the applicat...
554
			} else {
0f1bce56   Nathanael Jourdane   Use a listerner i...
555
				viewListener.onParameterChanged(paramName, item.query());
5af53be7   Nathanael Jourdane   Make the applicat...
556
			}
eb483599   Nathanael Jourdane   Add missing Param...
557
558
559
		}
	}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
560
561
562
563
564
565
	/**
	 * The target class field is used only for the `target_class` parameter. It is a ComboBox filled
	 * with a list of static target classes (see
	 * https://voparis-confluence.obspm.fr/display/VES/4+-+EPN-TAP+queries#id-4-EPN-TAPqueries-
	 * __RefHeading__39_312326667_Toc3037660464.2.6TargetClass). The parameter is sent to the
	 * controller each time it is updated.
1e543ea0   Nathanael Jourdane   Code clean-up
566
	 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
567
568
	 * @author N. Jourdane
	 */
eb483599   Nathanael Jourdane   Add missing Param...
569
	public static class TargetClassField extends ParamField {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
570

1e543ea0   Nathanael Jourdane   Code clean-up
571
572
		/** The serial version UID. */
		private static final long serialVersionUID = 1L;
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
573
574

		/** The comboBox used to select the target class. */
77184f22   Nathanael Jourdane   Use enums for Dat...
575
576
		JComboBox<TargetClass> comboBox;

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
577

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
578
579
		/**
		 * An enumeration of all available target classes.
1e543ea0   Nathanael Jourdane   Code clean-up
580
		 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
581
582
583
		 * @author N. Jourdane
		 */
		@SuppressWarnings("javadoc")
77184f22   Nathanael Jourdane   Use enums for Dat...
584
585
		enum TargetClass {
			// @noformat
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
586
587
588
			ALL("All"),        COMET("Comet"),   EXOPLANET("Exoplanet"),    RING("Ring"),
			SAMPLE("Sample"),  SKY("Sky"),       SPACECRAFT("Spacecraft"),  SPACEJUNK("Spacejunk"),
			STAR("Star"),      INTERPLANETARY_MEDIUM("Interplanetary medium");
77184f22   Nathanael Jourdane   Use enums for Dat...
589
590
			// @format

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
591
			/** The name of the target class. */
77184f22   Nathanael Jourdane   Use enums for Dat...
592
593
			String name;

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
594

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
595
596
			/**
			 * Method constructor for the enumeration.
1e543ea0   Nathanael Jourdane   Code clean-up
597
			 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
598
599
			 * @param name The name of the target class.
			 */
77184f22   Nathanael Jourdane   Use enums for Dat...
600
601
602
603
			TargetClass(String name) {
				this.name = name;
			}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
604
605
606
			/**
			 * @return The name formated for the query.
			 */
77184f22   Nathanael Jourdane   Use enums for Dat...
607
608
609
610
			String query() {
				return name.replace(" ", "_").toLowerCase();
			}
		}
667dd80c   Nathanael Jourdane   JTextField as Par...
611

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
612

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
613
614
		/**
		 * Method constructor
1e543ea0   Nathanael Jourdane   Code clean-up
615
		 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
616
617
618
		 * @param mainView The main view of the application.
		 * @param paramName The name of the parameter.
		 */
0f1bce56   Nathanael Jourdane   Use a listerner i...
619
620
		public TargetClassField(ViewListener viewListener, String paramName) {
			super(viewListener, paramName);
77184f22   Nathanael Jourdane   Use enums for Dat...
621
			comboBox = new JComboBox<>(TargetClass.values());
1e543ea0   Nathanael Jourdane   Code clean-up
622
623
			comboBox.setPreferredSize(
					new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
a99d92fa   Nathanael Jourdane   Add JComboBox for...
624
			comboBox.addActionListener(new ActionListener() {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
625

a99d92fa   Nathanael Jourdane   Add JComboBox for...
626
627
				@Override
				public void actionPerformed(ActionEvent e) {
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
628
					update();
a99d92fa   Nathanael Jourdane   Add JComboBox for...
629
630
631
632
633
				}
			});
			this.add(comboBox);
		}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
634
635
636
637
		/**
		 * This method is called each time the field is modified.
		 */
		void update() {
77184f22   Nathanael Jourdane   Use enums for Dat...
638
639
			TargetClass value = (TargetClass) comboBox.getSelectedItem();
			if (TargetClass.ALL.equals(value)) {
0f1bce56   Nathanael Jourdane   Use a listerner i...
640
				viewListener.onParameterRemoved(paramName);
5af53be7   Nathanael Jourdane   Make the applicat...
641
			} else {
0f1bce56   Nathanael Jourdane   Use a listerner i...
642
				viewListener.onParameterChanged(paramName, value.query());
5af53be7   Nathanael Jourdane   Make the applicat...
643
			}
eb483599   Nathanael Jourdane   Add missing Param...
644
645
646
		}
	}

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
647
648
649
650
	/**
	 * The listener of text field, it aims to provide a simple way to listen a text field without to
	 * override removeUpdate(DocumentEvent de), insertUpdate(DocumentEvent de) and
	 * changedUpdate(DocumentEvent de) on each field to listen.
1e543ea0   Nathanael Jourdane   Code clean-up
651
	 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
652
653
	 * @author N. Jourdane
	 */
e97b40e8   Nathanael Jourdane   Make ParamField c...
654
	interface TextFieldListener {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
655

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
656
657
		/**
		 * When the content of the JTextField is updated.
1e543ea0   Nathanael Jourdane   Code clean-up
658
		 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
659
660
661
		 * @param field The JTextField. Is useful for classes containing several text fields, such
		 *            as DateRangeField, to know which one triggered the event.
		 */
e97b40e8   Nathanael Jourdane   Make ParamField c...
662
663
		void update(JTextField field);
	}
eb483599   Nathanael Jourdane   Add missing Param...
664

aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
665

b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
666
667
	/**
	 * To add the listener. @see TextFieldListener
1e543ea0   Nathanael Jourdane   Code clean-up
668
	 *
b6b4fb3e   Nathanael Jourdane   Add Javadoc for P...
669
670
671
	 * @param changeListener The listener of text fields.
	 * @param field The field to listen.
	 */
42819b99   Nathanael Jourdane   Make EpnTAPClient...
672
	static void addChangeListener(final TextFieldListener changeListener, final JTextField field) {
e97b40e8   Nathanael Jourdane   Make ParamField c...
673
		field.getDocument().addDocumentListener(new DocumentListener() {
aa2a59ba   Nathanael Jourdane   [coding style] 2 ...
674

53d49e83   Nathanael Jourdane   Fix all Eclipse w...
675
			@Override
e97b40e8   Nathanael Jourdane   Make ParamField c...
676
677
			public void removeUpdate(DocumentEvent de) {
				changeListener.update(field);
eb483599   Nathanael Jourdane   Add missing Param...
678
679
			}

53d49e83   Nathanael Jourdane   Fix all Eclipse w...
680
			@Override
e97b40e8   Nathanael Jourdane   Make ParamField c...
681
682
			public void insertUpdate(DocumentEvent de) {
				changeListener.update(field);
eb483599   Nathanael Jourdane   Add missing Param...
683
684
			}

53d49e83   Nathanael Jourdane   Fix all Eclipse w...
685
			@Override
e97b40e8   Nathanael Jourdane   Make ParamField c...
686
687
			public void changedUpdate(DocumentEvent de) {
				changeListener.update(field);
eb483599   Nathanael Jourdane   Add missing Param...
688
			}
eb483599   Nathanael Jourdane   Add missing Param...
689
		});
eb483599   Nathanael Jourdane   Add missing Param...
690
691
	}
}