ChainGraphItem Class Reference

Inheritance diagram for ChainGraphItem:
Collaboration diagram for ChainGraphItem:

List of all members.

Detailed Description

Abstract prototype of a model element.

This class provides features necessary for all model elements, like:

  • property-change support (used to notify edit parts of model changes),
  • property-source support (used to display property values in the Property View TODO: show more interesting properties) and
  • serialization support (the model hierarchy must be serializable, so that the editor can save and restore a binary representation. You might not need this, if you store the model a non-binary form like XML TODO: we might want to use it to restore the positions of nodes and other things like zoom level that are not in the xml).
Elias Volanakis (original), sschwieb, fsteeg

Public Methods

Object getAdapter (Class adapterClass)
synchronized void addPropertyChangeListener (PropertyChangeListener l)
Object getEditableValue ()
IPropertyDescriptor[] getPropertyDescriptors ()
Object getPropertyValue (Object id)
boolean isPropertySet (Object id)
synchronized void removePropertyChangeListener (PropertyChangeListener l)
void resetPropertyValue (Object id)
void setPropertyValue (Object id, Object value)

Protected Methods

void firePropertyChange (String property, Object oldValue, Object newValue)

Method Details

synchronized void addPropertyChangeListener ( PropertyChangeListener  l)

Attach a non-null PropertyChangeListener to this object.

la non-null PropertyChangeListener instance
IllegalArgumentExceptionif the parameter is null
void firePropertyChange ( String  property,
Object  oldValue,
Object  newValue 
) [protected]

Report a property change to registered listeners (for example edit parts).

propertythe programmatic name of the property that changed
oldValuethe old value of this property
newValuethe new value of this property
Object getAdapter ( Class  adapterClass)
See also:

Reimplemented in ChainGraphDiagram, ChainGraphVertex, and ComponentVertex.

Object getEditableValue ( )

Returns a value for this property source that can be edited in a property sheet.

My (Elias Volanakis (original)) personal rule of thumb:

  • model elements should return themselves and
  • custom IPropertySource implementations (like DimensionPropertySource in the GEF-logic example) should return an editable value.

Override only if necessary.

this instance
IPropertyDescriptor [] getPropertyDescriptors ( )

Children should override this. The default implementation returns an empty array.

Reimplemented in ChainGraphVertex.

Object getPropertyValue ( Object  id)

Children should override this. The default implementation returns null.

Reimplemented in ChainGraphVertex, and Connection.

boolean isPropertySet ( Object  id)

Children should override this. The default implementation returns false.

synchronized void removePropertyChangeListener ( PropertyChangeListener  l)

Remove a PropertyChangeListener from this component.

la PropertyChangeListener instance
void resetPropertyValue ( Object  id)

Children should override this. The default implementation does nothing.

void setPropertyValue ( Object  id,
Object  value 

Children should override this. The default implementation does nothing.

Reimplemented in ChainGraphVertex, and Connection.