Package ucar.unidata.idv.ui
Class DataSelector
java.lang.Object
ucar.unidata.idv.ui.DataSourceHolder
ucar.unidata.idv.ui.DataSelector
This class provides facilities for managing
a collection of
DataSource,
DataCategory and
DataChoice
in a selection GUI.
It holds a list of DataSources. For each DataSource
there is a DataTree that shows the
DataChoices of the DataSource. There is a list of
ControlDescriptor-s
that are shown in the DataControlDialog
- Version:
- $Revision: 1.87 $Date: 2007/08/10 13:38:11 $
- Author:
- IDV development team
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass DataSourceWrapper Holds the selector gui for a data source -
Field Summary
FieldsFields inherited from class ucar.unidata.idv.ui.DataSourceHolder
formulaDataSource, frame, idv, treatFormulaDataSourceSpecial -
Constructor Summary
ConstructorsConstructorDescriptionDataSelector(IntegratedDataViewer idv, boolean horizontalOrientation, DataSource formulaDataSource) Create a DataSelector with the given idv and lsit of formulasDataSelector(IntegratedDataViewer idv, Dimension defaultSize, boolean singletonDataSource) Create a DataSelector with the given idv and list of formulasDataSelector(IntegratedDataViewer idv, DataSource formulaDataSource) Create a DataSelector with the given idv and lsit of formulas -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataSource(DataSource dataSource) Add theDataSourceand itsDataChoice-s into the guivoiddataSourceChanged(DataSource dataSource) The given data source has changed.voiddataSourceTimeChanged(DataSource dataSource) Change the gui when the given data source has changed.voidBe notified of a change to the display templatesvoiddispose()Remove all references to anything we may have.Return the JComponent that holds the Create and Close buttons.Return the GUI contentsstatic StringA helper method to find the label to use for the givenDataSource.static StringgetNameForDataSource(DataSource ds, int length, boolean alwaysDoIt) A helper method to find the label to use for the givenDataSource.protected booleanremoveDataSourceInner(DataSource dataSource) Remove the specified data source only if it is not the formulaDataSource.voidsetDataSource(DataSource dataSource) Set the data source shown by this selectorMethods inherited from class ucar.unidata.idv.ui.DataSourceHolder
addDisplayControl, addDisplayControl, doClose, doMakeFrame, getDataSources, getDerivedIcon, getFrame, getIdv, getLocationOnScreen, getName, removeAllDataSources, removeDataSource, removeDisplayControl, setDefaultSize, setFrame, show
-
Field Details
-
COLOR_BADSEARCH
Color for failed search
-
-
Constructor Details
-
DataSelector
Create a DataSelector with the given idv and lsit of formulas- Parameters:
idv- The IDVformulaDataSource- Contains the end-user formulas
-
DataSelector
public DataSelector(IntegratedDataViewer idv, boolean horizontalOrientation, DataSource formulaDataSource) Create a DataSelector with the given idv and lsit of formulas- Parameters:
idv- The IDVhorizontalOrientation- Should this be configured with normal dimensionsformulaDataSource- Contains the end-user formulas
-
DataSelector
Create a DataSelector with the given idv and list of formulas- Parameters:
idv- The IDVdefaultSize- Size of the windowsingletonDataSource- Does this dialog just show one data source
-
-
Method Details
-
setDataSource
Set the data source shown by this selector- Parameters:
dataSource- The data source
-
getContents
Return the GUI contents- Specified by:
getContentsin classDataSourceHolder- Returns:
- The GUI contents
-
getButtons
Return the JComponent that holds the Create and Close buttons.- Overrides:
getButtonsin classDataSourceHolder- Returns:
- Button panel
-
dispose
public void dispose()Remove all references to anything we may have. We do this because (stupid) Swing seems to keep around lots of different references to thei component and/or it's frame. So when we do a window.dispose () this DataSelector does not get gc'ed.- Overrides:
disposein classDataSourceHolder
-
removeDataSourceInner
Remove the specified data source only if it is not the formulaDataSource.- Overrides:
removeDataSourceInnerin classDataSourceHolder- Parameters:
dataSource- The data source to remove- Returns:
- Did we remove the data source
-
displayTemplatesChanged
public void displayTemplatesChanged()Be notified of a change to the display templates- Overrides:
displayTemplatesChangedin classDataSourceHolder
-
dataSourceTimeChanged
Change the gui when the given data source has changed. This gets called by theIntegratedDataViewerWhen one of theDataControlDialog-s changes the times on the data source.- Overrides:
dataSourceTimeChangedin classDataSourceHolder- Parameters:
dataSource- The data source that changed
-
dataSourceChanged
The given data source has changed. This method just re-adds the datasource to force an update of the GUI- Overrides:
dataSourceChangedin classDataSourceHolder- Parameters:
dataSource- The data source that changed
-
addDataSource
Add theDataSourceand itsDataChoice-s into the gui- Overrides:
addDataSourcein classDataSourceHolder- Parameters:
dataSource- The data source to add
-
getNameForDataSource
A helper method to find the label to use for the givenDataSource. If the length of the toString of the data source is less than 30 just use that. Else be a bit smart about truncating it.- Parameters:
ds- The data soruce to get a label for- Returns:
- The label
-
getNameForDataSource
A helper method to find the label to use for the givenDataSource. If the length of the toString of the data source is less than 30 just use that. Else be a bit smart about truncating it.- Parameters:
ds- The data soruce to get a label forlength- String length to clip toalwaysDoIt- If false then we only lip if this is a file or url- Returns:
- The label
-