svn commit: r13543 - trunk/src_new/org/argouml/kernel/DefaultUndoManager.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2007-09-11 15:19:28-0700
New Revision: 13543

Modified:
   trunk/src_new/org/argouml/kernel/DefaultUndoManager.java

Log:
Synchronize those methods that modify the stacks.

Modified: trunk/src_new/org/argouml/kernel/DefaultUndoManager.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/kernel/DefaultUndoManager.java?view=diff&rev=13543&p1=trunk/src_new/org/argouml/kernel/DefaultUndoManager.java&p2=trunk/src_new/org/argouml/kernel/DefaultUndoManager.java&r1=13542&r2=13543
==============================================================================
--- trunk/src_new/org/argouml/kernel/DefaultUndoManager.java	(original)
+++ trunk/src_new/org/argouml/kernel/DefaultUndoManager.java	2007-09-11 15:19:28-0700
@@ -85,12 +85,12 @@
         return INSTANCE;
     }
     
-    public Object execute(Command command) {
+    public synchronized Object execute(Command command) {
         addCommand(command);
         return command.execute();
     }
     
-    public void addCommand(Command command) {
+    public synchronized void addCommand(Command command) {
 
         ProjectManager.getManager().setSaveEnabled(true);
         
@@ -123,7 +123,7 @@
     }
 
 
-    public void undo() {
+    public synchronized void undo() {
         final Interaction command = undoStack.pop();
         command.undo();
         if (!command.isRedoable()) {
@@ -133,13 +133,13 @@
     }
     
 
-    public void redo() {
+    public synchronized void redo() {
         final Interaction command = redoStack.pop();
         command.execute();
         undoStack.push(command);
     }
     
-    public void startInteraction(String label) {
+    public synchronized void startInteraction(String label) {
         LOG.info("Starting interaction " + label);
         this.newInteractionLabel = label;
         newInteraction = true;
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.