Skip navigation links

Package ucar.unidata.data

The data package.

See: Description

Package ucar.unidata.data Description

The data package.

DataCategory

A DataCategory object is really a hierarchy of objects, each identified with a String component. There are two flavors. The first is a "display" category. These are used to create the DataChoice DataTree and menus in the IDV. The second use of the DataCategory is to match up a DataChoice with the DisplayControls that are applicable to it.

There are some utility methods that allow you to create a DataCategory from a "-" separated String definition. For example:
DataCategory category = DataCategory.parseCategory ("2D grid", true);
Will give a DataCategory with the single component "2D grid". The true says to make the DataCategory be a display category.

Alternatively:
DataCategory.parseCategory ("GRID-2D-TIME;", false);
will create a non-display DataCategory that can be used by DisplayControl-s that need gridded, 2 dimensional data with time.

Another utility method takes a String of ";" delimited DataCategory specifications and returns a List:
List 2dcategories = DataCategory.parseCategories ("2D grid;GRID-2D-TIME;");
Or
List 3dcategories = DataCategory.parseCategories ("3D grid;GRID-3D-TIME;");
Here by default the first category parsed (e.g., "2D grid" and "3D grid") will be the display categories.

So the DataChoice objects, which represent data available from a DataSource, hold a list of categories that define the flavor of data. The DisplayControl-s, (well really the ControlDescriptor-s) hold a list of categories which define the flavors of data they are applicable to. The categories that a DisplayControl has can contain regular expression patterns.

To see what display controls are applicable to what categories look at the file:
/ucar/unidata/idv/resources.controls.xml

There you will see entries like:

    categories="*-2D-*;*-3D-*"
This says that the given DisplayControl is applicable to anything that has 2D or 3D in any of its category components.

The TextDisplayControl has categories:

   categories="text;html" 
which says it is applicable to any category of "text" or "html"

The image sequence control has a single category:

   categories="IMAGE-2D-TIME" 
Which says it will only match data that has the exact category 2d, images with time.
Skip navigation links