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