svn commit: r13429 - trunk/src_new/org/argouml/uml/diagram/ui/FigEdgeModelElement.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-08-21 11:41:22-0700
New Revision: 13429

Modified:
   trunk/src_new/org/argouml/uml/diagram/ui/FigEdgeModelElement.java

Log:
Remove code to delete Fig from other diagrams per mvw's comment (which I agree with).

Add annotations and clean up Javadoc

Modified: trunk/src_new/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/FigEdgeModelElement.java?view=diff&rev=13429&p1=trunk/src_new/org/argouml/uml/diagram/ui/FigEdgeModelElement.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/FigEdgeModelElement.java&r1=13428&r2=13429
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	(original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	2007-08-21 11:41:22-0700
@@ -80,7 +80,6 @@
 import org.argouml.ui.ProjectActions;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.StereotypeUtility;
-import org.argouml.uml.diagram.ArgoDiagram;
 import org.argouml.uml.diagram.IItemUID;
 import org.argouml.uml.diagram.UMLMutableGraphSupport;
 import org.argouml.uml.ui.ActionDeleteModelElements;
@@ -284,6 +283,7 @@
     /*
      * @see org.tigris.gef.ui.PopupGenerator#getPopUpActions(java.awt.event.MouseEvent)
      */
+    @Override
     public Vector getPopUpActions(MouseEvent me) {
         Vector popUpActions = super.getPopUpActions(me);
         
@@ -482,12 +482,13 @@
         return null;
     }
 
-    /*
-     * Returns a {@link SelectionRerouteEdge} object that manages selection
+    /**
+     * Return a {@link SelectionRerouteEdge} object that manages selection
      * and rerouting of the edge.
      *
      * @see org.tigris.gef.presentation.Fig#makeSelection()
      */
+    @Override
     public Selection makeSelection() {
         return new SelectionRerouteEdge(this);
     }
@@ -551,6 +552,7 @@
     /*
      * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
      */
+    @Override
     public void propertyChange(PropertyChangeEvent pve) {
         Object src = pve.getSource();
         String pName = pve.getPropertyName();
@@ -844,20 +846,24 @@
 
     /**
      * This method should only be called once for any one Fig instance that
-     * represents a model element (ie not for a FigEdgeNote).
-     * It is called either by the constructor that takes an model element as an
-     * argument or it is called by PGMLStackParser after it has created the Fig
-     * by use of the empty constructor.
-     * The assigned model element (owner) must not change during the lifetime
-     * of the Fig.
-     * TODO: It is planned to refactor so that there is only one Fig
-     * constructor. When this is achieved this method can refactored out.
+     * represents a model element (ie not for a FigEdgeNote). It is called
+     * either by the constructor that takes an model element as an argument or
+     * it is called by PGMLStackParser after it has created the Fig by use of
+     * the empty constructor.
+     * <p>
+     * The assigned model element (owner) must not change during the lifetime of
+     * the Fig.
      * 
      * @param owner the model element that this Fig represents.
      * @throws IllegalArgumentException if the owner given is not a model
-     * element
+     *                 element
      * @see org.tigris.gef.presentation.Fig#setOwner(java.lang.Object)
      */
+    /*
+     * TODO: It is planned to refactor so that there is only one Fig
+     * constructor. When this is achieved this method can refactored out.
+     */
+    @Override
     public void setOwner(Object owner) {
         if (owner == null) {
             throw new IllegalArgumentException("An owner must be supplied");
@@ -956,6 +962,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setLayer(org.tigris.gef.base.Layer)
      */
+    @Override
     public void setLayer(Layer lay) {
         super.setLayer(lay);
         getFig().setLayer(lay);
@@ -964,6 +971,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#deleteFromModel()
      */
+    @Override
     public void deleteFromModel() {
         Object own = getOwner();
         if (own != null) {
@@ -1018,6 +1026,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#hit(java.awt.Rectangle)
      */
+    @Override
     public boolean hit(Rectangle r) {
 	// Check if labels etc have been hit
 	// Apparently GEF does require PathItems to be "annotations"
@@ -1073,19 +1082,8 @@
             fig.removeFromDiagram();
         }
 
-        /* TODO: MVW: Why the next action?
-         * Deleting a fig from 1 diagram should not influence others!
-         * */
-        // GEF does not take into account the multiple diagrams we have
-        // therefore we loop through our diagrams and delete each and every
-        // occurence on our own
-        for (ArgoDiagram diagram : getProject().getDiagramList()) {
-            diagram.damage();
-        }
-
-        /* TODO: MVW: Should we not call damage()
-         * for diagrams AFTER the next step? */
         super.removeFromDiagram();
+        damage();
     }
     
     protected void superRemoveFromDiagram() {
@@ -1095,6 +1093,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#damage()
      */
+    @Override
     public void damage() {
         super.damage();
         getFig().damage();
@@ -1246,20 +1245,21 @@
     /*
      * @see org.tigris.gef.presentation.Fig#postLoad()
      */
+    @Override
     public void postLoad() {
         ArgoEventPump.removeListener(this);
         ArgoEventPump.addListener(this);
     }
 
     /**
-     * @return Returns the lABEL_FONT.
+     * @return Returns the LABEL_FONT.
      */
     public static Font getLabelFont() {
         return LABEL_FONT;
     }
 
     /**
-     * @return Returns the iTALIC_LABEL_FONT.
+     * @return Returns the ITALIC_LABEL_FONT.
      */
     public static Font getItalicLabelFont() {
         return ITALIC_LABEL_FONT;
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.