ucar.unidata.data
Class CompositeDataChoice

java.lang.Object
  extended by ucar.unidata.data.DataChoice
      extended by ucar.unidata.data.DirectDataChoice
          extended by ucar.unidata.data.CompositeDataChoice

public class CompositeDataChoice
extends DirectDataChoice

A class for compositing data choices. This is useful for having a DataChoice with associated categories and child choices for the individual components.

Version:
$Revision: 1.36 $
Author:
IDV Development Team

Field Summary
 
Fields inherited from class ucar.unidata.data.DirectDataChoice
dataSource, PROP_WRITEDATASOURCE
 
Fields inherited from class ucar.unidata.data.DataChoice
description, id, name, NULL_DATASELECTION, NULL_PROPERTIES, NULL_REQUESTPROPERTIES, parent, PROP_ICON, PROP_REQUESTER, properties
 
Constructor Summary
CompositeDataChoice()
          Create a CompositeDataChoices with no associated child choices
CompositeDataChoice(CompositeDataChoice other)
          Create a CompositeDataChoices from another composite.
CompositeDataChoice(DataSource dataSource, Object id, String description, List categories)
          Create a composite data choice for the associated DataSource given the other parameters.
CompositeDataChoice(DataSource dataSource, Object id, String name, String description, List categories)
          Create a composite data choice for the associated DataSource given the other parameters.
CompositeDataChoice(DataSource dataSource, Object id, String name, String description, List categories, Hashtable properties)
          Create a composite data choice for the associated DataSource given the other parameters.
 
Method Summary
 void addDataChoice(DataChoice c)
          Add a DataChoice to the composite
 DataChoice cloneMe()
          Method for cloning this choice.
 void expandIfNeeded()
          Gets called by the GUI to incrementally add children if needed
 List getAllDateTimes()
          Override the superclass method for this.
 List getAllLevels(DataSelection dataSelection)
          Get all the levels associated with this choice
 List getDataChoices()
          Get the list of child data choices.
 void getFinalDataChoices(List finalDataChoices)
          Add to the given list all final data choices (i.e., the leafs of the datachoice tree)
 int getNumChildren()
          Get the number of child DataChoices
 List getSelectedDateTimes()
          Override the superclass method for this.
 boolean getUseDataSourceToFindTimes()
          Get the UseDataSourceToFindTimes property.
 void initAfterUnPersistence(Hashtable properties)
          This gets called after the data choice has been unpersisted
 void removeAllDataChoices()
          Remove the current children
 void removeDataChoice(DataChoice c)
          Remove a DataChoice from the composite
 void replaceDataChoice(DataChoice oldDataChoice, DataChoice newDataChoice)
          Replace the given child with the given chold
 void replaceDataChoices(List newChoices)
          Remove the current children and add the new ones
 void setDataChoices(List l)
          Set the list of child data choices for this composite
 void setUseDataSourceToFindTimes(boolean value)
          Set the UseDataSourceToFindTimes property.
 
Methods inherited from class ucar.unidata.data.DirectDataChoice
addDataChangeListener, basicallyEquals, equals, getData, getDataSource, getDataSources, getFullDescription, hashCode, removeDataChangeListener, setDataSource
 
Methods inherited from class ucar.unidata.data.DataChoice
addCategory, addCurrentName, addParamNameToCategories, cloneDataChoices, createClone, getAllLevels, getCategories, getCurrentNames, getData, getData, getDataCategories, getDataCategories, getDataSelection, getDescription, getDisplayCategory, getFixedRequestProperties, getForUser, getId, getIndexedName, getName, getParent, getProperties, getProperty, getProperty, getProperty, getStringId, isEndUserFormula, mergeRequestProperties, setCategories, setDataCategories, setDataSelection, setDescription, setFixedRequestProperties, setId, setLevelSelection, setName, setObjectProperty, setParent, setProperties, setProperty, setProperty, setTimeSelection, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeDataChoice

public CompositeDataChoice()
Create a CompositeDataChoices with no associated child choices


CompositeDataChoice

public CompositeDataChoice(CompositeDataChoice other)
Create a CompositeDataChoices from another composite. Clones the set of DataChoices from other.

Parameters:
other - other composite

CompositeDataChoice

public CompositeDataChoice(DataSource dataSource,
                           Object id,
                           String description,
                           List categories)
Create a composite data choice for the associated DataSource given the other parameters.

Parameters:
dataSource - source of the data
id - id of this choice
description - description for this choice
categories - choice categories

CompositeDataChoice

public CompositeDataChoice(DataSource dataSource,
                           Object id,
                           String name,
                           String description,
                           List categories)
Create a composite data choice for the associated DataSource given the other parameters.

Parameters:
dataSource - source of the data
id - id of this choice
name - name of this choice
description - description for this choice
categories - choice categories

CompositeDataChoice

public CompositeDataChoice(DataSource dataSource,
                           Object id,
                           String name,
                           String description,
                           List categories,
                           Hashtable properties)
Create a composite data choice for the associated DataSource given the other parameters.

Parameters:
dataSource - source of the data
id - id of this choice
name - name of this choice
description - description for this choice
categories - choice categories
properties - miscellaneous properties for this choice
Method Detail

expandIfNeeded

public void expandIfNeeded()
Gets called by the GUI to incrementally add children if needed


cloneMe

public DataChoice cloneMe()
Method for cloning this choice.

Overrides:
cloneMe in class DirectDataChoice
Returns:
new DataChoice with same properties as this.

initAfterUnPersistence

public void initAfterUnPersistence(Hashtable properties)
This gets called after the data choice has been unpersisted

Overrides:
initAfterUnPersistence in class DirectDataChoice
Parameters:
properties - Properties

getFinalDataChoices

public void getFinalDataChoices(List finalDataChoices)
Add to the given list all final data choices (i.e., the leafs of the datachoice tree)

Overrides:
getFinalDataChoices in class DirectDataChoice
Parameters:
finalDataChoices - The list to add to

getNumChildren

public int getNumChildren()
Get the number of child DataChoices

Returns:
number of child choices

getAllLevels

public List getAllLevels(DataSelection dataSelection)
Get all the levels associated with this choice

Overrides:
getAllLevels in class DirectDataChoice
Parameters:
dataSelection - data selection
Returns:
List of levels

getAllDateTimes

public List getAllDateTimes()
Override the superclass method for this.

Overrides:
getAllDateTimes in class DirectDataChoice
Returns:
a unique composite of the times for all child choices.

getSelectedDateTimes

public List getSelectedDateTimes()
Override the superclass method for this.

Overrides:
getSelectedDateTimes in class DirectDataChoice
Returns:
a unique set of the selected times of all child choices

addDataChoice

public void addDataChoice(DataChoice c)
Add a DataChoice to the composite

Parameters:
c - choice to add

replaceDataChoice

public void replaceDataChoice(DataChoice oldDataChoice,
                              DataChoice newDataChoice)
Replace the given child with the given chold

Parameters:
oldDataChoice - old one
newDataChoice - new one

replaceDataChoices

public void replaceDataChoices(List newChoices)
Remove the current children and add the new ones

Parameters:
newChoices - New children data choices

removeAllDataChoices

public void removeAllDataChoices()
Remove the current children


removeDataChoice

public void removeDataChoice(DataChoice c)
Remove a DataChoice from the composite

Parameters:
c - choice to remove

getDataChoices

public List getDataChoices()
Get the list of child data choices.

Returns:
list of children

setDataChoices

public void setDataChoices(List l)
Set the list of child data choices for this composite

Parameters:
l - list of choices

setUseDataSourceToFindTimes

public void setUseDataSourceToFindTimes(boolean value)
Set the UseDataSourceToFindTimes property.

Parameters:
value - The new value for UseDataSourceToFindTimes

getUseDataSourceToFindTimes

public boolean getUseDataSourceToFindTimes()
Get the UseDataSourceToFindTimes property.

Returns:
The UseDataSourceToFindTimes