sonification.dataimport.visbards_resourcetoolkit.model
Class DefaultDataset

java.lang.Object
  extended by sonification.dataimport.visbards_resourcetoolkit.model.DefaultDataset
All Implemented Interfaces:
ArrowManagerListener, Dataset, ModeManagerListener, PickListener, PropertyContainerListener, RangeModelListener, CategoryListener, PseudoCategoryListener

public class DefaultDataset
extends java.lang.Object
implements Dataset, PseudoCategoryListener, CategoryListener, PropertyContainerListener, RangeModelListener, ArrowManagerListener, PickListener, ModeManagerListener

The dataset is an extetion of the dataset properties container. It contains a personal set of dataset properties.


Field Summary
 
Fields inherited from interface sonification.dataimport.visbards_resourcetoolkit.model.RangeModelListener
ALL_CHANGED, OVERALL_RANGE_CHANGED, SELECTED_RANGE_CHANGED
 
Fields inherited from interface sonification.dataimport.visbards_resourcetoolkit.repository.category.CategoryListener
BOTH_RANGES_CHANGED, OVERALL_RANGE_CHANGED, PALETTE_CHANGED, RANGE_CHANGED
 
Constructor Summary
DefaultDataset(Repository rep, java.lang.String name)
           
 
Method Summary
 void addListener(DatasetListener listener)
          Registers a listener.
 void arrowAdded(ArrowManager source)
          Indicates that an arrow has been added.
 void arrowRemoved(ArrowManager source, int idx)
          Indicates that an arrow at index idx has been removed
 void attach(PropertyContainer container, RangeModel model, Universe uni)
          Attach a dataset to the universe.
 void categoryChanged(Category source, int eventID)
          An event indicating something about the category has changed.
 void detach()
          Detatch stop visualising this dataset.
 int findGlyphRow(Glyph g)
          Returns the row address of the glyph.
 Glyph findMiddleVisibleGlyph()
          Returns the middle vissible glyph of this dataset.
 java.lang.Object getBasePropVal(Property prop)
          This method either returns our own property value, or (if we dont have it) returns one from the default property container.
 PropertyContainer getDefaultPropertyContainer()
          Returns the default property container of this dataset.
 java.lang.String getName()
          Returns the name of the dataset.
 int getNumGlyphsDisplayed()
          Returns the number of currently displayed glyphs
 PropertyContainer getPropertyContainer()
          Returns the property container of the dataset.
 Repository getRepository()
          Returns the repository of this dataset.
 Range getRowRange()
          Returns the currently displayed row range
 int getSelectedRow()
          Returns the currently selected row.
 java.awt.Color getStaticColor()
          Returns the static glyph color for this dataset.
 void modeChanged(ModeManager source)
          Indicates a switch
 void picked(PickEvent event)
          Glyph has been picked, check if it needs to be selected.
 void propertyChanged(PropertyContainer source, Property prop)
          Indicates that the VALUE for a particular visual property has changed.
 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 controller changed.
 void removeListener(DatasetListener listener)
          Unregisters a listener.
 void setStaticColor(java.awt.Color col)
          Change the static glyph color for this dataset.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultDataset

public DefaultDataset(Repository rep,
                      java.lang.String name)
Method Detail

setStaticColor

public void setStaticColor(java.awt.Color col)
Change the static glyph color for this dataset. (The color to render glyphs in case the static color property is set to true)

Specified by:
setStaticColor in interface Dataset

getStaticColor

public java.awt.Color getStaticColor()
Returns the static glyph color for this dataset.

Specified by:
getStaticColor in interface Dataset

attach

public void attach(PropertyContainer container,
                   RangeModel model,
                   Universe uni)
Attach a dataset to the universe.

Specified by:
attach in interface Dataset

getDefaultPropertyContainer

public PropertyContainer getDefaultPropertyContainer()
Returns the default property container of this dataset.

Specified by:
getDefaultPropertyContainer in interface Dataset

detach

public void detach()
Detatch stop visualising this dataset.

Specified by:
detach in interface Dataset

findGlyphRow

public int findGlyphRow(Glyph g)
Returns the row address of the glyph. Returns -1 if glyph does not belong to this dataset.

Specified by:
findGlyphRow in interface Dataset

findMiddleVisibleGlyph

public Glyph findMiddleVisibleGlyph()
Description copied from interface: Dataset
Returns the middle vissible glyph of this dataset.

Specified by:
findMiddleVisibleGlyph in interface Dataset

getNumGlyphsDisplayed

public int getNumGlyphsDisplayed()
Returns the number of currently displayed glyphs

Specified by:
getNumGlyphsDisplayed in interface Dataset

getRowRange

public Range getRowRange()
Returns the currently displayed row range

Specified by:
getRowRange in interface Dataset

getSelectedRow

public int getSelectedRow()
Returns the currently selected row.

Specified by:
getSelectedRow in interface Dataset

getPropertyContainer

public PropertyContainer getPropertyContainer()
Returns the property container of the dataset.

Specified by:
getPropertyContainer in interface Dataset

getName

public java.lang.String getName()
Returns the name of the dataset.

Specified by:
getName in interface Dataset

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getRepository

public Repository getRepository()
Returns the repository of this dataset.

Specified by:
getRepository in interface Dataset

getBasePropVal

public java.lang.Object getBasePropVal(Property prop)
This method either returns our own property value, or (if we dont have it) returns one from the default property container.

Specified by:
getBasePropVal in interface Dataset

addListener

public void addListener(DatasetListener listener)
Registers a listener.

Specified by:
addListener in interface Dataset

removeListener

public void removeListener(DatasetListener listener)
Unregisters a listener.

Specified by:
removeListener in interface Dataset

rangeModelChanged

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

Specified by:
rangeModelChanged in interface RangeModelListener

propertyChanged

public void propertyChanged(PropertyContainer source,
                            Property prop)
Indicates that the VALUE for a particular visual property has changed. This call comes from the default property container when it changes the default. We ignore the default if we have our own setting.

Specified by:
propertyChanged in interface PropertyContainerListener

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

categoryChanged

public void categoryChanged(Category source,
                            int eventID)
An event indicating something about the category has changed.

Specified by:
categoryChanged in interface CategoryListener

arrowAdded

public void arrowAdded(ArrowManager source)
Indicates that an arrow has been added. (to the end of the arrow list)

Specified by:
arrowAdded in interface ArrowManagerListener

arrowRemoved

public void arrowRemoved(ArrowManager source,
                         int idx)
Indicates that an arrow at index idx has been removed

Specified by:
arrowRemoved in interface ArrowManagerListener

picked

public void picked(PickEvent event)
Glyph has been picked, check if it needs to be selected.

Specified by:
picked in interface PickListener

modeChanged

public void modeChanged(ModeManager source)
Indicates a switch

Specified by:
modeChanged in interface ModeManagerListener