svn commit: r13726 - trunk/src_new/org/argouml: kernel uml uml/diagram/ui uml/profile uml/ui uml/ui/foundation/core uml/ui/foundation/extension_mechanisms

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-11-04 13:21:13-0700
New Revision: 13726

Modified:
   trunk/src_new/org/argouml/kernel/ProjectImpl.java
   trunk/src_new/org/argouml/uml/ActionAddStereotype.java
   trunk/src_new/org/argouml/uml/StereotypeUtility.java
   trunk/src_new/org/argouml/uml/diagram/ui/ActionAddStereotype.java
   trunk/src_new/org/argouml/uml/profile/ProfileConfiguration.java
   trunk/src_new/org/argouml/uml/ui/TabStereotype.java
   trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetAssociationEndType.java
   trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetGeneralizationPowertype.java
   trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetParameterType.java
   trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetStructuralFeatureType.java
   trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionOwner.java
   trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionType.java

Log:
remove uses of deprecated getCorrespondingElement()

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=13726&p1=trunk/src_new/org/argouml/kernel/ProjectImpl.java&p2=trunk/src_new/org/argouml/kernel/ProjectImpl.java&r1=13725&r2=13726
==============================================================================
--- trunk/src_new/org/argouml/kernel/ProjectImpl.java	(original)
+++ trunk/src_new/org/argouml/kernel/ProjectImpl.java	2007-11-04 13:21:13-0700
@@ -566,13 +566,7 @@
             }
         }
         cls = findTypeInDefaultModel(s);
-        // hey, now we should move it to the model the user is working in
-        // TODO: Remove this when we support linked profiles - tfm - 20070726
-        if (cls != null) {
-            cls =
-                Model.getModelManagementHelper()
-                	.getCorrespondingElement(cls, getRoot());
-        }
+
         if (cls == null && defineNew) {
             LOG.debug("new Type defined!");
             cls =

Modified: trunk/src_new/org/argouml/uml/ActionAddStereotype.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ActionAddStereotype.java?view=diff&rev=13726&p1=trunk/src_new/org/argouml/uml/ActionAddStereotype.java&p2=trunk/src_new/org/argouml/uml/ActionAddStereotype.java&r1=13725&r2=13726
==============================================================================
--- trunk/src_new/org/argouml/uml/ActionAddStereotype.java	(original)
+++ trunk/src_new/org/argouml/uml/ActionAddStereotype.java	2007-11-04 13:21:13-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
@@ -71,23 +71,21 @@
     /*
      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
      */
+    @Override
     public void actionPerformed(ActionEvent ae) {
     	super.actionPerformed(ae);
         if (Model.getFacade().getStereotypes(modelElement)
                 .contains(stereotype)) {
             Model.getCoreHelper().removeStereotype(modelElement, stereotype);
         } else {
-            Object stereo =
-                Model.getModelManagementHelper()
-                    .getCorrespondingElement(stereotype,
-                        Model.getFacade().getModel(modelElement), true);
-            Model.getCoreHelper().addStereotype(modelElement, stereo);
+            Model.getCoreHelper().addStereotype(modelElement, stereotype);
         }
     }
 
     /*
      * @see javax.swing.Action#getValue(java.lang.String)
      */
+    @Override
     public Object getValue(String key) {
         if ("SELECTED".equals(key)) {
             if (Model.getFacade().getStereotypes(modelElement).contains(

Modified: trunk/src_new/org/argouml/uml/StereotypeUtility.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/StereotypeUtility.java?view=diff&rev=13726&p1=trunk/src_new/org/argouml/uml/StereotypeUtility.java&p2=trunk/src_new/org/argouml/uml/StereotypeUtility.java&r1=13725&r2=13726
==============================================================================
--- trunk/src_new/org/argouml/uml/StereotypeUtility.java	(original)
+++ trunk/src_new/org/argouml/uml/StereotypeUtility.java	2007-11-04 13:21:13-0700
@@ -339,8 +339,7 @@
                 name, obj); 
 
         if (stereo != null) {
-            return Model.getModelManagementHelper().getCorrespondingElement(
-                    stereo, root);
+            return stereo;
         }
 
         if (root != null && name.length() > 0) {

Modified: trunk/src_new/org/argouml/uml/diagram/ui/ActionAddStereotype.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/ActionAddStereotype.java?view=diff&rev=13726&p1=trunk/src_new/org/argouml/uml/diagram/ui/ActionAddStereotype.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/ActionAddStereotype.java&r1=13725&r2=13726
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/ActionAddStereotype.java	(original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/ActionAddStereotype.java	2007-11-04 13:21:13-0700
@@ -1,5 +1,5 @@
 // $Id: ActionAddStereotype.java 13040 2007-07-10 20:00:25Z linus $

-// 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

@@ -78,11 +78,7 @@
                 .contains(stereotype)) {

             Model.getCoreHelper().removeStereotype(modelElement, stereotype);

         } else {

-            Object stereo =

-                Model.getModelManagementHelper()

-                    .getCorrespondingElement(stereotype,

-                        Model.getFacade().getModel(modelElement), true);

-            Model.getCoreHelper().addStereotype(modelElement, stereo);

+            Model.getCoreHelper().addStereotype(modelElement, stereotype);

         }

     }

 


Modified: trunk/src_new/org/argouml/uml/profile/ProfileConfiguration.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/profile/ProfileConfiguration.java?view=diff&rev=13726&p1=trunk/src_new/org/argouml/uml/profile/ProfileConfiguration.java&p2=trunk/src_new/org/argouml/uml/profile/ProfileConfiguration.java&r1=13725&r2=13726
==============================================================================
--- trunk/src_new/org/argouml/uml/profile/ProfileConfiguration.java	(original)
+++ trunk/src_new/org/argouml/uml/profile/ProfileConfiguration.java	2007-11-04 13:21:13-0700
@@ -1,5 +1,5 @@
 // $Id: ProfileConfiguration.java 13298 2007-08-12 19:40:57Z maurelio1234 $

-// Copyright (c) 1996-2006 The Regents of the University of California. All

+// 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

@@ -282,13 +282,11 @@
                     continue;

                 }

 

-                if (Model.getExtensionMechanismsHelper().isValidStereoType(element,

-                        stereo)) {

-                    return Model.getModelManagementHelper()

-                            .getCorrespondingElement(stereo,

-                                    Model.getFacade().getModel(element));

+                if (Model.getExtensionMechanismsHelper().isValidStereotype(

+                        element, stereo)) {

+                    return element;

                 }

-            }            

+            }

         }

 

         return null;


Modified: trunk/src_new/org/argouml/uml/ui/TabStereotype.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/TabStereotype.java?view=diff&rev=13726&p1=trunk/src_new/org/argouml/uml/ui/TabStereotype.java&p2=trunk/src_new/org/argouml/uml/ui/TabStereotype.java&r1=13725&r2=13726
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/TabStereotype.java	(original)
+++ trunk/src_new/org/argouml/uml/ui/TabStereotype.java	2007-11-04 13:21:13-0700
@@ -182,6 +182,7 @@
     /*
      * @see org.argouml.uml.ui.PropPanel#shouldBeEnabled(java.lang.Object)
      */
+    @Override
     public boolean shouldBeEnabled(Object target) {
         if (target instanceof Fig) {
             target = ((Fig) target).getOwner();
@@ -192,6 +193,7 @@
     /*
      * @see org.argouml.ui.TabTarget#setTarget(java.lang.Object)
      */
+    @Override
     public void setTarget(Object theTarget) {
         super.setTarget(theTarget);
         if (isVisible()) {
@@ -213,12 +215,7 @@
         if (modelElement == null) {
             return;
         }
-
-        Object stereo =
-            Model.getModelManagementHelper()
-                .getCorrespondingElement(stereotype,
-                        Model.getFacade().getModel(modelElement), true);
-        Model.getCoreHelper().addStereotype(modelElement, stereo);
+        Model.getCoreHelper().addStereotype(modelElement, stereotype);
     }
 
     /**

Modified: trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetAssociationEndType.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetAssociationEndType.java?view=diff&rev=13726&p1=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetAssociationEndType.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetAssociationEndType.java&r1=13725&r2=13726
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetAssociationEndType.java	(original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetAssociationEndType.java	2007-11-04 13:21:13-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
@@ -53,10 +53,10 @@
     }
 
 
-
     /*
      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
      */
+    @Override
     public void actionPerformed(ActionEvent e) {
     	super.actionPerformed(e);
         Object source = e.getSource();
@@ -77,17 +77,12 @@
         }
         if (newClassifier != oldClassifier && end != null
                 && newClassifier != null) {
-            newClassifier = Model.getModelManagementHelper()
-                .getCorrespondingElement(
-                      newClassifier,
-                      Model.getFacade().getModel(end));
             Model.getCoreHelper().setType(end, newClassifier);
             super.actionPerformed(e);
         }
 
     }
-
-
+    
 
     /**
      * @return Returns the SINGLETON.

Modified: trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetGeneralizationPowertype.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetGeneralizationPowertype.java?view=diff&rev=13726&p1=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetGeneralizationPowertype.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetGeneralizationPowertype.java&r1=13725&r2=13726
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetGeneralizationPowertype.java	(original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetGeneralizationPowertype.java	2007-11-04 13:21:13-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
@@ -55,10 +55,10 @@
     }
 
 
-
     /*
      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
      */
+    @Override
     public void actionPerformed(ActionEvent e) {
         super.actionPerformed(e);
         Object source = e.getSource();
@@ -78,17 +78,12 @@
             }
         }
         if (newClassifier != oldClassifier && gen != null) {
-            newClassifier = Model.getModelManagementHelper()
-                .getCorrespondingElement(
-                        newClassifier,
-                        Model.getFacade().getModel(gen));
             Model.getCoreHelper().setPowertype(gen, newClassifier);
         }
 
     }
 
 
-
     /**
      * @return Returns the SINGLETON.
      */

Modified: trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetParameterType.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetParameterType.java?view=diff&rev=13726&p1=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetParameterType.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetParameterType.java&r1=13725&r2=13726
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetParameterType.java	(original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetParameterType.java	2007-11-04 13:21:13-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
@@ -53,10 +53,10 @@
     }
 
 
-
     /*
      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
      */
+    @Override
     public void actionPerformed(ActionEvent e) {
     	super.actionPerformed(e);
         Object source = e.getSource();
@@ -78,18 +78,12 @@
         if (newClassifier != null
                 && newClassifier != oldClassifier
                 && para != null) {
-            newClassifier = Model.getModelManagementHelper()
-                .getCorrespondingElement(
-				      newClassifier,
-				      Model.getFacade().getModel(para));
             Model.getCoreHelper().setType(para, newClassifier);
             super.actionPerformed(e);
         }
-
     }
 
 
-
     /**
      * @return Returns the sINGLETON.
      */

Modified: trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetStructuralFeatureType.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetStructuralFeatureType.java?view=diff&rev=13726&p1=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetStructuralFeatureType.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetStructuralFeatureType.java&r1=13725&r2=13726
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetStructuralFeatureType.java	(original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/core/ActionSetStructuralFeatureType.java	2007-11-04 13:21:13-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
@@ -54,6 +54,7 @@
     /*
      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
      */
+    @Override
     public void actionPerformed(ActionEvent e) {
         super.actionPerformed(e);
         Object source = e.getSource();
@@ -73,14 +74,6 @@
             }
         }
         if (newClassifier != oldClassifier && attr != null) {
-            if (newClassifier != null) {
-                newClassifier =
-                        Model.getModelManagementHelper()
-                                .getCorrespondingElement(
-                                    newClassifier,
-                                    Model.getFacade().getModel(attr));
-            }
-
             Model.getCoreHelper().setType(attr, newClassifier);
         }
     }

Modified: trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionOwner.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionOwner.java?view=diff&rev=13726&p1=trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionOwner.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionOwner.java&r1=13725&r2=13726
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionOwner.java	(original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionOwner.java	2007-11-04 13:21:13-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2003-2006 The Regents of the University of California. All
+// Copyright (c) 2003-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
@@ -32,7 +32,6 @@
 import org.apache.log4j.Logger;
 import org.argouml.application.helpers.ResourceLoaderWrapper;
 import org.argouml.i18n.Translator;
-import org.argouml.kernel.ProjectManager;
 import org.argouml.model.Model;
 import org.argouml.uml.ui.UMLComboBox2;
 import org.tigris.gef.undo.UndoableAction;
@@ -69,6 +68,7 @@
     /*
      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
      */
+    @Override
     public void actionPerformed(ActionEvent e) {
         super.actionPerformed(e);
         Object source = e.getSource();
@@ -82,17 +82,7 @@
             LOG.info("Set owner to " + o);
             if (Model.getFacade().isAStereotype(o)
                     && Model.getFacade().isATagDefinition(tagDefinition)) {
-                Object model =
-                    ProjectManager.getManager().getCurrentProject().getModel();
-                final Object stereo =
-                    Model.getModelManagementHelper()
-                        .getCorrespondingElement(o, model, true);
-                // TODO: Why was this next code here? Is it save to remove it?
-//                SwingUtilities.invokeLater(new Runnable() {
-//                    public void run() {
-                Model.getCoreHelper().setOwner(tagDefinition, stereo);
-//                    }
-//                });
+                Model.getCoreHelper().setOwner(tagDefinition, o);
             }
         }
     }

Modified: trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionType.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionType.java?view=diff&rev=13726&p1=trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionType.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionType.java&r1=13725&r2=13726
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionType.java	(original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/ActionSetTagDefinitionType.java	2007-11-04 13:21:13-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
@@ -54,6 +54,7 @@
     /*
      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
      */
+    @Override
     public void actionPerformed(ActionEvent e) {
         super.actionPerformed(e);
         Object source = e.getSource();
@@ -73,13 +74,6 @@
             }
         }
         if (newClassifier != oldClassifier && attr != null) {
-            if (newClassifier != null) {
-                newClassifier = Model
-                    .getModelManagementHelper().getCorrespondingElement(
-                                    newClassifier,
-                                    Model.getFacade().getModel(attr));
-            }
-
             Model.getCoreHelper().setType(attr, newClassifier);
         }
     }
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.