svn commit: r16598 - branches/work_issue1048_dthompson/src/argouml-app: . src/org/argouml/notation/providers/uml src/org/argouml/profile src/org/argouml/profile/internal src/org/argouml/uml/cognitive/critics src/org/argouml/uml/diagram/ui src/org/argouml/uml/diagram/use_case/ui tests/org/argouml

Dave Thompson <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: dthompson
Date: 2009-01-14 11:17:21-0800
New Revision: 16598

Modified:
   branches/work_issue1048_dthompson/src/argouml-app/   (props changed)
   branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/notation/providers/uml/AbstractMessageNotationUml.java
   branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/profile/FormatingStrategy.java
   branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/profile/internal/JavaFormatingStrategy.java
   branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUML.java
   branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/ArgoFigText.java
   branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java
   branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigExtend.java
   branches/work_issue1048_dthompson/src/argouml-app/tests/org/argouml/TestDependencies.java

Log:
Merging changes from trunk to branch (catch up).  FigExtend pathitem now has an owner so it should be possible to save and load it's position.  But getting NPEs when mouseover the diagram.  Problem in SelectionEdgeClarifers.java?

Modified: branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/notation/providers/uml/AbstractMessageNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/notation/providers/uml/AbstractMessageNotationUml.java?view=diff&pathrev=16598&r1=16597&r2=16598
==============================================================================
--- branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/notation/providers/uml/AbstractMessageNotationUml.java	(original)
+++ branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/notation/providers/uml/AbstractMessageNotationUml.java	2009-01-14 11:17:21-0800
@@ -79,8 +79,27 @@
  * is not even planned to be supported. The exceptions are intno, which
  * allows a number possibly followed by a sequence of letters in the range
  * 'a' - 'z', seqelem, which does not allow a recurrence, and message, which
- * does allow one recurrence near seq_expr. (formerly: name: action )
+ * does allow one recurrence near seq_expr. <p>
+ * 
+ * (formerly, the supported syntax was: name: action ) <p>
  *
+ * Generating a string from the model has some extra functionality:
+ * (to be implemented)
+ * If obtaining the Script of the Action returns an empty string, 
+ * then an alternative representation is given:
+ * If the action is a CallAction, use the name of its Operation, 
+ * and if it is a SendAction, the name of its Event.
+ * If also this returns no string, then we display the name of the Message. <p>
+ * 
+ *  Rationale:
+ *  This allows ArgoUML to show something on the diagram with older projects, 
+ *  which only had the name of the Message filled in by the user.
+ *  This also may improve the diagrams for imported XMI.<p>
+ *
+ * Parsing a text that is generated by one of the backup scenarios, 
+ * causes it to be written back in the script of the Action.
+ * Hence, editing the text on the diagram only once 
+ * causes the Action Script to be used from then on.
  *
  * @see MessageNotationUml
  * @see SDMessageNotationUml
@@ -97,11 +116,14 @@
      */
     private final List<CustomSeparator> parameterCustomSep;
 
+    /**
+     * An object containing an UML Message object.
+     */
     protected static class MsgPtr {
-            /**
-             * The message pointed to.
-             */
-            public Object message;
+        /**
+         * The message pointed to.
+         */
+        Object message;
     }
 
     /**
@@ -1490,8 +1512,8 @@
      * and return (a pointer to) the first Message in the chain.
      * 
      * @param message the UML Message to count the predecessors for
-     * @param ptr
-     * @return
+     * @param ptr an object to contain the returned first Message
+     * @return the number of messages in the chain
      */
     protected int recCountPredecessors(Object message, MsgPtr ptr) {
         int pre = 0;

Modified: branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/profile/FormatingStrategy.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/profile/FormatingStrategy.java?view=diff&pathrev=16598&r1=16597&r2=16598
==============================================================================
--- branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/profile/FormatingStrategy.java	(original)
+++ branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/profile/FormatingStrategy.java	2009-01-14 11:17:21-0800
@@ -44,7 +44,7 @@
      *                context namespace (may be null).
      * @return a string representing the model element
      */
-    public abstract String formatElement(Object element, Object namespace);
+    String formatElement(Object element, Object namespace);
 
     /**
      * Produce a string the represents the collection of model elements in the
@@ -56,5 +56,5 @@
      *                context namespace (may be null).
      * @return a string representing the collection
      */
-    public abstract String formatCollection(Iterator iter, Object namespace);
+    String formatCollection(Iterator iter, Object namespace);
 }

Modified: branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/profile/internal/JavaFormatingStrategy.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/profile/internal/JavaFormatingStrategy.java?view=diff&pathrev=16598&r1=16597&r2=16598
==============================================================================
--- branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/profile/internal/JavaFormatingStrategy.java	(original)
+++ branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/profile/internal/JavaFormatingStrategy.java	2009-01-14 11:17:21-0800
@@ -36,7 +36,6 @@
  */
 public class JavaFormatingStrategy implements FormatingStrategy {
     
-
     public String formatElement(Object element, Object namespace) {
         String value = null;
         if (element == null) {

Modified: branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUML.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUML.java?view=diff&pathrev=16598&r1=16597&r2=16598
==============================================================================
--- branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUML.java	(original)
+++ branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUML.java	2009-01-14 11:17:21-0800
@@ -30,8 +30,6 @@
 import org.argouml.cognitive.ListSet;
 import org.argouml.cognitive.ToDoItem;
 import org.argouml.cognitive.Translator;
-import org.argouml.kernel.Project;
-import org.argouml.kernel.ProjectManager;
 import org.argouml.model.Model;
 import org.argouml.ocl.CriticOclEvaluator;
 import org.argouml.uml.cognitive.UMLToDoItem;
@@ -162,10 +160,8 @@
      */
     @Override
     public boolean predicate(Object dm, Designer dsgr) {
-	Project p = ProjectManager.getManager().getCurrentProject();
-        if (p.isInTrash(dm)
-                || (Model.getFacade().isAModelElement(dm)
-                && Model.getUmlFactory().isRemoved(dm))) {
+        if (Model.getFacade().isAModelElement(dm)
+                && Model.getUmlFactory().isRemoved(dm)) {
             return NO_PROBLEM;
         } else {
             return predicate2(dm, dsgr);

Modified: branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/ArgoFigText.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/ArgoFigText.java?view=diff&pathrev=16598&r1=16597&r2=16598
==============================================================================
--- branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/ArgoFigText.java	(original)
+++ branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/ArgoFigText.java	2009-01-14 11:17:21-0800
@@ -106,8 +106,11 @@
         // per-fig basis, so we can just use the project/diagram defaults
 //        settings = new DiagramSettings(renderSettings);
         settings = renderSettings;
-        setFontFamily(settings.getFontName());
-        setFontSize(settings.getFontSize());
+        super.setFontFamily(settings.getFontName());
+        super.setFontSize(settings.getFontSize());
+        super.setFillColor(FILL_COLOR);
+        super.setTextFillColor(FILL_COLOR);
+        super.setTextColor(TEXT_COLOR);
         // Certain types of fixed text (e.g. a FigStereotype with a keyword)
         // may not have an owner
         if (owner != null) {

Modified: branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java?view=diff&pathrev=16598&r1=16597&r2=16598
==============================================================================
--- branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java	(original)
+++ branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java	2009-01-14 11:17:21-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2009 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -28,7 +28,6 @@
 
 import org.tigris.gef.base.Globals;
 import org.tigris.gef.base.PathItemPlacementStrategy;
-import org.tigris.gef.base.SelectionManager;
 import org.tigris.gef.base.SelectionReshape;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.gef.presentation.FigEdge;
@@ -41,11 +40,10 @@
  */
 public class SelectionEdgeClarifiers extends SelectionReshape {
 
-    ////////////////////////////////////////////////////////////////
-    // constructors
 
-    /** Construct a new SelectionEdgeClarifiers for the given Fig
-     *
+    /**
+     * Construct a new SelectionEdgeClarifiers for the given Fig
+     * 
      * @param f the given fig
      */
     public SelectionEdgeClarifiers(Fig f) { super(f); }
@@ -62,10 +60,10 @@
     public void paint(Graphics g) {
         super.paint(g);
         int selectionCount =
-            Globals.curEditor().getSelectionManager().selections().size();
+            Globals.curEditor().getSelectionManager().getSelections().size();
         if (selectionCount == 1) {
-            FigEdgeModelElement edge = (FigEdgeModelElement) getContent();
-            edge.paintClarifiers(g);
+            FigEdge edge = (FigEdge) getContent();
+            ((Clarifiable) edge).paintClarifiers(g);
 	    for (PathItemPlacementStrategy strategy
 	            : edge.getPathItemStrategies()) {
 	        strategy.paint(g);
@@ -73,5 +71,4 @@
 	}
     }
 
-} /* end class SelectionEdgeClarifiers */
-
+}

Modified: branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigExtend.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigExtend.java?view=diff&pathrev=16598&r1=16597&r2=16598
==============================================================================
--- branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigExtend.java	(original)
+++ branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigExtend.java	2009-01-14 11:17:21-0800
@@ -25,6 +25,7 @@
 package org.argouml.uml.diagram.use_case.ui;
 
 import java.awt.Graphics;
+import java.awt.Rectangle;
 import java.beans.PropertyChangeEvent;
 import java.util.HashSet;
 import java.util.Set;
@@ -32,12 +33,12 @@
 import org.argouml.model.Model;
 import org.argouml.notation.providers.uml.NotationUtilityUml;
 import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.ArgoFigText;
 import org.argouml.uml.diagram.ui.FigEdgeModelElement;
+import org.argouml.uml.diagram.ui.FigTextGroup;
 import org.argouml.uml.diagram.ui.PathItemPlacement;
 import org.tigris.gef.presentation.ArrowHeadGreater;
 import org.tigris.gef.presentation.Fig;
-import org.tigris.gef.presentation.FigGroup;
-import org.tigris.gef.presentation.FigText;
 
 /**
  * A fig for use with extend relationships on use case diagrams.<p>
@@ -49,6 +50,8 @@
  */
 public class FigExtend extends FigEdgeModelElement {
 
+    private static final int DEFAULT_WIDTH = 90;
+
     /**
      * Serialization ID - generated by Eclipse for rev. 1.22
      */
@@ -57,17 +60,17 @@
     /**
      * The &laquo;extend&raquo; label.<p>
      */
-    private FigText label;
+    private ArgoFigText label;
 
     /**
      * The condition expression.<p>
      */
-    private FigText condition;
+    private ArgoFigText condition;
 
     /**
      * The group of label and condition.<p>
      */
-    private FigGroup fg;
+    private FigTextGroup fg;
 
 
     private ArrowHeadGreater endArrow = new ArrowHeadGreater();
@@ -83,20 +86,19 @@
     @SuppressWarnings("deprecation")
     @Deprecated
     public FigExtend() {
-        initialize();
+        initialize(null);
     }
 
 
-    private void initialize() {
+    private void initialize(Object owner) {
         // The <<extend>> label.
         // It's not a true stereotype, so don't use the stereotype support
         //int y = getNameFig().getBounds().height;
-        int h = 20;
-        int y = Y0 + h;
-        label = new FigText(X0, y, 90, h);
-        y = y + h;
-        label.setTextColor(TEXT_COLOR);
-        label.setTextFilled(false);
+        int y = Y0 + STEREOHEIGHT;
+        label = new ArgoFigText(owner, 
+                new Rectangle(X0, y, DEFAULT_WIDTH, STEREOHEIGHT), 
+                getSettings(), false);
+        y = y + STEREOHEIGHT;
         label.setFilled(false);
         label.setLineWidth(0);
         label.setEditable(false);
@@ -104,17 +106,16 @@
         label.calcBounds();
 
         // Set up FigText to hold the condition.
-        condition = new FigText(X0, y, 90, h);
-        y = y + h;
-        condition.setTextColor(TEXT_COLOR);
-        condition.setTextFilled(false);
+        condition = new ArgoFigText(owner, 
+                new Rectangle(X0, y, DEFAULT_WIDTH, STEREOHEIGHT), 
+                getSettings(), false);
+        y = y + STEREOHEIGHT;
         condition.setFilled(false);
         condition.setLineWidth(0);
-        condition.setExpandOnly(false);
 
         // Join all into a group
 
-        fg = new FigGroup();
+        fg = new FigTextGroup(owner, getSettings());
 
         // UML spec for Extend doesn't call for name nor stereotype
         fg.addFig(label);
@@ -161,7 +162,7 @@
      */
     public FigExtend(Object owner, DiagramSettings settings) {
         super(owner, settings);
-        initialize();
+        initialize(owner);
     }
     
     /**

Modified: branches/work_issue1048_dthompson/src/argouml-app/tests/org/argouml/TestDependencies.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue1048_dthompson/src/argouml-app/tests/org/argouml/TestDependencies.java?view=diff&pathrev=16598&r1=16597&r2=16598
==============================================================================
--- branches/work_issue1048_dthompson/src/argouml-app/tests/org/argouml/TestDependencies.java	(original)
+++ branches/work_issue1048_dthompson/src/argouml-app/tests/org/argouml/TestDependencies.java	2009-01-14 11:17:21-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2009 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -146,7 +146,7 @@
             {"org.argouml.moduleloader", "org.argouml.persistence"},
             {"org.argouml.notation", "org.argouml.notation.ui"},
             {"org.argouml.ui.targetmanager", "org.argouml.ui"},
-            {"org.argouml.ui", "org.argouml.moduleloader"},
+            {"org.argouml.moduleloader", "org.argouml.ui"},
             {"org.argouml.cognitive", "org.argouml.ui"},
             {"org.argouml.cognitive.critics", "org.argouml.cognitive.ui"},
             {"org.argouml.ui", "org.argouml.cognitive.critics.ui"},
@@ -155,7 +155,6 @@
             {"org.argouml.uml.diagram", "org.argouml.ui"},
             {"org.argouml.ui", "org.argouml.notation.ui"},
             {"org.argouml.util", "org.argouml.ui.cmd"},
-            {"org.argouml.moduleloader", "org.argouml.ui"},
             //{"org.argouml.kernel", "org.argouml.uml.diagram.ui"},//why does this fail?
         };
         for (int i = 0; i < dep.length; i++) {

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=1024684

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.