Class TapQueryPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class TapQueryPanel extends JPanel
Panel for display of a TAP query for a given TAP service.
Since:
15 Feb 2011
Author:
Mark Taylor
See Also:
  • Constructor Details

    • TapQueryPanel

      public TapQueryPanel(TapTableLoadDialog tld)
      Constructor.
      Parameters:
      tld - load dialogue configuring this panel
  • Method Details

    • getCapabilityPanel

      public TapCapabilityPanel getCapabilityPanel()
      Returns the panel used to hold and display the TAP capability information.
      Returns:
      capability display panel
    • getMetadataPanel

      public TableSetPanel getMetadataPanel()
      Returns the panel that displays table metadata.
      Returns:
      table set panel
    • getAdql

      public String getAdql()
      Returns the text currently entered in the ADQL text component.
      Returns:
      adql text supplied by user
    • setServiceKit

      public void setServiceKit(TapServiceKit serviceKit)
      Sets the TAP service access used by this panel. Calling this will unconditionally initiate an asynchronous attempt to fill in service metadata from the given service.
      Parameters:
      serviceKit - defines TAP service
    • updateServiceKit

      public void updateServiceKit(TapServiceKit serviceKit)
      Dispatch various asynchronous requests to populate the state of this panel displaying characteristics of the TAP service. No attempt is made to re-establish authentication.
      Parameters:
      serviceKit - service to be contacted
    • setExtraTables

      public void setExtraTables(AdqlValidator.ValidatorTable[] extraTables)
      Sets a list of extra tables available for valid queries. By default ADQL validation is done on a list of tables acquired by reading the service's declared table metadata, but additional tables may be added for consideration using this call.
      Parameters:
      extraTables - additional tables to be passed by the validator
    • getEditActions

      public Action[] getEditActions()
      Returns an array of GUI actions related to editing the ADQL text.
      Returns:
      edit action list
    • getAuthenticateAction

      public Action getAuthenticateAction()
      Returns the action that logs in and out of the TAP service.
      Returns:
      authentication action
    • addControl

      public void addControl(JComponent comp)
      Adds a given control to the line of buttons displayed at the top of this panel.
      Parameters:
      comp - component to add
    • addCaretListener

      public void addCaretListener(CaretListener listener)
      Adds a listener for changes to the text in the displayed ADQL text entry panel. This uses a CaretListener rather than (what might be more appropriate) DocumentListener because the DocumentListener interface looks too hairy, especially for use by components that are themselves behaving asynchronously.
      Parameters:
      listener - listener to add
    • removeCaretListener

      public void removeCaretListener(CaretListener listener)
      Removes a listener previously added with addCaretListener.
      Parameters:
      listener - listener to remove
    • addCustomExamples

      public void addCustomExamples(String menuName, AdqlExample[] examples)
      Adds a submenu to the examples menu giving a list of custom ADQL example queries.
      Parameters:
      menuName - name of submenu
      examples - example list
    • getSkyPos

      public double[] getSkyPos()
      Returns the currently preferred sky position to use in examples. The default implementation returns null, which means examples must come up with some default themselves, but subclasses may override this.
      Returns:
      2-element (RA,Dec) array, or null for no position
    • getExampleQueryText

      public String getExampleQueryText(DaliExample daliEx)
      Returns the ADQL text corresponding to the query part of an example. Implementation is contentious; override it if you want.
      Parameters:
      daliEx - example object
      Returns:
      ADQL query text