svn commit: r16696 - trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AbstractMessageNotationUml.java
Michiel van der Wulp <[email protected]>
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mvw
Date: 2009-01-25 08:34:07-0800
New Revision: 16696
Modified:
trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AbstractMessageNotationUml.java
Log:
Some refactoring at the end of this patch.
Fix for a part of issue 5150: The "sorter" project from issue 5030 now shows the same strings when it loads as in the past with the previous sequence diagram implementation.
The fallback had to be adapted for the case where the script of the Action was empty, but there were arguments. In this case, the arguments were shown. This is now changed so that not the arguments are shown, but the operation name or message name.
Modified: trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AbstractMessageNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AbstractMessageNotationUml.java?view=diff&pathrev=16696&r1=16695&r2=16696
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AbstractMessageNotationUml.java (original)
+++ trunk/src/argouml-app/src/org/argouml/notation/providers/uml/AbstractMessageNotationUml.java 2009-01-25 08:34:07-0800
@@ -213,7 +213,11 @@
}
}
action = NotationUtilityUml.generateActionSequence(umlAction);
- if ("".equals(action)) {
+ if ("".equals(action) || action.trim().startsWith("(")) {
+ /* If the script of the Action is empty,
+ * (or only specifies arguments and no method name)
+ * then we generate a string based on
+ * a different model element: */
action = getInitiatorOfAction(umlAction);
if ("".equals(action)) {
// This may return null:
@@ -725,6 +729,35 @@
List<String> args = parseArguments(paramExpr, mayDeleteExpr);
+ printDebugInfo(s, fname, guard, paramExpr, varname, predecessors,
+ seqno, parallell, iterative);
+
+ /* Now apply the changes to the model: */
+
+ buildAction(umlMessage);
+
+ handleGuard(umlMessage, guard, parallell, iterative);
+
+ fname = fillBlankFunctionName(umlMessage, fname, mayDeleteExpr);
+
+ varname = fillBlankVariableName(umlMessage, varname, mayDeleteExpr);
+
+ refindOperation = handleFunctionName(umlMessage, fname, varname,
+ refindOperation);
+
+ refindOperation = handleArguments(umlMessage, args, refindOperation);
+
+ refindOperation = handleSequenceNumber(umlMessage, seqno,
+ refindOperation);
+
+ handleOperation(umlMessage, fname, refindOperation);
+
+ handlePredecessors(umlMessage, predecessors, hasPredecessors);
+ }
+
+ private void printDebugInfo(String s, String fname, StringBuilder guard,
+ String paramExpr, StringBuilder varname, List<List> predecessors,
+ List<Integer> seqno, boolean parallell, boolean iterative) {
if (LOG.isDebugEnabled()) {
StringBuffer buf = new StringBuffer();
buf.append("ParseMessage: " + s + "\n");
@@ -754,28 +787,6 @@
+ "\n");
LOG.debug(buf);
}
-
- /* Now apply the changes to the model: */
-
- buildAction(umlMessage);
-
- handleGuard(umlMessage, guard, parallell, iterative);
-
- fname = fillBlankFunctionName(umlMessage, fname, mayDeleteExpr);
-
- varname = fillBlankVariableName(umlMessage, varname, mayDeleteExpr);
-
- refindOperation = handleFunctionName(umlMessage, fname, varname,
- refindOperation);
-
- refindOperation = handleArguments(umlMessage, args, refindOperation);
-
- refindOperation = handleSequenceNumber(umlMessage, seqno,
- refindOperation);
-
- handleOperation(umlMessage, fname, refindOperation);
-
- handlePredecessors(umlMessage, predecessors, hasPredecessors);
}
/**
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=1050307
To unsubscribe from this discussion, e-mail: [[email protected]].