diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java b/src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java index d08c09b..c0acaab 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java @@ -56,7 +56,7 @@ public class EpnTapMainApp { frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setContentPane(epnTapControl.getView()); frame.setVisible(true); - frame.setSize(1000, 600); + frame.pack(); frame.setLocationRelativeTo(null); }); } diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java b/src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java index ee9dfc4..90f091b 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java @@ -17,9 +17,14 @@ package eu.omp.irap.vespa.epntapclient.view; import java.awt.BorderLayout; +import java.awt.Dimension; import javax.swing.JOptionPane; import javax.swing.JPanel; +import javax.swing.JSplitPane; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import eu.omp.irap.vespa.epntapclient.controller.EpnTapController; import eu.omp.irap.vespa.epntapclient.votable.view.VOTableView; @@ -29,6 +34,9 @@ import eu.omp.irap.vespa.epntapclient.votable.view.VOTableView; */ public class EpnTapMainView extends JPanel { + /** The logger for this class. */ + static final Logger logger = LogManager.getLogger(EpnTapMainView.class); + /** The serial version UID (affected with a random number). */ private static final long serialVersionUID = -1233290271099283814L; @@ -58,10 +66,10 @@ public class EpnTapMainView extends JPanel { this.resultsView = resultsView; this.requestView = new RequestView(this); + setLayout(new BorderLayout()); buildWindow(); // TODO: Support multi-selection - servicesView.getTable().getSelectionModel().addListSelectionListener( e -> controller.setSelectedService(servicesView.getTable().getSelectedRow())); } @@ -91,13 +99,20 @@ public class EpnTapMainView extends JPanel { * Build and fill the GUI. */ public void buildWindow() { - JPanel northPanel = new JPanel(new BorderLayout()); - northPanel.add(servicesView, BorderLayout.WEST); - northPanel.add(requestView, BorderLayout.CENTER); + JSplitPane northPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, servicesView, + requestView); - setLayout(new BorderLayout()); - add(northPanel, BorderLayout.NORTH); - add(resultsView, BorderLayout.CENTER); + servicesView.setMinimumSize(new Dimension(100, 50)); + servicesView.setPreferredSize(new Dimension(300, 300)); + + requestView.setMinimumSize(new Dimension(100, 50)); + requestView.setPreferredSize(new Dimension(200, 200)); + + resultsView.setMinimumSize(new Dimension(200, 50)); + resultsView.setPreferredSize(new Dimension(600, 100)); + + JSplitPane mainPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, northPanel, resultsView); + add(mainPanel, BorderLayout.CENTER); } /** diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java b/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java index d4f043c..b287eb8 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java @@ -57,6 +57,7 @@ public class RequestView extends JPanel implements ActionListener { this.mainView = mainView; JLabel queryTitle = new JLabel("Query for the selected service"); queryArea = new JTextArea(Queries.SAMPLE_AMDA_QUERY); + queryArea.setLineWrap(true); JButton button = new JButton("Send query"); button.setName("btnSend"); setLayout(new BorderLayout()); -- libgit2 0.21.2