ucar.unidata.data
Interface DataContext

All Superinterfaces:
IdvContext
All Known Subinterfaces:
ControlContext, ViewContext
All Known Implementing Classes:
DefaultIdv, IdvServer.MyIdv, IntegratedDataViewer, MultiPaneIdv

public interface DataContext
extends IdvContext

This interface defines the context in which the collection of data classes (e.g., DataChoice, DirectDataChoice, DerivedDataDescriptor, DataSource etc.) exist. For now the DataContext is the IntegratedDataViewer (IDV). It is mostly used by the DerivedDataChoice to have the user select the DataChoice operands needed when evaluating the DerivedDataChoice.

Version:
$Revision: 1.29 $Date: 2006/12/01 20:41:21 $
Author:
IDV development team

Method Summary
 void dataSourceChanged(DataSource source)
          This method gets called when something changed in the data source.
 List getAllDataSources()
          Return the list of DataSource objects currently held, including the formula data source
 List getDataSources()
          Return the list of DataSource objects currently held
 IntegratedDataViewer getIdv()
          Get the reference to the idv
 JythonManager getJythonManager()
          Return the JythonManager.
 XmlObjectStore getObjectStore()
          Return the XmlObjectStore that is used to get and store persistent user state.
 Object getPreference(String pref)
          Get the given user preference
 IdvResourceManager getResourceManager()
          Return the IdvResourceManager.
 boolean loadDataSource(DataSource dataSource)
          Add the given DataSource.
 List selectDataChoices(List labels)
          Select a set of DataChoice-s, one for each label (String) contained within the labels List.
 String selectDataType(Object definingObject)
          Ask the user what data type to use
 String selectDataType(Object definingObject, String label)
          Ask the user what data type to use
 List selectUserChoices(String msg, List userChoices)
          Select a set of Strings, one for each label (String) contained within the userChoices List.
 
Methods inherited from interface ucar.unidata.idv.IdvContext
getColorProperty, getProperty, getProperty
 

Method Detail

getIdv

IntegratedDataViewer getIdv()
Get the reference to the idv

Returns:
The idv

getDataSources

List getDataSources()
Return the list of DataSource objects currently held

Returns:
List of DataSources

getAllDataSources

List getAllDataSources()
Return the list of DataSource objects currently held, including the formula data source

Returns:
List of DataSources

selectDataChoices

List selectDataChoices(List labels)
Select a set of DataChoice-s, one for each label (String) contained within the labels List. This may return null to denote a user cancellation.

Parameters:
labels - labels to associate with choices
Returns:
List of DataChoices

getPreference

Object getPreference(String pref)
Get the given user preference

Parameters:
pref - The name of the preference
Returns:
The value

selectUserChoices

List selectUserChoices(String msg,
                       List userChoices)
Select a set of Strings, one for each label (String) contained within the userChoices List. This may return null to denote a user cancellation. Typically a user interface is generated based on the userChoices that is made of a set of JTextFields in which the user enters the required values.

Parameters:
msg - message prompt
userChoices - list of user choices
Returns:
List of user choices (may be null)

dataSourceChanged

void dataSourceChanged(DataSource source)
This method gets called when something changed in the data source.

Parameters:
source - The data source that changed

loadDataSource

boolean loadDataSource(DataSource dataSource)
Add the given DataSource. For the IDV this entails displaying the DataSource in the jtrees and menus, etc.

Parameters:
dataSource - the DataSource to load
Returns:
true if the DataSource was loaded

getJythonManager

JythonManager getJythonManager()
Return the JythonManager. This is the class that manages the set of jython interpreters, etc.,

Returns:
The JythonManager

getResourceManager

IdvResourceManager getResourceManager()
Return the IdvResourceManager. This is the class that manages the set of idv resources etc.,

Returns:
The IdvResourcemanager

getObjectStore

XmlObjectStore getObjectStore()
Return the XmlObjectStore that is used to get and store persistent user state.

Returns:
The object store

selectDataType

String selectDataType(Object definingObject)
Ask the user what data type to use

Parameters:
definingObject - defines the data source to be created
Returns:
The data type or null

selectDataType

String selectDataType(Object definingObject,
                      String label)
Ask the user what data type to use

Parameters:
definingObject - defines the data source to be created
label - the label
Returns:
The data type or null