svn commit: r16398 - branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/FigTextGroup.java

Dave Thompson <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: dthompson
Date: 2008-12-21 07:57:18-0800
New Revision: 16398

Modified:
   branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/FigTextGroup.java

Log:
Modified FigTextGroup so that a user double-click anywhere in the group on an non-editable Fig will edit the first available editable FigText in the group.  Allows clarifier outline boxes to be removed.  For some reason, not quite working yet on the middle label on a FigAssociation.

Modified: branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/FigTextGroup.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/FigTextGroup.java?view=diff&pathrev=16398&r1=16397&r2=16398
==============================================================================
--- branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/FigTextGroup.java	(original)
+++ branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/FigTextGroup.java	2008-12-21 07:57:18-0800
@@ -31,6 +31,7 @@
 
 import org.argouml.uml.diagram.DiagramSettings;
 import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.FigText;
 
 /**
  * Custom class to group FigTexts in such a way that they don't
@@ -185,7 +186,27 @@
             if (f instanceof MouseListener) {
                 ((MouseListener) f).mouseClicked(me);
             }
+            if (me.isConsumed()) {
+                return;
+            }
+            // If the mouse event hasn't been consumed, it means that the user
+            // double clicked on an area that didn't contain an editable fig.
+            // in this case, scan through the list and start editing the first 
+            // fig with editable text.  This allows us to remove the editable 
+            // box clarifier outline, and just outline the whole FigTextGroup, 
+            // see issue 1048.
+            for (Object o : this.getFigs()) {
+                f = (Fig) o;
+                if (f instanceof MouseListener && f instanceof FigText) {
+                    if ( ((FigText) f).getEditable()) {
+                        ((MouseListener) f).mouseClicked(me);
+                    }
+                }
+            }
         }
+        // TODO: 21/12/2008 dthompson mouseClicked(me) above consumes the 
+        // mouse event internally, so I suspect that this line might not be 
+        // necessary.
         me.consume();
     }
 }

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

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.