|
||||||||||
| 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 java.lang.String |
ATTRIBUTE_REGISTRATION_STATUS
|
static java.lang.String |
ATTRIBUTES_PROPERTY_CHANGE
|
| Constructor Summary | |
|---|---|
AttributeManager()
|
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a property change listener to the object |
protected void |
firePropertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
|
Attribute |
getAttribute(java.lang.String id)
Returns attribute with given id (name). |
java.util.Collection<Attribute> |
getAttributes()
|
java.util.List<Attribute> |
getPermanentAttributes()
|
void |
init(java.util.List<Attribute> attributes)
Initialise this manager after deserializing attributes |
boolean |
isRegisteredId(java.lang.String id)
|
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Forward property change events from single attributes |
protected java.lang.Object |
readResolve()
|
void |
registerAttribute(java.lang.String id,
ValueType valueType)
|
protected void |
registerPermanentAttribute(java.lang.String id,
ValueType type,
boolean editable,
boolean showAsLabel)
This register method should be used for predefined attributes, i.e. |
protected void |
registerPermanentAttribute(java.lang.String id,
ValueType type,
boolean editable,
boolean showAsLabel,
java.lang.String ownerTypeId,
java.lang.String modelExtensionId)
This register method should be used for attributes defined in domain models. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a property change listener to the object |
void |
setAttributeIsLabel(java.lang.String id,
boolean showAsLabel)
Modifies registered attribute's showAsLabel flag. |
void |
unregisterId(java.lang.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 java.lang.String ATTRIBUTES_PROPERTY_CHANGE
public static final java.lang.String ATTRIBUTE_REGISTRATION_STATUS
| Constructor Detail |
|---|
public AttributeManager()
| Method Detail |
|---|
public boolean isRegisteredId(java.lang.String id)
public java.util.List<Attribute> getPermanentAttributes()
public void registerAttribute(java.lang.String id,
ValueType valueType)
public void setAttributeIsLabel(java.lang.String id,
boolean showAsLabel)
id - attribute nameshowAsLabel - new value of the showAsLabel flag
java.lang.IllegalArgumentException - if attribute name is not registered in this
manager
protected void registerPermanentAttribute(java.lang.String id,
ValueType type,
boolean editable,
boolean showAsLabel)
protected void registerPermanentAttribute(java.lang.String id,
ValueType type,
boolean editable,
boolean showAsLabel,
java.lang.String ownerTypeId,
java.lang.String modelExtensionId)
public java.util.Collection<Attribute> getAttributes()
public void unregisterId(java.lang.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
java.lang.IllegalArgumentException - if attribute was not registered in this manager, or attribute
is permanentpublic Attribute getAttribute(java.lang.String id)
id - attribute name
Attribute object registered in this manager
java.lang.IllegalArgumentException - if attribute id is not registered in this
managerpublic void init(java.util.List<Attribute> attributes)
attributes - public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerprotected 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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||