svn commit: r13620 - branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: b00__1
Date: 2007-09-27 01:55:03-0700
New Revision: 13620

Removed:
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ChangeCommand.java
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CommandStackImpl.java
Modified:
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesFactoryEUMLImpl.java
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesHelperEUMLImpl.java

Log:
Remove the command stack implementation and modified the code that used it.
The scope of the command stack is ArgoUML (or other high level apps, eg: ArgoEclipse)

Removed: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ChangeCommand.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ChangeCommand.java?view=auto&rev=13619

Removed: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CommandStackImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CommandStackImpl.java?view=auto&rev=13619

Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java?view=diff&rev=13620&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java&r1=13619&r2=13620
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java	(original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java	2007-09-27 01:55:03-0700
@@ -32,6 +32,7 @@
 import org.argouml.model.CoreFactory;
 import org.argouml.model.NotImplementedException;
 import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.uml2.common.edit.command.ChangeCommand;
 import org.eclipse.uml2.uml.Abstraction;
 import org.eclipse.uml2.uml.AggregationKind;
 import org.eclipse.uml2.uml.Artifact;
@@ -119,11 +120,7 @@
                 getParams().add(abstraction);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run,
-                "Create the abstraction # between the client # and the supplier #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), client, supplier);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (Abstraction) run.getParams().get(0);
     }
@@ -184,10 +181,7 @@
                 getParams().add(association);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run, "Create the association # between # and #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), type1, type2);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (Association) run.getParams().get(0);
     }
@@ -250,11 +244,7 @@
                 getParams().add(associationClass);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run,
-                "Create the association class # between # and #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), end1, end2);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (AssociationClass) run.getParams().get(0);
     }
@@ -340,10 +330,7 @@
             }
         };
         modelImpl.getModelEventPump().getRootContainer().setHoldEvents(true);
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run,
-                "Create the association end # of the association #");
-        editingDomain.getCommandStack().execute(cmd);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
         if (run.getParams().isEmpty()) {
             editingDomain.getCommandStack().undo();
             editingDomain.getCommandStack().flush();
@@ -353,7 +340,6 @@
             throw new UnsupportedOperationException(
                     "This stereotype cannot be applied to the association end."); //$NON-NLS-1$
         }
-        cmd.setObjects(run.getParams().get(0), assoc);
         modelImpl.getModelEventPump().getRootContainer().setHoldEvents(false);
 
         return (Property) run.getParams().get(0);
@@ -411,10 +397,7 @@
                 getParams().add(property);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run, "Create the attribute # of the type #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), handle);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (Property) run.getParams().get(0);
     }
@@ -461,11 +444,7 @@
                 getParams().add(templateBinding);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run,
-                "Create the template binding # between the client # and the supplier #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), client, supplier);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (TemplateBinding) run.getParams().get(0);
     }
@@ -511,10 +490,7 @@
                 getParams().add(clazz);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run, "Create the class # of the owner #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), owner);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (org.eclipse.uml2.uml.Class) run.getParams().get(0);
     }
@@ -537,20 +513,7 @@
                 getParams().add(comment);
             }
         };
-        ChangeCommand cmd;
-        if (element == null) {
-            cmd = new ChangeCommand(modelImpl, run, "Create the comment #");
-        } else {
-            cmd = new ChangeCommand(
-                    modelImpl, run,
-                    "Create the comment # attached to the element #");
-        }
-        editingDomain.getCommandStack().execute(cmd);
-        if (element == null) {
-            cmd.setObjects(run.getParams().get(0));
-        } else {
-            cmd.setObjects(run.getParams().get(0), element);
-        }
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (Comment) run.getParams().get(0);
     }
@@ -571,11 +534,7 @@
                 getParams().add(constraint);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run,
-                "Create the constraint # that constrains the element #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), constrElement);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (Constraint) run.getParams().get(0);
     }
@@ -619,10 +578,7 @@
                 getParams().add(dataType);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run, "Create the data type # owned by #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), owner);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (DataType) run.getParams().get(0);
     }
@@ -648,11 +604,7 @@
                 getParams().add(dependency);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run,
-                "Create the dependency # between the client # and the supplier #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), clientObj, supplierObj);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (Dependency) run.getParams().get(0);
     }
@@ -686,10 +638,7 @@
                 getParams().add(enumeration);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run, "Create the enumeration # owned by #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), owner);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (Enumeration) run.getParams().get(0);
     }
@@ -710,10 +659,7 @@
                 getParams().add(enumerationLiteral);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run, "Create the enumeration literal # owned by #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), enumeration);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (EnumerationLiteral) run.getParams().get(0);
     }
@@ -739,11 +685,7 @@
                 getParams().add(generalization);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run,
-                "Create the generalization # between # (general) and # (specific)");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), parent, child);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (Generalization) run.getParams().get(0);
     }
@@ -788,10 +730,7 @@
                 getParams().add(interface_);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run, "Create the interface # owned by #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), owner);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (Interface) run.getParams().get(0);
     }
@@ -839,10 +778,7 @@
                 getParams().add(operation);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run, "Create the operation # owned by #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), cls);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (Operation) run.getParams().get(0);
     }
@@ -872,10 +808,7 @@
                 getParams().add(param);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run, "Create the parameter # owned by #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), o);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (Parameter) run.getParams().get(0);
     }
@@ -918,11 +851,7 @@
                 getParams().add(packageImport);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run,
-                "Create the package import # between the client # and the supplier #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), client, supplier);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (PackageImport) run.getParams().get(0);
     }
@@ -949,11 +878,7 @@
                 getParams().add(realization);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run,
-                "Create the interface realization # between the client # and the supplier #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), client, supplier);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (InterfaceRealization) run.getParams().get(0);
     }
@@ -983,11 +908,7 @@
                 getParams().add(usage);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run,
-                "Create the usage # between the client # and the supplier #");
-        editingDomain.getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), client, supplier);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
 
         return (Usage) run.getParams().get(0);
     }

Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java?view=diff&rev=13620&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java&r1=13619&r2=13620
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java	(original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java	2007-09-27 01:55:03-0700
@@ -42,6 +42,7 @@
 import org.eclipse.emf.edit.command.CommandParameter;
 import org.eclipse.emf.edit.command.RemoveCommand;
 import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.uml2.common.edit.command.ChangeCommand;
 import org.eclipse.uml2.uml.AggregationKind;
 import org.eclipse.uml2.uml.Association;
 import org.eclipse.uml2.uml.Behavior;
@@ -124,17 +125,7 @@
                 }
             }
         };
-        ChangeCommand cmd;
-        if (stereos.size() == 1) {
-            cmd = new ChangeCommand(
-                    modelImpl, run, "Apply the stereotype # to the element #",
-                    stereos.iterator().next(), modelElement);
-        } else {
-            cmd = new ChangeCommand(
-                    modelImpl, run, "Apply # stereotypes to the element #",
-                    stereos.size(), modelElement);
-        }
-        editingDomain.getCommandStack().execute(cmd);
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void addAnnotatedElement(final Object comment,
@@ -153,10 +144,7 @@
                         (Element) annotatedElement);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Add the comment # to the element #",
-                        comment, annotatedElement));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void addClient(final Object dependency, final Object element) {
@@ -174,10 +162,7 @@
                         (NamedElement) element);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Add the client # to the dependency #",
-                        element, dependency));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void addClientDependency(Object handle, Object dependency) {
@@ -203,12 +188,7 @@
         }
         RunnableClass run = getRunnableClassForAddCommand(
                 (Association) handle, position, (Property) connection);
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl,
-                        run,
-                        "Add the AssociationEnd (Property) # to the Association #",
-                        connection, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void addConstraint(final Object handle, final Object mc) {
@@ -225,10 +205,7 @@
                 ((Constraint) mc).getConstrainedElements().add((Element) handle);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Add the constraint # to the element #", mc, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void addDeploymentLocation(Object handle, Object node) {
@@ -290,10 +267,8 @@
             throw new IllegalArgumentException("f must be instance of Feature"); //$NON-NLS-1$
         }
         editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, getRunnableClassForAddCommand(
-                                (Classifier) handle, index, (Feature) f),
-                        "Add the feature # to the classifier #", f, handle));
+                new ChangeCommand(editingDomain, getRunnableClassForAddCommand(
+                        (Classifier) handle, index, (Feature) f)));
     }
 
     public void addFeature(Object handle, Object f) {
@@ -315,12 +290,9 @@
                     "literal must be instance of EnumerationLiteral"); //$NON-NLS-1$
         }
         editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, getRunnableClassForAddCommand(
-                                (Enumeration) handle, index,
-                                (EnumerationLiteral) literal),
-                        "Add the EnumerationLiteral # to the Enumeration #",
-                        literal, handle));
+                new ChangeCommand(editingDomain, getRunnableClassForAddCommand(
+                        (Enumeration) handle, index,
+                        (EnumerationLiteral) literal)));
     }
 
     public void addMethod(final Object handle, final Object method) {
@@ -340,16 +312,10 @@
                 ((BehavioralFeature) handle).getMethods().add((Behavior) method);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl,
-                        run,
-                        "Add the Behavior (method) # to the BehavioralFeature (operation) #",
-                        method, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
     
-    public void addOwnedElement(Object handle, Object me, String msg,
-            Object... objects) {
+    public void addOwnedElement(Object handle, Object me) {
         if (!(handle instanceof Namespace)) {
             throw new IllegalArgumentException(
                     "The handle must be instance of Namespace"); //$NON-NLS-1$
@@ -359,17 +325,14 @@
                     "'me' must be instance of Element"); //$NON-NLS-1$
         }
         editingDomain.getCommandStack().execute(
-                new ChangeCommand(modelImpl, getRunnableClassForAddCommand(
-                        (Namespace) handle, (Element) me), msg, objects));
-    }
-
-    public void addOwnedElement(Object handle, Object me) {
-        addOwnedElement(handle, me, "Add the owned element # to the owner #", me, handle);
+                new ChangeCommand(editingDomain, getRunnableClassForAddCommand(
+                        (Namespace) handle, (Element) me)));
     }
 
     public void addParameter(Object handle, int index, Object parameter) {
         // TODO: In UML2.x Event has no parameters.
-        // TODO: Treat ObjectFlowState (this doesn't exist anymore in UML2) and Classifier
+        // TODO: Treat ObjectFlowState (this doesn't exist anymore in UML2) and
+        // Classifier
         if (!(handle instanceof BehavioralFeature)) {
             throw new IllegalArgumentException(
                     "handle must be instance of BehavioralFeature"); //$NON-NLS-1$
@@ -379,12 +342,9 @@
                     "parameter must be instance of Parameter"); //$NON-NLS-1$
         }
         editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, getRunnableClassForAddCommand(
-                                (BehavioralFeature) handle, index,
-                                (Parameter) parameter),
-                        "Add the owned element # to the owner #", parameter,
-                        handle));
+                new ChangeCommand(editingDomain, getRunnableClassForAddCommand(
+                        (BehavioralFeature) handle, index,
+                        (Parameter) parameter)));
     }
 
     public void addParameter(Object handle, Object parameter) {
@@ -397,12 +357,8 @@
                     "handle and qualifier must be instances of Property"); //$NON-NLS-1$
         }
         editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, getRunnableClassForAddCommand(
-                                (Property) handle, position,
-                                (Property) qualifier),
-                        "Add the qualifier # to the property #", qualifier,
-                        handle));
+                new ChangeCommand(editingDomain, getRunnableClassForAddCommand(
+                        (Property) handle, position, (Property) qualifier)));
     }
 
     public void addRaisedSignal(Object handle, Object sig) {
@@ -434,11 +390,7 @@
                         (NamedElement) element);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Add the supplier # to the dependency #", element,
-                        dependency));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void addSupplierDependency(Object supplier, Object dependency) {
@@ -1041,12 +993,7 @@
                         (Element) annotatedElement);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl,
-                        run,
-                        "Remove the link between the comment # and the element #",
-                        comment, annotatedElement));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void removeClientDependency(final Object handle, final Object dep) {
@@ -1063,11 +1010,7 @@
                 ((NamedElement) handle).getClientDependencies().remove(dep);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Remove the client dependency # from the element #",
-                        handle, dep));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void removeConnection(final Object handle, final Object connection) {
@@ -1089,11 +1032,7 @@
                 }
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Remove the association end # from the association #",
-                        connection, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void removeConstraint(Object handle, Object cons) {
@@ -1126,10 +1065,8 @@
                     "value must be instance of Element"); //$NON-NLS-1$
         }
         editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl,
-                        getRunnableClassForRemoveCommand((Element) value),
-                        "Remove the element # from the owner #", value, handle));
+                new ChangeCommand(editingDomain,
+                        getRunnableClassForRemoveCommand((Element) value)));
     }
 
     public void removeParameter(Object handle, Object parameter) {
@@ -1163,11 +1100,7 @@
                 ((Dependency) dependency).getSuppliers().remove(supplier);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Remove the supplier # from the dependency #",
-                        supplier, dependency));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void removeTargetFlow(Object handle, Object flow) {
@@ -1197,10 +1130,7 @@
                 }
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Set isAbstract to # for #",
-                        isAbstract, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setActive(final Object handle, final boolean isActive) {
@@ -1213,10 +1143,7 @@
                 ((org.eclipse.uml2.uml.Class) handle).setIsActive(isActive);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Set isActive to # for #", isActive,
-                        handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setAggregation(final Object handle, final Object aggregationKind) {
@@ -1233,11 +1160,7 @@
                 ((Property) handle).setAggregation((AggregationKind) aggregationKind);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Set the aggregation # to the association end #",
-                        aggregationKind, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setAnnotatedElements(final Object handle, final Collection elems) {
@@ -1262,11 +1185,7 @@
                 }
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Set # annotated alements for the comment #",
-                        elems.size(), handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setAssociation(Object handle, Object association) {
@@ -1312,12 +1231,7 @@
                 ((Generalization) handle).setSpecific((Classifier) child);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl,
-                        run,
-                        "Set the # as the specific classifier of the generalization #",
-                        child, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setConcurrency(Object handle, Object concurrencyKind) {
@@ -1375,9 +1289,7 @@
                 ((RedefinableElement) handle).setIsLeaf(isLeaf);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Set isLeaf to # for #", isLeaf, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setModelElementContainer(Object handle, Object container) {
@@ -1408,11 +1320,7 @@
                     ((MultiplicityElement) handle).setUpper(upper_);
                 }
             };
-            editingDomain.getCommandStack().execute(
-                    new ChangeCommand(
-                            modelImpl, run,
-                            "Set the multiplicity # to the element #", arg,
-                            handle));
+            editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
         } else {
             throw new NotYetImplementedException();
         }
@@ -1431,11 +1339,7 @@
                 ((NamedElement) handle).setName(name);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Set the name \"#\" to the named element #",
-                        name, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setNamespace(Object handle, Object ns) {
@@ -1452,11 +1356,7 @@
                 ((Property) handle).setIsNavigable(flag);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Set isNavigable to # for the association end #", flag,
-                        handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setOperations(Object classifier, List operations) {
@@ -1500,12 +1400,7 @@
                 ((Generalization) handle).setGeneral((Classifier) parent);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl,
-                        run,
-                        "Set the # as the general classifier of the generalization #",
-                        parent, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setPowertype(Object handle, Object powerType) {
@@ -1526,10 +1421,7 @@
                 ((Operation) handle).setIsQuery(isQuery);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Set isQuery to # for the operation #",
-                        isQuery, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setRaisedSignals(Object handle, Collection raisedSignals) {
@@ -1546,11 +1438,7 @@
                 ((StructuralFeature) handle).setIsReadOnly(isReadOnly);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Set isReadOnly to # for the structural feature #",
-                        isReadOnly, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setResident(Object handle, Object resident) {
@@ -1596,10 +1484,7 @@
                 ((Feature) feature).setIsStatic(isStatic);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Set isStatic to # for the feature #",
-                        isStatic, feature));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setTaggedValue(Object handle, String tag, String value) {
@@ -1629,10 +1514,7 @@
                 ((TypedElement) handle).setType((Type) type);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Set the type # for the typed element #", type, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public void setVisibility(final Object handle, final Object visibility) {
@@ -1649,11 +1531,7 @@
                 ((NamedElement) handle).setVisibility((VisibilityKind) visibility);
             }
         };
-        editingDomain.getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Set the visibility # to the named element #",
-                        visibility, handle));
+        editingDomain.getCommandStack().execute(new ChangeCommand(editingDomain, run));
     }
 
     public Collection getParents(Object generalizableElement) {

Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java?view=diff&rev=13620&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java&r1=13619&r2=13620
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java	(original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java	2007-09-27 01:55:03-0700
@@ -47,6 +47,7 @@
 import java.util.Map;
 
 import org.apache.log4j.Logger;
+import org.argouml.model.CommandStack;
 import org.argouml.model.DiagramInterchangeModel;
 import org.argouml.model.ModelImplementation;
 import org.argouml.model.UmlException;
@@ -156,8 +157,6 @@
     private UseCasesHelperEUMLImpl theUseCasesHelper;
 
     private VisibilityKindEUMLImpl theVisibilityKind;
-    
-    private CommandStackImpl theCommandStack;
 
     /**
      * This keeps track of the editing domain that is used to track all changes
@@ -509,11 +508,13 @@
         return null;
     }
 
-    public CommandStackImpl getCommandStack() {
-        if (theCommandStack == null) {
-            theCommandStack = new CommandStackImpl(this);
-        }
-        return theCommandStack;
+    /**
+     * The command stack implementation is out of scope in eUML,
+     * instead use the command stack provided by ArgoUML.
+     */
+    @Deprecated
+    public CommandStack getCommandStack() {
+        return null;
     }
 
 }

Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java?view=diff&rev=13620&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java&r1=13619&r2=13620
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java	(original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java	2007-09-27 01:55:03-0700
@@ -123,8 +123,6 @@
 
     private Logger LOG = Logger.getLogger(ModelEventPumpEUMLImpl.class);
 
-    public static final int COMMAND_STACK_UPDATE = Notification.EVENT_TYPE_COUNT + 1;
-
     /**
      * Constructor.
      * 
@@ -134,15 +132,6 @@
     public ModelEventPumpEUMLImpl(EUMLModelImplementation implementation) {
         modelImpl = implementation;
         mutex = this;
-        implementation.getEditingDomain().getCommandStack().addCommandStackListener(
-                new CommandStackListener() {
-
-                    public void commandStackChanged(EventObject event) {
-                        notifyChanged(new NotificationImpl(
-                                COMMAND_STACK_UPDATE, false, false));
-                    }
-
-                });
     }
 
     /**
@@ -170,8 +159,7 @@
 
     public void addModelEventListener(PropertyChangeListener listener,
             Object modelelement, String[] propertyNames) {
-        if (!(modelelement instanceof EObject)
-                && !(modelelement instanceof String && modelelement.equals(CommandStackImpl.COMMAND_STACK_UPDATE_EVENT))) {
+        if (!(modelelement instanceof EObject)) {
             throw new IllegalArgumentException(
                     "The modelelement must be instance of EObject."); //$NON-NLS-1$
         }
@@ -229,8 +217,7 @@
 
     public void removeModelEventListener(PropertyChangeListener listener,
             Object modelelement, String[] propertyNames) {
-        if (!(modelelement instanceof EObject)
-                && !(modelelement instanceof String && modelelement.equals(CommandStackImpl.COMMAND_STACK_UPDATE_EVENT))) {
+        if (!(modelelement instanceof EObject)) {
             throw new IllegalArgumentException();
         }
         unregisterListener(
@@ -379,13 +366,6 @@
                     }
                 }
             }
-        } else if (notification.getEventType() == COMMAND_STACK_UPDATE) {
-            events.add(new EventAndListeners(
-                    new PropertyChangeEvent(
-                            this, CommandStackImpl.COMMAND_STACK_UPDATE_EVENT,
-                            false, false),
-                    getListeners(CommandStackImpl.COMMAND_STACK_UPDATE_EVENT)));
-//            Model.notifyMementoCreationObserver(CommandStackImpl.getInstance(modelImpl));
         }
 
         for (EventAndListeners e : events) {

Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java?view=diff&rev=13620&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java&r1=13619&r2=13620
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java	(original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java	2007-09-27 01:55:03-0700
@@ -38,6 +38,7 @@
 import org.argouml.model.UmlFactory;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.uml2.common.edit.command.ChangeCommand;
 import org.eclipse.uml2.uml.Abstraction;
 import org.eclipse.uml2.uml.AggregationKind;
 import org.eclipse.uml2.uml.Association;
@@ -320,9 +321,7 @@
             }
         };
         modelImpl.getEditingDomain().getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Remove from the model the element #",
-                        elem));
+                new ChangeCommand(modelImpl.getEditingDomain(), run));
     }
     
     public boolean isRemoved(Object o) {

Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesFactoryEUMLImpl.java?view=diff&rev=13620&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesFactoryEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesFactoryEUMLImpl.java&r1=13619&r2=13620
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesFactoryEUMLImpl.java	(original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesFactoryEUMLImpl.java	2007-09-27 01:55:03-0700
@@ -29,6 +29,7 @@
 import org.argouml.model.AbstractModelFactory;
 import org.argouml.model.NotImplementedException;
 import org.argouml.model.UseCasesFactory;
+import org.eclipse.uml2.common.edit.command.ChangeCommand;
 import org.eclipse.uml2.uml.Actor;
 import org.eclipse.uml2.uml.Extend;
 import org.eclipse.uml2.uml.ExtensionPoint;
@@ -72,8 +73,7 @@
             ns = (Namespace) model;
         }
         Actor ret = createActor();
-        modelImpl.getCoreHelper().addOwnedElement(
-                ns, ret, "Create the actor # in the namespace #", ret, ns);
+        modelImpl.getCoreHelper().addOwnedElement(ns, ret);
 //        ret.setIsLeaf(false);
 //        ret.setIsRoot(false);
         return ret;
@@ -116,13 +116,8 @@
                 getParams().add(ep);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run,
-                "Create the extend # for the case # that extends the case # through #");
-        modelImpl.getEditingDomain().getCommandStack().execute(cmd);
-        cmd.setObjects(
-                run.getParams().get(0), extension, extendedCase,
-                run.getParams().get(1));
+        modelImpl.getEditingDomain().getCommandStack().execute(
+                new ChangeCommand(modelImpl.getEditingDomain(), run));
 
         return (Extend) run.getParams().get(0);
     }
@@ -132,10 +127,7 @@
             throw new IllegalArgumentException();
         }
         ExtensionPoint ep = createExtensionPoint();
-        modelImpl.getCoreHelper().addOwnedElement(
-                modelElement, ep,
-                "Create the extension point # for the case #", ep,
-                modelElement);
+        modelImpl.getCoreHelper().addOwnedElement(modelElement, ep);
         return ep;
     }
 
@@ -153,11 +145,8 @@
                 getParams().add(include);
             }
         };
-        ChangeCommand cmd = new ChangeCommand(
-                modelImpl, run,
-                "Create the include # of the including case # that include the case #");
-        modelImpl.getEditingDomain().getCommandStack().execute(cmd);
-        cmd.setObjects(run.getParams().get(0), includingCase, addition);
+        modelImpl.getEditingDomain().getCommandStack().execute(
+                new ChangeCommand(modelImpl.getEditingDomain(), run));
 
         return (Include) run.getParams().get(0);
     }

Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesHelperEUMLImpl.java?view=diff&rev=13620&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesHelperEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesHelperEUMLImpl.java&r1=13619&r2=13620
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesHelperEUMLImpl.java	(original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/UseCasesHelperEUMLImpl.java	2007-09-27 01:55:03-0700
@@ -32,6 +32,7 @@
 import org.argouml.model.NotImplementedException;
 import org.argouml.model.UseCasesHelper;
 import org.eclipse.emf.edit.command.CommandParameter;
+import org.eclipse.uml2.common.edit.command.ChangeCommand;
 import org.eclipse.uml2.uml.Actor;
 import org.eclipse.uml2.uml.Extend;
 import org.eclipse.uml2.uml.ExtensionPoint;
@@ -76,9 +77,7 @@
             }
         };
         modelImpl.getEditingDomain().getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Add the extend # to the #", extend,
-                        handle));
+                new ChangeCommand(modelImpl.getEditingDomain(), run));
     }
     
     public void addExtensionPoint(final Object handle,
@@ -106,9 +105,7 @@
             }
         };
         modelImpl.getEditingDomain().getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Add the extension point # to the #",
-                        extensionPoint, handle));
+                new ChangeCommand(modelImpl.getEditingDomain(), run));
     }
 
     public void addInclude(final Object usecase, final Object include) {
@@ -124,9 +121,7 @@
             }
         };
         modelImpl.getEditingDomain().getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Add the include # to the case #",
-                        include, usecase));
+                new ChangeCommand(modelImpl.getEditingDomain(), run));
     }
 
     public Collection getAllActors(Object ns) {
@@ -207,9 +202,7 @@
             }
         };
         modelImpl.getEditingDomain().getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Remove the include # from the case #",
-                        include, usecase));
+                new ChangeCommand(modelImpl.getEditingDomain(), run));
     }
 
     public void setAddition(final Object handle, final Object useCase) {
@@ -225,9 +218,7 @@
             }
         };
         modelImpl.getEditingDomain().getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run, "Set the addition # to the include #",
-                        useCase, handle));
+                new ChangeCommand(modelImpl.getEditingDomain(), run));
     }
 
     public void setBase(Object extend, Object base) {
@@ -273,10 +264,7 @@
             }
         };
         modelImpl.getEditingDomain().getCommandStack().execute(
-                new ChangeCommand(
-                        modelImpl, run,
-                        "Set # extension points for the case #",
-                        extensionPoints.size(), handle));
+                new ChangeCommand(modelImpl.getEditingDomain(), run));
     }
 
     public void setIncludes(Object handle, Collection includes) {
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.