com.tensegrity.gui.template
Class AttributableOnSetList

java.lang.Object
  extended bycom.tensegrity.gui.template.AttributableOnSetList
All Implemented Interfaces:
Attributable, AttributableOnSet

public class AttributableOnSetList
extends java.lang.Object
implements AttributableOnSet

The class AttributableOnSetList allows you to merge AttributableOnSet instances. This can be useful, if you need to combine several AttributableOnSet's without manually merging their attributes.

Version:
$Id: AttributableOnSetList.java,v 1.5 2006/03/02 11:42:01 BurkhardWick Exp $
Author:
GillesIachelini

Field Summary
 
Fields inherited from interface com.tensegrity.generic.attribute.AttributableOnSet
TREE_SUBSET_POSTFIX
 
Constructor Summary
AttributableOnSetList()
          Creates a new AttributableOnSetList.
 
Method Summary
 void add(AttributableOnSet onSet)
          Adds a given AttributableOnSet to the internal list of elements.
 void addAttributableOnSetListener(AttributableOnSetListener attributableOnSetListener)
          Adds the given listener to *all* listed Attributable's.
 boolean areAttributableEventsEnabled()
          Returns a boolean that indicates whether generating of events is enabled or not.
 void disableAttributableEvents()
          Disables events for the registered listeners.
 void enableAttributableEvents()
          Enables the transmission of events to registered listeners.
 Attribute getAttribute(java.lang.String name)
          Returns the first occurrency of an attribute with the parameter name.
 AttributeSet getAttributes()
          Manually merges all the AttributeSets of the currently listed attributables and returns the resulting Set.
 AttributeSet getAttributesTree()
          Returns an AttributeSet containing all Attributes of this AttributableOnSet in a treelike structure.
 AttributeType getAttributeType(java.lang.String name)
          Returns the AttributeType of the attribute with the given name.
 java.lang.Object getAttributeValue(java.lang.String name)
          Return the value of the attribute with the given name.
 void removeAttributableOnSetListener(AttributableOnSetListener attributableOnSetListener)
          Remove the given listener from *all* listed Attributable's.
 void setAttribute(Attribute attribute)
          Sets the value of the attribute with the same name to the value of the given attribute.
 void setAttributes(AttributeSet attributes)
          Passes the given AttributeSet to all listed Attributable's.
 void setAttributesTree(AttributeSet attributes)
          Performs the same operation as the setAttributes(com.tensegrity.generic.attribute.AttributeSet) method with the difference that the AttributeSet given to this method must provide the treelike structure mentioned in the documentation of the getAttributesTree().
 void setAttributeValue(java.lang.String name, java.lang.Object value)
          Sets the value of the attribute with the name to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributableOnSetList

public AttributableOnSetList()
Creates a new AttributableOnSetList. This constructor does intentionally nothing.

Method Detail

add

public void add(AttributableOnSet onSet)
Adds a given AttributableOnSet to the internal list of elements.

Parameters:
onSet - the AttributableOnSet to add to the internal list.

getAttributes

public AttributeSet getAttributes()
Manually merges all the AttributeSets of the currently listed attributables and returns the resulting Set.

Specified by:
getAttributes in interface AttributableOnSet
Returns:
AttributeSet an AttributeSet with all attributes.
See Also:
AttributableOnSet.getAttributes()

setAttributes

public void setAttributes(AttributeSet attributes)
Passes the given AttributeSet to all listed Attributable's. Each of the Attributable's can decide which attributes to pick from that set.

Specified by:
setAttributes in interface AttributableOnSet
Parameters:
attributes - the AttributeSet consisting of the attributes whose values to set.
See Also:
AttributableOnSet.setAttributes(com.tensegrity.generic.attribute.AttributeSet)

getAttributesTree

public AttributeSet getAttributesTree()
Description copied from interface: AttributableOnSet
Returns an AttributeSet containing all Attributes of this AttributableOnSet in a treelike structure.
Treelike means that each attribute can have a subset that contains subsequent Attributes for an Attribute of this AttributableOnSet.
Since an Attribute can only have one value (in this case an object or the Attributes for an object) the subsequent attributes are plugged into the returned AttributeSet as a new Attribute with the same name and the AttributableOnSet.TREE_SUBSET_POSTFIX.

Specified by:
getAttributesTree in interface AttributableOnSet
Returns:
AttributeSet an AttributeSet with the attributes in a treelike structure

setAttributesTree

public void setAttributesTree(AttributeSet attributes)
Description copied from interface: AttributableOnSet
Performs the same operation as the AttributableOnSet.setAttributes(com.tensegrity.generic.attribute.AttributeSet) method with the difference that the AttributeSet given to this method must provide the treelike structure mentioned in the documentation of the AttributableOnSet.getAttributesTree().

Specified by:
setAttributesTree in interface AttributableOnSet
Parameters:
attributes - the AttributeSet containing the attributes whose values to set.

addAttributableOnSetListener

public void addAttributableOnSetListener(AttributableOnSetListener attributableOnSetListener)
Adds the given listener to *all* listed Attributable's.

Specified by:
addAttributableOnSetListener in interface AttributableOnSet
Parameters:
attributableOnSetListener - an AttributableOnSet listener listening for changes
See Also:
AttributableOnSet.addAttributableOnSetListener(com.tensegrity.generic.attribute.event.AttributableOnSetListener)

removeAttributableOnSetListener

public void removeAttributableOnSetListener(AttributableOnSetListener attributableOnSetListener)
Remove the given listener from *all* listed Attributable's.

Specified by:
removeAttributableOnSetListener in interface AttributableOnSet
Parameters:
attributableOnSetListener - the AttributableOnSet to be removed from the list of listeners.
See Also:
AttributableOnSet.removeAttributableOnSetListener(com.tensegrity.generic.attribute.event.AttributableOnSetListener)

enableAttributableEvents

public void enableAttributableEvents()
Description copied from interface: AttributableOnSet
Enables the transmission of events to registered listeners.

Specified by:
enableAttributableEvents in interface AttributableOnSet

disableAttributableEvents

public void disableAttributableEvents()
Description copied from interface: AttributableOnSet
Disables events for the registered listeners.

Specified by:
disableAttributableEvents in interface AttributableOnSet

areAttributableEventsEnabled

public boolean areAttributableEventsEnabled()
Description copied from interface: AttributableOnSet
Returns a boolean that indicates whether generating of events is enabled or not.

Specified by:
areAttributableEventsEnabled in interface AttributableOnSet
Returns:
boolean flag that indicates whether event generation is active or not

getAttribute

public Attribute getAttribute(java.lang.String name)
Returns the first occurrency of an attribute with the parameter name.

Specified by:
getAttribute in interface Attributable
Parameters:
name - name of the attribute to return.
Returns:
the attribute with the given name or null.
See Also:
Attributable.getAttribute(java.lang.String)

setAttribute

public void setAttribute(Attribute attribute)
Description copied from interface: Attributable
Sets the value of the attribute with the same name to the value of the given attribute.
Notice: If the specific implementor of the Attributable interface doesn't support an Attribute with the name of the Attribute given by attribute, the given attribute is not handled by nor added to the attributes of the Attributable.

Specified by:
setAttribute in interface Attributable
Parameters:
attribute - the attribute to be set.

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String name)
Description copied from interface: Attributable
Return the value of the attribute with the given name.

Specified by:
getAttributeValue in interface Attributable
Parameters:
name - the name of the attribute to return the value from.
Returns:
the value of the attribute with the given name.

setAttributeValue

public void setAttributeValue(java.lang.String name,
                              java.lang.Object value)
Description copied from interface: Attributable
Sets the value of the attribute with the name to the given value.
Notice: If the specific implementor of the Attributable interface doesn't support an Attribute with the name given by name, the attribute given through name and value is not handled nor created by Attributable.

Specified by:
setAttributeValue in interface Attributable
Parameters:
name - the name of the attribute.
value - the value to set the attributes value to.

getAttributeType

public AttributeType getAttributeType(java.lang.String name)
Description copied from interface: Attributable
Returns the AttributeType of the attribute with the given name.

Specified by:
getAttributeType in interface Attributable
Parameters:
name - the name of the attribute.
Returns:
the attribute type with given name.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.