svn commit: r13471 - 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-08-31 06:26:50-0700
New Revision: 13471

Modified:
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CommandStackImpl.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

Log:
Merged with branches/gsoc2007/b00__1/tags/gsoc2007_deadline/model-euml

Modified: 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=diff&rev=13471&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CommandStackImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CommandStackImpl.java&r1=13470&r2=13471
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CommandStackImpl.java	(original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/CommandStackImpl.java	2007-08-31 06:26:50-0700
@@ -26,25 +26,15 @@
 
 package org.argouml.model.euml;
 
-import org.argouml.model.ModelMemento;
+import org.argouml.model.CommandStack;
 
-public class CommandStackImpl extends ModelMemento {
+public class CommandStackImpl implements CommandStack {
 
     private EUMLModelImplementation modelImplementation;
-    
-    private static CommandStackImpl instance;
-    
-    public static final String COMMAND_STACK_UPDATE_EVENT = "MEMENTO_CHANGED"; //$NON-NLS-1$
 
-    private CommandStackImpl(EUMLModelImplementation modelImplementation) {
+    public CommandStackImpl(EUMLModelImplementation modelImplementation) {
         this.modelImplementation = modelImplementation;
-    }
-    
-    public static ModelMemento getInstance(EUMLModelImplementation modelImplementation) {
-        if (instance == null) {
-            instance = new CommandStackImpl(modelImplementation);
-        }
-        return instance;
+        modelImplementation.getEditingDomain().getCommandStack().flush();
     }
 
     public boolean canRedo() {
@@ -65,6 +55,10 @@
                 : null;
     }
 
+    public boolean isCommandStackCapabilityAvailable() {
+        return true;
+    }
+
     public void redo() {
         modelImplementation.getEditingDomain().getCommandStack().redo();
     }

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=13471&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=13470&r2=13471
==============================================================================
--- 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-08-31 06:26:50-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;
@@ -509,4 +510,11 @@
         return null;
     }
 
+    public CommandStackImpl getCommandStack() {
+        if (theCommandStack == null) {
+            theCommandStack = new CommandStackImpl(this);
+        }
+        return theCommandStack;
+    }
+
 }

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=13471&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=13470&r2=13471
==============================================================================
--- 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-08-31 06:26:50-0700
@@ -386,7 +386,7 @@
                             this, CommandStackImpl.COMMAND_STACK_UPDATE_EVENT,
                             false, false),
                     getListeners(CommandStackImpl.COMMAND_STACK_UPDATE_EVENT)));
-            Model.notifyMementoCreationObserver(CommandStackImpl.getInstance(modelImpl));
+//            Model.notifyMementoCreationObserver(CommandStackImpl.getInstance(modelImpl));
         }
 
         for (EventAndListeners e : events) {
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.