svn commit: r19347 - trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2011-05-04 08:00:44-0700
New Revision: 19347

Modified:
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java

Log:
Receipt of a removal event will remove the relevant Fig from a compartment. This is demonstrated with stereotypes - remove a stereotype frmo a state in the model and the diagram removes it from the Fig.

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java?view=diff&pathrev=19347&r1=19346&r2=19347
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java	2011-05-04 08:00:44-0700
@@ -112,13 +112,11 @@
     }
 
     @Override
-    protected void setBoundsImpl(int x, int y, int w, int h) {
-        super.setBoundsImpl(x, y, w, h);
+    protected void positionChildren() {
 
-        w -= getLeftMargin() + getRightMargin();
-        h -= getTopMargin() + getBottomMargin();
-
-        y += getTopMargin();
+        int w = _w - (getLeftMargin() + getRightMargin());
+        int x = _x + getLeftMargin();
+        int y = _y + getTopMargin();
         
         for (Object f : getFigs()) {
             Fig fig = (Fig) f;
@@ -133,10 +131,18 @@
         FigNotation fn = new FigNotation(
                 element, childBounds, getDiagramSettings(), NotationType.NAME);
         addFig(fn);
+        calcBounds();
     }
 
     public void elementRemoved(RemoveAssociationEvent evt) {
-        // TODO Auto-generated method stub
-        
+        Object element = evt.getOldValue();
+        for (Object f : getFigs()) {
+            Fig fig = (Fig) f;
+            if (fig.getOwner() == element) {
+                removeFig(fig);
+                calcBounds();
+                return;
+            }
+        }
     }
 }

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

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.