Author: bobtarling
Date: 2011-04-12 18:37:56-0700
New Revision: 19230
Modified:
trunk/src/argouml-core-notation/src/org/argouml/notation2/NameUmlNotation.java
trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationManager.java
trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationLanguage.java
Log:
Put listeners in place for notation
Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/NameUmlNotation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/NameUmlNotation.java?view=diff&pathrev=19230&r1=19229&r2=19230
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/NameUmlNotation.java (original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/NameUmlNotation.java 2011-04-12 18:37:56-0700
@@ -27,8 +27,6 @@
NameUmlNotation(NotatedItem item) {
notatedItem = item;
- Model.getPump().addModelEventListener(
- this, notatedItem.getOwner(), "name");
}
@Override
@@ -47,7 +45,8 @@
final Object owner = notatedItem.getOwner();
final String name = Model.getFacade().getName(owner);
final boolean isAbstract = Model.getFacade().isAbstract(owner);
- final boolean isStatic = Model.getFacade().isStatic(owner);
+ final boolean isStatic =
+ Model.getFacade().isAFeature(owner) && Model.getFacade().isStatic(owner);
Runnable doWorkRunnable = new Runnable() {
public void run() {
Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationManager.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationManager.java?view=diff&pathrev=19230&r1=19229&r2=19230
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationManager.java (original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationManager.java 2011-04-12 18:37:56-0700
@@ -22,7 +22,7 @@
*
* @author Bob Tarling
*/
-final class NotationManager {
+public final class NotationManager {
/**
* The singleton instance.
@@ -41,17 +41,20 @@
return instance;
}
- void addNotationLanguage(NotationLanguage language) {
+ public void addNotationLanguage(NotationLanguage language) {
languages.add(language);
}
- void addListener(NotatedItem item) {
+ public void addListener(NotatedItem item) {
NotationLanguage nl = item.getNotationLanguage();
+ if (nl == null) {
+ nl = languages.get(0);
+ }
nl.createNotationText(item);
items.add(item);
}
- void removeListener(NotatedItem item) {
+ public void removeListener(NotatedItem item) {
items.remove(item);
}
}
Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationLanguage.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationLanguage.java?view=diff&pathrev=19230&r1=19229&r2=19230
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationLanguage.java (original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationLanguage.java 2011-04-12 18:37:56-0700
@@ -13,6 +13,8 @@
package org.argouml.notation2;
+import org.argouml.model.Model;
+
class UmlNotationLanguage implements NotationLanguage {
@Override
@@ -22,7 +24,12 @@
@Override
public NotationText createNotationText(NotatedItem item) {
- return new NameUmlNotation(item);
+
+ NameUmlNotation nt = new NameUmlNotation(item);
+ Model.getPump().addModelEventListener(
+ nt, item.getOwner());
+
+ return nt;
}
}
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2719272
To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.