sonification.dataimport.visbards_resourcetoolkit.model
Class DefaultDatasetContainer

java.lang.Object
  extended by sonification.dataimport.visbards_resourcetoolkit.model.DefaultDatasetContainer
All Implemented Interfaces:
java.io.Serializable, CategoryPoolListener, DatasetContainer, DatasetListener, RangeModelListener, PseudoCategoryListener

public class DefaultDatasetContainer
extends java.lang.Object
implements DatasetContainer, DatasetListener, CategoryPoolListener, PseudoCategoryListener, RangeModelListener, java.io.Serializable

This unit keeps a collection of datasets and their default properties. It is able to inform it's listeners about additions/removals of datasets. It also servers as a link to the 3d universe, as it attaches and detatches datasets from it.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface sonification.dataimport.visbards_resourcetoolkit.model.DatasetContainer
MAXGLYPHS
 
Fields inherited from interface sonification.dataimport.visbards_resourcetoolkit.model.DatasetListener
SELECTED_ROW, SELECTED_ROWRANGE_CHANGED
 
Fields inherited from interface sonification.dataimport.visbards_resourcetoolkit.model.RangeModelListener
ALL_CHANGED, OVERALL_RANGE_CHANGED, SELECTED_RANGE_CHANGED
 
Constructor Summary
DefaultDatasetContainer(Universe uni, RangeModel rmodel, PropertyContainer dc, CategoryPool pool)
          Constructs a standard dataset container.
 
Method Summary
 void addDatasets(Dataset[] datasets)
          Adds a dataset to the system.
 void addDatasets(Dataset[] datasets, ProgressReporter pud)
          Adds datasets to the system, reporting progress
 void addListener(DatasetContainerListener listener)
          Registers a listener.
 void categoryAdded(CategoryPool source, Category cat)
          Indicates that a category has been added to the system.
 void categoryRemoved(CategoryPool source, Category cat)
          Indicates that a category has been removed from the system.
 Range computeOverallCategoryRange(Category cat)
          Returns the overall datarange for the specified category
 void computeOverallCategoryRanges()
           
 void datasetChanged(Dataset source, int eventID)
          Notified when one of the datasets changes its encompasing range.
 java.util.Enumeration getAllDatasets()
          Returns all loaded datasets.
 Dataset getDataset(java.lang.String name)
          Returns a dataset.
 java.util.Enumeration getDatasetNames()
          Returns the dataset names.
 PropertyContainer getDefaultsPropertyContainer()
          Returns the default property container for this dataset
 int getGlyphsReserved()
          Number of glyphs allocated by datasets with custom numGlyphs setting
 int getNumDatasets()
          Returns the number of added datasets.
 int getNumDefaultsets()
          Number of datasets using the default numGlyphs setting
 RangeModel getRangeModel()
          Returns the range model of this dataset container.
 void pseudoCategoryChanged(PseudoCategory source)
          An event that indicates that this pseudo category has changed how it computes its values.
 void rangeModelChanged(RangeModel source, int eventID)
          Indicates that the range model changed.
 void removeDataset(Dataset dataset)
          Removes a dataset from the container.
 void removeDataset(Dataset dataset, ProgressReporter pud)
          Removes a dataset from the system.
 void removeExtraCategories()
          Removes categories which are not used by any currently loaded datsets
 void removeListener(DatasetContainerListener listener)
          Unregisters a listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDatasetContainer

public DefaultDatasetContainer(Universe uni,
                               RangeModel rmodel,
                               PropertyContainer dc,
                               CategoryPool pool)
Constructs a standard dataset container.

Method Detail

computeOverallCategoryRanges

public void computeOverallCategoryRanges()

getDataset

public Dataset getDataset(java.lang.String name)
Returns a dataset.

Specified by:
getDataset in interface DatasetContainer

getAllDatasets

public java.util.Enumeration getAllDatasets()
Returns all loaded datasets.

Specified by:
getAllDatasets in interface DatasetContainer

getDatasetNames

public java.util.Enumeration getDatasetNames()
Returns the dataset names. (Currently visualised)

Specified by:
getDatasetNames in interface DatasetContainer

removeDataset

public void removeDataset(Dataset dataset)
                   throws SonificationException
Removes a dataset from the container. (No longer visualised)

Specified by:
removeDataset in interface DatasetContainer
Throws:
SonificationException

removeExtraCategories

public void removeExtraCategories()
Description copied from interface: DatasetContainer
Removes categories which are not used by any currently loaded datsets

Specified by:
removeExtraCategories in interface DatasetContainer

removeDataset

public void removeDataset(Dataset dataset,
                          ProgressReporter pud)
                   throws SonificationException
Removes a dataset from the system. (No longer visualised)

Specified by:
removeDataset in interface DatasetContainer
Throws:
SonificationException

getGlyphsReserved

public int getGlyphsReserved()
Description copied from interface: DatasetContainer
Number of glyphs allocated by datasets with custom numGlyphs setting

Specified by:
getGlyphsReserved in interface DatasetContainer

getNumDefaultsets

public int getNumDefaultsets()
Description copied from interface: DatasetContainer
Number of datasets using the default numGlyphs setting

Specified by:
getNumDefaultsets in interface DatasetContainer

addDatasets

public void addDatasets(Dataset[] datasets,
                        ProgressReporter pud)
                 throws SonificationException
Adds datasets to the system, reporting progress

Specified by:
addDatasets in interface DatasetContainer
Throws:
SonificationException

addDatasets

public void addDatasets(Dataset[] datasets)
                 throws SonificationException
Adds a dataset to the system.

Specified by:
addDatasets in interface DatasetContainer
Throws:
SonificationException

computeOverallCategoryRange

public Range computeOverallCategoryRange(Category cat)
Returns the overall datarange for the specified category

Specified by:
computeOverallCategoryRange in interface DatasetContainer

getRangeModel

public RangeModel getRangeModel()
Returns the range model of this dataset container.

Specified by:
getRangeModel in interface DatasetContainer

getDefaultsPropertyContainer

public PropertyContainer getDefaultsPropertyContainer()
Returns the default property container for this dataset

Specified by:
getDefaultsPropertyContainer in interface DatasetContainer

rangeModelChanged

public void rangeModelChanged(RangeModel source,
                              int eventID)
Indicates that the range model changed.

Specified by:
rangeModelChanged in interface RangeModelListener

addListener

public void addListener(DatasetContainerListener listener)
Registers a listener.

Specified by:
addListener in interface DatasetContainer

removeListener

public void removeListener(DatasetContainerListener listener)
Unregisters a listener.

Specified by:
removeListener in interface DatasetContainer

datasetChanged

public void datasetChanged(Dataset source,
                           int eventID)
Notified when one of the datasets changes its encompasing range.

Specified by:
datasetChanged in interface DatasetListener

categoryAdded

public void categoryAdded(CategoryPool source,
                          Category cat)
Indicates that a category has been added to the system.

Specified by:
categoryAdded in interface CategoryPoolListener

categoryRemoved

public void categoryRemoved(CategoryPool source,
                            Category cat)
Indicates that a category has been removed from the system.

Specified by:
categoryRemoved in interface CategoryPoolListener

getNumDatasets

public int getNumDatasets()
Returns the number of added datasets.

Specified by:
getNumDatasets in interface DatasetContainer

pseudoCategoryChanged

public void pseudoCategoryChanged(PseudoCategory source)
An event that indicates that this pseudo category has changed how it computes its values.

Specified by:
pseudoCategoryChanged in interface PseudoCategoryListener