org.argouml.notation.providers
Class ObjectNotation

java.lang.Object
  extended by org.argouml.notation.NotationProvider
      extended by org.argouml.notation.providers.ObjectNotation
Direct Known Subclasses:
ObjectNotationUml

public abstract class ObjectNotation
extends NotationProvider

This abstract class forms the basis of all Notation providers for the text shown in the Fig that represents an Object. Subclass this for all languages.


Constructor Summary
ObjectNotation(java.lang.Object theObject)
          The constructor.
 
Method Summary
 void initialiseListener(java.beans.PropertyChangeListener listener, java.lang.Object modelElement)
          Initialise the appropriate model change listeners for the given modelelement to the given listener.
 void updateListener(java.beans.PropertyChangeListener listener, java.lang.Object modelElement, java.beans.PropertyChangeEvent pce)
          Update the set of listeners based on the given event.
 
Methods inherited from class org.argouml.notation.NotationProvider
addElementListener, addElementListener, addElementListener, cleanListener, formatNameList, formatNameList, getParsingHelp, parse, removeAllElementListeners, removeElementListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectNotation

public ObjectNotation(java.lang.Object theObject)
The constructor.

Parameters:
theObject - the UML element
Method Detail

initialiseListener

public void initialiseListener(java.beans.PropertyChangeListener listener,
                               java.lang.Object modelElement)
Description copied from class: NotationProvider
Initialise the appropriate model change listeners for the given modelelement to the given listener. Overrule this when you need more than listening to all events from the base modelelement.

Overrides:
initialiseListener in class NotationProvider
Parameters:
listener - the given listener
modelElement - the modelelement that we provide notation for

updateListener

public void updateListener(java.beans.PropertyChangeListener listener,
                           java.lang.Object modelElement,
                           java.beans.PropertyChangeEvent pce)
Description copied from class: NotationProvider
Update the set of listeners based on the given event.

The default implementation just removes all listeners, and then re-initialises completely - this is method 1. A more efficient way would be to dissect the propertyChangeEvent, and only adapt the listeners that need to be adapted - this is method 2.

Method 2 is explained by the code below that is commented out. Method 1 is the easiest to implement, since at every arrival of an event, we just remove all old listeners, and then inspect the current model, and add listeners where we need them. I.e. the advantage is that we only need to traverse the model structure in one location, i.e. the initialiseListener() method.

Overrides:
updateListener in class NotationProvider
Parameters:
listener - the given listener
modelElement - the modelelement that we provide notation for
pce - the received event, that we base the changes on


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook