Commit 1e543ea07b22339f695ec0840d9527e62054a3db

Authored by Nathanael Jourdane
1 parent a8113866
Exists in master

Code clean-up

Showing 21 changed files with 263 additions and 219 deletions   Show diff stats
.settings/org.eclipse.jdt.core.prefs deleted
... ... @@ -1,8 +0,0 @@
1   -eclipse.preferences.version=1
2   -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3   -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4   -org.eclipse.jdt.core.compiler.compliance=1.7
5   -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6   -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7   -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
8   -org.eclipse.jdt.core.compiler.source=1.7
src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -25,7 +25,7 @@ import eu.omp.irap.vespa.epntapclient.controller.EpnTapController;
25 25  
26 26 /**
27 27 * Simple class to have a main function to launch the EPNTap client.
28   - *
  28 + *
29 29 * @author N. Jourdane
30 30 */
31 31 public class EpnTapMainApp {
... ... @@ -38,14 +38,14 @@ public class EpnTapMainApp {
38 38  
39 39 /**
40 40 * Main function to start the application as standalone.
41   - *
  41 + *
42 42 * @param args The program arguments (not used).
43 43 */
44 44 public static void main(final String[] args) {
45 45 SwingUtilities.invokeLater(new Runnable() {
46 46 @Override
47 47 public void run() {
48   - logger.info("Lauching EPN-TAP application...");
  48 + EpnTapMainApp.logger.info("Lauching EPN-TAP application...");
49 49 EpnTapController epnTapControl = new EpnTapController();
50 50 if (args.length != 0) {
51 51 System.console().writer().println("Usage: EpnTapMainApp");
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/controller/EpnTapController.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -31,7 +31,7 @@ import eu.omp.irap.vespa.epntapclient.votable.utils.Const;
31 31  
32 32 /**
33 33 * The main controller which manage views and controllers.
34   - *
  34 + *
35 35 * @author N. Jourdane
36 36 */
37 37 public class EpnTapController implements MainViewListener {
... ... @@ -94,7 +94,7 @@ public class EpnTapController implements MainViewListener {
94 94  
95 95 /**
96 96 * Update the row selected by the user on the Services Panel.
97   - *
  97 + *
98 98 * @param row The row selected by the user on the Jtable.
99 99 */
100 100 public void updateSelected(int row) {
... ... @@ -111,7 +111,7 @@ public class EpnTapController implements MainViewListener {
111 111  
112 112 /**
113 113 * Remove a query parameter from the parameters list.
114   - *
  114 + *
115 115 * @param paramName The name of the parameter as described in REG-TAP specifications.
116 116 */
117 117 public void removeParameter(String paramName) {
... ... @@ -122,7 +122,7 @@ public class EpnTapController implements MainViewListener {
122 122  
123 123 /**
124 124 * Update a query parameter in the parameter list.
125   - *
  125 + *
126 126 * @param paramName The name of the parameter as described in REG-TAP specifications.
127 127 * @param value The value of the parameter to update.
128 128 */
... ... @@ -142,7 +142,7 @@ public class EpnTapController implements MainViewListener {
142 142  
143 143 /**
144 144 * Send a query to the selected service on the services panel.
145   - *
  145 + *
146 146 * @param query The query to send to the selected service.
147 147 * @throws VOTableException Can not fill the Table
148 148 */
... ... @@ -153,7 +153,7 @@ public class EpnTapController implements MainViewListener {
153 153  
154 154 /**
155 155 * This methods is called each time a graphical event is detected from a view.
156   - *
  156 + *
157 157 * @param event The type of the detected event. @see Event
158 158 * @param args The possible arguments which comes with the event (ie. a row column).
159 159 */
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -25,7 +25,7 @@ import eu.omp.irap.vespa.epntapclient.votable.utils.Utils.StringJoiner;
25 25  
26 26 /**
27 27 * Defines the queries and the query patterns usually used in the application.
28   - *
  28 + *
29 29 * @author N. Jourdane
30 30 */
31 31 public final class Queries {
... ... @@ -54,7 +54,7 @@ public final class Queries {
54 54 /**
55 55 * The default query, with these parameters, respectively: max_rows, target_name, time_min,
56 56 * time_max, dataproduct_type, spectral_range_min, spectral_range_max.
57   - *
  57 + *
58 58 * @param nbRow The maximum number of rows returned.
59 59 * @param tableName The name of the target table for the query.
60 60 * @param params A map of parameters, for the `WHERE` keywords.
... ... @@ -67,8 +67,9 @@ public final class Queries {
67 67 StringJoiner orJoin = new StringJoiner(" OR ");
68 68 @SuppressWarnings("unchecked")
69 69 List<String> possibleValues = (List<String>) param.getValue();
70   - for (String possibleValue : possibleValues)
  70 + for (String possibleValue : possibleValues) {
71 71 orJoin.add(param.getKey() + " LIKE '" + possibleValue + "'");
  72 + }
72 73 addJoin.add("(" + orJoin + ")");
73 74 } else if (param.getValue() instanceof String) {
74 75 addJoin.add(param.getKey() + " LIKE '" + param.getValue() + "'");
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/Dim.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -18,7 +18,7 @@ package eu.omp.irap.vespa.epntapclient.view;
18 18  
19 19 /**
20 20 * A simple class containing GUI panel and elements dimensions.
21   - *
  21 + *
22 22 * @author N. Jourdane
23 23 */
24 24 public class Dim {
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -31,7 +31,7 @@ import eu.omp.irap.vespa.epntapclient.votable.view.VOTableView;
31 31  
32 32 /**
33 33 * The main view of the application, which manage all the other views.
34   - *
  34 + *
35 35 * @author N. Jourdane
36 36 */
37 37 public class EpnTapMainView extends JPanel {
... ... @@ -39,8 +39,8 @@ public class EpnTapMainView extends JPanel {
39 39 @SuppressWarnings("unused")
40 40 private static final Logger logger = Logger.getLogger(EpnTapMainView.class.getName());
41 41  
42   - /** The serial version UID (affected with a random number). */
43   - private static final long serialVersionUID = -1233290271099283814L;
  42 + /** The serial version UID. */
  43 + private static final long serialVersionUID = 1L;
44 44  
45 45 /** The JPanel where the VOTable results is displayed. */
46 46 private ResultsPanel resultsPanel;
... ... @@ -59,14 +59,14 @@ public class EpnTapMainView extends JPanel {
59 59  
60 60 /**
61 61 * The interface for the main view listener, which listen for events.
62   - *
  62 + *
63 63 * @author N. Jourdane
64 64 */
65 65 public interface MainViewListener {
66 66  
67 67 /**
68 68 * When an event is detected on the main view.
69   - *
  69 + *
70 70 * @param event The event type. @see Event
71 71 * @param args The possible arguments which comes with the event (ie. a row number).
72 72 */
... ... @@ -75,22 +75,22 @@ public class EpnTapMainView extends JPanel {
75 75  
76 76 /**
77 77 * The main view constructor, which create all the panels.
78   - *
  78 + *
79 79 * @param voTableServicesView The view to put in the services panel, built by ServicesController
80 80 * @param voTableResultsView The view to put in the results panel, built by ResultsController.
81 81 */
82 82  
83 83 public EpnTapMainView(VOTableView voTableServicesView, VOTableView voTableResultsView) {
84   - this.servicesPanel = new ServicesPanel(this, voTableServicesView);
85   - this.resultsPanel = new ResultsPanel(this, voTableResultsView);
86   - this.requestPanel = new RequestPanel(this);
87   - this.bottomBarPanel = new BottomBarPanel(this);
  84 + servicesPanel = new ServicesPanel(this, voTableServicesView);
  85 + resultsPanel = new ResultsPanel(this, voTableResultsView);
  86 + requestPanel = new RequestPanel(this);
  87 + bottomBarPanel = new BottomBarPanel(this);
88 88 buildWindow();
89 89 }
90 90  
91 91 /**
92 92 * Add a listener for the main view.
93   - *
  93 + *
94 94 * @param listener A MainViewListener.
95 95 */
96 96 public void addMainViewListener(MainViewListener listener) {
... ... @@ -152,7 +152,7 @@ public class EpnTapMainView extends JPanel {
152 152  
153 153 /**
154 154 * Get an event and send it to the listener of the main view.
155   - *
  155 + *
156 156 * @param event The event type. @see Event
157 157 * @param args The possible arguments which comes with the event (ie. a row number).
158 158 */
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/Event.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -50,45 +50,53 @@ import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSe
50 50 * is an abstract method and all type of parameter field should extend it. See
51 51 * https://voparis-confluence.obspm.fr/display/VES/4+-+EPN-TAP+queries to get all parameters
52 52 * details.
53   - *
  53 + *
54 54 * @author N. Jourdane
55 55 */
56 56 public abstract class ParamField extends JPanel {
57   - /** The serial version UID (affected with a random number). */
58   - private static final long serialVersionUID = 6025994164004985362L;
  57 + /** The serial version UID. */
  58 + private static final long serialVersionUID = 1L;
59 59  
60 60 /** The logger for the class ParamField. */
61 61 static final Logger logger = Logger.getLogger(ParamField.class.getName());
62 62  
63 63 /** The minimum width of the field. */
64 64 private static final int MIN_FIELD_WIDTH = 30;
  65 +
65 66 /** The preferred field height. */
66 67 private static final int FIELD_HEIGHT = 20;
  68 +
67 69 /** The maximum width of the field. */
68 70 private static final int MAX_FIELD_WIDTH = 400;
  71 +
69 72 /** The preferred label width. */
70 73 private static final int LABEL_WIDTH = 140;
71 74  
72 75 /** The URL of the resolver used for the `target name` field. */
73 76 private static final String RESOLVER_URL = "http://voparis-registry.obspm.fr/ssodnet/1/autocomplete";
  77 +
74 78 /** The date format used in the DateRange field */
75 79 private static final String DATE_FORMAT = "dd/MM/yyyy";
  80 +
76 81 /** The regex used to validate the Date fields */
77 82 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)$)";
  83 +
78 84 /** The suffix used in REG-TAP parameters names, indicating that it's a beginning of a range. */
79 85 private static final String MIN_SUFFIX = "min";
  86 +
80 87 /** The suffix used in REG-TAP parameters names, indicating that it is a end of a range. */
81 88 private static final String MAX_SUFFIX = "max";
82 89  
83 90 /** The main view of the application. */
84 91 protected EpnTapMainView mainView;
  92 +
85 93 /** The parameter name of the field */
86 94 protected String paramName;
87 95  
88 96 /**
89 97 * Method constructor for the parameter field abstract class, which do all common action for all
90 98 * type of field, such as displaying the name of the parameter.
91   - *
  99 + *
92 100 * @param mainView The main view of the application.
93 101 * @param paramName The name of the parameter.
94 102 */
... ... @@ -98,11 +106,11 @@ public abstract class ParamField extends JPanel {
98 106 this.mainView = mainView;
99 107 this.paramName = paramName;
100 108  
101   - this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
102   - this.setMaximumSize(new Dimension(MAX_FIELD_WIDTH, FIELD_HEIGHT));
  109 + setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
  110 + setMaximumSize(new Dimension(ParamField.MAX_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
103 111 String strLabel = paramName.replaceAll("_", " ").trim();
104 112 JLabel label = new JLabel(strLabel.substring(0, 1).toUpperCase() + strLabel.substring(1));
105   - label.setPreferredSize(new Dimension(LABEL_WIDTH, FIELD_HEIGHT));
  113 + label.setPreferredSize(new Dimension(ParamField.LABEL_WIDTH, ParamField.FIELD_HEIGHT));
106 114 this.add(label);
107 115 // TODO: Add tooltip text based on rr.table_column.column_description
108 116 }
... ... @@ -110,25 +118,26 @@ public abstract class ParamField extends JPanel {
110 118 /**
111 119 * The string field is used for parameter with a `String` class. It is a simple JTextField with
112 120 * no verification. The parameter is sent to the controller each time it is modified.
113   - *
  121 + *
114 122 * @author N. Jourdane
115 123 */
116 124 public static class StringField extends ParamField implements TextFieldListener {
117   - /** The serial version UID (affected with a random number). */
118   - private static final long serialVersionUID = 24219488975302068L;
  125 + /** The serial version UID. */
  126 + private static final long serialVersionUID = 1L;
  127 +
119 128 /** The JTextField used to put the parameter value. */
120 129 JTextField field;
121 130  
122 131 /**
123 132 * Method constructor for the string field.
124   - *
  133 + *
125 134 * @param mainView The main view of the application.
126 135 * @param paramName The name of the parameter.
127 136 */
128 137 public StringField(EpnTapMainView mainView, String paramName) {
129 138 super(mainView, paramName);
130 139 field = new JTextField();
131   - addChangeListener(this, field);
  140 + ParamField.addChangeListener(this, field);
132 141 this.add(field);
133 142 }
134 143  
... ... @@ -149,25 +158,26 @@ public abstract class ParamField extends JPanel {
149 158 * The float field is used for parameter with a `Float` class. It is a JTextField which checks
150 159 * if the content is a valid float. If the parameter is valid or if it is empty, then the float
151 160 * value is sent to the controller.
152   - *
  161 + *
153 162 * @author N. Jourdane
154 163 */
155 164 public static class FloatField extends ParamField implements TextFieldListener {
156   - /** The serial version UID (affected with a random number). */
157   - private static final long serialVersionUID = -1880193152285564590L;
  165 + /** The serial version UID. */
  166 + private static final long serialVersionUID = 1L;
  167 +
158 168 /** The JTextField used to put the parameter value. */
159 169 JTextField field;
160 170  
161 171 /**
162 172 * Method constructor
163   - *
  173 + *
164 174 * @param mainView The main view of the application.
165 175 * @param paramName The name of the parameter.
166 176 */
167 177 public FloatField(EpnTapMainView mainView, String paramName) {
168 178 super(mainView, paramName);
169 179 field = new JTextField();
170   - addChangeListener(this, field);
  180 + ParamField.addChangeListener(this, field);
171 181 this.add(field);
172 182 }
173 183  
... ... @@ -196,20 +206,22 @@ public abstract class ParamField extends JPanel {
196 206 * `time_min` and `time_max` parameters is concerned for now). These are JTextFields which check
197 207 * if the content is a valid date, according to DATE_FORMAT. If the parameter is valid or if it
198 208 * is empty, then the dates value are sent to the controller, in Julian Day format.
199   - *
  209 + *
200 210 * @author N. Jourdane
201 211 */
202 212 public static class DateRangeField extends ParamField implements TextFieldListener {
203   - /** The serial version UID (affected with a random number). */
204   - private static final long serialVersionUID = -7781309003911514777L;
  213 + /** The serial version UID. */
  214 + private static final long serialVersionUID = 1L;
  215 +
205 216 /** The JTextField used to put the parameter minimum value of the range. */
206 217 JTextField fieldMin;
  218 +
207 219 /** The JTextField used to put the parameter maximum value of the range. */
208 220 JTextField fieldMax;
209 221  
210 222 /**
211 223 * Method constructor
212   - *
  224 + *
213 225 * @param mainView The main view of the application.
214 226 * @param paramName The name of the parameter.
215 227 */
... ... @@ -217,16 +229,18 @@ public abstract class ParamField extends JPanel {
217 229 super(mainView, paramName);
218 230 this.add(new JLabel("min "));
219 231 fieldMin = new JTextField();
220   - fieldMin.setName(MIN_SUFFIX);
221   - fieldMin.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT));
222   - addChangeListener(this, fieldMin);
  232 + fieldMin.setName(ParamField.MIN_SUFFIX);
  233 + fieldMin.setPreferredSize(
  234 + new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
  235 + ParamField.addChangeListener(this, fieldMin);
223 236 this.add(fieldMin);
224 237  
225 238 this.add(new JLabel("max "));
226 239 fieldMax = new JTextField();
227   - fieldMax.setName(MAX_SUFFIX);
228   - fieldMax.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT));
229   - addChangeListener(this, fieldMin);
  240 + fieldMax.setName(ParamField.MAX_SUFFIX);
  241 + fieldMax.setPreferredSize(
  242 + new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
  243 + ParamField.addChangeListener(this, fieldMin);
230 244 this.add(fieldMax);
231 245 }
232 246  
... ... @@ -235,14 +249,14 @@ public abstract class ParamField extends JPanel {
235 249 */
236 250 @Override
237 251 public void update(JTextField field) {
238   - DateFormat df = new SimpleDateFormat(DATE_FORMAT, Locale.ENGLISH);
  252 + DateFormat df = new SimpleDateFormat(ParamField.DATE_FORMAT, Locale.ENGLISH);
239 253 if ("".equals(field.getText())) {
240 254 field.setBackground(Color.WHITE);
241 255 mainView.event(Event.PARAMETER_REMOVED, paramName + field.getName());
242   - } else if (field.getText().matches(DATE_REGEX)) {
  256 + } else if (field.getText().matches(ParamField.DATE_REGEX)) {
243 257 try {
244 258 long date = df.parse(field.getText()).getTime();
245   - date = Math.round((date / 86400000.0) + 2440587.5); // to JD
  259 + date = Math.round(date / 86400000.0 + 2440587.5); // to JD
246 260 mainView.event(Event.PARAMETER_CHANGED, paramName + field.getName(), date);
247 261 field.setBackground(Color.WHITE);
248 262 } catch (@SuppressWarnings("unused") ParseException e) {
... ... @@ -259,33 +273,35 @@ public abstract class ParamField extends JPanel {
259 273 * The float range field is used for couples of parameter with both a `Float` class. These are
260 274 * JTextFields which check if the content is a valid float. If the parameter is valid or if it
261 275 * is empty, then the float value are sent to the controller.
262   - *
  276 + *
263 277 * @author N. Jourdane
264 278 */
265 279 public static class FloatRangeField extends ParamField implements TextFieldListener {
266   - /** The serial version UID (affected with a random number). */
267   - private static final long serialVersionUID = 7923358142882329015L;
  280 + /** The serial version UID. */
  281 + private static final long serialVersionUID = 1L;
  282 +
268 283 /** The JTextField used to put the parameter minimum value of the range. */
269 284 JTextField fieldMin;
  285 +
270 286 /** The JTextField used to put the parameter maximum value of the range. */
271 287 JTextField fieldMax;
272 288  
273 289 /**
274 290 * Method constructor
275   - *
  291 + *
276 292 * @param mainView The main view of the application.
277 293 * @param paramName The name of the parameter.
278 294 */
279 295 public FloatRangeField(EpnTapMainView mainView, String paramName) {
280 296 super(mainView, paramName);
281 297 fieldMin = new JTextField();
282   - fieldMin.setName(MIN_SUFFIX);
283   - addChangeListener(this, fieldMin);
  298 + fieldMin.setName(ParamField.MIN_SUFFIX);
  299 + ParamField.addChangeListener(this, fieldMin);
284 300 this.add(fieldMin);
285 301  
286 302 fieldMax = new JTextField();
287   - fieldMax.setName(MAX_SUFFIX);
288   - addChangeListener(this, fieldMax);
  303 + fieldMax.setName(ParamField.MAX_SUFFIX);
  304 + ParamField.addChangeListener(this, fieldMax);
289 305 this.add(fieldMax);
290 306 }
291 307  
... ... @@ -314,16 +330,19 @@ public abstract class ParamField extends JPanel {
314 330 * automatically filled with actual target names which begins by the entered characters, by
315 331 * asking to an online resolver (RESOLVER_URL). The parameter is sent to the controller each
316 332 * time it is updated, so it is possible to enter a parameter that the resolver do not know.
317   - *
  333 + *
318 334 * @author N. Jourdane
319 335 */
320 336 public static class TargetNameField extends ParamField implements TextFieldListener {
321   - /** The serial version UID (affected with a random number). */
322   - private static final long serialVersionUID = 5136431108894677113L;
  337 + /** The serial version UID. */
  338 + private static final long serialVersionUID = 1L;
  339 +
323 340 /** The comboBox to enter the target_name and display target name propositions. */
324 341 JComboBox<String> comboBox;
  342 +
325 343 /** The JTextField related to the ComboBox, allowing to listen for text content update. */
326 344 JTextField field;
  345 +
327 346 /**
328 347 * The content of the last entered value. It is used to avoid recursions, because each time
329 348 * an update event is detected, the resolver is called and the ComboBox is filled with new
... ... @@ -344,11 +363,12 @@ public abstract class ParamField extends JPanel {
344 363 lastContent = content;
345 364 comboBox.removeAllItems();
346 365 try {
347   - for (String s : getItems(content)) {
  366 + for (String s : TargetNameField.getItems(content)) {
348 367 comboBox.addItem(s);
349 368 }
350 369 } catch (CantSendQueryException e) {
351   - logger.log(Level.WARNING, "Can't get table names for the resolver", e);
  370 + ParamField.logger.log(Level.WARNING,
  371 + "Can't get table names for the resolver", e);
352 372 }
353 373 comboBox.getEditor().setItem(content);
354 374 }
... ... @@ -363,31 +383,33 @@ public abstract class ParamField extends JPanel {
363 383  
364 384 /**
365 385 * Method constructor
366   - *
  386 + *
367 387 * @param mainView The main view of the application.
368 388 * @param paramName The name of the parameter.
369 389 */
370 390 public TargetNameField(EpnTapMainView mainView, String paramName) {
371 391 super(mainView, paramName);
372 392 comboBox = new JComboBox<>();
373   - comboBox.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT));
  393 + comboBox.setPreferredSize(
  394 + new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
374 395  
375 396 comboBox.setEditable(true);
376 397 field = (JTextField) comboBox.getEditor().getEditorComponent();
377   - addChangeListener(this, field);
  398 + ParamField.addChangeListener(this, field);
378 399 this.add(comboBox);
379 400 }
380 401  
381 402 /**
382 403 * The method used to get target names propositions by asking to the resolver.
383   - *
  404 + *
384 405 * @param begining The beginning of the target_name.
385 406 * @return An array of Strings corresponding to the target names got.
386 407 * @throws CantSendQueryException If the resolver do not work.
387 408 */
388 409 static String[] getItems(String begining) throws CantSendQueryException {
389 410 StringBuilder resolverResult;
390   - resolverResult = VOTableConnection.sendGet(RESOLVER_URL, "q=\"" + begining + "\"");
  411 + resolverResult = VOTableConnection.sendGet(ParamField.RESOLVER_URL,
  412 + "q=\"" + begining + "\"");
391 413 JsonObject root = new JsonParser().parse(resolverResult.toString()).getAsJsonObject();
392 414 int count = Integer.parseInt(root.get("count").toString());
393 415 String[] targetNames = new String[count];
... ... @@ -415,12 +437,13 @@ public abstract class ParamField extends JPanel {
415 437 * https://voparis-confluence.obspm.fr/display/VES/4+-+EPN-TAP+queries#id-4-EPN-TAPqueries-
416 438 * __RefHeading__35_312326667_Toc3037660444.2.4DataProductType). The parameter is sent to the
417 439 * controller each time it is updated.
418   - *
  440 + *
419 441 * @author N. Jourdane
420 442 */
421 443 public static class DataProductTypeField extends ParamField {
422   - /** The serial version UID (affected with a random number). */
423   - private static final long serialVersionUID = -6362359909898369750L;
  444 + /** The serial version UID. */
  445 + private static final long serialVersionUID = 1L;
  446 +
424 447 /** The comboBox used to select the data product type. */
425 448 JComboBox<DataProductType> comboBox;
426 449  
... ... @@ -428,7 +451,7 @@ public abstract class ParamField extends JPanel {
428 451 * An enumeration of all available data product types. Each values comes with an id because
429 452 * EPN-TAP table can possibly be filled with the id instead of the name, so the query have
430 453 * to ask for both of them.
431   - *
  454 + *
432 455 * @author N. Jourdane
433 456 */
434 457 @SuppressWarnings("javadoc")
... ... @@ -442,12 +465,13 @@ public abstract class ParamField extends JPanel {
442 465  
443 466 /** The full name of the data product type, such as `Dynamic spectrum`. */
444 467 private String name = "";
  468 +
445 469 /** The id of the data product type, such as `ds`. */
446 470 private String id = "";
447 471  
448 472 /**
449 473 * Method constructor for the enumeration.
450   - *
  474 + *
451 475 * @param name The full name of the data product type, such as `Dynamic spectrum`.
452 476 * @param id The id of the data product type, such as `ds`.
453 477 */
... ... @@ -476,7 +500,7 @@ public abstract class ParamField extends JPanel {
476 500  
477 501 /**
478 502 * Method constructor
479   - *
  503 + *
480 504 * @param mainView The main view of the application.
481 505 * @param paramName The name of the parameter.
482 506 */
... ... @@ -484,7 +508,8 @@ public abstract class ParamField extends JPanel {
484 508 super(mainView, paramName);
485 509 comboBox = new JComboBox<>(DataProductType.values());
486 510 comboBox.setSelectedItem(DataProductType.ALL);
487   - comboBox.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT));
  511 + comboBox.setPreferredSize(
  512 + new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
488 513 comboBox.addActionListener(new ActionListener() {
489 514 @Override
490 515 public void actionPerformed(ActionEvent e) {
... ... @@ -513,19 +538,19 @@ public abstract class ParamField extends JPanel {
513 538 * https://voparis-confluence.obspm.fr/display/VES/4+-+EPN-TAP+queries#id-4-EPN-TAPqueries-
514 539 * __RefHeading__39_312326667_Toc3037660464.2.6TargetClass). The parameter is sent to the
515 540 * controller each time it is updated.
516   - *
  541 + *
517 542 * @author N. Jourdane
518 543 */
519 544 public static class TargetClassField extends ParamField {
520   - /** The serial version UID (affected with a random number). */
521   - private static final long serialVersionUID = 6439475087727685080L;
  545 + /** The serial version UID. */
  546 + private static final long serialVersionUID = 1L;
522 547  
523 548 /** The comboBox used to select the target class. */
524 549 JComboBox<TargetClass> comboBox;
525 550  
526 551 /**
527 552 * An enumeration of all available target classes.
528   - *
  553 + *
529 554 * @author N. Jourdane
530 555 */
531 556 @SuppressWarnings("javadoc")
... ... @@ -541,7 +566,7 @@ public abstract class ParamField extends JPanel {
541 566  
542 567 /**
543 568 * Method constructor for the enumeration.
544   - *
  569 + *
545 570 * @param name The name of the target class.
546 571 */
547 572 TargetClass(String name) {
... ... @@ -558,14 +583,15 @@ public abstract class ParamField extends JPanel {
558 583  
559 584 /**
560 585 * Method constructor
561   - *
  586 + *
562 587 * @param mainView The main view of the application.
563 588 * @param paramName The name of the parameter.
564 589 */
565 590 public TargetClassField(EpnTapMainView mainView, String paramName) {
566 591 super(mainView, paramName);
567 592 comboBox = new JComboBox<>(TargetClass.values());
568   - comboBox.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT));
  593 + comboBox.setPreferredSize(
  594 + new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
569 595 comboBox.addActionListener(new ActionListener() {
570 596 @Override
571 597 public void actionPerformed(ActionEvent e) {
... ... @@ -592,13 +618,13 @@ public abstract class ParamField extends JPanel {
592 618 * The listener of text field, it aims to provide a simple way to listen a text field without to
593 619 * override removeUpdate(DocumentEvent de), insertUpdate(DocumentEvent de) and
594 620 * changedUpdate(DocumentEvent de) on each field to listen.
595   - *
  621 + *
596 622 * @author N. Jourdane
597 623 */
598 624 interface TextFieldListener {
599 625 /**
600 626 * When the content of the JTextField is updated.
601   - *
  627 + *
602 628 * @param field The JTextField. Is useful for classes containing several text fields, such
603 629 * as DateRangeField, to know which one triggered the event.
604 630 */
... ... @@ -607,7 +633,7 @@ public abstract class ParamField extends JPanel {
607 633  
608 634 /**
609 635 * To add the listener. @see TextFieldListener
610   - *
  636 + *
611 637 * @param changeListener The listener of text fields.
612 638 * @param field The field to listen.
613 639 */
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/panels/BottomBarPanel.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -29,27 +29,22 @@ import eu.omp.irap.vespa.epntapclient.view.EpnTapMainView;
29 29 * @author N. Jourdane
30 30 */
31 31 public class BottomBarPanel extends JPanel {
32   - /** The serial version UID (affected with a random number). */
33   - private static final long serialVersionUID = 8083897308526492902L;
  32 + /** The serial version UID. */
  33 + private static final long serialVersionUID = 1L;
34 34  
35 35 /** The logger for the class BottomBar. */
36 36 @SuppressWarnings("unused")
37 37 private static final Logger logger = Logger.getLogger(BottomBarPanel.class.getName());
38 38  
39   - /** The main view of the application. */
40   - @SuppressWarnings("unused")
41   - private EpnTapMainView mainView;
42   -
43 39 /** A label to display several informations (aka. status bar). */
44 40 private JLabel infoLabel;
45 41  
46 42 /**
47 43 * Method constructor for the bottom bar panel.
48   - *
  44 + *
49 45 * @param mainView The main view of the application.
50 46 */
51 47 public BottomBarPanel(EpnTapMainView mainView) {
52   - this.mainView = mainView;
53 48 setLayout(new BorderLayout());
54 49 infoLabel = new JLabel();
55 50 this.add(infoLabel);
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/panels/RequestPanel.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -41,7 +41,7 @@ import eu.omp.irap.vespa.epntapclient.view.ParamField.TargetNameField;
41 41  
42 42 /**
43 43 * The view of the panel where the user builds the query.
44   - *
  44 + *
45 45 * @author N. Jourdane
46 46 */
47 47 public class RequestPanel extends JPanel implements ActionListener {
... ... @@ -49,8 +49,8 @@ public class RequestPanel extends JPanel implements ActionListener {
49 49 @SuppressWarnings("unused")
50 50 private static final Logger logger = Logger.getLogger(RequestPanel.class.getName());
51 51  
52   - /** The serial version UID (affected with a random number). */
53   - private static final long serialVersionUID = 1262856496809315405L;
  52 + /** The serial version UID. */
  53 + private static final long serialVersionUID = 1L;
54 54  
55 55 /** The name of the button to send the query. */
56 56 private static final String BTN_NAME = "btnSend";
... ... @@ -71,7 +71,7 @@ public class RequestPanel extends JPanel implements ActionListener {
71 71  
72 72 /**
73 73 * Method constructor
74   - *
  74 + *
75 75 * @param mainView The EPN-TAP main view.
76 76 */
77 77 public RequestPanel(EpnTapMainView mainView) {
... ... @@ -97,7 +97,7 @@ public class RequestPanel extends JPanel implements ActionListener {
97 97  
98 98 /**
99 99 * Build a JPanel containing graphical elements to build the query user-friendly.
100   - *
  100 + *
101 101 * @return The JPanel.
102 102 */
103 103 private JPanel buildParamPanel() {
... ... @@ -123,7 +123,7 @@ public class RequestPanel extends JPanel implements ActionListener {
123 123  
124 124 /**
125 125 * Build a JPanel containing a text-area where the query is displayed.
126   - *
  126 + *
127 127 * @return The JPanel.
128 128 */
129 129 private JPanel buildQueryPanel() {
... ... @@ -140,7 +140,7 @@ public class RequestPanel extends JPanel implements ActionListener {
140 140  
141 141 /**
142 142 * Update the query JTextArea.
143   - *
  143 + *
144 144 * @param query The string literal to put in the text-area, which will override the old content.
145 145 */
146 146 public void updateQueryArea(String query) {
... ... @@ -149,16 +149,16 @@ public class RequestPanel extends JPanel implements ActionListener {
149 149  
150 150 /**
151 151 * Build a JPanel containing the button(s), particularly the `Send` button.
152   - *
  152 + *
153 153 * @return The JPanel .
154 154 */
155 155 private JPanel buildButtonPanel() {
156 156 JPanel buttonPanel = new JPanel();
157 157 JButton btnSend = new JButton("Send query");
158   - btnSend.setName(BTN_NAME);
  158 + btnSend.setName(RequestPanel.BTN_NAME);
159 159 btnSend.addActionListener(this);
160 160 buttonPanel.add(btnSend);
161   - buttonPanel.setMaximumSize(new Dimension(1000, BUTTON_PANEL_HEIGHT));
  161 + buttonPanel.setMaximumSize(new Dimension(1000, RequestPanel.BUTTON_PANEL_HEIGHT));
162 162  
163 163 return buttonPanel;
164 164 }
... ... @@ -168,8 +168,8 @@ public class RequestPanel extends JPanel implements ActionListener {
168 168 */
169 169 @Override
170 170 public void actionPerformed(ActionEvent evt) {
171   - if (((JButton) evt.getSource()).getName() == BTN_NAME) {
172   - this.mainView.event(Event.SEND_BUTTON_CLICKED, queryArea.getText());
  171 + if (((JButton) evt.getSource()).getName() == RequestPanel.BTN_NAME) {
  172 + mainView.event(Event.SEND_BUTTON_CLICKED, queryArea.getText());
173 173 }
174 174 }
175 175  
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/panels/ResultsPanel.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -37,28 +37,17 @@ public class ResultsPanel extends JPanel {
37 37 @SuppressWarnings("unused")
38 38 private static final Logger logger = Logger.getLogger(ResultsPanel.class.getName());
39 39  
40   - /** The main view of the application. */
41   - @SuppressWarnings("unused")
42   - private EpnTapMainView mainView;
43   -
44   - /** The generic view of the VOTable panel. */
45   - @SuppressWarnings("unused")
46   - private VOTableView voTableView;
47   -
48 40 /**
49 41 * Method constructor which customize the result panel, but don't build it from scratch since
50 42 * VOTableView is already created by ResultController.
51   - *
  43 + *
52 44 * @param mainView The main view of the application.
53 45 * @param voTableView The generic view of the VOTable panel.
54 46 */
55 47 public ResultsPanel(EpnTapMainView mainView, VOTableView voTableView) {
56 48 super();
57 49  
58   - this.mainView = mainView;
59   - this.voTableView = voTableView;
60   -
61   - this.setLayout(new BorderLayout());
  50 + setLayout(new BorderLayout());
62 51 this.add(voTableView);
63 52  
64 53 setPreferredSize(new Dimension(Dim.LEFT_PANEL_WIDTH + Dim.RIGHT_PANEL_WIDTH,
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/panels/ServicesPanel.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -33,32 +33,27 @@ import eu.omp.irap.vespa.epntapclient.votable.view.VOTableView;
33 33 * @author N. Jourdane
34 34 */
35 35 public class ServicesPanel extends JPanel {
36   - /** The serial version UID (affected with a random number). */
37   - private static final long serialVersionUID = 7850369546415832758L;
  36 + /** The serial version UID. */
  37 + private static final long serialVersionUID = 1L;
38 38  
39 39 /** The logger for the class ServicesView. */
40 40 @SuppressWarnings("unused")
41 41 private static final Logger logger = Logger.getLogger(ServicesPanel.class.getName());
42 42  
43   - /** The main view of the application. */
44   - @SuppressWarnings("unused")
45   - private EpnTapMainView mainView;
46   -
47 43 /** The generic view of the VOTable panel. */
48 44 private VOTableView voTableView;
49 45  
50 46 /**
51 47 * Method constructor which customize the services panel, but don't build it from scratch since
52 48 * VOTableView is already created by ServicesController. Add also the JTable listener.
53   - *
  49 + *
54 50 * @param mainView The main view of the application.
55 51 * @param voTableView The generic view of the VOTable panel.
56 52 */
57 53 public ServicesPanel(final EpnTapMainView mainView, final VOTableView voTableView) {
58 54 super();
59   - this.mainView = mainView;
60 55 this.voTableView = voTableView;
61   - this.setLayout(new BorderLayout());
  56 + setLayout(new BorderLayout());
62 57 this.add(voTableView);
63 58  
64 59 setPreferredSize(new Dimension(Dim.LEFT_PANEL_WIDTH, Dim.TOP_PANEL_HEIGHT));
... ... @@ -80,7 +75,7 @@ public class ServicesPanel extends JPanel {
80 75 * @return The URL of the service corresponding to the row.
81 76 */
82 77 public String getServiceURL(int row) {
83   - return (String) this.voTableView.getValueAt(5, row);
  78 + return (String) voTableView.getValueAt(5, row);
84 79 }
85 80  
86 81 /**
... ... @@ -88,6 +83,6 @@ public class ServicesPanel extends JPanel {
88 83 * @return The table name of the service corresponding to the row.
89 84 */
90 85 public String getTableName(int row) {
91   - return (String) this.voTableView.getValueAt(2, row);
  86 + return (String) voTableView.getValueAt(2, row);
92 87 }
93 88 }
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableApp.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -42,19 +42,19 @@ public class VOTableApp {
42 42  
43 43 /**
44 44 * Main function to start the application as standalone.
45   - *
  45 + *
46 46 * <pre>
47 47 * **Usage 1**: `VOtableApp pathToVOTable`
48 48 * Display the VOTable stored in the specified XML file.
49 49 * - `pathToVOTable`: The path to an XML file representing a VOtable;
50   - *
  50 + *
51 51 * **Usage 2**: `VOtableApp targetURL type language query`
52 52 * Display the VOTable resulting the service or registry request.
53 53 * - `targetURL`: The URL of the service or registry to ask, ie `http://cdpp-epntap.cesr.fr`;
54 54 * - `language`: The language of the query, ie `ADQL`;
55 55 * - `query`: The query in the specified language in double quotes, ie. `"SELECT * FROM amdadb.epn_core"`
56 56 * </pre>
57   - *
  57 + *
58 58 * @param args The program arguments
59 59 */
60 60 public static void main(final String[] args) {
... ... @@ -63,13 +63,14 @@ public class VOTableApp {
63 63 public void run() {
64 64 // TODO: Add option to export to CSV and HTML in CLI.
65 65 VOTableController voTableControl;
66   - logger.info("Lauching VOTable app with arguments:\n " + new Gson().toJson(args));
  66 + VOTableApp.logger
  67 + .info("Lauching VOTable app with arguments:\n " + new Gson().toJson(args));
67 68 if (args.length == 1) {
68 69 try {
69 70 voTableControl = new VOTableController(args[0]);
70 71 } catch (VOTableException e) {
71 72 System.console().writer().println("Error: " + e.getMessage());
72   - logger.log(Level.WARNING, e.getMessage(), e);
  73 + VOTableApp.logger.log(Level.WARNING, e.getMessage(), e);
73 74 return;
74 75 }
75 76 } else if (args.length == 3) {
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableConnection.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -40,7 +40,7 @@ import eu.omp.irap.vespa.epntapclient.votable.utils.Const;
40 40  
41 41 /**
42 42 * This class provide HTTP connection support to send requests through POST / GET protocols.
43   - *
  43 + *
44 44 * @author N. Jourdane
45 45 */
46 46 public final class VOTableConnection {
... ... @@ -77,9 +77,10 @@ public final class VOTableConnection {
77 77 throw new CantSendQueryException.MalformedURLException(uri, e);
78 78 }
79 79  
80   - logger.info("request: " + uri + "?" + parameters);
  80 + VOTableConnection.logger.info("request: " + uri + "?" + parameters);
81 81 try {
82   - printRequestResult(sendGet(uri, parameters), voTablePath);
  82 + VOTableConnection.printRequestResult(VOTableConnection.sendGet(uri, parameters),
  83 + voTablePath);
83 84 } catch (IOException e) {
84 85 throw new CantPrintRequestResultException(voTablePath, e);
85 86 }
... ... @@ -115,7 +116,7 @@ public final class VOTableConnection {
115 116 throw new CantOpenConnectionException(uri, e);
116 117 }
117 118  
118   - con.setRequestProperty("User-Agent", USER_AGENT);
  119 + con.setRequestProperty("User-Agent", VOTableConnection.USER_AGENT);
119 120 int code = -1;
120 121  
121 122 try {
... ... @@ -134,7 +135,7 @@ public final class VOTableConnection {
134 135 }
135 136 in.close();
136 137 } catch (IOException e1) {
137   - logger.log(Level.WARNING, "Can not get input stream", e1);
  138 + VOTableConnection.logger.log(Level.WARNING, "Can not get input stream", e1);
138 139 try (BufferedReader in = new BufferedReader(
139 140 new InputStreamReader(con.getErrorStream()))) {
140 141 while ((inputLine = in.readLine()) != null) {
... ... @@ -151,7 +152,7 @@ public final class VOTableConnection {
151 152  
152 153 /**
153 154 * Print result of the query in a file.
154   - *
  155 + *
155 156 * @param response The request response content.
156 157 * @param resultFileName The name of the file where the request response content is writed.
157 158 * @throws IOException File not found or bad encoding.
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -51,7 +51,7 @@ public class VOTableController {
51 51  
52 52 /**
53 53 * Method constructor
54   - *
  54 + *
55 55 * @param voTablePath The path of the VOTable XML file.
56 56 * @throws VOTableException If something went wrong on the VOTable view or when filling table.
57 57 */
... ... @@ -62,7 +62,7 @@ public class VOTableController {
62 62  
63 63 /**
64 64 * Method constructor
65   - *
  65 + *
66 66 * @param targetURL The URL of the registry to communicate (ie. "http://reg.g-vo.org").
67 67 * @param queryLanguage The language used for the queries (ie. "ADQL").
68 68 * @param query The query to ask to the registry.
... ... @@ -73,7 +73,7 @@ public class VOTableController {
73 73 try {
74 74 fillTable(VOTableConnection.sendQuery(targetURL, queryLanguage, query));
75 75 } catch (VOTableException e) {
76   - logger.info("VOTableController error: " + e);
  76 + VOTableController.logger.info("VOTableController error: " + e);
77 77 }
78 78 }
79 79  
... ... @@ -114,7 +114,7 @@ public class VOTableController {
114 114 throw new SeveralTablesException(voTablePath);
115 115 }
116 116  
117   - Table table = (Table) (voTable.getRESOURCE().get(0).getLINKAndTABLEOrRESOURCE().get(0));
  117 + Table table = (Table) voTable.getRESOURCE().get(0).getLINKAndTABLEOrRESOURCE().get(0);
118 118  
119 119 VOTableDataParser dataParser;
120 120 try {
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableDataParser.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -61,7 +61,7 @@ public class VOTableDataParser {
61 61 * In VOTables, data can be stored in 4 different serializations: BINARY, BINARY2, TABLEDATA and
62 62 * FITS. This class aims to provide a unique way to get the data table, regardless of its
63 63 * serialization type.
64   - *
  64 + *
65 65 * @param table The table on which we want get the data.
66 66 * @throws IOException If the VOTable data can not be parsed.
67 67 */
... ... @@ -78,18 +78,18 @@ public class VOTableDataParser {
78 78 for (int i = 0; i < fields.size(); i++) {
79 79 columnsName[i] = fields.get(i).getName();
80 80 }
81   - logger.info("Columns name: " + new Gson().toJson(columnsName));
  81 + VOTableDataParser.logger.info("Columns name: " + new Gson().toJson(columnsName));
82 82  
83 83 data = new ArrayList<>();
84 84  
85 85 if (table.getDATA().getBINARY() != null) {
86 86 parseBinaryStream(table.getDATA().getBINARY().getSTREAM(), fields);
87 87 } else if (table.getDATA().getBINARY2() != null) {
88   - parseBinary2Stream(table.getDATA().getBINARY2().getSTREAM(), fields);
  88 + VOTableDataParser.parseBinary2Stream(table.getDATA().getBINARY2().getSTREAM(), fields);
89 89 } else if (table.getDATA().getTABLEDATA() != null) {
90   - parseTableDataStream(table.getDATA().getTABLEDATA(), fields);
  90 + VOTableDataParser.parseTableDataStream(table.getDATA().getTABLEDATA(), fields);
91 91 } else if (table.getDATA().getFITS() != null) {
92   - parseFITSStream(table.getDATA().getFITS().getSTREAM(), fields);
  92 + VOTableDataParser.parseFITSStream(table.getDATA().getFITS().getSTREAM(), fields);
93 93 }
94 94  
95 95 Utils.printObject("voTableData", data);
... ... @@ -118,8 +118,9 @@ public class VOTableDataParser {
118 118 int i = 0;
119 119 while (!column.equals(columnsName[i])) {
120 120 i++;
121   - if (i > columnsName.length)
  121 + if (i > columnsName.length) {
122 122 throw new IllegalArgumentException("Column " + column + " not found in the table.");
  123 + }
123 124 }
124 125 return i;
125 126 }
... ... @@ -166,8 +167,9 @@ public class VOTableDataParser {
166 167 */
167 168 public Object[] getRowByValue(int columnIndex, Object value) {
168 169 for (Object[] row : data) {
169   - if (value.equals(row[columnIndex]))
  170 + if (value.equals(row[columnIndex])) {
170 171 return row;
  172 + }
171 173 }
172 174 throw new IndexOutOfBoundsException(
173 175 "The value " + value + " is not found on the table at the column " + columnIndex);
... ... @@ -175,13 +177,13 @@ public class VOTableDataParser {
175 177  
176 178 /**
177 179 * get the data on its BINARY form.
178   - *
  180 + *
179 181 * @param voStream the data Stream in the VOTable Table.
180 182 * @param fields The Fields corresponding to the Table.
181 183 * @throws UnsupportedOperationException Data as arrays are not supported yet.
182 184 */
183 185 private void parseBinaryStream(Stream voStream, List<Field> fields) {
184   - logger.info("Parsing data in BINARY stream...");
  186 + VOTableDataParser.logger.info("Parsing data in BINARY stream...");
185 187 String strStream = voStream.getValue().replaceAll("(\\r|\\n)", "");
186 188  
187 189 stream = ByteBuffer.wrap(DatatypeConverter.parseBase64Binary(strStream));
... ... @@ -216,7 +218,7 @@ public class VOTableDataParser {
216 218 } else {
217 219 arraySize = Integer.parseInt(column.getArraysize()) * blockSize;
218 220 }
219   - if ((arraySize != blockSize) && !(dataType.equals(DataType.CHAR)
  221 + if (arraySize != blockSize && !(dataType.equals(DataType.CHAR)
220 222 || dataType.equals(DataType.UNICODE_CHAR))) {
221 223 throw new UnsupportedOperationException("Numeric data as array are not supported.");
222 224 }
... ... @@ -252,7 +254,7 @@ public class VOTableDataParser {
252 254 } else if (dataType.equals(DataType.DOUBLE)) {
253 255 row[nColumn] = stream.getDouble();
254 256 } else {
255   - logger.warning("Data type " + dataType + " is not supported.");
  257 + VOTableDataParser.logger.warning("Data type " + dataType + " is not supported.");
256 258 }
257 259  
258 260 // logger.debug(columnsName[nColumn] + ": " + row[nColumn])
... ... @@ -271,7 +273,7 @@ public class VOTableDataParser {
271 273 * @param fields The Fields corresponding to the Table.
272 274 */
273 275 private static void parseBinary2Stream(Stream stream, List<Field> fields) {
274   - logger.info("Parsing data in BINARY2 stream...");
  276 + VOTableDataParser.logger.info("Parsing data in BINARY2 stream...");
275 277 // TODO Implement parseBinary2Stream()
276 278 }
277 279  
... ... @@ -280,7 +282,7 @@ public class VOTableDataParser {
280 282 * @param fields The Fields corresponding to the Table.
281 283 */
282 284 private static void parseTableDataStream(TableData tabledata, List<Field> fields) {
283   - logger.info("Parsing data in TABLEDATA stream...");
  285 + VOTableDataParser.logger.info("Parsing data in TABLEDATA stream...");
284 286 // TODO Implement parseTableDataStream()
285 287 }
286 288  
... ... @@ -289,7 +291,7 @@ public class VOTableDataParser {
289 291 * @param fields The Fields corresponding to the Table.
290 292 */
291 293 private static void parseFITSStream(Stream stream, List<Field> fields) {
292   - logger.info("Parsing data in FITS stream...");
  294 + VOTableDataParser.logger.info("Parsing data in FITS stream...");
293 295 // TODO Implement parseFITSStream()
294 296 }
295 297 }
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableException.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -21,13 +21,12 @@ import java.io.IOException;
21 21 /**
22 22 * VOTableException is the global exception for all the VOTable application. All other exceptions
23 23 * should extend it.
24   - *
  24 + *
25 25 * @author N. Jourdane
26 26 */
27   -@SuppressWarnings("serial")
28 27 public abstract class VOTableException extends Exception {
29   - /** The serial version UID (affected with a random number). */
30   - private static final long serialVersionUID = -5707662871529583209L;
  28 + /** The serial version UID. */
  29 + private static final long serialVersionUID = 1L;
31 30  
32 31 /**
33 32 * @param message The message describing the exception displayed in the error dialog.
... ... @@ -47,6 +46,9 @@ public abstract class VOTableException extends Exception {
47 46 /** Abstract exception for when the application can not send the query. */
48 47 public abstract static class CantSendQueryException extends VOTableException {
49 48  
  49 + /** */
  50 + private static final long serialVersionUID = 1L;
  51 +
50 52 /**
51 53 * @param message The message describing the exception displayed in the error dialog.
52 54 */
... ... @@ -65,6 +67,9 @@ public abstract class VOTableException extends Exception {
65 67 /** The URL is not correctly formated. */
66 68 public static class MalformedURLException extends CantSendQueryException {
67 69  
  70 + /** */
  71 + private static final long serialVersionUID = 1L;
  72 +
68 73 /**
69 74 * @param uri The URI sent to the server.
70 75 * @param e The exception thrown.
... ... @@ -77,6 +82,9 @@ public abstract class VOTableException extends Exception {
77 82 /** Can not print the result in the file. */
78 83 public static class CantPrintRequestResultException extends CantSendQueryException {
79 84  
  85 + /** */
  86 + private static final long serialVersionUID = 1L;
  87 +
80 88 /**
81 89 * @param resultFilePath The path of the file where the query results should be stored.
82 90 * @param e The exception thrown.
... ... @@ -89,6 +97,9 @@ public abstract class VOTableException extends Exception {
89 97 /** Can not open an HTTP connection to the specified URL. */
90 98 public static class CantOpenConnectionException extends CantSendQueryException {
91 99  
  100 + /** */
  101 + private static final long serialVersionUID = 1L;
  102 +
92 103 /**
93 104 * @param uri The URI sent to the server.
94 105 * @param e The exception thrown.
... ... @@ -101,6 +112,9 @@ public abstract class VOTableException extends Exception {
101 112 /** Can not get the server response code for the request. */
102 113 public static class CantGetResponseCode extends CantSendQueryException {
103 114  
  115 + /** */
  116 + private static final long serialVersionUID = 1L;
  117 +
104 118 /**
105 119 * @param uri The URI sent to the server.
106 120 * @param e The exception thrown.
... ... @@ -113,6 +127,9 @@ public abstract class VOTableException extends Exception {
113 127 /** The server returned the bad response code (but not 400). */
114 128 public static class BadResponseCodeException extends CantSendQueryException {
115 129  
  130 + /** */
  131 + private static final long serialVersionUID = 1L;
  132 +
116 133 /**
117 134 * @param uri The URI sent to the server.
118 135 * @param responseCode The HTTP GET response code, which is bad.
... ... @@ -126,6 +143,9 @@ public abstract class VOTableException extends Exception {
126 143 /** Can not get the input stream of the result, neither the error stream. */
127 144 public static class CantGetErrorStream extends CantSendQueryException {
128 145  
  146 + /** */
  147 + private static final long serialVersionUID = 1L;
  148 +
129 149 /**
130 150 * @param uri The URI sent to the server.
131 151 * @param e The exception thrown.
... ... @@ -141,6 +161,9 @@ public abstract class VOTableException extends Exception {
141 161 /** Abstract exception for when the application can not display the VOTable. */
142 162 public abstract static class CantDisplayVOTableException extends VOTableException {
143 163  
  164 + /** */
  165 + private static final long serialVersionUID = 1L;
  166 +
144 167 /**
145 168 * @param message The message describing the exception displayed in the error dialog.
146 169 * @param e The exception thrown.
... ... @@ -159,6 +182,9 @@ public abstract class VOTableException extends Exception {
159 182 /** Can not parse the VOTable because it doesn't match with the VOTable schema. */
160 183 public static class VOTableIsNotValidException extends CantDisplayVOTableException {
161 184  
  185 + /** */
  186 + private static final long serialVersionUID = 1L;
  187 +
162 188 /**
163 189 * @param voTablePath The path of the VOTable.
164 190 * @param e The exception thrown.
... ... @@ -172,6 +198,9 @@ public abstract class VOTableException extends Exception {
172 198 /** VOTable with more than one resource are not yet supported. */
173 199 public static class SeveralResourcesException extends CantDisplayVOTableException {
174 200  
  201 + /** */
  202 + private static final long serialVersionUID = 1L;
  203 +
175 204 /**
176 205 * @param voTablePath The path of the VOTable.
177 206 */
... ... @@ -184,6 +213,9 @@ public abstract class VOTableException extends Exception {
184 213 /** VOTable with more than one resource are not yet supported. */
185 214 public static class SeveralTablesException extends CantDisplayVOTableException {
186 215  
  216 + /** */
  217 + private static final long serialVersionUID = 1L;
  218 +
187 219 /**
188 220 * @param voTablePath The path of the VOTable.
189 221 */
... ... @@ -195,6 +227,9 @@ public abstract class VOTableException extends Exception {
195 227  
196 228 /** Can not change schema location on the VOTable file. */
197 229 public static class CantModifyVOTableException extends CantDisplayVOTableException {
  230 + /** */
  231 + private static final long serialVersionUID = 1L;
  232 +
198 233 /**
199 234 * @param voTablePath The path of the VOTable.
200 235 * @param e The exception thrown.
... ... @@ -206,6 +241,9 @@ public abstract class VOTableException extends Exception {
206 241  
207 242 /** There is an error in the VOTable. */
208 243 public static class ErrorMessageInVOTableException extends CantDisplayVOTableException {
  244 + /** */
  245 + private static final long serialVersionUID = 1L;
  246 +
209 247 /**
210 248 * @param errorInfo The information about the error, which comes from the VOTable itself
211 249 * from the "INFO" node.
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableParser.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -74,12 +74,12 @@ public final class VOTableParser {
74 74 VOTABLE voTable;
75 75 JAXBContext jc;
76 76 try {
77   - changeVOTableSchemaLocation(voTablePath);
  77 + VOTableParser.changeVOTableSchemaLocation(voTablePath);
78 78 } catch (IOException e) {
79 79 throw new CantModifyVOTableException(voTablePath, e);
80 80 }
81 81 try {
82   - jc = JAXBContext.newInstance(VOTABLE_MODEL_PACKAGE);
  82 + jc = JAXBContext.newInstance(VOTableParser.VOTABLE_MODEL_PACKAGE);
83 83 Unmarshaller unmarshaller = jc.createUnmarshaller();
84 84 voTable = (VOTABLE) unmarshaller.unmarshal(new File(voTablePath));
85 85 } catch (JAXBException e) {
... ... @@ -94,7 +94,7 @@ public final class VOTableParser {
94 94 * allows JAXB to parse the VOTable even it's not the same namespace than the XSD. Because
95 95 * VOTables schemas are retro-compatibles, there is no problem to parse a VOTable with a XML
96 96 * schema with a higher version. In the same way, this method check if the file is a valid XML.
97   - *
  97 + *
98 98 * @param voTablePath The path of the VOTable XML file.
99 99 * @throws IOException Can not read or write the XML file.
100 100 */
... ... @@ -107,12 +107,14 @@ public final class VOTableParser {
107 107 NamedNodeMap votAttrs = doc.getFirstChild().getAttributes();
108 108  
109 109 String version = votAttrs.getNamedItem("version").getTextContent();
110   - if (version != JAXB_VOTABLE_VERSION) {
111   - logger.info("VOTable version is " + version + ", changing VOTable svhema to "
112   - + JAXB_VOTABLE_VERSION);
113   - votAttrs.getNamedItem("xmlns").setTextContent(VOTABLE_SHEMA + JAXB_VOTABLE_VERSION);
  110 + if (version != VOTableParser.JAXB_VOTABLE_VERSION) {
  111 + VOTableParser.logger
  112 + .info("VOTable version is " + version + ", changing VOTable svhema to "
  113 + + VOTableParser.JAXB_VOTABLE_VERSION);
  114 + votAttrs.getNamedItem("xmlns").setTextContent(
  115 + VOTableParser.VOTABLE_SHEMA + VOTableParser.JAXB_VOTABLE_VERSION);
114 116 } else {
115   - logger.info("VOTable version is " + version + ", everything is ok.");
  117 + VOTableParser.logger.info("VOTable version is " + version + ", everything is ok.");
116 118 }
117 119  
118 120 Transformer transformer = TransformerFactory.newInstance().newTransformer();
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Const.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -18,7 +18,7 @@ package eu.omp.irap.vespa.epntapclient.votable.utils;
18 18  
19 19 /**
20 20 * This class defines widely-used constants.
21   - *
  21 + *
22 22 * @author N. Jourdane
23 23 */
24 24 public class Const {
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Utils.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -39,7 +39,7 @@ public class Utils {
39 39 /**
40 40 * StringJoiner has the same purpose of Java 8 StringJoiner, it has been rewritten for Java7
41 41 * compatibility.
42   - *
  42 + *
43 43 * @author N. Jourdane
44 44 */
45 45 public static class StringJoiner {
... ... @@ -52,18 +52,18 @@ public class Utils {
52 52  
53 53 /**
54 54 * Method constructor for the String joiner.
55   - *
  55 + *
56 56 * @param separator The string joiner separator to put between each word, ie. ';'.
57 57 */
58 58 public StringJoiner(String separator) {
59 59 this.separator = separator;
60   - this.list = new ArrayList<>();
  60 + list = new ArrayList<>();
61 61 string = "";
62 62 }
63 63  
64 64 /**
65 65 * add a new word to the joiner.
66   - *
  66 + *
67 67 * @param text The word to add.
68 68 */
69 69 public void add(String text) {
... ... @@ -82,7 +82,7 @@ public class Utils {
82 82  
83 83 /**
84 84 * Print the specified object in JSON format in a file on the temporary directory.
85   - *
  85 + *
86 86 * @param title The name of the file.
87 87 * @param obj the object to print in a file.
88 88 * @return The path of the file.
... ... @@ -95,9 +95,9 @@ public class Utils {
95 95 writer.write(json);
96 96  
97 97 } catch (IOException e) {
98   - logger.warning("Can not print in the file " + path + e);
  98 + Utils.logger.warning("Can not print in the file " + path + e);
99 99 }
100   - logger.info("A json file representing " + title + " (" + obj.getClass().getName()
  100 + Utils.logger.info("A json file representing " + title + " (" + obj.getClass().getName()
101 101 + ") has been created on " + path);
102 102  
103 103 return path;
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/view/VOTableView.java
... ... @@ -3,7 +3,7 @@
3 3 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
4 4 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
5 5 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
6   - *
  6 + *
7 7 * This program is free software: you can
8 8 * redistribute it and/or modify it under the terms of the GNU General Public License as published
9 9 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
... ... @@ -32,7 +32,7 @@ import eu.omp.irap.vespa.epntapclient.votable.utils.Utils;
32 32  
33 33 /**
34 34 * The main class of the View of the application.
35   - *
  35 + *
36 36 * @author N. Jourdane
37 37 */
38 38 public class VOTableView extends JPanel implements TableModelListener {
... ... @@ -40,8 +40,8 @@ public class VOTableView extends JPanel implements TableModelListener {
40 40 static final Logger logger = Logger.getLogger(VOTableView.class.getName());
41 41  
42 42 // TODO: Create class VOTableCLI the view for a CLI usage
43   - /** The serial version UID (affected with a random number). */
44   - private static final long serialVersionUID = -6131752938586134234L;
  43 + /** The serial version UID. */
  44 + private static final long serialVersionUID = 1L;
45 45  
46 46 /** The JTable component where the data are displayed. */
47 47 JTable table;
... ... @@ -54,8 +54,8 @@ public class VOTableView extends JPanel implements TableModelListener {
54 54 */
55 55 public VOTableView() {
56 56 tableData = new DefaultTableModel() {
57   - /** The serial version UID (affected with a random number). */
58   - private static final long serialVersionUID = 8195913508549662555L;
  57 + /** The serial version UID. */
  58 + private static final long serialVersionUID = 1L;
59 59  
60 60 @Override
61 61 public boolean isCellEditable(int row, int column) {
... ... @@ -75,7 +75,7 @@ public class VOTableView extends JPanel implements TableModelListener {
75 75  
76 76 /**
77 77 * Fill the JTable.
78   - *
  78 + *
79 79 * @param columns the column names
80 80 * @param data The VoTable data displayed on the JTable
81 81 */
... ... @@ -83,8 +83,9 @@ public class VOTableView extends JPanel implements TableModelListener {
83 83 Object[][] values = data.toArray(new Object[data.size()][]);
84 84 Utils.printObject("tableData", values);
85 85 tableData.setDataVector(values, columns);
86   - if (values.length != 0)
  86 + if (values.length != 0) {
87 87 table.setRowSelectionInterval(0, 0);
  88 + }
88 89 }
89 90  
90 91 /**
... ... @@ -106,8 +107,9 @@ public class VOTableView extends JPanel implements TableModelListener {
106 107  
107 108 @Override
108 109 public void tableChanged(TableModelEvent e) {
109   - if (e.getType() != TableModelEvent.UPDATE)
  110 + if (e.getType() != TableModelEvent.UPDATE) {
110 111 return;
  112 + }
111 113 }
112 114  
113 115 }
... ...