Commit e62f88502abb4a7c7c2c998bdc2d1c8c6c98d665
Exists in
master
Merge branch 'master' of gitlab1.irap.omp.eu:OV-GSO-DC/EpnTAPClient
Showing
3 changed files
with
25 additions
and
12 deletions
Show diff stats
src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java
... | ... | @@ -24,7 +24,6 @@ import javax.swing.SwingUtilities; |
24 | 24 | import com.google.gson.Gson; |
25 | 25 | |
26 | 26 | import eu.omp.irap.vespa.epntapclient.gui.mainpanel.MainPanelCtrl; |
27 | -import eu.omp.irap.vespa.epntapclient.gui.mainpanel.MainPanelView; | |
28 | 27 | |
29 | 28 | /** |
30 | 29 | * Simple class to have a main function to launch the EPNTap client. |
... | ... | @@ -56,26 +55,25 @@ public class EpnTapMainApp { |
56 | 55 | return; |
57 | 56 | } |
58 | 57 | |
59 | - MainPanelCtrl guiCtrl = new MainPanelCtrl(); | |
60 | - guiCtrl.readServices(); | |
61 | - SwingUtilities.invokeLater(EpnTapMainApp.run(guiCtrl.getView(), "EPN-TAP client")); | |
58 | + SwingUtilities.invokeLater(EpnTapMainApp.run("EPN-TAP client")); | |
62 | 59 | } |
63 | 60 | |
64 | 61 | /** |
65 | 62 | * Creates runnable used to run the application GUI. |
66 | 63 | * |
67 | - * @param voTableView The VOTable main view, created by the controller. | |
68 | 64 | * @param title The title of the application window. |
69 | 65 | * @return The runnable. |
70 | 66 | */ |
71 | - private static Runnable run(final MainPanelView voTableView, final String title) { | |
67 | + private static Runnable run(final String title) { | |
72 | 68 | return new Runnable() { |
73 | 69 | |
74 | 70 | @Override |
75 | 71 | public void run() { |
72 | + MainPanelCtrl guiCtrl = new MainPanelCtrl(); | |
73 | + guiCtrl.readServices(); | |
76 | 74 | JFrame frame = new JFrame(title); |
77 | 75 | frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
78 | - frame.setContentPane(voTableView); | |
76 | + frame.setContentPane(guiCtrl.getView()); | |
79 | 77 | frame.setVisible(true); |
80 | 78 | frame.pack(); |
81 | 79 | frame.setLocationRelativeTo(null); | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/gui/mainpanel/GUIDim.java
... | ... | @@ -24,10 +24,10 @@ package eu.omp.irap.vespa.epntapclient.gui.mainpanel; |
24 | 24 | public class GUIDim { |
25 | 25 | |
26 | 26 | /** The height of the bottom panel (result view). */ |
27 | - public static final int BOTTOM_PANEL_HEIGHT = 150; | |
27 | + public static final int BOTTOM_PANEL_HEIGHT = 350; | |
28 | 28 | |
29 | 29 | /** The minimum height of the bottom panel (result view). */ |
30 | - public static final int BOTTOM_PANEL_MIN_HEIGHT = 100; | |
30 | + public static final int BOTTOM_PANEL_MIN_HEIGHT = 150; | |
31 | 31 | |
32 | 32 | /** The minimum width of the left panel (services view). */ |
33 | 33 | public static final int LEFT_PANEL_MIN_WIDTH = 300; |
... | ... | @@ -42,10 +42,10 @@ public class GUIDim { |
42 | 42 | public static final int RIGHT_PANEL_WIDTH = 450; |
43 | 43 | |
44 | 44 | /** The height of the top panel (request view and services view). */ |
45 | - public static final int TOP_PANEL_HEIGHT = 400; | |
45 | + public static final int TOP_PANEL_HEIGHT = 300; | |
46 | 46 | |
47 | 47 | /** The minimum height of the top panel (request view and services view). */ |
48 | - public static final int TOP_PANEL_MIN_HEIGHT = 100; | |
48 | + public static final int TOP_PANEL_MIN_HEIGHT = 150; | |
49 | 49 | |
50 | 50 | |
51 | 51 | /** Private constructor to hide the implicit public one. */ | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/gui/resultpanel/ResultPanelView.java
... | ... | @@ -44,6 +44,9 @@ public class ResultPanelView extends VOTableView { |
44 | 44 | /** The listener of the result panel. */ |
45 | 45 | ResultPanelListener listener; |
46 | 46 | |
47 | + /** The JPanel containing the buttons. */ | |
48 | + private JPanel buttonsPanel; | |
49 | + | |
47 | 50 | |
48 | 51 | /** |
49 | 52 | * Method constructor which customize the result panel, but don't build it from scratch since |
... | ... | @@ -64,7 +67,7 @@ public class ResultPanelView extends VOTableView { |
64 | 67 | JPanel bottomBar = new JPanel(); |
65 | 68 | bottomBar.setLayout(new BorderLayout()); |
66 | 69 | bottomBar.add(getStatusBar(), BorderLayout.CENTER); |
67 | - bottomBar.add(getFileButton(), BorderLayout.EAST); | |
70 | + bottomBar.add(getButtonsPanel(), BorderLayout.EAST); | |
68 | 71 | |
69 | 72 | add(bottomBar, BorderLayout.SOUTH); |
70 | 73 | } |
... | ... | @@ -109,4 +112,16 @@ public class ResultPanelView extends VOTableView { |
109 | 112 | getStatusBar().setText(infoText); |
110 | 113 | } |
111 | 114 | |
115 | + /** | |
116 | + * Create if necessary the buttons panel, then return it. | |
117 | + * | |
118 | + * @return the buttons panel. | |
119 | + */ | |
120 | + public JPanel getButtonsPanel() { | |
121 | + if (buttonsPanel == null) { | |
122 | + buttonsPanel = new JPanel(); | |
123 | + buttonsPanel.add(getFileButton()); | |
124 | + } | |
125 | + return buttonsPanel; | |
126 | + } | |
112 | 127 | } | ... | ... |