Commit 68ae1315e0d5104cd300301f5dd03f0a0cea9819
1 parent
e7647bba
Exists in
master
Improve GUI apparence.
Showing
3 changed files
with
20 additions
and
7 deletions
Show diff stats
src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java
... | ... | @@ -55,16 +55,16 @@ public class EpnTapMainView extends JPanel { |
55 | 55 | /** The width of the left panel (services view). */ |
56 | 56 | static final int LEFT_PANEL_WIDTH = 400; |
57 | 57 | /** The minimum width of the left panel (services view). */ |
58 | - static final int LEFT_PANEL_MIN_WIDTH = 100; | |
58 | + static final int LEFT_PANEL_MIN_WIDTH = 150; | |
59 | 59 | /** The width of the right panel (request view). */ |
60 | 60 | static final int RIGHT_PANEL_WIDTH = 400; |
61 | 61 | /** The minimum width of the right panel (request view). */ |
62 | - static final int RIGHT_PANEL_MIN_WIDTH = 100; | |
62 | + static final int RIGHT_PANEL_MIN_WIDTH = 220; | |
63 | 63 | |
64 | 64 | /** The height of the top panel (request view and services view). */ |
65 | 65 | static final int TOP_PANEL_HEIGHT = 250; |
66 | 66 | /** The minimum height of the top panel (request view and services view). */ |
67 | - static final int TOP_PANEL_MIN_HEIGHT = 100; | |
67 | + static final int TOP_PANEL_MIN_HEIGHT = 190; | |
68 | 68 | /** The height of the bottom panel (result view). */ |
69 | 69 | static final int BOTTOM_PANEL_HEIGHT = 150; |
70 | 70 | /** The minimum height of the bottom panel (result view). */ | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java
... | ... | @@ -43,10 +43,14 @@ public abstract class ParamField extends JPanel { |
43 | 43 | /** The logger for this class. */ |
44 | 44 | private static final Logger logger = LogManager.getLogger(ParamField.class); |
45 | 45 | |
46 | + private static final int MIN_FIELD_WIDTH = 30; | |
47 | + private static final int FIELD_HEIGHT = 20; | |
48 | + private static final int MAX_FIELD_WIDTH = 400; | |
49 | + private static final int LABEL_WIDTH = 140; | |
50 | + | |
46 | 51 | private static final String RESOLVER_URL = "http://voparis-registry.obspm.fr/ssodnet/1/autocomplete"; |
47 | 52 | private static final String DATE_FORMAT = "dd/MM/yyyy"; |
48 | 53 | 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)$)"; |
49 | - | |
50 | 54 | private static final String MIN_SUFFIX = "min"; |
51 | 55 | private static final String MAX_SUFFIX = "max"; |
52 | 56 | |
... | ... | @@ -56,9 +60,10 @@ public abstract class ParamField extends JPanel { |
56 | 60 | public ParamField(RequestView requestView, String paramName) { |
57 | 61 | super(); |
58 | 62 | this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); |
63 | + this.setMaximumSize(new Dimension(MAX_FIELD_WIDTH, FIELD_HEIGHT)); | |
59 | 64 | String strLabel = paramName.replaceAll("_", " ").trim(); |
60 | 65 | JLabel label = new JLabel(strLabel.substring(0, 1).toUpperCase() + strLabel.substring(1)); |
61 | - label.setPreferredSize(new Dimension(140, 15)); | |
66 | + label.setPreferredSize(new Dimension(LABEL_WIDTH, FIELD_HEIGHT)); | |
62 | 67 | this.add(label); |
63 | 68 | // TODO: Add tooltip text based on rr.table_column.column_description |
64 | 69 | this.requestView = requestView; |
... | ... | @@ -115,11 +120,15 @@ public abstract class ParamField extends JPanel { |
115 | 120 | |
116 | 121 | DateRangeField(RequestView requestView, String paramName) { |
117 | 122 | super(requestView, paramName); |
123 | + this.add(new JLabel("min ")); | |
118 | 124 | fieldMin = new JTextField(); |
125 | + fieldMin.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT)); | |
119 | 126 | addChangeListener(fieldMin, e -> onUpdate(fieldMin, MIN_SUFFIX)); |
120 | 127 | this.add(fieldMin); |
121 | 128 | |
129 | + this.add(new JLabel("max ")); | |
122 | 130 | fieldMax = new JTextField(); |
131 | + fieldMax.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT)); | |
123 | 132 | addChangeListener(fieldMax, e -> onUpdate(fieldMax, MAX_SUFFIX)); |
124 | 133 | this.add(fieldMax); |
125 | 134 | } |
... | ... | @@ -183,6 +192,8 @@ public abstract class ParamField extends JPanel { |
183 | 192 | TargetNameField(RequestView requestView, String paramName) { |
184 | 193 | super(requestView, paramName); |
185 | 194 | comboBox = new JComboBox(); |
195 | + comboBox.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT)); | |
196 | + | |
186 | 197 | comboBox.setEditable(true); |
187 | 198 | field = (JTextField) comboBox.getEditor().getEditorComponent(); |
188 | 199 | addChangeListener(field, e -> onUpdate()); |
... | ... | @@ -229,6 +240,7 @@ public abstract class ParamField extends JPanel { |
229 | 240 | DataProductTypeField(RequestView requestView, String paramName) { |
230 | 241 | super(requestView, paramName); |
231 | 242 | comboBox = new JComboBox(getItems().keySet().toArray()); |
243 | + comboBox.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT)); | |
232 | 244 | comboBox.addActionListener(new ActionListener() { |
233 | 245 | @Override |
234 | 246 | public void actionPerformed(ActionEvent e) { |
... | ... | @@ -270,6 +282,7 @@ public abstract class ParamField extends JPanel { |
270 | 282 | TargetClassField(RequestView requestView, String paramName) { |
271 | 283 | super(requestView, paramName); |
272 | 284 | comboBox = new JComboBox(getItems()); |
285 | + comboBox.setPreferredSize(new Dimension(MIN_FIELD_WIDTH, FIELD_HEIGHT)); | |
273 | 286 | comboBox.addActionListener(new ActionListener() { |
274 | 287 | @Override |
275 | 288 | public void actionPerformed(ActionEvent e) { | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java
... | ... | @@ -71,7 +71,7 @@ public class RequestView extends JPanel implements ActionListener { |
71 | 71 | private Map<String, Object> paramValues; |
72 | 72 | |
73 | 73 | /** The height of the buttons panel. */ |
74 | - private static final int BUTTON_PANEL_HEIGHT = 15; | |
74 | + private static final int BUTTON_PANEL_HEIGHT = 20; | |
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Method constructor |
... | ... | @@ -158,7 +158,7 @@ public class RequestView extends JPanel implements ActionListener { |
158 | 158 | btnSend.addActionListener(this); |
159 | 159 | buttonPanel.add(btnSend); |
160 | 160 | buttonPanel.setMaximumSize( |
161 | - new Dimension(EpnTapMainView.RIGHT_PANEL_WIDTH, BUTTON_PANEL_HEIGHT)); | |
161 | + new Dimension(1000, BUTTON_PANEL_HEIGHT)); | |
162 | 162 | |
163 | 163 | return buttonPanel; |
164 | 164 | } | ... | ... |