Author: mvw
Date: 2007-06-29 13:13:47-0700
New Revision: 12926
Modified:
trunk/src_new/org/argouml/ui/ProjectBrowser.java
trunk/src_new/org/argouml/ui/explorer/rules/GoModelElementToContainedDiagrams.java
trunk/src_new/org/argouml/ui/explorer/rules/GoNamespaceToDiagram.java
trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java
trunk/src_new/org/argouml/uml/diagram/deployment/ui/UMLDeploymentDiagram.java
trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java
trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java
trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java
trunk/src_new/org/argouml/uml/diagram/ui/ActionAddNote.java
trunk/src_new/org/argouml/uml/diagram/ui/DiagramNameDocument.java
trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java
trunk/src_new/org/argouml/uml/diagram/ui/PropPanelDiagram.java
trunk/src_new/org/argouml/uml/diagram/ui/TabDiagram.java
trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java
trunk/src_new/org/argouml/uml/ui/ActionActivityDiagram.java
trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java
trunk/src_new/org/argouml/uml/ui/ActionClassDiagram.java
trunk/src_new/org/argouml/uml/ui/ActionCollaborationDiagram.java
trunk/src_new/org/argouml/uml/ui/ActionDeploymentDiagram.java
trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java
trunk/src_new/org/argouml/uml/ui/ActionNewDiagram.java
trunk/src_new/org/argouml/uml/ui/ActionSequenceDiagram.java
trunk/src_new/org/argouml/uml/ui/ActionStateDiagram.java
trunk/src_new/org/argouml/uml/ui/ActionUseCaseDiagram.java
Log:
Again, reduce the dependencies on org.argouml.uml.diagram.ui.UMLDiagram (the center of many dependency cycles).
Modified: trunk/src_new/org/argouml/ui/ProjectBrowser.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/ProjectBrowser.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/ui/ProjectBrowser.java&p2=trunk/src_new/org/argouml/ui/ProjectBrowser.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/ui/ProjectBrowser.java (original)
+++ trunk/src_new/org/argouml/ui/ProjectBrowser.java 2007-06-29 13:13:47-0700
@@ -86,7 +86,6 @@
import org.argouml.uml.diagram.DiagramFactory;
import org.argouml.uml.diagram.UMLMutableGraphSupport;
import org.argouml.uml.diagram.ui.ActionRemoveFromDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.argouml.uml.ui.ActionSaveProject;
import org.argouml.uml.ui.ProjectFileView;
import org.argouml.uml.ui.TabProps;
@@ -1027,8 +1026,8 @@
Object theCurrentNamespace = null;
target = TargetManager.getInstance().getTarget();
- if (target instanceof UMLDiagram) {
- theCurrentNamespace = ((UMLDiagram) target).getNamespace();
+ if (target instanceof ArgoDiagram) {
+ theCurrentNamespace = ((ArgoDiagram) target).getNamespace();
} else if (Model.getFacade().isANamespace(target)) {
theCurrentNamespace = target;
} else if (Model.getFacade().isAModelElement(target)) {
Modified: trunk/src_new/org/argouml/ui/explorer/rules/GoModelElementToContainedDiagrams.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/explorer/rules/GoModelElementToContainedDiagrams.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/ui/explorer/rules/GoModelElementToContainedDiagrams.java&p2=trunk/src_new/org/argouml/ui/explorer/rules/GoModelElementToContainedDiagrams.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/ui/explorer/rules/GoModelElementToContainedDiagrams.java (original)
+++ trunk/src_new/org/argouml/ui/explorer/rules/GoModelElementToContainedDiagrams.java 2007-06-29 13:13:47-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 2006 The Regents of the University of California. All
+// Copyright (c) 2006-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
@@ -35,7 +35,6 @@
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
import org.argouml.uml.diagram.ArgoDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
/**
* Rule for ModelElement -> Contained diagrams. <p>
@@ -65,10 +64,8 @@
Iterator it = diagrams.iterator();
while (it.hasNext()) {
ArgoDiagram diagram = (ArgoDiagram) it.next();
- if (diagram instanceof UMLDiagram) {
- if (((UMLDiagram) diagram).getNamespace() == parent) {
- ret.add(diagram);
- }
+ if (diagram.getNamespace() == parent) {
+ ret.add(diagram);
}
}
return ret;
Modified: trunk/src_new/org/argouml/ui/explorer/rules/GoNamespaceToDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/explorer/rules/GoNamespaceToDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/ui/explorer/rules/GoNamespaceToDiagram.java&p2=trunk/src_new/org/argouml/ui/explorer/rules/GoNamespaceToDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/ui/explorer/rules/GoNamespaceToDiagram.java (original)
+++ trunk/src_new/org/argouml/ui/explorer/rules/GoNamespaceToDiagram.java 2007-06-29 13:13:47-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-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
@@ -34,10 +34,10 @@
import org.argouml.kernel.Project;
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.activity.ui.UMLActivityDiagram;
import org.argouml.uml.diagram.sequence.ui.UMLSequenceDiagram;
import org.argouml.uml.diagram.state.ui.UMLStateDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
/**
* Rule for Package->Diagram.
@@ -64,7 +64,7 @@
Project proj = ProjectManager.getManager().getCurrentProject();
Iterator it = proj.getDiagrams().iterator();
while (it.hasNext()) {
- UMLDiagram diagram = (UMLDiagram) it.next();
+ ArgoDiagram diagram = (ArgoDiagram) it.next();
// Sequence diagrams are not shown as children of the
// collaboration that they show but as children of the
// classifier/operation the collaboration represents.
Modified: trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java&p2=trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java 2007-06-29 13:13:47-0700
@@ -24,6 +24,8 @@
package org.argouml.uml.diagram;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.beans.PropertyVetoException;
import java.util.ArrayList;
import java.util.Iterator;
@@ -32,7 +34,10 @@
import org.apache.log4j.Logger;
import org.argouml.cognitive.ItemUID;
import org.argouml.kernel.Project;
+import org.argouml.model.CoreHelper;
+import org.argouml.model.DeleteInstanceEvent;
import org.argouml.model.Model;
+import org.argouml.model.ModelManagementHelper;
import org.argouml.uml.diagram.activity.ui.FigPool;
import org.argouml.uml.diagram.static_structure.ui.FigComment;
import org.argouml.uml.diagram.ui.FigEdgeModelElement;
@@ -47,9 +52,29 @@
/**
* This class represents all Diagrams within ArgoUML.
- * It is based upon the GEF Diagram.
+ * It is based upon the GEF Diagram.<p>
+ *
+ * It adds a namespace, and the capability
+ * to delete itself when its namespace is deleted. <p>
+ *
+ * TODO: MVW: I am not sure of the following:<p>
+ * The "namespace" of the diagram is e.g. used when creating new elements
+ * that are shown on the diagram; they will have their namespace set
+ * according this. It is NOT necessarily equal to the "owner". <p>
+ *
+ * MVW: I doubt all following:
+ * The "namespace" of the diagram is e.g. used to register a listener
+ * to the UML model, to be notified if this element is removed;
+ * which will imply that this diagram has to be deleted, too. <p>
+ *
+ * Hence the namespace of e.g. a collaboration diagram should be the
+ * represented classifier or, in case of a represented operation, the
+ * classifier that owns this operation.
+ * And the namespace of the statechart diagram should be
+ * the namespace of its statemachine.
*/
-public abstract class ArgoDiagram extends Diagram {
+public abstract class ArgoDiagram extends Diagram
+ implements PropertyChangeListener {
private ItemUID id;
@@ -72,6 +97,8 @@
*/
private Project project;
+ protected Object namespace;
+
/**
* The constructor.
*
@@ -111,6 +138,10 @@
return id;
}
+ /** The bean property name denoting the diagram's namespace.
+ * Value is a String. */
+ public static final String NAMESPACE_KEY = "namespace";
+
////////////////////////////////////////////////////////////////
// event management
/**
@@ -490,5 +521,122 @@
public Object getDependentElement() {
return null;
}
+
+ /**
+ * @return the namespace for the diagram
+ */
+ public Object getNamespace() {
+ return namespace;
+ }
+
+ /**
+ * Sets the namespace of the Diagram, and
+ * adds the diagram as a listener of its namespace in the UML model
+ * (so that it can delete itself when the model element is deleted).
+ *
+ * @param ns the namespace for the diagram
+ */
+ public void setNamespace(Object ns) {
+ if (!Model.getFacade().isANamespace(ns)) {
+ LOG.error("Not a namespace");
+ LOG.error(ns);
+ throw new IllegalArgumentException("Given object not a namespace");
+ }
+ if ((namespace != null) && (namespace != ns)) {
+ Model.getPump().removeModelEventListener(this, namespace);
+ }
+ Object oldNs = namespace;
+ namespace = ns;
+ firePropertyChange(NAMESPACE_KEY, oldNs, ns);
+ // Add the diagram as a listener to the namespace so
+ // that when the namespace is removed the diagram is deleted also.
+ /* Listening only to "remove" events does not work...
+ * TODO: Check if this works now with new event pump - tfm
+ */
+ Model.getPump().addModelEventListener(this, namespace, "remove");
+ }
+
+ /**
+ * Set the namespace of a model element to the owner of
+ * the given namespace. If the namespace is null
+ * the namespace of the diagram is used instead.
+ * If the modelElement is not valid in the given namespace
+ * this method takes no action.
+ * @param modelElement the model element
+ * @param ns the namespace
+ */
+ public void setModelElementNamespace(Object modelElement, Object ns) {
+ if (modelElement == null) {
+ return;
+ }
+
+ // If we're not provided a namespace then get it from the diagram or
+ // the root
+ if (ns == null) {
+ if (getNamespace() != null) {
+ ns = getNamespace();
+ } else {
+ ns = getProject().getRoot();
+ }
+ }
+
+ // If we haven't succeeded in getting a namespace then abort
+ if (ns == null) {
+ return;
+ }
+
+ // If we're trying to set the namespace to the existing value
+ // then don't do any more work.
+ if (Model.getFacade().getNamespace(modelElement) == ns) {
+ return;
+ }
+
+ CoreHelper coreHelper = Model.getCoreHelper();
+ ModelManagementHelper modelHelper = Model.getModelManagementHelper();
+
+ if (!modelHelper.isCyclicOwnership(ns, modelElement)
+ && coreHelper.isValidNamespace(modelElement, ns)) {
+
+ coreHelper.setModelElementContainer(modelElement, ns);
+ /* TODO: move the associations to the correct owner (namespace)
+ * i.e. issue 2151
+ */
+ }
+ }
+
+ /**
+ * This diagram listens to events from its namespace ModelElement;
+ * when the modelelement is removed, we also want to delete this
+ * diagram. <p>
+ *
+ * There is also a risk that if this diagram was the one shown in
+ * the diagram panel, then it will remain after it has been
+ * deleted. So we need to deselect this diagram.
+ * There are other things to take care of, so all this is delegated to
+ * {@link org.argouml.kernel.Project#moveToTrash(Object)}.
+ *
+ * {@inheritDoc}
+ */
+ public void propertyChange(PropertyChangeEvent evt) {
+ if ((evt.getSource() == namespace)
+ && (evt instanceof DeleteInstanceEvent)
+ && "remove".equals(evt.getPropertyName())) {
+
+ Model.getPump().removeModelEventListener(this, namespace, "remove");
+
+ getProject().moveToTrash(this);
+ }
+ }
+
+ /**
+ * The default implementation for diagrams that
+ * have the namespace as their owner.
+ *
+ * @return the namespace
+ */
+ public Object getOwner() {
+ return getNamespace();
+ }
+
} /* end class ArgoDiagram */
Modified: trunk/src_new/org/argouml/uml/diagram/deployment/ui/UMLDeploymentDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/deployment/ui/UMLDeploymentDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/diagram/deployment/ui/UMLDeploymentDiagram.java&p2=trunk/src_new/org/argouml/uml/diagram/deployment/ui/UMLDeploymentDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/deployment/ui/UMLDeploymentDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/deployment/ui/UMLDeploymentDiagram.java 2007-06-29 13:13:47-0700
@@ -494,7 +494,7 @@
* @param namespace the namespace (or null for diagram)
* @see org.argouml.uml.diagram.ui.UMLDiagram#setModelElementNamespace(java.lang.Object, Object)
*/
- protected void setModelElementNamespace(
+ public void setModelElementNamespace(
Object modelElement,
Object namespace) {
Facade facade = Model.getFacade();
Modified: trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java&p2=trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java 2007-06-29 13:13:47-0700
@@ -32,9 +32,9 @@
import org.apache.log4j.Logger;
import org.argouml.model.Model;
import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.ui.CompartmentFigText;
import org.argouml.uml.diagram.ui.FigStereotypesCompartment;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.tigris.gef.base.Editor;
import org.tigris.gef.base.Globals;
import org.tigris.gef.base.Selection;
@@ -241,9 +241,9 @@
// If default Namespace is not already set
if (Model.getFacade().getNamespace(me) == null
&& (TargetManager.getInstance().getTarget()
- instanceof UMLDiagram)) {
+ instanceof ArgoDiagram)) {
m =
- ((UMLDiagram) TargetManager.getInstance().getTarget())
+ ((ArgoDiagram) TargetManager.getInstance().getTarget())
.getNamespace();
Model.getCoreHelper().setNamespace(me, m);
}
Modified: trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java&p2=trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java 2007-06-29 13:13:47-0700
@@ -39,9 +39,9 @@
import org.argouml.model.AttributeChangeEvent;
import org.argouml.model.Model;
import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.ui.CompartmentFigText;
import org.argouml.uml.diagram.ui.FigStereotypesCompartment;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.tigris.gef.base.Editor;
import org.tigris.gef.base.Globals;
import org.tigris.gef.base.Selection;
@@ -271,9 +271,9 @@
// If default Namespace is not already set
if (Model.getFacade().getNamespace(me) == null
&& (TargetManager.getInstance().getTarget()
- instanceof UMLDiagram)) {
+ instanceof ArgoDiagram)) {
m =
- ((UMLDiagram) TargetManager.getInstance().getTarget())
+ ((ArgoDiagram) TargetManager.getInstance().getTarget())
.getNamespace();
Model.getCoreHelper().setNamespace(me, m);
}
Modified: trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java&p2=trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java 2007-06-29 13:13:47-0700
@@ -53,7 +53,6 @@
import org.argouml.uml.diagram.ui.FigNodeModelElement;
import org.argouml.uml.diagram.ui.FigStereotypesCompartment;
import org.argouml.uml.diagram.ui.StereotypeContainer;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.argouml.uml.diagram.ui.VisibilityContainer;
import org.tigris.gef.base.Editor;
import org.tigris.gef.base.Geometry;
@@ -635,8 +634,8 @@
Enumeration diagEnum = diags.elements();
ArgoDiagram lFirst = null;
while (diagEnum.hasMoreElements()) {
- UMLDiagram lDiagram =
- (UMLDiagram) diagEnum.nextElement();
+ ArgoDiagram lDiagram =
+ (ArgoDiagram) diagEnum.nextElement();
Object lDiagramNS = lDiagram.getNamespace();
if ((lNS == null && lDiagramNS == null)
|| (lNS.equals(lDiagramNS))) {
Modified: trunk/src_new/org/argouml/uml/diagram/ui/ActionAddNote.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/ActionAddNote.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/diagram/ui/ActionAddNote.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/ActionAddNote.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/ActionAddNote.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/ActionAddNote.java 2007-06-29 13:13:47-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-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
@@ -39,6 +39,7 @@
import org.argouml.ui.ProjectBrowser;
import org.argouml.ui.targetmanager.TargetManager;
import org.argouml.uml.CommentEdge;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.tigris.gef.base.Diagram;
import org.tigris.gef.graph.MutableGraphModel;
import org.tigris.gef.presentation.Fig;
@@ -90,11 +91,11 @@
Collection targets = TargetManager.getInstance().getModelTargets();
//Let's build the comment first, unlinked.
- Diagram diagram =
+ ArgoDiagram diagram =
ProjectManager.getManager().getCurrentProject().getActiveDiagram();
Object comment =
Model.getCoreFactory().buildComment(null,
- ((UMLDiagram) diagram).getNamespace());
+ diagram.getNamespace());
MutableGraphModel mgm = (MutableGraphModel) diagram.getGraphModel();
//Now, we link it to the modelelements which are represented by FigNode
Modified: trunk/src_new/org/argouml/uml/diagram/ui/DiagramNameDocument.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/DiagramNameDocument.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/diagram/ui/DiagramNameDocument.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/DiagramNameDocument.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/DiagramNameDocument.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/DiagramNameDocument.java 2007-06-29 13:13:47-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 2004-2006 The Regents of the University of California. All
+// Copyright (c) 2004-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
@@ -35,6 +35,7 @@
import org.argouml.ui.targetmanager.TargetEvent;
import org.argouml.ui.targetmanager.TargetListener;
import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
/**
* This is the model for the diagram name text box (JTextField)
@@ -75,9 +76,9 @@
* @param t the currently selected object
*/
private void setTarget(Object t) {
- if (t instanceof UMLDiagram) {
+ if (t instanceof ArgoDiagram) {
stopEvents = true;
- field.setText(((UMLDiagram) t).getName());
+ field.setText(((ArgoDiagram) t).getName());
stopEvents = false;
}
}
@@ -133,8 +134,8 @@
private void update(DocumentEvent e) {
if (!stopEvents) {
Object target = TargetManager.getInstance().getTarget();
- if (target instanceof UMLDiagram) {
- UMLDiagram d = (UMLDiagram) target;
+ if (target instanceof ArgoDiagram) {
+ ArgoDiagram d = (ArgoDiagram) target;
try {
int documentLength = e.getDocument().getLength();
String newName = e.getDocument().getText(0, documentLength);
Modified: trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java 2007-06-29 13:13:47-0700
@@ -572,8 +572,8 @@
if (layer != null && newEncloser != oldEncloser) {
Diagram diagram = layer.getDiagram();
- if (diagram instanceof UMLDiagram) {
- UMLDiagram umlDiagram = (UMLDiagram) diagram;
+ if (diagram instanceof ArgoDiagram) {
+ ArgoDiagram umlDiagram = (ArgoDiagram) diagram;
// Set the namespace of the enclosed model element to the
// namespace of the encloser.
Object namespace = null;
Modified: trunk/src_new/org/argouml/uml/diagram/ui/PropPanelDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/PropPanelDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/diagram/ui/PropPanelDiagram.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/PropPanelDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/PropPanelDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/PropPanelDiagram.java 2007-06-29 13:13:47-0700
@@ -36,6 +36,7 @@
import org.argouml.ui.targetmanager.TargetEvent;
import org.argouml.ui.targetmanager.TargetListener;
import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.ui.AbstractActionNavigate;
import org.argouml.uml.ui.ActionDeleteModelElements;
import org.argouml.uml.ui.PropPanel;
@@ -91,8 +92,8 @@
* @see org.argouml.uml.ui.AbstractActionNavigate#navigateTo(java.lang.Object)
*/
protected Object navigateTo(Object source) {
- if (source instanceof UMLDiagram) {
- return ((UMLDiagram) source).getNamespace();
+ if (source instanceof ArgoDiagram) {
+ return ((ArgoDiagram) source).getNamespace();
}
return null;
}
@@ -125,7 +126,7 @@
extends DefaultListModel
implements TargetListener, PropertyChangeListener {
- private static UMLDiagram oldTarget = null;
+ private static ArgoDiagram oldTarget = null;
/**
* Constructor for UMLCommentAnnotatedElementListModel.
*/
@@ -159,15 +160,15 @@
private void setTarget(Object t) {
if (oldTarget != null) {
oldTarget.removePropertyChangeListener(
- UMLDiagram.NAMESPACE_KEY, this);
+ ArgoDiagram.NAMESPACE_KEY, this);
}
- UMLDiagram target = null;
- if (t instanceof UMLDiagram) {
- target = (UMLDiagram) t;
+ ArgoDiagram target = null;
+ if (t instanceof ArgoDiagram) {
+ target = (ArgoDiagram) t;
oldTarget = target;
target.addPropertyChangeListener(
- UMLDiagram.NAMESPACE_KEY, this);
+ ArgoDiagram.NAMESPACE_KEY, this);
}
removeAllElements();
Modified: trunk/src_new/org/argouml/uml/diagram/ui/TabDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/TabDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/diagram/ui/TabDiagram.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/TabDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/TabDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/TabDiagram.java 2007-06-29 13:13:47-0700
@@ -51,6 +51,7 @@
import org.argouml.ui.ProjectBrowser;
import org.argouml.ui.targetmanager.TargetEvent;
import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.ui.ActionCopy;
import org.argouml.uml.ui.ActionCut;
import org.argouml.uml.ui.TabModelTarget;
@@ -184,7 +185,7 @@
UMLDiagram newTarget = (UMLDiagram) t;
if (target != null) {
- target.removePropertyChangeListener("remove", this);
+ target.removePropertyChangeListener("remove", this);
}
newTarget.addPropertyChangeListener("remove", this);
@@ -223,7 +224,7 @@
* @see org.argouml.ui.TabTarget#shouldBeEnabled(java.lang.Object)
*/
public boolean shouldBeEnabled(Object newTarget) {
- return newTarget instanceof UMLDiagram;
+ return newTarget instanceof ArgoDiagram;
}
////////////////////////////////////////////////////////////////
Modified: trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java 2007-06-29 13:13:47-0700
@@ -25,8 +25,6 @@
package org.argouml.uml.diagram.ui;
import java.awt.Component;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
import java.beans.PropertyVetoException;
import javax.swing.Action;
@@ -44,10 +42,7 @@
import org.argouml.gefext.ArgoModeCreateFigText;
import org.argouml.i18n.Translator;
import org.argouml.kernel.Project;
-import org.argouml.model.CoreHelper;
-import org.argouml.model.DeleteInstanceEvent;
import org.argouml.model.Model;
-import org.argouml.model.ModelManagementHelper;
import org.argouml.ui.CmdCreateNode;
import org.argouml.uml.UUIDHelper;
import org.argouml.uml.diagram.ArgoDiagram;
@@ -65,8 +60,7 @@
* This class provides support for writing a UML diagram for argo using
* the GEF framework. <p>
*
- * It adds common buttons, a namespace, capability
- * to delete itself when its namespace is deleted, some help
+ * It adds common buttons, and some help
* with creating a valid diagram name. <p>
*
* There are various methods for returning 'structures' of Actions
@@ -88,28 +82,13 @@
* For a activitydiagram is that the activitygraph.
* Override the getOwner method to return the owner. <p>
*
- *The "owner" is shown in the diagram's properties
- *panel as the "home model". <p>
- *
- * TODO: MVW: I am not sure of the following:<p>
- * The "namespace" of the diagram is e.g. used when creating new elements
- * that are shown on the diagram; they will have their namespace set
- * according this. It is NOT necessarily equal to the "owner". <p>
- *
- * MVW: I doubt all following:
- * The "namespace" of the diagram is e.g. used to register a listener
- * to the UML model, to be notified if this element is removed;
- * which will imply that this diagram has to be deleted, too. <p>
- *
- * Hence the namespace of e.g. a collaboration diagram should be the
- * represented classifier or, in case of a represented operation, the
- * classifier that owns this operation.
- * And the namespace of the statechart diagram should be
- * the namespace of its statemachine.
+ * The "owner" is shown in the diagram's properties
+ * panel as the "home model". <p>
*/
public abstract class UMLDiagram
extends ArgoDiagram
- implements PropertyChangeListener, Relocatable {
+ implements Relocatable {
+
/**
* Logger.
*/
@@ -121,13 +100,6 @@
*/
private int diagramSerial = 1;
- /** The bean property name denoting the diagram's namespace.
- * Value is a String. */
- public static final String NAMESPACE_KEY = "namespace";
-
- ////////////////////////////////////////////////////////////////
- // actions for toolbar
-
/**
* Tool to add a comment node.
*/
@@ -180,10 +152,6 @@
new RadioAction(new ActionSetMode(ArgoModeCreateFigInk.class,
"Ink", "misc.primitive.ink"));
- ////////////////////////////////////////////////////////////////
- // instance variables
- private Object namespace;
-
private JToolBar toolBar;
private Action selectedAction;
@@ -238,41 +206,6 @@
////////////////////////////////////////////////////////////////
// accessors
- /**
- * @return the namespace for the diagram
- */
- public Object getNamespace() {
- return namespace;
- }
-
- /**
- * Sets the namespace of the Diagram, and
- * adds the diagram as a listener of its namespace in the UML model
- * (so that it can delete itself when the model element is deleted).
- *
- * @param ns the namespace for the diagram
- */
- public void setNamespace(Object ns) {
- if (!Model.getFacade().isANamespace(ns)) {
- LOG.error("Not a namespace");
- LOG.error(ns);
- throw new IllegalArgumentException("Given object not a namespace");
- }
- if ((namespace != null) && (namespace != ns)) {
- Model.getPump().removeModelEventListener(this, namespace);
- }
- Object oldNs = namespace;
- namespace = ns;
- firePropertyChange(NAMESPACE_KEY, oldNs, ns);
-
- // Add the diagram as a listener to the namespace so
- // that when the namespace is removed the diagram is deleted also.
- /* Listening only to "remove" events does not work...
- * TODO: Check if this works now with new event pump - tfm
- */
- Model.getPump().addModelEventListener(this, namespace, "remove");
- }
-
/*
* @see org.tigris.gef.base.Diagram#getClassAndModelID()
*/
@@ -286,16 +219,6 @@
}
/**
- * The default implementation for diagrams that
- * have the namespace as their owner.
- *
- * @return the namespace
- */
- public Object getOwner() {
- return getNamespace();
- }
-
- /**
* Get the toolbar for the diagram.
* @return the diagram toolbar
*/
@@ -426,30 +349,6 @@
}
/**
- * This diagram listens to events from its namespace ModelElement;
- * when the modelelement is removed, we also want to delete this
- * diagram. <p>
- *
- * There is also a risk that if this diagram was the one shown in
- * the diagram panel, then it will remain after it has been
- * deleted. So we need to deselect this diagram.
- * There are other things to take care of, so all this is delegated to
- * {@link org.argouml.kernel.Project#moveToTrash(Object)}.
- *
- * {@inheritDoc}
- */
- public void propertyChange(PropertyChangeEvent evt) {
- if ((evt.getSource() == namespace)
- && (evt instanceof DeleteInstanceEvent)
- && "remove".equals(evt.getPropertyName())) {
-
- Model.getPump().removeModelEventListener(this, namespace, "remove");
-
- getProject().moveToTrash(this);
- }
- }
-
- /**
* Set the given action as the selected action (ie pressed down on the
* diagram toolbar). All other actions become unselected.
*
@@ -645,56 +544,6 @@
}
/**
- * Set the namespace of a model element to the owner of
- * the given namespace. If the namespace is null
- * the namespace of the diagram is used instead.
- * If the modelElement is not valid in the given namespace
- * this method takes no action.
- * @param modelElement the model element
- * @param ns the namespace
- */
- protected void setModelElementNamespace(
- Object modelElement,
- Object ns) {
- if (modelElement == null) {
- return;
- }
-
- // If we're not provided a namespace then get it from the diagram or
- // the root
- if (ns == null) {
- if (getNamespace() != null) {
- ns = getNamespace();
- } else {
- ns = getProject().getRoot();
- }
- }
-
- // If we haven't succeeded in getting a namespace then abort
- if (ns == null) {
- return;
- }
-
- // If we're trying to set the namespace to the existing value
- // then don't do any more work.
- if (Model.getFacade().getNamespace(modelElement) == ns) {
- return;
- }
-
- CoreHelper coreHelper = Model.getCoreHelper();
- ModelManagementHelper modelHelper = Model.getModelManagementHelper();
-
- if (!modelHelper.isCyclicOwnership(ns, modelElement)
- && coreHelper.isValidNamespace(modelElement, ns)) {
-
- coreHelper.setModelElementContainer(modelElement, ns);
- /* TODO: move the associations to the correct owner (namespace)
- * i.e. issue 2151
- */
- }
- }
-
- /**
* The UID.
*/
static final long serialVersionUID = -401219134410459387L;
Modified: trunk/src_new/org/argouml/uml/ui/ActionActivityDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionActivityDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/ui/ActionActivityDiagram.java&p2=trunk/src_new/org/argouml/uml/ui/ActionActivityDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionActivityDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionActivityDiagram.java 2007-06-29 13:13:47-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-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
@@ -28,9 +28,9 @@
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.DiagramFactory;
import org.argouml.uml.diagram.activity.ui.UMLActivityDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
/**
* Action to trigger creation of a new activity diagram.<p>
@@ -56,7 +56,7 @@
* Create the diagram.
* @return the newly created and initialized diagram
*/
- protected UMLDiagram createDiagram() {
+ protected ArgoDiagram createDiagram() {
Project p = ProjectManager.getManager().getCurrentProject();
Object target = TargetManager.getInstance().getModelTarget();
Object graph = null;
@@ -75,7 +75,7 @@
.buildCompositeStateOnStateMachine(graph);
}
- return (UMLDiagram) DiagramFactory.getInstance().createDiagram(
+ return DiagramFactory.getInstance().createDiagram(
UMLActivityDiagram.class,
Model.getFacade().getNamespace(graph),
graph);
Modified: trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java&p2=trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java 2007-06-29 13:13:47-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-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
@@ -37,7 +37,6 @@
import org.argouml.ui.explorer.ExplorerEventAdaptor;
import org.argouml.ui.targetmanager.TargetManager;
import org.argouml.uml.diagram.ArgoDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.tigris.gef.undo.UndoableAction;
/**
@@ -140,5 +139,5 @@
* @param ns The namespace the UMLDiagram should get.
* @return UMLDiagram
*/
- public abstract UMLDiagram createDiagram(Object ns);
+ public abstract ArgoDiagram createDiagram(Object ns);
}
Modified: trunk/src_new/org/argouml/uml/ui/ActionClassDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionClassDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/ui/ActionClassDiagram.java&p2=trunk/src_new/org/argouml/uml/ui/ActionClassDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionClassDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionClassDiagram.java 2007-06-29 13:13:47-0700
@@ -26,9 +26,9 @@
import org.apache.log4j.Logger;
import org.argouml.model.Model;
+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.ui.UMLDiagram;
/**
* Action to trigger creation of new class diagram.
@@ -57,9 +57,9 @@
/*
* @see org.argouml.uml.ui.ActionAddDiagram#createDiagram(Object)
*/
- public UMLDiagram createDiagram(Object ns) {
+ public ArgoDiagram createDiagram(Object ns) {
if (Model.getFacade().isANamespace(ns)) {
- return (UMLDiagram) DiagramFactory.getInstance().createDiagram(
+ return DiagramFactory.getInstance().createDiagram(
UMLClassDiagram.class,
ns,
null);
Modified: trunk/src_new/org/argouml/uml/ui/ActionCollaborationDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionCollaborationDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/ui/ActionCollaborationDiagram.java&p2=trunk/src_new/org/argouml/uml/ui/ActionCollaborationDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionCollaborationDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionCollaborationDiagram.java 2007-06-29 13:13:47-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-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
@@ -24,9 +24,9 @@
package org.argouml.uml.ui;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.DiagramFactory;
import org.argouml.uml.diagram.collaboration.ui.UMLCollaborationDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
/**
* Action to trigger creation of new collaboration diagram.
@@ -43,8 +43,8 @@
/*
* @see org.argouml.uml.ui.ActionNewDiagram#createDiagram()
*/
- public UMLDiagram createDiagram() {
- return (UMLDiagram) DiagramFactory.getInstance().createDiagram(
+ public ArgoDiagram createDiagram() {
+ return DiagramFactory.getInstance().createDiagram(
UMLCollaborationDiagram.class,
createCollaboration(),
null);
Modified: trunk/src_new/org/argouml/uml/ui/ActionDeploymentDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionDeploymentDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/ui/ActionDeploymentDiagram.java&p2=trunk/src_new/org/argouml/uml/ui/ActionDeploymentDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionDeploymentDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionDeploymentDiagram.java 2007-06-29 13:13:47-0700
@@ -28,9 +28,9 @@
import org.argouml.kernel.Project;
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.DiagramFactory;
import org.argouml.uml.diagram.deployment.ui.UMLDeploymentDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
/**
* Action to trigger creation of a deployment diagram.
@@ -61,7 +61,7 @@
/*
* @see org.argouml.uml.ui.ActionAddDiagram#createDiagram(Object)
*/
- public UMLDiagram createDiagram(Object notUsedHandle) {
+ public ArgoDiagram createDiagram(Object notUsedHandle) {
// a deployment diagram shows something about the whole model
// according to the uml spec
Project p = ProjectManager.getManager().getCurrentProject();
@@ -73,7 +73,7 @@
"The argument " + handle
+ "is not a namespace.");
}
- return (UMLDiagram) DiagramFactory.getInstance().createDiagram(
+ return DiagramFactory.getInstance().createDiagram(
UMLDeploymentDiagram.class,
handle,
null);
Modified: trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java&p2=trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java 2007-06-29 13:13:47-0700
@@ -35,7 +35,6 @@
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
import org.argouml.uml.diagram.ArgoDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.argouml.uml.generator.GeneratorManager;
import org.argouml.uml.generator.ui.ClassGenerationDialog;
import org.tigris.gef.undo.UndoableAction;
@@ -77,7 +76,7 @@
if (activeDiagram == null) {
return;
}
- Object ns = ((UMLDiagram) activeDiagram).getNamespace();
+ Object ns = activeDiagram.getNamespace();
if (ns == null) {
return;
}
Modified: trunk/src_new/org/argouml/uml/ui/ActionNewDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionNewDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/ui/ActionNewDiagram.java&p2=trunk/src_new/org/argouml/uml/ui/ActionNewDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionNewDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionNewDiagram.java 2007-06-29 13:13:47-0700
@@ -35,7 +35,7 @@
import org.argouml.model.Model;
import org.argouml.ui.explorer.ExplorerEventAdaptor;
import org.argouml.ui.targetmanager.TargetManager;
-import org.argouml.uml.diagram.ui.UMLDiagram;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.tigris.gef.undo.UndoableAction;
/**
@@ -65,7 +65,7 @@
public void actionPerformed(ActionEvent e) {
super.actionPerformed(e);
- UMLDiagram diagram = createDiagram();
+ ArgoDiagram diagram = createDiagram();
assert (diagram != null)
: "No diagram was returned by the concrete class";
@@ -81,7 +81,7 @@
/**
* @return the new diagram
*/
- protected abstract UMLDiagram createDiagram();
+ protected abstract ArgoDiagram createDiagram();
/**
* Utility function to create a collaboration.
Modified: trunk/src_new/org/argouml/uml/ui/ActionSequenceDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionSequenceDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/ui/ActionSequenceDiagram.java&p2=trunk/src_new/org/argouml/uml/ui/ActionSequenceDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionSequenceDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionSequenceDiagram.java 2007-06-29 13:13:47-0700
@@ -24,9 +24,9 @@
package org.argouml.uml.ui;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.DiagramFactory;
import org.argouml.uml.diagram.sequence.ui.UMLSequenceDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
/**
* Action to add a new sequence diagram.
@@ -43,8 +43,8 @@
/*
* @see org.argouml.uml.ui.ActionNewDiagram#createDiagram()
*/
- public UMLDiagram createDiagram() {
- return (UMLDiagram) DiagramFactory.getInstance().createDiagram(
+ public ArgoDiagram createDiagram() {
+ return DiagramFactory.getInstance().createDiagram(
UMLSequenceDiagram.class,
createCollaboration(),
null);
Modified: trunk/src_new/org/argouml/uml/ui/ActionStateDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionStateDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/ui/ActionStateDiagram.java&p2=trunk/src_new/org/argouml/uml/ui/ActionStateDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionStateDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionStateDiagram.java 2007-06-29 13:13:47-0700
@@ -34,7 +34,6 @@
import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.DiagramFactory;
import org.argouml.uml.diagram.state.ui.UMLStateDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
/**
* Action to create a new statechart diagram.
@@ -51,7 +50,7 @@
/*
* @see org.argouml.uml.ui.ActionNewDiagram#createDiagram()
*/
- protected UMLDiagram createDiagram() {
+ protected ArgoDiagram createDiagram() {
Project p = ProjectManager.getManager().getCurrentProject();
Object target = TargetManager.getInstance().getModelTarget();
Object machine = null;
@@ -78,7 +77,7 @@
.buildCompositeStateOnStateMachine(machine);
}
- return (UMLDiagram) DiagramFactory.getInstance().createDiagram(
+ return DiagramFactory.getInstance().createDiagram(
UMLStateDiagram.class,
Model.getFacade().getNamespace(machine),
machine);
Modified: trunk/src_new/org/argouml/uml/ui/ActionUseCaseDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionUseCaseDiagram.java?view=diff&rev=12926&p1=trunk/src_new/org/argouml/uml/ui/ActionUseCaseDiagram.java&p2=trunk/src_new/org/argouml/uml/ui/ActionUseCaseDiagram.java&r1=12925&r2=12926
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionUseCaseDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionUseCaseDiagram.java 2007-06-29 13:13:47-0700
@@ -26,8 +26,8 @@
import org.apache.log4j.Logger;
import org.argouml.model.Model;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.DiagramFactory;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.argouml.uml.diagram.use_case.ui.UMLUseCaseDiagram;
/**
@@ -48,14 +48,14 @@
/*
* @see org.argouml.uml.ui.ActionAddDiagram#createDiagram(Object)
*/
- public UMLDiagram createDiagram(Object namespace) {
+ public ArgoDiagram createDiagram(Object namespace) {
if (!Model.getFacade().isANamespace(namespace)) {
LOG.error("No namespace as argument");
LOG.error(namespace);
throw new IllegalArgumentException(
"The argument " + namespace + "is not a namespace.");
}
- return (UMLDiagram) DiagramFactory.getInstance().createDiagram(
+ return DiagramFactory.getInstance().createDiagram(
UMLUseCaseDiagram.class,
namespace,
null);
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.