com.tensegrity.gui.swing.control.attributeeditor
Class EditorStateAttributableOnSet

java.lang.Object
  extended bycom.tensegrity.generic.attribute.AttributableOnSetCollection
      extended bycom.tensegrity.gui.swing.control.attributeeditor.EditorStateAttributableOnSet
All Implemented Interfaces:
Attributable, AttributableOnSet

public class EditorStateAttributableOnSet
extends AttributableOnSetCollection
implements AttributableOnSet

AttributableOnSet to edit the hidden state of attributes that is stored in the AttributeEditorProperties.

Author:
BurkhardWick

Field Summary
 
Fields inherited from interface com.tensegrity.generic.attribute.AttributableOnSet
TREE_SUBSET_POSTFIX
 
Constructor Summary
EditorStateAttributableOnSet(AttributeEditorProperties props)
          Constructor
 
Method Summary
 void addAttributableOnSetListener(AttributableOnSetListener attributableOnSetListener)
          Adds a listener to the attributable on set instance.
 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 attribute with the given name or null if there is no Attribute with the given name.
 AttributeSet getAttributes()
          Returns an AttributeSet consisting of all attributes of this AttributableOnSet.
 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.
 boolean isUndefinedState(java.lang.String path)
          Checks whether the value of the attribute identified by the given path is in an undefined state.
 void removeAttributableOnSetListener(AttributableOnSetListener attributableOnSetListener)
          Removes a listener from the attributable on set instance.
 void setAttributableOnSet(AttributableOnSet onset)
          Sets the attributableOnSet for that the attribute visibility should be edited
 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)
          Searches within the AttributeSet given by attributes for attributes that have the same name as the attributes of this AttributableOnSet holds.
 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 com.tensegrity.generic.attribute.AttributableOnSetCollection
addAttributableOnSet, disableTypeRemoval, enableTypeRemoval, findAttribute, get, getPath, getTypeName, getTypeName, getTypeNames, isTypeRemovalEnabled, removeAttributableOnSet, setAttributesTree, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorStateAttributableOnSet

public EditorStateAttributableOnSet(AttributeEditorProperties props)
                             throws ConstraintParserException
Constructor

Parameters:
props - The AttributeEditorProperties which is used to retrieve and set the hidden state of attributes
Throws:
ConstraintParserException - thrown if the constraint for the visibility value could not be parsed
Method Detail

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
Overrides:
getAttributesTree in class AttributableOnSetCollection

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
Overrides:
setAttributesTree in class AttributableOnSetCollection

setAttributableOnSet

public void setAttributableOnSet(AttributableOnSet onset)
Sets the attributableOnSet for that the attribute visibility should be edited

Parameters:
onset - The AttributableOnSet to set

isUndefinedState

public boolean isUndefinedState(java.lang.String path)
Description copied from class: AttributableOnSetCollection
Checks whether the value of the attribute identified by the given path is in an undefined state. Which means that at least two elements in this collection have different values for this attribute.

Overrides:
isUndefinedState in class AttributableOnSetCollection
Parameters:
path - The complete path of the attribute
Returns:
True, if the value is undefined

addAttributableOnSetListener

public void addAttributableOnSetListener(AttributableOnSetListener attributableOnSetListener)
Description copied from interface: AttributableOnSet
Adds a listener to the attributable on set instance.

Specified by:
addAttributableOnSetListener in interface AttributableOnSet
Overrides:
addAttributableOnSetListener in class AttributableOnSetCollection

removeAttributableOnSetListener

public void removeAttributableOnSetListener(AttributableOnSetListener attributableOnSetListener)
Description copied from interface: AttributableOnSet
Removes a listener from the attributable on set instance.

Specified by:
removeAttributableOnSetListener in interface AttributableOnSet
Overrides:
removeAttributableOnSetListener in class AttributableOnSetCollection

enableAttributableEvents

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

Specified by:
enableAttributableEvents in interface AttributableOnSet
Overrides:
enableAttributableEvents in class AttributableOnSetCollection

disableAttributableEvents

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

Specified by:
disableAttributableEvents in interface AttributableOnSet
Overrides:
disableAttributableEvents in class AttributableOnSetCollection

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
Overrides:
areAttributableEventsEnabled in class AttributableOnSetCollection

getAttribute

public Attribute getAttribute(java.lang.String name)
Description copied from interface: Attributable
Returns the attribute with the given name or null if there is no Attribute with the given name.

Specified by:
getAttribute in interface Attributable
Overrides:
getAttribute in class AttributableOnSetCollection

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
Overrides:
setAttribute in class AttributableOnSetCollection

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
Overrides:
getAttributeValue in class AttributableOnSetCollection

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
Overrides:
setAttributeValue in class AttributableOnSetCollection

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
Overrides:
getAttributeType in class AttributableOnSetCollection

getAttributes

public AttributeSet getAttributes()
Description copied from interface: AttributableOnSet
Returns an AttributeSet consisting of all attributes of this AttributableOnSet.

Specified by:
getAttributes in interface AttributableOnSet
Overrides:
getAttributes in class AttributableOnSetCollection

setAttributes

public void setAttributes(AttributeSet attributes)
Description copied from interface: AttributableOnSet
Searches within the AttributeSet given by attributes for attributes that have the same name as the attributes of this AttributableOnSet holds. The value of every attribute that has the same name is used as the new value for the corresponding attribute of this AttributableOnSet. An Attribute within the given AttributeSet that is not an attribute of the object that implements the AttributableOnSet interface is not handled by nor added to the specific implementor of the AttributableOnSet interface.

Specified by:
setAttributes in interface AttributableOnSet
Overrides:
setAttributes in class AttributableOnSetCollection


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