|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.argouml.notation.NotationProvider
public abstract class NotationProvider
A class that implements this abstract class manages a text shown on a diagram. This means it is able to generate text that represents one or more UML objects. And when the user has edited this text, the model may be adapted by parsing the text. Additionally, a help text for the parsing is provided, so that the user knows the syntax.
| Constructor Summary | |
|---|---|
NotationProvider()
|
|
| Method Summary | |
|---|---|
protected void |
addElementListener(java.beans.PropertyChangeListener listener,
java.lang.Object element)
|
protected void |
addElementListener(java.beans.PropertyChangeListener listener,
java.lang.Object element,
java.lang.String property)
|
protected void |
addElementListener(java.beans.PropertyChangeListener listener,
java.lang.Object element,
java.lang.String[] property)
|
void |
cleanListener(java.beans.PropertyChangeListener listener,
java.lang.Object modelElement)
Clean out the listeners registered before. |
protected java.lang.StringBuilder |
formatNameList(java.util.Collection modelElements)
|
protected java.lang.StringBuilder |
formatNameList(java.util.Collection modelElements,
java.lang.String separator)
|
abstract java.lang.String |
getParsingHelp()
|
void |
initialiseListener(java.beans.PropertyChangeListener listener,
java.lang.Object modelElement)
Initialise the appropriate model change listeners for the given modelelement to the given listener. |
abstract void |
parse(java.lang.Object modelElement,
java.lang.String text)
Parses the given text, and adapts the modelElement and maybe related elements accordingly. |
protected void |
removeAllElementListeners(java.beans.PropertyChangeListener listener)
|
protected void |
removeElementListener(java.beans.PropertyChangeListener listener,
java.lang.Object element)
|
abstract java.lang.String |
toString(java.lang.Object modelElement,
NotationSettings settings)
Generate a string representation for the given model element. |
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NotationProvider()
| Method Detail |
|---|
public abstract java.lang.String getParsingHelp()
public abstract void parse(java.lang.Object modelElement,
java.lang.String text)
modelElement - the modelelement to adapttext - the string given by the user to be parsed
to adapt the model
public abstract java.lang.String toString(java.lang.Object modelElement,
NotationSettings settings)
modelElement - the base UML elementsettings - settings that control rendering of the text
public void initialiseListener(java.beans.PropertyChangeListener listener,
java.lang.Object modelElement)
listener - the given listenermodelElement - the modelelement that we provide
notation for
public void cleanListener(java.beans.PropertyChangeListener listener,
java.lang.Object modelElement)
listener - the given listenermodelElement - the modelelement that we provide
notation for
public void updateListener(java.beans.PropertyChangeListener listener,
java.lang.Object modelElement,
java.beans.PropertyChangeEvent pce)
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.
listener - the given listenermodelElement - the modelelement that we provide
notation forpce - the received event, that we base the changes on
protected final void addElementListener(java.beans.PropertyChangeListener listener,
java.lang.Object element)
protected final void addElementListener(java.beans.PropertyChangeListener listener,
java.lang.Object element,
java.lang.String property)
protected final void addElementListener(java.beans.PropertyChangeListener listener,
java.lang.Object element,
java.lang.String[] property)
protected final void removeElementListener(java.beans.PropertyChangeListener listener,
java.lang.Object element)
protected final void removeAllElementListeners(java.beans.PropertyChangeListener listener)
protected java.lang.StringBuilder formatNameList(java.util.Collection modelElements)
protected java.lang.StringBuilder formatNameList(java.util.Collection modelElements,
java.lang.String separator)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| ArgoUML © 1996-2006 | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |