svn commit: r16647 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui
Michiel van der Wulp <[email protected]>
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mvw
Date: 2009-01-18 00:54:22-0800
New Revision: 16647
Modified:
trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Log:
Removed the deprecation introduced for issue 5500. As discussed on the dev list.
No renaming of this method (yet), since we are in alpha period, and for stability of naming.
Clarified the reduced purpose of this method.
Replaced the use of deprecated function.
Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java?view=diff&pathrev=16647&r1=16646&r2=16647
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java 2009-01-18 00:54:22-0800
@@ -966,20 +966,27 @@
/**
- * Create the NotationProviders.
+ * Replace the NotationProvider(s). <p>
+ *
+ * This method shall not be used for the initial creation of
+ * notation providers, but only for replacing them when required.
+ * Initialization must be done in the
+ * constructor using methods which
+ * can't be overridden. <p>
+ * NotationProviders can not be updated - they
+ * are lightweight throw-away objects.
+ * Hence this method creates a (new) NotationProvider whenever
+ * needed. E.g. when the notation language is
+ * changed by the user, then the NPs are to be re-created.
+ * So, this method shall not be
+ * called from a Fig constructor.<p>
+ *
+ * After the removal of the deprecated method setOwner(),
+ * this method shall contain the following statement:
+ * assert notationProviderName != null
*
* @param own the current owner
- * @deprecated for 0.27.3 by tfmorris. Separate initialization of
- * notation providers from any later updates which are required.
- * Initialization must be done in the constructor using methods which
- * can't be overriden. <p>
- * TODO: MVW: NotationProviders can not be updated - they
- * are lightweight throw-away objects. Hence there is functionally
- * only this method to create a (new) NotationProvider whenever
- * needed. E.g. when the notation language is
- * changed by the user, then the NPs are to be re-created.
- * So, why split this in 2 methods?
- */
+ */
protected void initNotationProviders(Object own) {
if (notationProviderName != null) {
notationProviderName.cleanListener(this, own);
Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&pathrev=16647&r1=16646&r2=16647
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java 2009-01-18 00:54:22-0800
@@ -76,6 +76,8 @@
import org.argouml.model.InvalidElementException;
import org.argouml.model.Model;
import org.argouml.model.UmlChangeEvent;
+import org.argouml.notation.Notation;
+import org.argouml.notation.NotationName;
import org.argouml.notation.NotationProvider;
import org.argouml.notation.NotationProviderFactory2;
import org.argouml.notation.NotationSettings;
@@ -1517,23 +1519,38 @@
}
/**
- * Create the NotationProviders.
+ * Replace the NotationProvider(s). <p>
+ *
+ * This method shall not be used for the initial creation of
+ * notation providers, but only for replacing them when required.
+ * Initialization must be done in the
+ * constructor using methods which
+ * can't be overridden. <p>
+ * NotationProviders can not be updated - they
+ * are lightweight throw-away objects.
+ * Hence this method creates a (new) NotationProvider whenever
+ * needed. E.g. when the notation language is
+ * changed by the user, then the NPs are to be re-created.
+ * So, this method shall not be
+ * called from a Fig constructor.<p>
+ *
+ * After the removal of the deprecated method setOwner(),
+ * this method shall contain the following statement:
+ * assert notationProviderName != null
*
* @param own owning UML element
- * @deprecated for 0.27.3 by tfmorris. Initialization of notation providers
- * and any later needed updates must be separated.
- * Initialization must be done in a way that can't be overridden
- * since the subclasses constructors won't have completed by the
- * time the subclass implementation is run.
*/
protected void initNotationProviders(Object own) {
if (notationProviderName != null) {
notationProviderName.cleanListener(this, own);
}
if (Model.getFacade().isAUMLElement(own)) {
+ NotationName notation = Notation.findNotation(
+ getNotationSettings().getNotationLanguage());
notationProviderName =
NotationProviderFactory2.getInstance().getNotationProvider(
- getNotationProviderType(), own, this);
+ getNotationProviderType(), own, this,
+ notation);
}
}
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=1032284
To unsubscribe from this discussion, e-mail: [[email protected]].