Class ThreddsDatasetChooser

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible

    public class ThreddsDatasetChooser
    extends JPanel
    A Swing widget for THREDDS clients that combines a CatalogChooser, and optionally a QueryChooser PropertyChangeEvent events are thrown to notify you of various user actions; see addPropertyChangeListener.

    You can use the ThreddsDatasetChooser:

    1. add the components into your own JTabbedPanel.
    2. wrapped in a JDialog for popping up
    3. as a standalone application through its main() method
    Example:
     datasetChooser = new ThreddsDatasetChooser( prefs, tabbedPane);
     datasetChooser.addPropertyChangeListener(  new java.beans.PropertyChangeListener() {
     public void propertyChange( java.beans.PropertyChangeEvent e) {
     if (e.getPropertyName().equals("Dataset")) {
     thredds.catalog.InvDataset ds = (thredds.catalog.InvDataset) e.getNewValue();
     setDataset( ds);
     }
     }
     }
     });
     

    To use as popup dialog box:

     ThreddsDatasetChooser datasetChooser = new ThreddsDatasetChooser(prefs, null);
     JDialog datasetChooserDialog = datasetChooser.makeDialog("Open THREDDS dataset", true);
     datasetChooserDialog.show();
     

    When using as a standalone application, the default behavior is to write the dataURLs of the selections to standard out. Copy main() and make changes as needed.

     java -classpath clientUI.jar;... thredds.catalog.ui.ThreddsDatasetChooser
     
    See Also:
    Serialized Form
    • Constructor Detail

      • ThreddsDatasetChooser

        public ThreddsDatasetChooser​(PreferencesExt prefs,
                                     JTabbedPane tabs)
        Usual Constructor. Create a CatalogChooser and a QueryChooser widget, add them to a JTabbedPane.
        Parameters:
        prefs - persistent storage, may be null
        tabs - add panels to this JTabbedPane, may be null if you are using as Dialog.
      • ThreddsDatasetChooser

        public ThreddsDatasetChooser​(PreferencesExt prefs,
                                     JTabbedPane tabs,
                                     JFrame frame,
                                     boolean pipeOutput,
                                     boolean messageOutput,
                                     boolean addDqc)
        General Constructor. Create a CatalogChooser and a QueryChooser widget, add them to a JTabbedPane. Optionally write to stdout and/or pop up event messsages.
        Parameters:
        prefs - persistent storage
        tabs - add to this JTabbedPane
        frame - best if non-null when messageOutP = true, otherwise null
        pipeOutput - send selection message to System.out
        messageOutput - send selection to popup message
    • Method Detail

      • setDoResolve

        public void setDoResolve​(boolean doResolve)
        If you want resolver datasets to be resolved (default false). If true, may throw "Datasets" event.
      • getCatalogChooser

        public CatalogChooser getCatalogChooser()
        Get the component CatalogChooser
      • save

        public void save()
        save the state
      • makeDialog

        public JDialog makeDialog​(JFrame parent,
                                  String title,
                                  boolean modal)
        Wrap this in a JDialog component.
        Parameters:
        parent - put dialog on top of this, may be null
        title - dialog window title
        modal - is modal