sonification.dataimport.visbards_resourcetoolkit.model
Class DefaultPropertyContainer

java.lang.Object
  extended by sonification.dataimport.visbards_resourcetoolkit.model.DefaultPropertyContainer
All Implemented Interfaces:
ArrowManagerListener, CategoryPoolListener, PropertyContainer, SettingsHolder

public class DefaultPropertyContainer
extends java.lang.Object
implements PropertyContainer, CategoryPoolListener, ArrowManagerListener, SettingsHolder


Constructor Summary
DefaultPropertyContainer(boolean allowNulls)
          Initialize the property container.
 
Method Summary
 void addListener(PropertyContainerListener listener)
          Registers a listener.
 boolean allowsNulls()
          Returns true if this container allows nulls.
 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 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.
 void dispose()
          Unregisters and cleans up.
protected  void firePropertyChangedEvent(Property prop)
          Send a general event to all listeners.
 Property[] getAllProperties()
          Returns all the currently existing properties.
 java.lang.String getHolderID()
          Returns a string which identifies this object uniquely.
 java.lang.Object getPropertyValue(Property prop)
          Return the value for a particular visual property
 java.util.HashMap getSettings()
          Returns a hashmap of settings (strings) which represent the current object state, and are keyed by string names.
 boolean hasProperty(Property prop)
          Returns true if this container has the property.
 void removeListener(PropertyContainerListener listener)
          Unregisters a listener.
 void setPropertyValue(Property prop, java.lang.Object val)
          Change the visual property to a given value.
 void setSettings(java.util.HashMap settings)
          Changes the settings of this object to match the settings in the specified hashmap.
static java.lang.Object stringToVal(Property prop, java.lang.String val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPropertyContainer

public DefaultPropertyContainer(boolean allowNulls)
Initialize the property container. If allowNulls is false, setting null values for non category properties is not allowed.

Method Detail

setPropertyValue

public void setPropertyValue(Property prop,
                             java.lang.Object val)
Description copied from interface: PropertyContainer
Change the visual property to a given value.

Specified by:
setPropertyValue in interface PropertyContainer

getPropertyValue

public java.lang.Object getPropertyValue(Property prop)
Return the value for a particular visual property

Specified by:
getPropertyValue in interface PropertyContainer

stringToVal

public static java.lang.Object stringToVal(Property prop,
                                           java.lang.String val)

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

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. Bump the index of properties down one.

Specified by:
arrowRemoved in interface ArrowManagerListener

dispose

public void dispose()
Unregisters and cleans up.

Specified by:
dispose in interface PropertyContainer

getAllProperties

public Property[] getAllProperties()
Returns all the currently existing properties.

Specified by:
getAllProperties in interface PropertyContainer

allowsNulls

public boolean allowsNulls()
Returns true if this container allows nulls.

Specified by:
allowsNulls in interface PropertyContainer

getSettings

public java.util.HashMap getSettings()
Returns a hashmap of settings (strings) which represent the current object state, and are keyed by string names.

Specified by:
getSettings in interface SettingsHolder

setSettings

public void setSettings(java.util.HashMap settings)
Changes the settings of this object to match the settings in the specified hashmap. HashMap may be empty, in which case no settings are delivered

Specified by:
setSettings in interface SettingsHolder

hasProperty

public boolean hasProperty(Property prop)
Returns true if this container has the property.

Specified by:
hasProperty in interface PropertyContainer

firePropertyChangedEvent

protected void firePropertyChangedEvent(Property prop)
Send a general event to all listeners.


addListener

public void addListener(PropertyContainerListener listener)
Registers a listener.

Specified by:
addListener in interface PropertyContainer

removeListener

public void removeListener(PropertyContainerListener listener)
Unregisters a listener.

Specified by:
removeListener in interface PropertyContainer

getHolderID

public java.lang.String getHolderID()
Returns a string which identifies this object uniquely. Any string is valid as long as it does not contain the underscore character.

Specified by:
getHolderID in interface SettingsHolder