ucar.unidata.idv.ui
Class DataSelectionWidget

java.lang.Object
  extended by ucar.unidata.idv.ui.DataSelectionWidget

public class DataSelectionWidget
extends Object

This class is a sortof polymorphic dialog/window that manages selection of times for a datasource, displays/times for a datachoice and (sometime) a window showing a DataTree, list of displays and times.

Version:
$Revision: 1.98 $
Author:
Jeff McWhirter

Constructor Summary
DataSelectionWidget(IntegratedDataViewer idv)
          Constructor for when we are a part of the DataSelector
DataSelectionWidget(IntegratedDataViewer idv, boolean doSettings)
          Constructor for when we are a part of the DataSelector
 
Method Summary
 DataSelection createDataSelection(boolean addLevels)
          Create the data selection from everything selected by the user
 void dataSourceChanged(DataSource dataSource)
          Called by the DataSelector to handle when the data source has changed
 List getAllDateTimes()
          Get the list of all dttms
 JComponent getContents()
          get the gui contents
 boolean getDefaultLevelToFirst()
          Get the DefaultLevelToFirst property.
 GeoSelection getGeoSelection()
          Any geo selection
 List getSelectedDateTimes()
          Return a list of Integer indices of the selected times.
protected  Object[] getSelectedLevelRange()
          Get the min/max level range
protected  List getSelectedSettings()
          Get list of selected DisplaySettings
 JComponent getTimesList()
          Create the GUI for the times list.
 JComponent getTimesList(String cbxLabel)
          Create the GUI for the times list.
 boolean getUseAllTimes()
          Did user choose "Use all times"
 void setDefaultLevelToFirst(boolean value)
          Set the DefaultLevelToFirst property.
 void setTimes(List all, List selected)
          Select the times in the times list
protected  void updateSelectionTab(DataChoice dataChoice)
          Update the tabbed pane
protected  boolean updateSelectionTab(DataSource dataSource, DataChoice dc)
          Update selection panel for data source
protected  void updateSettings(ControlDescriptor cd)
          Update the display settings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSelectionWidget

public DataSelectionWidget(IntegratedDataViewer idv)
Constructor for when we are a part of the DataSelector

Parameters:
idv - Reference to the IDV

DataSelectionWidget

public DataSelectionWidget(IntegratedDataViewer idv,
                           boolean doSettings)
Constructor for when we are a part of the DataSelector

Parameters:
idv - Reference to the IDV
doSettings - include the display settings in the tab
Method Detail

getContents

public JComponent getContents()
get the gui contents

Returns:
gui contents

dataSourceChanged

public void dataSourceChanged(DataSource dataSource)
Called by the DataSelector to handle when the data source has changed

Parameters:
dataSource - The data source that changed

getGeoSelection

public GeoSelection getGeoSelection()
Any geo selection

Returns:
the geoselection or null if none

getSelectedLevelRange

protected Object[] getSelectedLevelRange()
Get the min/max level range

Returns:
min max levels

updateSettings

protected void updateSettings(ControlDescriptor cd)
Update the display settings

Parameters:
cd - new control descriptor

updateSelectionTab

protected void updateSelectionTab(DataChoice dataChoice)
Update the tabbed pane

Parameters:
dataChoice - new data choice

updateSelectionTab

protected boolean updateSelectionTab(DataSource dataSource,
                                     DataChoice dc)
Update selection panel for data source

Parameters:
dataSource - data source
dc - The data choice
Returns:
_more_

createDataSelection

public DataSelection createDataSelection(boolean addLevels)
Create the data selection from everything selected by the user

Parameters:
addLevels - include the levels
Returns:
new data selection

getSelectedSettings

protected List getSelectedSettings()
Get list of selected DisplaySettings

Returns:
list of selected DisplaySettings

getAllDateTimes

public List getAllDateTimes()
Get the list of all dttms

Returns:
List of times

getSelectedDateTimes

public List getSelectedDateTimes()
Return a list of Integer indices of the selected times.

Returns:
List of indices.

getUseAllTimes

public boolean getUseAllTimes()
Did user choose "Use all times"

Returns:
Is the allTimes checkbox selected or true if checkbox not created

setTimes

public void setTimes(List all,
                     List selected)
Select the times in the times list

Parameters:
all - All times
selected - The selected times

getTimesList

public JComponent getTimesList()
Create the GUI for the times list. (i.e., all times button and the times JList)

Returns:
The GUI for times

getTimesList

public JComponent getTimesList(String cbxLabel)
Create the GUI for the times list. (i.e., all times button and the times JList)

Parameters:
cbxLabel - Label for times checkbox
Returns:
The GUI for times

setDefaultLevelToFirst

public void setDefaultLevelToFirst(boolean value)
Set the DefaultLevelToFirst property.

Parameters:
value - The new value for DefaultLevelToFirst

getDefaultLevelToFirst

public boolean getDefaultLevelToFirst()
Get the DefaultLevelToFirst property.

Returns:
The DefaultLevelToFirst