Package ucar.unidata.data
Class CompositeDataChoice
java.lang.Object
ucar.unidata.data.DataChoice
ucar.unidata.data.DirectDataChoice
ucar.unidata.data.CompositeDataChoice
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
ConstructorsConstructorDescriptionCreate a CompositeDataChoices with no associated child choicesCreate a CompositeDataChoices from another composite.CompositeDataChoice
(DataSource dataSource, Object id, String name, String description, List categories) Create a composite data choice for the associatedDataSource
given the other parameters.CompositeDataChoice
(DataSource dataSource, Object id, String name, String description, List categories, Hashtable properties) Create a composite data choice for the associatedDataSource
given the other parameters.CompositeDataChoice
(DataSource dataSource, Object id, String description, List categories) Create a composite data choice for the associatedDataSource
given the other parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add aDataChoice
to the compositecloneMe()
Method for cloning this choice.void
Gets called by the GUI to incrementally add children if neededOverride the superclass method for this.getAllLevels
(DataSelection dataSelection) Get all the levels associated with this choiceGet 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
Get the number of childDataChoice
sOverride the superclass method for this.boolean
Get the UseDataSourceToFindTimes property.void
initAfterUnPersistence
(Hashtable properties) This gets called after the data choice has been unpersistedvoid
Remove the current childrenvoid
Remove aDataChoice
from the compositevoid
replaceDataChoice
(DataChoice oldDataChoice, DataChoice newDataChoice) Replace the given child with the given choldvoid
replaceDataChoices
(List newChoices) Remove the current children and add the new onesvoid
Set the list of child data choices for this compositevoid
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
-
Constructor Details
-
CompositeDataChoice
public CompositeDataChoice()Create a CompositeDataChoices with no associated child choices -
CompositeDataChoice
Create a CompositeDataChoices from another composite. Clones the set ofDataChoice
s fromother
.- Parameters:
other
- other composite
-
CompositeDataChoice
Create a composite data choice for the associatedDataSource
given the other parameters.- Parameters:
dataSource
- source of the dataid
- id of this choicedescription
- description for this choicecategories
- choice categories
-
CompositeDataChoice
public CompositeDataChoice(DataSource dataSource, Object id, String name, String description, List categories) Create a composite data choice for the associatedDataSource
given the other parameters.- Parameters:
dataSource
- source of the dataid
- id of this choicename
- name of this choicedescription
- description for this choicecategories
- choice categories
-
CompositeDataChoice
public CompositeDataChoice(DataSource dataSource, Object id, String name, String description, List categories, Hashtable properties) Create a composite data choice for the associatedDataSource
given the other parameters.- Parameters:
dataSource
- source of the dataid
- id of this choicename
- name of this choicedescription
- description for this choicecategories
- choice categoriesproperties
- miscellaneous properties for this choice
-
-
Method Details
-
expandIfNeeded
public void expandIfNeeded()Gets called by the GUI to incrementally add children if needed -
cloneMe
Method for cloning this choice.- Overrides:
cloneMe
in classDirectDataChoice
- Returns:
- new DataChoice with same properties as this.
-
initAfterUnPersistence
This gets called after the data choice has been unpersisted- Overrides:
initAfterUnPersistence
in classDirectDataChoice
- Parameters:
properties
- Properties
-
getFinalDataChoices
Add to the given list all final data choices (i.e., the leafs of the datachoice tree)- Overrides:
getFinalDataChoices
in classDirectDataChoice
- Parameters:
finalDataChoices
- The list to add to
-
getNumChildren
public int getNumChildren()Get the number of childDataChoice
s- Returns:
- number of child choices
-
getAllLevels
Get all the levels associated with this choice- Overrides:
getAllLevels
in classDirectDataChoice
- Parameters:
dataSelection
- data selection- Returns:
- List of levels
-
getAllDateTimes
Override the superclass method for this.- Overrides:
getAllDateTimes
in classDirectDataChoice
- Returns:
- a unique composite of the times for all child choices.
-
getSelectedDateTimes
Override the superclass method for this.- Overrides:
getSelectedDateTimes
in classDirectDataChoice
- Returns:
- a unique set of the selected times of all child choices
-
addDataChoice
Add aDataChoice
to the composite- Parameters:
c
- choice to add
-
replaceDataChoice
Replace the given child with the given chold- Parameters:
oldDataChoice
- old onenewDataChoice
- new one
-
replaceDataChoices
Remove the current children and add the new ones- Parameters:
newChoices
- New children data choices
-
removeAllDataChoices
public void removeAllDataChoices()Remove the current children -
removeDataChoice
Remove aDataChoice
from the composite- Parameters:
c
- choice to remove
-
getDataChoices
Get the list of child data choices.- Returns:
- list of children
-
setDataChoices
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
-