Commit 4a03be1659fec9f4029a734c7a4c7901d7a3b84b
1 parent
6b021d84
Exists in
master
Put queryArea in a JPanel in order to add other graphic elements on this area.
Showing
2 changed files
with
61 additions
and
5 deletions
Show diff stats
src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java
... | ... | @@ -20,7 +20,6 @@ import java.awt.BorderLayout; |
20 | 20 | |
21 | 21 | import javax.swing.JOptionPane; |
22 | 22 | import javax.swing.JPanel; |
23 | -import javax.swing.JTextArea; | |
24 | 23 | |
25 | 24 | import eu.omp.irap.vespa.epntapclient.controller.EpnTapController; |
26 | 25 | import eu.omp.irap.vespa.epntapclient.votable.view.VOTableView; |
... | ... | @@ -39,8 +38,8 @@ public class EpnTapMainView extends JPanel { |
39 | 38 | /** The JPanel where the list of services is displayed. */ |
40 | 39 | private VOTableView servicesView; |
41 | 40 | |
42 | - /** The text area where the user put its requests. */ | |
43 | - private JTextArea queryArea; | |
41 | + /** The JPanel where the user put requests. */ | |
42 | + private RequestView requestView; | |
44 | 43 | |
45 | 44 | /** |
46 | 45 | * The constructor of the view. |
... | ... | @@ -51,7 +50,7 @@ public class EpnTapMainView extends JPanel { |
51 | 50 | public EpnTapMainView(EpnTapController controller, VOTableView servicesView) { |
52 | 51 | this.servicesView = servicesView; |
53 | 52 | resultsView = new VOTableView(controller.getResultsController()); |
54 | - queryArea = new JTextArea(""); | |
53 | + this.requestView = new RequestView(this); | |
55 | 54 | |
56 | 55 | buildWindow(); |
57 | 56 | } |
... | ... | @@ -94,7 +93,7 @@ public class EpnTapMainView extends JPanel { |
94 | 93 | public void buildWindow() { |
95 | 94 | JPanel northPanel = new JPanel(new BorderLayout()); |
96 | 95 | northPanel.add(servicesView, BorderLayout.WEST); |
97 | - northPanel.add(queryArea, BorderLayout.CENTER); | |
96 | + northPanel.add(requestView, BorderLayout.CENTER); | |
98 | 97 | |
99 | 98 | setLayout(new BorderLayout()); |
100 | 99 | add(northPanel, BorderLayout.NORTH); | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java
0 → 100644
... | ... | @@ -0,0 +1,57 @@ |
1 | +/* | |
2 | + * This file is a part of EpnTAPClient. | |
3 | + * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer. | |
4 | + * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861 | |
5 | + * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie. | |
6 | + * | |
7 | + * This program is free software: you can | |
8 | + * redistribute it and/or modify it under the terms of the GNU General Public License as published | |
9 | + * by the Free Software Foundation, either version 3 of the License, or (at your option) any later | |
10 | + * version. This program is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | |
12 | + * PURPOSE. See the GNU General Public License for more details. You should have received a copy of | |
13 | + * the GNU General Public License along with this program. If not, see | |
14 | + * <http://www.gnu.org/licenses/>. | |
15 | + */ | |
16 | + | |
17 | +package eu.omp.irap.vespa.epntapclient.view; | |
18 | + | |
19 | +import java.awt.BorderLayout; | |
20 | + | |
21 | +import javax.swing.JLabel; | |
22 | +import javax.swing.JPanel; | |
23 | +import javax.swing.JTextArea; | |
24 | + | |
25 | +/** | |
26 | + * @author N. Jourdane | |
27 | + */ | |
28 | +public class RequestView extends JPanel { | |
29 | + | |
30 | + /** The serial version UID (affected with a random number). */ | |
31 | + private static final long serialVersionUID = 1262856496809315405L; | |
32 | + | |
33 | + /** The EPN-TAP main view. */ | |
34 | + EpnTapMainView mainView; | |
35 | + | |
36 | + /** The text area where the user put its requests. */ | |
37 | + private JTextArea queryArea; | |
38 | + | |
39 | + /** The text area where the user put its requests. */ | |
40 | + private JLabel queryTitle; | |
41 | + | |
42 | + /** | |
43 | + * Method constructor | |
44 | + * | |
45 | + * @param mainView The EPN-TAP main view. | |
46 | + */ | |
47 | + public RequestView(EpnTapMainView mainView) { | |
48 | + this.mainView = mainView; | |
49 | + queryArea = new JTextArea(""); | |
50 | + queryTitle = new JLabel("Query for the selected service"); | |
51 | + | |
52 | + setLayout(new BorderLayout()); | |
53 | + this.add(queryTitle, BorderLayout.NORTH); | |
54 | + this.add(queryArea, BorderLayout.CENTER); | |
55 | + } | |
56 | + | |
57 | +} | ... | ... |