From ae96e79303cc993d60f2e34302829192c2475e06 Mon Sep 17 00:00:00 2001 From: Jean-Michel Glorian Date: Fri, 13 May 2016 15:09:15 +0200 Subject: [PATCH] access of the field in the query panel --- src/main/java/eu/omp/irap/vespa/epntapclient/gui/panels/RequestPanel.java | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/gui/panels/RequestPanel.java b/src/main/java/eu/omp/irap/vespa/epntapclient/gui/panels/RequestPanel.java index 73ccbc6..73633e0 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/gui/panels/RequestPanel.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/gui/panels/RequestPanel.java @@ -57,6 +57,14 @@ public class RequestPanel extends JPanel { */ private List paramFields; + private TargetNameField targetNameField; + + private DateRangeField timeRangeField; + + private FloatRangeField spectralRangeField; + + private DataProductTypeField dataProductTypeField; + /** The height of the buttons panel. */ private static final int BUTTON_PANEL_HEIGHT = 20; @@ -84,12 +92,12 @@ public class RequestPanel extends JPanel { * * @return The JPanel. */ - private JPanel buildParamPanel() { + public JPanel buildParamPanel() { paramFields = new ArrayList<>(); - paramFields.add(new TargetNameField(viewListener, "target_name")); - paramFields.add(new DateRangeField(viewListener, "time_")); - paramFields.add(new FloatRangeField(viewListener, "spectral_range_")); - paramFields.add(new DataProductTypeField(viewListener, "dataproduct_type")); + paramFields.add(getTargetNameField()); + paramFields.add(getTimeRangeField()); + paramFields.add(getSpectralRangeField()); + paramFields.add(getDataProductTypeField()); JPanel paramPanel = new JPanel(); paramPanel.setLayout(new BoxLayout(paramPanel, BoxLayout.Y_AXIS)); paramPanel.setBorder(BorderFactory.createTitledBorder("Query parameters")); @@ -102,6 +110,50 @@ public class RequestPanel extends JPanel { } /** + * @return the data product field + */ + public DataProductTypeField getDataProductTypeField() { + if(dataProductTypeField == null){ + dataProductTypeField = new DataProductTypeField(viewListener, "dataproduct_type"); + } + + return dataProductTypeField; + } + + /** + * @return the spectral range field + */ + public FloatRangeField getSpectralRangeField() { + if (spectralRangeField == null){ + spectralRangeField = new FloatRangeField(viewListener, "spectral_range_"); + } + + return spectralRangeField; + } + + /** + * @return the time range field + */ + public DateRangeField getTimeRangeField() { + if (timeRangeField == null){ + timeRangeField = new DateRangeField(viewListener, "time_"); + } + + return timeRangeField; + } + + /** + * @return the target name field + */ + public TargetNameField getTargetNameField() { + if(targetNameField == null){ + targetNameField = new TargetNameField(viewListener, "target_name"); + } + + return targetNameField; + } + + /** * Build a JPanel containing a text-area where the query is displayed. * * @return The JPanel. -- libgit2 0.21.2