|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.edu.agh.cast.model.attributes.AttributeManager
public abstract class AttributeManager
Class responsible for holding available attribute types for different model element types.
Available attribute types are specific for model element types, such as Node
, ConnectionGroup
,
Legend
etc.
For convenience, the manager acts as a forwarder of all events fired by its registered attributes. Events have ID
ATTRIBUTES_PROPERTY_CHANGE
, and oldValue set to corresponding PropertyChangeEvent
object that is
being forwarded.
Field Summary | |
---|---|
static String |
ATTRIBUTE_REGISTRATION_STATUS
ID of the RegistrationStatus property. |
static String |
ATTRIBUTES_PROPERTY_CHANGE
ID of the AttributesProperty property. |
Constructor Summary | |
---|---|
AttributeManager()
Default constructor. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Add a property change listener to the object. |
protected void |
firePropertyChange(String property,
Object oldValue,
Object newValue)
|
Attribute |
getAttribute(String id)
Returns attribute with given id (name). |
Collection<Attribute> |
getAttributes()
Returns a collection of registered attributes. |
List<Attribute> |
getPermanentAttributes()
Returns list of permanent attributes. |
void |
init(List<Attribute> attributes)
Initialize this manager after deserializing attributes. |
boolean |
isRegisteredId(String id)
Checks if an attribute with given ID is registered. |
void |
propertyChange(PropertyChangeEvent evt)
Forward property change events from single attributes. |
protected Object |
readResolve()
|
void |
registerAttribute(String id,
ValueType valueType)
Registers new Attribute in this manager. |
protected void |
registerPermanentAttribute(String id,
ValueType type,
boolean editable,
boolean showAsLabel)
This register method should be used for predefined attributes, i.e. |
protected void |
registerPermanentAttribute(String id,
ValueType type,
boolean editable,
boolean showAsLabel,
String ownerTypeId,
String modelExtensionId)
This register method should be used for attributes defined in domain models. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Remove a property change listener to the object. |
void |
setAttributeIsLabel(String id,
boolean showAsLabel)
Modifies registered attribute's showAsLabel flag. |
void |
unregisterId(String id)
Unregisters an attribute from this manager. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ATTRIBUTES_PROPERTY_CHANGE
public static final String ATTRIBUTE_REGISTRATION_STATUS
Constructor Detail |
---|
public AttributeManager()
Method Detail |
---|
public boolean isRegisteredId(String id)
id
- ID to check
true
if an attribute with given ID is registeredpublic List<Attribute> getPermanentAttributes()
public void registerAttribute(String id, ValueType valueType)
Attribute
in this manager.
id
- id of the new attributevalueType
- value type of the new attributepublic void setAttributeIsLabel(String id, boolean showAsLabel)
id
- attribute nameshowAsLabel
- new value of the showAsLabel flag
IllegalArgumentException
- if attribute name
is not registered in this managerprotected void registerPermanentAttribute(String id, ValueType type, boolean editable, boolean showAsLabel)
protected void registerPermanentAttribute(String id, ValueType type, boolean editable, boolean showAsLabel, String ownerTypeId, String modelExtensionId)
public Collection<Attribute> getAttributes()
public void unregisterId(String id)
ATTRIBUTE_REGISTRATION_STATUS
event with old value set
to the removed attribute object and newValue set to null.
id
- name of attribute to remove
IllegalArgumentException
- if attribute was not registered in this manager, or attribute is permanentpublic Attribute getAttribute(String id)
id
- attribute name
Attribute
object registered in this manager
IllegalArgumentException
- if attribute id
is not registered in this managerpublic void init(List<Attribute> attributes)
attributes
- list of attributes to registerpublic void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
protected Object readResolve()
public void addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener
in interface IPropertyChangeProvider
l
- property change listenerIPropertyChangeProvider.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener
in interface IPropertyChangeProvider
l
- property change listener#removePropertyChangeListener(java.beans.PropertyChangeListener)
protected void firePropertyChange(String property, Object oldValue, Object newValue)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |