|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpl.edu.agh.cast.model.visual.ModelElement
public abstract class ModelElement
An abstract class for a visual model element. Provides implementation for property change support
| Field Summary | |
|---|---|
protected java.util.SortedMap<Attribute,AttributeValue> |
_attributeValues
|
static java.lang.String |
ATTRIBUTE_CHANGE
Id of an event informing of attribute value changes in model elements. |
| Constructor Summary | |
|---|---|
protected |
ModelElement()
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a property change listener to the object |
protected void |
bindToAttributeManager()
Registers this model elements to notifications from its attribute manager about changed properties. |
protected void |
copyAttributes(AttributeValueContainer target)
Copies attributes present in current model element to another model element |
void |
copyAttributeValues(pl.edu.agh.cast.model.mapper.Mappable mappable)
Copies values of all Attributes of mappable that are
registered in this ModelElement's AttributeManager. |
protected void |
firePropertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
|
java.util.List<AttributeValue> |
getAllValues()
Returns complete list of attribute values in this container. |
abstract AttributeManager |
getAttributeManager()
Returns element's attribute manager |
AttributeValue |
getAttributeValue(java.lang.String name)
|
long |
getMid()
|
boolean |
isAttributeEditable(java.lang.String attributeName)
|
boolean |
isAttributeSettable(java.lang.String name)
|
boolean |
isSaved()
|
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
protected java.lang.Object |
readResolve()
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a property change listener to the object |
AttributeValue |
removePropertyValue(java.lang.String name)
Removes attribute value from this container. |
void |
setAttributeValue(java.lang.String name,
java.lang.Object newValue)
Sets a new attribute value, fires change event. |
void |
setAttributeValue(java.lang.String name,
java.lang.Object newValue,
AttributeMergePolicy policy)
Sets a new attribute value according to given AttributeMergePolicy, fires change event. |
void |
setMid(long mid)
|
void |
setSaved(boolean saved)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ATTRIBUTE_CHANGE
PropertyChangeEvent, old value is of type
AttributeValue, and new value is the
AttributeValue.getValue() of the new value.
@XStreamConverter(value=AttributeValuesConverter.class) protected java.util.SortedMap<Attribute,AttributeValue> _attributeValues
| Constructor Detail |
|---|
protected ModelElement()
| Method Detail |
|---|
public abstract AttributeManager getAttributeManager()
getAttributeManager in interface AttributeValueContainerpublic long getMid()
public void setMid(long mid)
public boolean isSaved()
public void setSaved(boolean saved)
protected java.lang.Object readResolve()
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
IPropertyChangeProvider
addPropertyChangeListener in interface IPropertyChangeProviderpublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
IPropertyChangeProvider
removePropertyChangeListener in interface IPropertyChangeProvider
protected void firePropertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
public AttributeValue getAttributeValue(java.lang.String name)
getAttributeValue in interface AttributeValueContainerpublic boolean isAttributeSettable(java.lang.String name)
public void setAttributeValue(java.lang.String name,
java.lang.Object newValue)
AttributeValueContainer
setAttributeValue in interface AttributeValueContainername - name of the attribute to changenewValue - new value of the attribute
public void setAttributeValue(java.lang.String name,
java.lang.Object newValue,
AttributeMergePolicy policy)
AttributeValueContainerAttributeMergePolicy, fires change event.
If policy is null then acts the same as
AttributeValueContainer.setAttributeValue(String, Object).
setAttributeValue in interface AttributeValueContainername - name of the attribute to changenewValue - new value of the attributepolicy - merge policypublic boolean isAttributeEditable(java.lang.String attributeName)
isAttributeEditable in interface AttributeValueContainerpublic java.util.List<AttributeValue> getAllValues()
AttributeValueContainer
getAllValues in interface AttributeValueContainerpublic AttributeValue removePropertyValue(java.lang.String name)
AttributeValueContainer
removePropertyValue in interface AttributeValueContainername - name of attribute to remove
AttributeValue, or null if this attribute's value
was not set (see Collection.remove(Object))protected void copyAttributes(AttributeValueContainer target)
target - public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerprotected final void bindToAttributeManager()
public void copyAttributeValues(pl.edu.agh.cast.model.mapper.Mappable mappable)
Attributes of mappable that are
registered in this ModelElement's AttributeManager.
If defined, the Attribute.getDefaultMergePolicy() policies are
used in order to update particular attribute value.
mappable - Mappable to copy attribute values' from
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||