Author: tfmorris
Date: 2007-09-10 23:07:34-0700
New Revision: 13529
Modified:
trunk/src_new/org/argouml/kernel/Command.java
trunk/src_new/org/argouml/kernel/DefaultUndoManager.java
trunk/src_new/org/argouml/kernel/Project.java
trunk/src_new/org/argouml/kernel/ProjectImpl.java
trunk/src_new/org/argouml/kernel/ProjectManager.java
trunk/src_new/org/argouml/uml/diagram/DiagramUndoManager.java
Log:
Remove obsolete references to mementos from Javadoc and variable names.
Modified: trunk/src_new/org/argouml/kernel/Command.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/kernel/Command.java?view=diff&rev=13529&p1=trunk/src_new/org/argouml/kernel/Command.java&p2=trunk/src_new/org/argouml/kernel/Command.java&r1=13528&r2=13529
==============================================================================
--- trunk/src_new/org/argouml/kernel/Command.java (original)
+++ trunk/src_new/org/argouml/kernel/Command.java 2007-09-10 23:07:34-0700
@@ -1,56 +1,56 @@
-// $Id: UndoableCommand.java 13484 2007-09-03 20:53:50Z bobtarling $
-// Copyright (c) 2007 The Regents of the University of California. All
-// Rights Reserved. Permission to use, copy, modify, and distribute this
-// software and its documentation without fee, and without a written
-// agreement is hereby granted, provided that the above copyright notice
-// and this paragraph appear in all copies. This software program and
-// documentation are copyrighted by The Regents of the University of
-// California. The software program and documentation are supplied "AS
-// IS", without any accompanying services from The Regents. The Regents
-// does not warrant that the operation of the program will be
-// uninterrupted or error-free. The end-user understands that the program
-// was developed for research purposes and is advised not to rely
-// exclusively on the program for any reason. IN NO EVENT SHALL THE
-// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
-// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
-// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
-// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
-// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
-// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
-// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
-package org.argouml.kernel;
-
-/**
- * An executable Command
- *
- * @author Bob
- */
-public interface Command {
-
- /**
- * To be implemented on the concrete memento to redo an instruction
- * @return any resulting object created by the command
- */
- public abstract Object execute();
-
- /**
- * Perform undo an an undoable command that is in an undoable state
- */
- abstract void undo();
-
- /**
- * Returns true if the command can be undone
- * @return true if the command is undoable
- */
- abstract boolean isUndoable();
-
- /**
- * Returns true if the command can be redone once undone
- * @return true if the command is redoable
- */
- abstract boolean isRedoable();
+// $Id$
+// Copyright (c) 2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.kernel;
+
+/**
+ * An executable Command
+ *
+ * @author Bob
+ */
+public interface Command {
+
+ /**
+ * Execute the command to redo an instruction.
+ * @return any result object created by the command
+ */
+ public abstract Object execute();
+
+ /**
+ * Perform undo an an undoable command that is in an undoable state
+ */
+ abstract void undo();
+
+ /**
+ * Returns true if the command can be undone.
+ * @return true if the command is undoable
+ */
+ abstract boolean isUndoable();
+
+ /**
+ * Returns true if the command can be redone once undone
+ * @return true if the command is redoable
+ */
+ abstract boolean isRedoable();
}
\ No newline at end of file
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=13529&p1=trunk/src_new/org/argouml/kernel/DefaultUndoManager.java&p2=trunk/src_new/org/argouml/kernel/DefaultUndoManager.java&r1=13528&r2=13529
==============================================================================
--- trunk/src_new/org/argouml/kernel/DefaultUndoManager.java (original)
+++ trunk/src_new/org/argouml/kernel/DefaultUndoManager.java 2007-09-10 23:07:34-0700
@@ -37,8 +37,9 @@
import org.argouml.i18n.Translator;
/**
- * Manages a stacks of Commands to undo and redo.
- * UndoManager is only temporarily singleton until changes are made to GEF.
+ * Manages a stacks of Commands to undo and redo. This DefaultUndoManager is
+ * only temporarily a singleton until changes are made to GEF.
+ *
* @author Bob Tarling
*/
class DefaultUndoManager implements UndoManager {
@@ -73,9 +74,13 @@
/**
* Get the UndoManager singleton instance.
- * UndoManager is only temporarily singleton until changes are made to GEF.
+ *
+ * @deprecated The DefaultUndoManager is only temporarily a singleton until
+ * changes are made to GEF at which point there will be one undo
+ * manager per ArgoUML project and this method will disappear.
* @return the singleton undo manager
*/
+ @Deprecated
public static UndoManager getInstance() {
return INSTANCE;
}
@@ -117,10 +122,7 @@
undoMax = max;
}
- /**
- *
- * @see org.argouml.kernel.UndoManager#undo()
- */
+
public void undo() {
final Interaction command = undoStack.pop();
command.undo();
@@ -130,10 +132,7 @@
redoStack.push(command);
}
- /**
- *
- * @see org.argouml.kernel.UndoManager#redo()
- */
+
public void redo() {
final Interaction command = redoStack.pop();
command.execute();
Modified: trunk/src_new/org/argouml/kernel/Project.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/kernel/Project.java?view=diff&rev=13529&p1=trunk/src_new/org/argouml/kernel/Project.java&p2=trunk/src_new/org/argouml/kernel/Project.java&r1=13528&r2=13529
==============================================================================
--- trunk/src_new/org/argouml/kernel/Project.java (original)
+++ trunk/src_new/org/argouml/kernel/Project.java 2007-09-10 23:07:34-0700
@@ -613,5 +613,11 @@
*/
public ProjectSettings getProjectSettings();
+ /**
+ * Return the UndoManager for this project. Undo is managed on a
+ * per-project basis.
+ *
+ * @return the UndoManager for this project
+ */
public UndoManager getUndoManager();
}
\ No newline at end of file
Modified: trunk/src_new/org/argouml/kernel/ProjectImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/kernel/ProjectImpl.java?view=diff&rev=13529&p1=trunk/src_new/org/argouml/kernel/ProjectImpl.java&p2=trunk/src_new/org/argouml/kernel/ProjectImpl.java&r1=13528&r2=13529
==============================================================================
--- trunk/src_new/org/argouml/kernel/ProjectImpl.java (original)
+++ trunk/src_new/org/argouml/kernel/ProjectImpl.java 2007-09-10 23:07:34-0700
@@ -148,6 +148,8 @@
private Collection trashcan = new ArrayList();
+ // TODO: Change this to use an UndoManager instance per project when
+ // GEF has been enhanced.
private UndoManager undoManager = DefaultUndoManager.getInstance();
/**
Modified: trunk/src_new/org/argouml/kernel/ProjectManager.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/kernel/ProjectManager.java?view=diff&rev=13529&p1=trunk/src_new/org/argouml/kernel/ProjectManager.java&p2=trunk/src_new/org/argouml/kernel/ProjectManager.java&r1=13528&r2=13529
==============================================================================
--- trunk/src_new/org/argouml/kernel/ProjectManager.java (original)
+++ trunk/src_new/org/argouml/kernel/ProjectManager.java 2007-09-10 23:07:34-0700
@@ -26,7 +26,7 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import java.util.Vector;
+import java.util.List;
import javax.swing.Action;
import javax.swing.event.EventListenerList;
@@ -34,15 +34,14 @@
import org.apache.log4j.Logger;
import org.argouml.cognitive.Designer;
import org.argouml.i18n.Translator;
-import org.argouml.model.ModelCommandCreationObserver;
import org.argouml.model.Model;
import org.argouml.model.ModelCommand;
+import org.argouml.model.ModelCommandCreationObserver;
import org.argouml.uml.cognitive.ProjectMemberTodoList;
import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.DiagramFactory;
import org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram;
import org.argouml.uml.diagram.use_case.ui.UMLUseCaseDiagram;
-import org.tigris.gef.graph.MutableGraphSupport;
/**
* This class manages the projects loaded in argouml,
@@ -74,6 +73,7 @@
* The name of the property that there is no project.
* @deprecated in 0.25.4 By Bob Tarling This is unused.
*/
+ @Deprecated
public static final String NO_PROJECT =
"noProject";
@@ -81,6 +81,7 @@
* The name of the property that defines the save state.
* @deprecated in 0.25.4 By Bob Tarling This is unused.
*/
+ @Deprecated
public static final String SAVE_STATE_PROPERTY_NAME = "saveState";
/**
@@ -202,10 +203,9 @@
currentProject = newProject;
if (currentProject != null
&& currentProject.getActiveDiagram() == null) {
- Vector diagrams = currentProject.getDiagrams();
+ List<ArgoDiagram> diagrams = currentProject.getDiagramList();
if (diagrams != null && !diagrams.isEmpty()) {
- ArgoDiagram activeDiagram =
- (ArgoDiagram) currentProject.getDiagrams().get(0);
+ ArgoDiagram activeDiagram = diagrams.get(0);
currentProject.setActiveDiagram(activeDiagram);
}
}
@@ -345,17 +345,17 @@
}
/**
- * Called when the model subsystem creates a memento.
+ * Called when the model subsystem creates a command.
* We must add this to the UndoManager.
*
- * @param memento the memento.
+ * @param command the command.
* @see org.argouml.model.ModelCommandCreationObserver#modelCommandCreated(org.argouml.model.ModelCommand)
*/
public Object execute(final ModelCommand command) {
if (saveAction != null) {
saveAction.setEnabled(true);
}
- AbstractCommand wrappedMemento = new AbstractCommand() {
+ AbstractCommand wrappedCommand = new AbstractCommand() {
private ModelCommand modelCommand = command;
public void undo() {
modelCommand.undo();
@@ -373,6 +373,6 @@
return modelCommand.toString();
}
};
- return getCurrentProject().getUndoManager().execute(wrappedMemento);
+ return getCurrentProject().getUndoManager().execute(wrappedCommand);
}
}
Modified: trunk/src_new/org/argouml/uml/diagram/DiagramUndoManager.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/DiagramUndoManager.java?view=diff&rev=13529&p1=trunk/src_new/org/argouml/uml/diagram/DiagramUndoManager.java&p2=trunk/src_new/org/argouml/uml/diagram/DiagramUndoManager.java&r1=13528&r2=13529
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/DiagramUndoManager.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/DiagramUndoManager.java 2007-09-10 23:07:34-0700
@@ -34,7 +34,7 @@
/**
* This class is a temporary wrapper around the GEF UndoManager.
- * This will be changed when GEF is modified to fire mementos and
+ * This will be changed when GEF is modified to create commands and
* provide an observer interface for ArgoUML to receive them.
*
* @author Bob Tarling
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.