|
||||||||||
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 Attribute s 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 AttributeValueContainer
public 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 IPropertyChangeProvider
public 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 AttributeValueContainer
public boolean isAttributeSettable(java.lang.String name)
public void setAttributeValue(java.lang.String name, java.lang.Object newValue)
AttributeValueContainer
setAttributeValue
in interface AttributeValueContainer
name
- name of the attribute to changenewValue
- new value of the attributepublic void setAttributeValue(java.lang.String name, java.lang.Object newValue, AttributeMergePolicy policy)
AttributeValueContainer
AttributeMergePolicy
, fires change event.
If policy
is null
then acts the same as
AttributeValueContainer.setAttributeValue(String, Object)
.
setAttributeValue
in interface AttributeValueContainer
name
- name of the attribute to changenewValue
- new value of the attributepolicy
- merge policypublic boolean isAttributeEditable(java.lang.String attributeName)
isAttributeEditable
in interface AttributeValueContainer
public java.util.List<AttributeValue> getAllValues()
AttributeValueContainer
getAllValues
in interface AttributeValueContainer
public AttributeValue removePropertyValue(java.lang.String name)
AttributeValueContainer
removePropertyValue
in interface AttributeValueContainer
name
- 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.PropertyChangeListener
protected final void bindToAttributeManager()
public void copyAttributeValues(pl.edu.agh.cast.model.mapper.Mappable mappable)
Attribute
s 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 |