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 cff47dd..ff6547d 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 @@ -55,16 +55,16 @@ public class EpnTapMainView extends JPanel { /** The width of the left panel (services view). */ static final int LEFT_PANEL_WIDTH = 400; /** The minimum width of the left panel (services view). */ - static final int LEFT_PANEL_MIN_WIDTH = 100; + static final int LEFT_PANEL_MIN_WIDTH = 150; /** The width of the right panel (request view). */ static final int RIGHT_PANEL_WIDTH = 400; /** The minimum width of the right panel (request view). */ - static final int RIGHT_PANEL_MIN_WIDTH = 100; + static final int RIGHT_PANEL_MIN_WIDTH = 220; /** The height of the top panel (request view and services view). */ static final int TOP_PANEL_HEIGHT = 250; /** The minimum height of the top panel (request view and services view). */ - static final int TOP_PANEL_MIN_HEIGHT = 100; + static final int TOP_PANEL_MIN_HEIGHT = 190; /** The height of the bottom panel (result view). */ static final int BOTTOM_PANEL_HEIGHT = 150; /** The minimum height of the bottom panel (result view). */ diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java b/src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java index b4217a7..b87899f 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java @@ -43,10 +43,14 @@ public abstract class ParamField extends JPanel { /** The logger for this class. */ private static final Logger logger = LogManager.getLogger(ParamField.class); + private static final int MIN_FIELD_WIDTH = 30; + private static final int FIELD_HEIGHT = 20; + private static final int MAX_FIELD_WIDTH = 400; + private static final int LABEL_WIDTH = 140; + private static final String RESOLVER_URL = "http://voparis-registry.obspm.fr/ssodnet/1/autocomplete"; private static final String DATE_FORMAT = "dd/MM/yyyy"; 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)$)"; - private static final String MIN_SUFFIX = "min"; private static final String MAX_SUFFIX = "max"; @@ -56,9 +60,10 @@ public abstract class ParamField extends JPanel { public ParamField(RequestView requestView, String paramName) { super(); this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + this.setMaximumSize(new Dimension(MAX_FIELD_WIDTH, FIELD_HEIGHT)); String strLabel = paramName.replaceAll("_", " ").trim(); JLabel label = new JLabel(strLabel.substring(0, 1).toUpperCase() + strLabel.substring(1)); - label.setPreferredSize(new Dimension(140, 15)); + label.setPreferredSize(new Dimension(LABEL_WIDTH, FIELD_HEIGHT)); this.add(label); // TODO: Add tooltip text based on rr.table_column.column_description this.requestView = requestView; @@ -115,11 +120,15 @@ public abstract class ParamField extends JPanel { DateRangeField(RequestView requestView, String paramName) { super(requestView, paramName); + this.add(new JLabel("min ")); fieldMin = new JTextField(); + fieldMin.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT)); addChangeListener(fieldMin, e -> onUpdate(fieldMin, MIN_SUFFIX)); this.add(fieldMin); + this.add(new JLabel("max ")); fieldMax = new JTextField(); + fieldMax.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT)); addChangeListener(fieldMax, e -> onUpdate(fieldMax, MAX_SUFFIX)); this.add(fieldMax); } @@ -183,6 +192,8 @@ public abstract class ParamField extends JPanel { TargetNameField(RequestView requestView, String paramName) { super(requestView, paramName); comboBox = new JComboBox(); + comboBox.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT)); + comboBox.setEditable(true); field = (JTextField) comboBox.getEditor().getEditorComponent(); addChangeListener(field, e -> onUpdate()); @@ -229,6 +240,7 @@ public abstract class ParamField extends JPanel { DataProductTypeField(RequestView requestView, String paramName) { super(requestView, paramName); comboBox = new JComboBox(getItems().keySet().toArray()); + comboBox.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT)); comboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -270,6 +282,7 @@ public abstract class ParamField extends JPanel { TargetClassField(RequestView requestView, String paramName) { super(requestView, paramName); comboBox = new JComboBox(getItems()); + comboBox.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT)); comboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { 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 c0fa898..c2bf7e1 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 @@ -71,7 +71,7 @@ public class RequestView extends JPanel implements ActionListener { private Map paramValues; /** The height of the buttons panel. */ - private static final int BUTTON_PANEL_HEIGHT = 15; + private static final int BUTTON_PANEL_HEIGHT = 20; /** * Method constructor @@ -158,7 +158,7 @@ public class RequestView extends JPanel implements ActionListener { btnSend.addActionListener(this); buttonPanel.add(btnSend); buttonPanel.setMaximumSize( - new Dimension(EpnTapMainView.RIGHT_PANEL_WIDTH, BUTTON_PANEL_HEIGHT)); + new Dimension(1000, BUTTON_PANEL_HEIGHT)); return buttonPanel; } -- libgit2 0.21.2