Commit a227a22d1655e6e47d68447bd3f98adfc6aa76f6
1 parent
89e0ae9a
Exists in
master
Add comments.
Showing
12 changed files
with
159 additions
and
45 deletions
Show diff stats
src/main/java/eu/omp/irap/vespa/epntapclient/controller/EpnTapController.java
... | ... | @@ -30,6 +30,8 @@ import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController; |
30 | 30 | import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException; |
31 | 31 | |
32 | 32 | /** |
33 | + * The main controller which manage views and controllers. | |
34 | + * | |
33 | 35 | * @author N. Jourdane |
34 | 36 | */ |
35 | 37 | public class EpnTapController implements MainViewListener { |
... | ... | @@ -57,7 +59,7 @@ public class EpnTapController implements MainViewListener { |
57 | 59 | private Map<String, Object> paramValues = new HashMap<>(); |
58 | 60 | |
59 | 61 | /** |
60 | - * Method constructor | |
62 | + * Method constructor, which initialize servicesController, resultsController and mainView. | |
61 | 63 | */ |
62 | 64 | public EpnTapController() { |
63 | 65 | servicesController = new VOTableController(Const.DEFAULT_REGISTRY_URL, "ADQL", |
... | ... | @@ -70,27 +72,29 @@ public class EpnTapController implements MainViewListener { |
70 | 72 | } |
71 | 73 | |
72 | 74 | /** |
73 | - * @return the EPN-TAP view. | |
75 | + * @return the EPN-TAP main view. | |
74 | 76 | */ |
75 | 77 | public EpnTapMainView getView() { |
76 | 78 | return mainView; |
77 | 79 | } |
78 | 80 | |
79 | 81 | /** |
80 | - * @return The controller of the VOTable displaying the query results. | |
82 | + * @return The controller of the VOTable which displays the result of the query. | |
81 | 83 | */ |
82 | 84 | public VOTableController getResultsController() { |
83 | 85 | return resultsController; |
84 | 86 | } |
85 | 87 | |
86 | 88 | /** |
87 | - * @return The controller of the VOTable displaying the list of services. | |
89 | + * @return The controller of the VOTable which displays the list of services. | |
88 | 90 | */ |
89 | 91 | public VOTableController getServicesController() { |
90 | 92 | return servicesController; |
91 | 93 | } |
92 | 94 | |
93 | 95 | /** |
96 | + * Update the row selected by the user on the Services Panel. | |
97 | + * | |
94 | 98 | * @param row The row selected by the user on the Jtable. |
95 | 99 | */ |
96 | 100 | public void updateSelected(int row) { |
... | ... | @@ -105,24 +109,40 @@ public class EpnTapController implements MainViewListener { |
105 | 109 | } |
106 | 110 | } |
107 | 111 | |
112 | + /** | |
113 | + * Remove a query parameter from the parameters list. | |
114 | + * | |
115 | + * @param paramName The name of the parameter as described in REG-TAP specifications. | |
116 | + */ | |
108 | 117 | public void removeParameter(String paramName) { |
109 | 118 | paramValues.remove(paramName); |
110 | 119 | updateQueryArea(); |
111 | 120 | logger.info("removed " + paramName); |
112 | 121 | } |
113 | 122 | |
123 | + /** | |
124 | + * Update a query parameter in the parameter list. | |
125 | + * | |
126 | + * @param paramName The name of the parameter as described in REG-TAP specifications. | |
127 | + * @param value The value of the parameter to update. | |
128 | + */ | |
114 | 129 | public void updateParameter(String paramName, Object value) { |
115 | 130 | paramValues.put(paramName, value); |
116 | 131 | updateQueryArea(); |
117 | 132 | logger.info("uploaded " + paramName + ": " + value); |
118 | 133 | } |
119 | 134 | |
135 | + /** | |
136 | + * Update the query area with a working ADQL query, based on the parameters list. | |
137 | + */ | |
120 | 138 | private void updateQueryArea() { |
121 | 139 | String query = Queries.getQuery(selectedTableName, paramValues, 10); |
122 | 140 | mainView.getRequestPanel().updateQueryArea(query); |
123 | 141 | } |
124 | 142 | |
125 | 143 | /** |
144 | + * Send a query to the selected service on the services panel. | |
145 | + * | |
126 | 146 | * @param query The query to send to the selected service. |
127 | 147 | * @throws VOTableException Can not fill the Table |
128 | 148 | */ |
... | ... | @@ -132,8 +152,10 @@ public class EpnTapController implements MainViewListener { |
132 | 152 | } |
133 | 153 | |
134 | 154 | /** |
135 | - * @param event | |
136 | - * @param args | |
155 | + * This methods is called each time a graphical event is detected from a view. | |
156 | + * | |
157 | + * @param event The type of the detected event. @see Event | |
158 | + * @param args The possible arguments which comes with the event (ie. a row column). | |
137 | 159 | */ |
138 | 160 | @Override |
139 | 161 | public void event(Event event, Object... args) { |
... | ... | @@ -145,7 +167,7 @@ public class EpnTapController implements MainViewListener { |
145 | 167 | case serviceSelected: |
146 | 168 | updateSelected(((Integer) args[0]).intValue()); |
147 | 169 | break; |
148 | - case btnSearchClicked: | |
170 | + case btnSendClicked: | |
149 | 171 | sendQuery((String) object); |
150 | 172 | break; |
151 | 173 | case paramChanged: | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java
... | ... | @@ -24,6 +24,8 @@ import java.util.logging.Logger; |
24 | 24 | import eu.omp.irap.vespa.epntapclient.votable.Utils.StringJoiner; |
25 | 25 | |
26 | 26 | /** |
27 | + * Defines the queries and the query patterns usually used in the application. | |
28 | + * | |
27 | 29 | * @author N. Jourdane |
28 | 30 | */ |
29 | 31 | public final class Queries { | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java
... | ... | @@ -30,6 +30,8 @@ import eu.omp.irap.vespa.epntapclient.view.panels.ServicesPanel; |
30 | 30 | import eu.omp.irap.vespa.epntapclient.votable.view.VOTableView; |
31 | 31 | |
32 | 32 | /** |
33 | + * The main view of the application, which manage all the other views. | |
34 | + * | |
33 | 35 | * @author N. Jourdane |
34 | 36 | */ |
35 | 37 | public class EpnTapMainView extends JPanel { |
... | ... | @@ -46,22 +48,35 @@ public class EpnTapMainView extends JPanel { |
46 | 48 | /** The JPanel where the list of services is displayed. */ |
47 | 49 | private ServicesPanel servicesPanel; |
48 | 50 | |
49 | - /** The JPanel where the user put requests. */ | |
51 | + /** The JPanel where the user build the query. */ | |
50 | 52 | private RequestPanel requestPanel; |
51 | 53 | |
52 | - /** The JPanel where the user put requests. */ | |
54 | + /** The status bar. */ | |
53 | 55 | private BottomBarPanel bottomBarPanel; |
54 | 56 | |
57 | + /** The listener of the EpnTapMainView (usually the main controller) */ | |
55 | 58 | private MainViewListener mainViewListener; |
56 | 59 | |
60 | + /** | |
61 | + * The interface for the main view listener, which listen for events. | |
62 | + * | |
63 | + * @author N. Jourdane | |
64 | + */ | |
57 | 65 | public interface MainViewListener { |
66 | + /** | |
67 | + * When an event is detected on the main view. | |
68 | + * | |
69 | + * @param event The event type. @see Event | |
70 | + * @param args The possible arguments which comes with the event (ie. a row number). | |
71 | + */ | |
58 | 72 | void event(Event event, Object... args); |
59 | 73 | } |
60 | 74 | |
61 | 75 | /** |
62 | - * The constructor of the view. TODO: controlleur = รฉcouteur de la vue | |
76 | + * The main view constructor, which create all the panels. | |
63 | 77 | * |
64 | - * @param controller The EPN-TAP controller, allowing the EPN-TAP view to send events. | |
78 | + * @param voTableServicesView The view to put in the services panel, built by ServicesController | |
79 | + * @param voTableResultsView The view to put in the results panel, built by ResultsController. | |
65 | 80 | */ |
66 | 81 | |
67 | 82 | public EpnTapMainView(VOTableView voTableServicesView, VOTableView voTableResultsView) { |
... | ... | @@ -69,23 +84,27 @@ public class EpnTapMainView extends JPanel { |
69 | 84 | this.resultsPanel = new ResultsPanel(this, voTableResultsView); |
70 | 85 | this.requestPanel = new RequestPanel(this); |
71 | 86 | this.bottomBarPanel = new BottomBarPanel(this); |
72 | - setLayout(new BorderLayout()); | |
73 | 87 | buildWindow(); |
74 | 88 | } |
75 | 89 | |
90 | + /** | |
91 | + * Add a listener for the main view. | |
92 | + * | |
93 | + * @param listener A MainViewListener. | |
94 | + */ | |
76 | 95 | public void addMainViewListener(MainViewListener listener) { |
77 | 96 | mainViewListener = listener; |
78 | 97 | } |
79 | 98 | |
80 | 99 | /** |
81 | - * @return The JPanel where the VOTable results is displayed. | |
100 | + * @return The JPanel where the VOTable result is displayed. | |
82 | 101 | */ |
83 | 102 | public ResultsPanel getResultsPanel() { |
84 | 103 | return resultsPanel; |
85 | 104 | } |
86 | 105 | |
87 | 106 | /** |
88 | - * @return The JPanel where the GUI elements to make the request are displayed. | |
107 | + * @return The JPanel containing the GUI elements to build the query. | |
89 | 108 | */ |
90 | 109 | public RequestPanel getRequestPanel() { |
91 | 110 | return requestPanel; |
... | ... | @@ -99,7 +118,7 @@ public class EpnTapMainView extends JPanel { |
99 | 118 | } |
100 | 119 | |
101 | 120 | /** |
102 | - * @return The JPanel where the list of services is displayed. | |
121 | + * @return The status bar. | |
103 | 122 | */ |
104 | 123 | public BottomBarPanel getBottomBarPanel() { |
105 | 124 | return bottomBarPanel; |
... | ... | @@ -109,18 +128,18 @@ public class EpnTapMainView extends JPanel { |
109 | 128 | * Build and fill the GUI. |
110 | 129 | */ |
111 | 130 | public void buildWindow() { |
131 | + setLayout(new BorderLayout()); | |
132 | + | |
112 | 133 | JSplitPane northPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, servicesPanel, |
113 | 134 | requestPanel); |
114 | 135 | |
115 | - // TODO: put requestView inside a JScrollPane. | |
116 | - | |
117 | 136 | JSplitPane mainPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, northPanel, resultsPanel); |
118 | 137 | add(mainPanel, BorderLayout.CENTER); |
119 | 138 | add(bottomBarPanel, BorderLayout.SOUTH); |
120 | 139 | } |
121 | 140 | |
122 | 141 | /** |
123 | - * Display an error. | |
142 | + * Display an error message. Usually used each time an error happens. | |
124 | 143 | * |
125 | 144 | * @param title The title of the error. |
126 | 145 | * @param message The message of the error. |
... | ... | @@ -130,6 +149,12 @@ public class EpnTapMainView extends JPanel { |
130 | 149 | JOptionPane.ERROR_MESSAGE); |
131 | 150 | } |
132 | 151 | |
152 | + /** | |
153 | + * Get an event and send it to the listener of the main view. | |
154 | + * | |
155 | + * @param event The event type. @see Event | |
156 | + * @param args The possible arguments which comes with the event (ie. a row number). | |
157 | + */ | |
133 | 158 | public void event(Event event, Object... args) { |
134 | 159 | mainViewListener.event(event, args); |
135 | 160 | } | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/view/Event.java
... | ... | @@ -20,5 +20,12 @@ package eu.omp.irap.vespa.epntapclient.view; |
20 | 20 | * @author N. Jourdane |
21 | 21 | */ |
22 | 22 | public enum Event { |
23 | - serviceSelected, btnSearchClicked, paramRemoved, paramChanged; | |
23 | + /** When a service is selected on the service panel. */ | |
24 | + serviceSelected, | |
25 | + /** When the `Send query` button is clicked. */ | |
26 | + btnSendClicked, | |
27 | + /** When a parameter is removed on the parameter panel. */ | |
28 | + paramRemoved, | |
29 | + /** When a parameter is updated to a valid value on the parameter panel. */ | |
30 | + paramChanged; | |
24 | 31 | } | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java
... | ... | @@ -45,6 +45,11 @@ import com.google.gson.JsonParser; |
45 | 45 | import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableConnection; |
46 | 46 | import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.SendQueryException; |
47 | 47 | |
48 | +/** | |
49 | + * A field used to set a service parameter to build the query (in the parameter panel). | |
50 | + * | |
51 | + * @author N. Jourdane | |
52 | + */ | |
48 | 53 | public abstract class ParamField extends JPanel { |
49 | 54 | /** */ |
50 | 55 | private static final long serialVersionUID = 6025994164004985362L; |
... | ... | @@ -52,18 +57,29 @@ public abstract class ParamField extends JPanel { |
52 | 57 | /** The logger for the class ParamField. */ |
53 | 58 | static final Logger logger = Logger.getLogger(ParamField.class.getName()); |
54 | 59 | |
60 | + /** The minimum width of the field. */ | |
55 | 61 | private static final int MIN_FIELD_WIDTH = 30; |
62 | + /** The preferred field height. */ | |
56 | 63 | private static final int FIELD_HEIGHT = 20; |
64 | + /** The maximum width of the field. */ | |
57 | 65 | private static final int MAX_FIELD_WIDTH = 400; |
66 | + /** The preferred label width. */ | |
58 | 67 | private static final int LABEL_WIDTH = 140; |
59 | 68 | |
69 | + /** The URL of the resolver used for the `target name` field. */ | |
60 | 70 | private static final String RESOLVER_URL = "http://voparis-registry.obspm.fr/ssodnet/1/autocomplete"; |
71 | + /** The date format used in the DateRange field */ | |
61 | 72 | private static final String DATE_FORMAT = "dd/MM/yyyy"; |
73 | + /** The regex used to validate the Date fields */ | |
62 | 74 | 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)$)"; |
75 | + /** The suffix used in REG-TAP parameters names, indicating that it's a beginning of a range. */ | |
63 | 76 | private static final String MIN_SUFFIX = "min"; |
77 | + /** The suffix used in REG-TAP parameters names, indicating that it is a end of a range. */ | |
64 | 78 | private static final String MAX_SUFFIX = "max"; |
65 | 79 | |
80 | + /** The main view of the application. */ | |
66 | 81 | protected EpnTapMainView mainView; |
82 | + /** The parameter name of the field */ | |
67 | 83 | protected String paramName; |
68 | 84 | |
69 | 85 | public ParamField(EpnTapMainView mainView, String paramName) { | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/view/panels/BottomBarPanel.java
... | ... | @@ -29,18 +29,25 @@ import eu.omp.irap.vespa.epntapclient.view.EpnTapMainView; |
29 | 29 | * @author N. Jourdane |
30 | 30 | */ |
31 | 31 | public class BottomBarPanel extends JPanel { |
32 | - /** */ | |
32 | + /** The serial version UID (affected with a random number). */ | |
33 | 33 | private static final long serialVersionUID = 8083897308526492902L; |
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. */ | |
39 | 40 | @SuppressWarnings("unused") |
40 | 41 | private EpnTapMainView mainView; |
41 | 42 | |
43 | + /** A label to display several informations (aka. status bar). */ | |
42 | 44 | private JLabel infoLabel; |
43 | 45 | |
46 | + /** | |
47 | + * Method constructor for the bottom bar panel. | |
48 | + * | |
49 | + * @param mainView The main view of the application. | |
50 | + */ | |
44 | 51 | public BottomBarPanel(EpnTapMainView mainView) { |
45 | 52 | this.mainView = mainView; |
46 | 53 | setLayout(new BorderLayout()); |
... | ... | @@ -49,6 +56,9 @@ public class BottomBarPanel extends JPanel { |
49 | 56 | this.add(new JButton("Get File"), BorderLayout.EAST); |
50 | 57 | } |
51 | 58 | |
59 | + /** | |
60 | + * @param infoText The text to display in the status-bar, which will override the old one. | |
61 | + */ | |
52 | 62 | public void setInfoText(String infoText) { |
53 | 63 | infoLabel.setText(infoText); |
54 | 64 | } | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/view/panels/RequestPanel.java
... | ... | @@ -40,6 +40,8 @@ import eu.omp.irap.vespa.epntapclient.view.ParamField.FloatRangeField; |
40 | 40 | import eu.omp.irap.vespa.epntapclient.view.ParamField.TargetNameField; |
41 | 41 | |
42 | 42 | /** |
43 | + * The view of the panel where the user builds the query. | |
44 | + * | |
43 | 45 | * @author N. Jourdane |
44 | 46 | */ |
45 | 47 | public class RequestPanel extends JPanel implements ActionListener { |
... | ... | @@ -50,16 +52,15 @@ public class RequestPanel extends JPanel implements ActionListener { |
50 | 52 | /** The serial version UID (affected with a random number). */ |
51 | 53 | private static final long serialVersionUID = 1262856496809315405L; |
52 | 54 | |
55 | + /** The name of the button to send the query. */ | |
53 | 56 | private static final String BTN_NAME = "btnSend"; |
54 | 57 | |
55 | - /** The EPN-TAP main view. */ | |
58 | + /** The main view of the application. */ | |
56 | 59 | private EpnTapMainView mainView; |
57 | 60 | |
58 | - /** The text area where the user put the query. */ | |
61 | + /** The text area where the user write the query. */ | |
59 | 62 | private JTextArea queryArea; |
60 | 63 | |
61 | - // TODO: Use one map for paramFields, paramValues, paramTypes. | |
62 | - | |
63 | 64 | /** |
64 | 65 | * The parameters fields for the request. |
65 | 66 | */ |
... | ... | @@ -79,6 +80,7 @@ public class RequestPanel extends JPanel implements ActionListener { |
79 | 80 | setPreferredSize(new Dimension(Dim.RIGHT_PANEL_WIDTH, Dim.TOP_PANEL_HEIGHT)); |
80 | 81 | setMinimumSize(new Dimension(Dim.RIGHT_PANEL_MIN_WIDTH, Dim.TOP_PANEL_MIN_HEIGHT)); |
81 | 82 | |
83 | + // TODO: Use a JScrollPane. | |
82 | 84 | // TODO: Get max row number from the GUI |
83 | 85 | |
84 | 86 | this.add(buildParamPanel(), this); |
... | ... | @@ -86,17 +88,23 @@ public class RequestPanel extends JPanel implements ActionListener { |
86 | 88 | this.add(buildButtonPanel(), this); |
87 | 89 | } |
88 | 90 | |
91 | + /** | |
92 | + * @return The main view of the application. | |
93 | + */ | |
89 | 94 | public EpnTapMainView getMainView() { |
90 | 95 | return mainView; |
91 | 96 | } |
92 | 97 | |
93 | 98 | /** |
94 | - * @return A JPanel containing graphical elements for the service parameters. | |
99 | + * Build a JPanel containing graphical elements to build the query user-friendly. | |
100 | + * | |
101 | + * @return The JPanel. | |
95 | 102 | */ |
96 | 103 | private JPanel buildParamPanel() { |
97 | 104 | // TODO: new GUI field column to allow the user to select the comparison operator: |
98 | 105 | // - if the field is a String: listbox with 'xx', '%xx', 'xx%', and '%xx%'. |
99 | 106 | // - if the field is a numeric value: listbox with <, <=, =, =>, >. |
107 | + // TODO use enums for the parameters names | |
100 | 108 | paramFields = new ArrayList<>(); |
101 | 109 | paramFields.add(new TargetNameField(mainView, "target_name")); |
102 | 110 | paramFields.add(new DateRangeField(mainView, "time_")); |
... | ... | @@ -114,7 +122,9 @@ public class RequestPanel extends JPanel implements ActionListener { |
114 | 122 | } |
115 | 123 | |
116 | 124 | /** |
117 | - * @return A JPanel containing graphical elements for the query. | |
125 | + * Build a JPanel containing a text-area where the query is displayed. | |
126 | + * | |
127 | + * @return The JPanel. | |
118 | 128 | */ |
119 | 129 | private JPanel buildQueryPanel() { |
120 | 130 | JPanel queryPanel = new JPanel(); |
... | ... | @@ -129,14 +139,18 @@ public class RequestPanel extends JPanel implements ActionListener { |
129 | 139 | } |
130 | 140 | |
131 | 141 | /** |
132 | - * Update the query JTextArea according to the parameters values. | |
142 | + * Update the query JTextArea. | |
143 | + * | |
144 | + * @param query The string literal to put in the text-area, which will override the old content. | |
133 | 145 | */ |
134 | 146 | public void updateQueryArea(String query) { |
135 | 147 | queryArea.setText(query); |
136 | 148 | } |
137 | 149 | |
138 | 150 | /** |
139 | - * @return A JPanel containing the button(s). | |
151 | + * Build a JPanel containing the button(s), particularly the `Send` button. | |
152 | + * | |
153 | + * @return The JPanel . | |
140 | 154 | */ |
141 | 155 | private JPanel buildButtonPanel() { |
142 | 156 | JPanel buttonPanel = new JPanel(); |
... | ... | @@ -149,10 +163,13 @@ public class RequestPanel extends JPanel implements ActionListener { |
149 | 163 | return buttonPanel; |
150 | 164 | } |
151 | 165 | |
166 | + /** | |
167 | + * This method is called when the user click on the `Send` button. | |
168 | + */ | |
152 | 169 | @Override |
153 | 170 | public void actionPerformed(ActionEvent evt) { |
154 | 171 | if (((JButton) evt.getSource()).getName() == BTN_NAME) { |
155 | - this.mainView.event(Event.btnSearchClicked, queryArea.getText()); | |
172 | + this.mainView.event(Event.btnSendClicked, queryArea.getText()); | |
156 | 173 | } |
157 | 174 | } |
158 | 175 | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/view/panels/ResultsPanel.java
... | ... | @@ -34,13 +34,24 @@ public class ResultsPanel extends JPanel { |
34 | 34 | private static final long serialVersionUID = -3387526562625069156L; |
35 | 35 | |
36 | 36 | /** The logger for the class ResultPanel. */ |
37 | + @SuppressWarnings("unused") | |
37 | 38 | private static final Logger logger = Logger.getLogger(ResultsPanel.class.getName()); |
38 | 39 | |
40 | + /** The main view of the application. */ | |
39 | 41 | @SuppressWarnings("unused") |
40 | 42 | private EpnTapMainView mainView; |
41 | 43 | |
44 | + /** The generic view of the VOTable panel. */ | |
45 | + @SuppressWarnings("unused") | |
42 | 46 | private VOTableView voTableView; |
43 | 47 | |
48 | + /** | |
49 | + * Method constructor which customize the result panel, but don't build it from scratch since | |
50 | + * VOTableView is already created by ResultController. | |
51 | + * | |
52 | + * @param mainView The main view of the application. | |
53 | + * @param voTableView The generic view of the VOTable panel. | |
54 | + */ | |
44 | 55 | public ResultsPanel(EpnTapMainView mainView, VOTableView voTableView) { |
45 | 56 | super(); |
46 | 57 | |
... | ... | @@ -54,6 +65,5 @@ public class ResultsPanel extends JPanel { |
54 | 65 | Dim.BOTTOM_PANEL_HEIGHT)); |
55 | 66 | setMinimumSize(new Dimension(Dim.LEFT_PANEL_MIN_WIDTH + Dim.RIGHT_PANEL_MIN_WIDTH, |
56 | 67 | Dim.BOTTOM_PANEL_MIN_HEIGHT)); |
57 | - | |
58 | 68 | } |
59 | 69 | } | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/view/panels/ServicesPanel.java
... | ... | @@ -33,17 +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 | - /** */ | |
36 | + /** The serial version UID (affected with a random number). */ | |
37 | 37 | private static final long serialVersionUID = 7850369546415832758L; |
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") | |
43 | 45 | private EpnTapMainView mainView; |
44 | 46 | |
47 | + /** The generic view of the VOTable panel. */ | |
45 | 48 | private VOTableView voTableView; |
46 | 49 | |
50 | + /** | |
51 | + * Method constructor which customize the services panel, but don't build it from scratch since | |
52 | + * VOTableView is already created by ServicesController. Add also the JTable listener. | |
53 | + * | |
54 | + * @param mainView The main view of the application. | |
55 | + * @param voTableView The generic view of the VOTable panel. | |
56 | + */ | |
47 | 57 | public ServicesPanel(final EpnTapMainView mainView, final VOTableView voTableView) { |
48 | 58 | super(); |
49 | 59 | this.mainView = mainView; |
... | ... | @@ -63,13 +73,20 @@ public class ServicesPanel extends JPanel { |
63 | 73 | voTableView.getTable().getSelectedRow()); |
64 | 74 | } |
65 | 75 | }); |
66 | - | |
67 | 76 | } |
68 | 77 | |
78 | + /** | |
79 | + * @param row The row index in the JTable element. | |
80 | + * @return The URL of the service corresponding to the row. | |
81 | + */ | |
69 | 82 | public String getServiceURL(int row) { |
70 | 83 | return (String) this.voTableView.getValueAt(5, row); |
71 | 84 | } |
72 | 85 | |
86 | + /** | |
87 | + * @param row The row index in the JTable element. | |
88 | + * @return The table name of the service corresponding to the row. | |
89 | + */ | |
73 | 90 | public String getTableName(int row) { |
74 | 91 | return (String) this.voTableView.getValueAt(2, row); |
75 | 92 | } | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableConnection.java
... | ... | @@ -31,7 +31,6 @@ import java.util.Date; |
31 | 31 | import java.util.logging.Logger; |
32 | 32 | |
33 | 33 | import eu.omp.irap.vespa.epntapclient.utils.Const; |
34 | -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.BadRequestException; | |
35 | 34 | import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.SendQueryException; |
36 | 35 | |
37 | 36 | /** | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableDataParser.java
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableException.java
... | ... | @@ -17,7 +17,6 @@ |
17 | 17 | package eu.omp.irap.vespa.epntapclient.votable.controller; |
18 | 18 | |
19 | 19 | import java.io.IOException; |
20 | -import java.util.logging.Logger; | |
21 | 20 | |
22 | 21 | /** |
23 | 22 | * VOTable Exception class. |
... | ... | @@ -26,9 +25,6 @@ import java.util.logging.Logger; |
26 | 25 | */ |
27 | 26 | @SuppressWarnings({ "javadoc", "serial" }) |
28 | 27 | public abstract class VOTableException extends Exception { |
29 | - /** The logger for the class VOTableException. */ | |
30 | - private static final Logger logger = Logger.getLogger(VOTableException.class.getName()); | |
31 | - | |
32 | 28 | public VOTableException(String message) { |
33 | 29 | super(message); |
34 | 30 | } |
... | ... | @@ -73,7 +69,6 @@ public abstract class VOTableException extends Exception { |
73 | 69 | } |
74 | 70 | } |
75 | 71 | |
76 | - // The query is not valid. | |
77 | 72 | public static class ErrorInVOTableException extends VOTableException { |
78 | 73 | public ErrorInVOTableException(String errorInfo) { |
79 | 74 | super("There is an error in the VOTable:\n" + errorInfo |
... | ... | @@ -81,10 +76,4 @@ public abstract class VOTableException extends Exception { |
81 | 76 | } |
82 | 77 | } |
83 | 78 | |
84 | - public static class BadRequestException extends VOTableException { | |
85 | - public BadRequestException(String message, String info) { | |
86 | - super(message); | |
87 | - } | |
88 | - } | |
89 | - | |
90 | 79 | } | ... | ... |