pl.edu.agh.cast.model.visual.backward
Interface AttributeValueContainer

All Known Subinterfaces:
IDiagram
All Known Implementing Classes:
ConnectionGroup, Diagram, Legend, ModelElement, Node

public interface AttributeValueContainer

An interface to be implemented by elements containing attributes.

Author:
AGH CAST Team

Method Summary
 List<AttributeValue> getAllValues()
          Returns complete list of attribute values in this container.
 AttributeManager getAttributeManager()
          Returns attribute manager for this container.
 AttributeValue getAttributeValue(String name)
          Returns the value of the attribute named name.
 boolean isAttributeEditable(String name)
          Checks if given attribute is editable.
 AttributeValue removePropertyValue(String name)
          Removes attribute value from this container.
 void setAttributeValue(String name, Object newValue)
          Sets a new attribute value, fires change event.
 void setAttributeValue(String name, Object newValue, AttributeMergePolicy policy)
          Sets a new attribute value according to given AttributeMergePolicy, fires change event.
 

Method Detail

getAttributeValue

AttributeValue getAttributeValue(String name)
Returns the value of the attribute named name.

Parameters:
name - name of the attribute
Returns:
an AttributeValue instance for the given attribute

setAttributeValue

void setAttributeValue(String name,
                       Object newValue)
Sets a new attribute value, fires change event.

Parameters:
name - name of the attribute to change
newValue - new value of the attribute
Throws:
UnsupportedOperationException - if attribute is not editable

setAttributeValue

void setAttributeValue(String name,
                       Object newValue,
                       AttributeMergePolicy policy)
Sets a new attribute value according to given AttributeMergePolicy, fires change event. If policy is null then acts the same as setAttributeValue(String, Object).

Parameters:
name - name of the attribute to change
newValue - new value of the attribute
policy - merge policy
Throws:
UnsupportedOperationException - if attribute is not editable

isAttributeEditable

boolean isAttributeEditable(String name)
Checks if given attribute is editable.

Parameters:
name - name of the attribute
Returns:
editable flag

getAllValues

List<AttributeValue> getAllValues()
Returns complete list of attribute values in this container. Takes into consideration that registered properties may have changed in the manager, i.e. some values may be obsolete.

Returns:
list of all contained AttributeValues

removePropertyValue

AttributeValue removePropertyValue(String name)
Removes attribute value from this container.

Parameters:
name - name of attribute to remove
Returns:
removed AttributeValue, or null if this attribute's value was not set (see Collection.remove(Object))

getAttributeManager

AttributeManager getAttributeManager()
Returns attribute manager for this container.

Returns:
attribute manager for this container


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.