Commit ae96e79303cc993d60f2e34302829192c2475e06
1 parent
773ec25f
Exists in
master
access of the field in the query panel
Showing
1 changed file
with
57 additions
and
5 deletions
Show diff stats
src/main/java/eu/omp/irap/vespa/epntapclient/gui/panels/RequestPanel.java
@@ -57,6 +57,14 @@ public class RequestPanel extends JPanel { | @@ -57,6 +57,14 @@ public class RequestPanel extends JPanel { | ||
57 | */ | 57 | */ |
58 | private List<ParamField> paramFields; | 58 | private List<ParamField> paramFields; |
59 | 59 | ||
60 | + private TargetNameField targetNameField; | ||
61 | + | ||
62 | + private DateRangeField timeRangeField; | ||
63 | + | ||
64 | + private FloatRangeField spectralRangeField; | ||
65 | + | ||
66 | + private DataProductTypeField dataProductTypeField; | ||
67 | + | ||
60 | /** The height of the buttons panel. */ | 68 | /** The height of the buttons panel. */ |
61 | private static final int BUTTON_PANEL_HEIGHT = 20; | 69 | private static final int BUTTON_PANEL_HEIGHT = 20; |
62 | 70 | ||
@@ -84,12 +92,12 @@ public class RequestPanel extends JPanel { | @@ -84,12 +92,12 @@ public class RequestPanel extends JPanel { | ||
84 | * | 92 | * |
85 | * @return The JPanel. | 93 | * @return The JPanel. |
86 | */ | 94 | */ |
87 | - private JPanel buildParamPanel() { | 95 | + public JPanel buildParamPanel() { |
88 | paramFields = new ArrayList<>(); | 96 | paramFields = new ArrayList<>(); |
89 | - paramFields.add(new TargetNameField(viewListener, "target_name")); | ||
90 | - paramFields.add(new DateRangeField(viewListener, "time_")); | ||
91 | - paramFields.add(new FloatRangeField(viewListener, "spectral_range_")); | ||
92 | - paramFields.add(new DataProductTypeField(viewListener, "dataproduct_type")); | 97 | + paramFields.add(getTargetNameField()); |
98 | + paramFields.add(getTimeRangeField()); | ||
99 | + paramFields.add(getSpectralRangeField()); | ||
100 | + paramFields.add(getDataProductTypeField()); | ||
93 | JPanel paramPanel = new JPanel(); | 101 | JPanel paramPanel = new JPanel(); |
94 | paramPanel.setLayout(new BoxLayout(paramPanel, BoxLayout.Y_AXIS)); | 102 | paramPanel.setLayout(new BoxLayout(paramPanel, BoxLayout.Y_AXIS)); |
95 | paramPanel.setBorder(BorderFactory.createTitledBorder("Query parameters")); | 103 | paramPanel.setBorder(BorderFactory.createTitledBorder("Query parameters")); |
@@ -102,6 +110,50 @@ public class RequestPanel extends JPanel { | @@ -102,6 +110,50 @@ public class RequestPanel extends JPanel { | ||
102 | } | 110 | } |
103 | 111 | ||
104 | /** | 112 | /** |
113 | + * @return the data product field | ||
114 | + */ | ||
115 | + public DataProductTypeField getDataProductTypeField() { | ||
116 | + if(dataProductTypeField == null){ | ||
117 | + dataProductTypeField = new DataProductTypeField(viewListener, "dataproduct_type"); | ||
118 | + } | ||
119 | + | ||
120 | + return dataProductTypeField; | ||
121 | + } | ||
122 | + | ||
123 | + /** | ||
124 | + * @return the spectral range field | ||
125 | + */ | ||
126 | + public FloatRangeField getSpectralRangeField() { | ||
127 | + if (spectralRangeField == null){ | ||
128 | + spectralRangeField = new FloatRangeField(viewListener, "spectral_range_"); | ||
129 | + } | ||
130 | + | ||
131 | + return spectralRangeField; | ||
132 | + } | ||
133 | + | ||
134 | + /** | ||
135 | + * @return the time range field | ||
136 | + */ | ||
137 | + public DateRangeField getTimeRangeField() { | ||
138 | + if (timeRangeField == null){ | ||
139 | + timeRangeField = new DateRangeField(viewListener, "time_"); | ||
140 | + } | ||
141 | + | ||
142 | + return timeRangeField; | ||
143 | + } | ||
144 | + | ||
145 | + /** | ||
146 | + * @return the target name field | ||
147 | + */ | ||
148 | + public TargetNameField getTargetNameField() { | ||
149 | + if(targetNameField == null){ | ||
150 | + targetNameField = new TargetNameField(viewListener, "target_name"); | ||
151 | + } | ||
152 | + | ||
153 | + return targetNameField; | ||
154 | + } | ||
155 | + | ||
156 | + /** | ||
105 | * Build a JPanel containing a text-area where the query is displayed. | 157 | * Build a JPanel containing a text-area where the query is displayed. |
106 | * | 158 | * |
107 | * @return The JPanel. | 159 | * @return The JPanel. |