svn commit: r18729 - trunk/src: argouml-app/src/org/argouml/kernel argouml-app/src/org/argouml/uml/diagram/activity/ui argouml-app/src/org/argouml/uml/diagram/collaboration/ui argouml-app/src/org/argouml/uml/diagram/deployment/ui argouml-app/src/org/argouml/uml/diagram/state/ui argouml-app/src/org/argouml/uml/diagram/static_structure/ui argouml-app/src/org/argouml/uml/diagram/ui argouml-app/src/org/argouml/uml/diagram/use_case/ui argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram argouml-core-diagrams-state2/src/org/argouml/state2/diagram

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-09-10 09:10:34-0700
New Revision: 18729

Added:
   trunk/src/argouml-app/src/org/argouml/kernel/Owned.java
Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/activity/ui/ActivityDiagramRenderer.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/CollabDiagramRenderer.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/UMLCollaborationDiagram.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/DeploymentDiagramRenderer.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/StateDiagramRenderer.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/ClassDiagramRenderer.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigEdgeNote.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/UMLClassDiagram.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/DnDJGraph.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/UMLDiagram.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/UMLUseCaseDiagram.java
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramRenderer.java
   trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/SequenceDiagramRenderer.java
   trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramRenderer.java

Log:
Allow edges to be drag/dropped onto a class diagram (other diagram types can now be implemented also)

Added: trunk/src/argouml-app/src/org/argouml/kernel/Owned.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/kernel/Owned.java?view=markup&pathrev=18729
==============================================================================
--- (empty file)
+++ trunk/src/argouml-app/src/org/argouml/kernel/Owned.java	2010-09-10 09:10:34-0700
@@ -0,0 +1,27 @@
+/* $Id:$

+ *****************************************************************************

+ * Copyright (c) 2010 Contributors - see below

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ *

+ * Contributors:

+ *    Bob Tarling

+ *****************************************************************************

+ */

+

+package org.argouml.kernel;

+

+/**

+ * To be implemented by classes that are "owned" by some model element.

+ * e.g. a FigClass is owned by a class, a UMLClassDiagram is owned by a

+ * namespace.

+ * The owner is typically immutable and set by the constructor. Hence not

+ * setter is provided as part of this interface.

+ *

+ * @author Bob Tarling

+ */

+public interface Owned {

+    Object getOwner();

+}


Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/activity/ui/ActivityDiagramRenderer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/activity/ui/ActivityDiagramRenderer.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/activity/ui/ActivityDiagramRenderer.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/activity/ui/ActivityDiagramRenderer.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,14 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
+ *    Tom Morris
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -95,7 +96,7 @@
         Diagram diag = ((LayerPerspective) lay).getDiagram(); 
         if (diag instanceof UMLDiagram
             && ((UMLDiagram) diag).doesAccept(node)) {
-            figNode = ((UMLDiagram) diag).drop(node, null);
+            figNode = (FigNode) ((UMLDiagram) diag).drop(node, null);
         } else {
             figNode =  super.getFigNodeFor(gm, lay, node, styleAttributes);
             if (figNode == null) {

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/CollabDiagramRenderer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/CollabDiagramRenderer.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/CollabDiagramRenderer.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/CollabDiagramRenderer.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -106,7 +106,7 @@
         Diagram diag = ((LayerPerspective) lay).getDiagram(); 
         if (diag instanceof UMLDiagram
                 && ((UMLDiagram) diag).doesAccept(node)) {
-            figNode = ((UMLDiagram) diag).drop(node, null);
+            figNode = (FigNode) ((UMLDiagram) diag).drop(node, null);
         } else { 
             LOG.error("TODO: CollabDiagramRenderer getFigNodeFor");
             throw new IllegalArgumentException(

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/UMLCollaborationDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/UMLCollaborationDiagram.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/UMLCollaborationDiagram.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/UMLCollaborationDiagram.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -510,8 +510,8 @@
     }
     
     @Override
-    public FigNode drop(Object droppedObject, Point location) {
-        FigNode figNode = null;
+    public DiagramElement drop(Object droppedObject, Point location) {
+        DiagramElement figNode = null;
         GraphModel gm = getGraphModel();
         Layer lay = Globals.curEditor().getLayerManager().getActiveLayer();
         

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/DeploymentDiagramRenderer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/DeploymentDiagramRenderer.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/DeploymentDiagramRenderer.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/DeploymentDiagramRenderer.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -95,7 +95,7 @@
         Diagram diag = ((LayerPerspective) lay).getDiagram(); 
         if (diag instanceof UMLDiagram
                 && ((UMLDiagram) diag).doesAccept(node)) {
-            figNode = ((UMLDiagram) diag).drop(node, null);
+            figNode = (FigNode) ((UMLDiagram) diag).drop(node, null);
         } else {
             LOG.debug("TODO: DeploymentDiagramRenderer getFigNodeFor");
             return null;

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/StateDiagramRenderer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/StateDiagramRenderer.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/StateDiagramRenderer.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/StateDiagramRenderer.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -102,7 +102,7 @@
         Diagram diag = ((LayerPerspective) lay).getDiagram(); 
         if (diag instanceof UMLDiagram
                 && ((UMLDiagram) diag).doesAccept(node)) {
-            figNode = ((UMLDiagram) diag).drop(node, null);
+            figNode = (FigNode) ((UMLDiagram) diag).drop(node, null);
         } else {
             LOG.debug("TODO: StateDiagramRenderer getFigNodeFor");
             throw new IllegalArgumentException(

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -827,8 +827,8 @@
     }
     
     @Override
-    public FigNode drop(Object droppedObject, Point location) {
-        FigNode figNode = null;
+    public DiagramElement drop(Object droppedObject, Point location) {
+        FigNodeModelElement figNode = null;
 
         // If location is non-null, convert to a rectangle that we can use
         Rectangle bounds = null;

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/ClassDiagramRenderer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/ClassDiagramRenderer.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/ClassDiagramRenderer.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/ClassDiagramRenderer.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -38,27 +38,12 @@
 
 package org.argouml.uml.diagram.static_structure.ui;
 
-import java.util.Collection;
 import java.util.Map;
 
 import org.apache.log4j.Logger;
-import org.argouml.model.CoreFactory;
-import org.argouml.model.Model;
-import org.argouml.uml.CommentEdge;
-import org.argouml.uml.diagram.ArgoDiagram;
-import org.argouml.uml.diagram.DiagramEdgeSettings;
-import org.argouml.uml.diagram.DiagramSettings;
 import org.argouml.uml.diagram.GraphChangeAdapter;
 import org.argouml.uml.diagram.UmlDiagramRenderer;
-import org.argouml.uml.diagram.ui.FigAbstraction;
-import org.argouml.uml.diagram.ui.FigAssociation;
-import org.argouml.uml.diagram.ui.FigAssociationClass;
-import org.argouml.uml.diagram.ui.FigAssociationEnd;
-import org.argouml.uml.diagram.ui.FigDependency;
-import org.argouml.uml.diagram.ui.FigGeneralization;
 import org.argouml.uml.diagram.ui.FigNodeModelElement;
-import org.argouml.uml.diagram.ui.FigPermission;
-import org.argouml.uml.diagram.ui.FigUsage;
 import org.argouml.uml.diagram.ui.UMLDiagram;
 import org.tigris.gef.base.Diagram;
 import org.tigris.gef.base.Layer;
@@ -164,118 +149,21 @@
         }
         
         assert lay instanceof LayerPerspective;
-        ArgoDiagram diag = (ArgoDiagram) ((LayerPerspective) lay).getDiagram();
-        DiagramSettings settings = diag.getDiagramSettings();
         
-        FigEdge newEdge = null;
-        if (Model.getFacade().isAAssociationClass(edge)) {
-            Object[] associationEnds = 
-                Model.getFacade().getConnections(edge).toArray();
-            newEdge = new FigAssociationClass(
-                    new DiagramEdgeSettings(
-                            edge, 
-                            associationEnds[0], 
-                            associationEnds[1]), 
-                            settings);
-            FigNode sourceFig =
-                getFigNodeForAssociationEnd(diag, associationEnds[0]);
-            FigNode destFig =
-                getFigNodeForAssociationEnd(diag, associationEnds[1]);
-            newEdge.setSourceFigNode(sourceFig);
-            newEdge.setSourcePortFig(sourceFig);
-            newEdge.setDestFigNode(destFig);
-            newEdge.setDestPortFig(destFig);
-        } else if (Model.getFacade().isAAssociationEnd(edge)) {
-            FigAssociationEnd asend = new FigAssociationEnd(edge, settings);
-            Model.getFacade().getAssociation(edge);
-            FigNode associationFN =
-                (FigNode) lay.presentationFor(
-			Model.getFacade().getAssociation(edge));
-            FigNode classifierFN =
-                (FigNode) lay.presentationFor(Model.getFacade().getType(edge));
-
-            asend.setSourcePortFig(associationFN);
-            asend.setSourceFigNode(associationFN);
-            asend.setDestPortFig(classifierFN);
-            asend.setDestFigNode(classifierFN);
-            newEdge = asend;
-        } else if (Model.getFacade().isAAssociation(edge)) {
-            Object[] associationEnds = 
-                Model.getFacade().getConnections(edge).toArray();
-            newEdge = new FigAssociation(
-                    new DiagramEdgeSettings(
-                            edge, 
-                            associationEnds[0], 
-                            associationEnds[1]), 
-                            settings);
-            FigNode sourceFig =
-                getFigNodeForAssociationEnd(diag, associationEnds[0]);
-            FigNode destFig =
-                getFigNodeForAssociationEnd(diag, associationEnds[1]);
-            newEdge.setSourceFigNode(sourceFig);
-            newEdge.setSourcePortFig(sourceFig);
-            newEdge.setDestFigNode(destFig);
-            newEdge.setDestPortFig(destFig);
-        } else if (Model.getFacade().isALink(edge)) {
-            FigLink lnkFig = new FigLink(edge, settings);
-            Collection linkEndsColn = Model.getFacade().getConnections(edge);
-
-            Object[] linkEnds = linkEndsColn.toArray();
-            Object fromInst = Model.getFacade().getInstance(linkEnds[0]);
-            Object toInst = Model.getFacade().getInstance(linkEnds[1]);
-
-            FigNode fromFN = (FigNode) lay.presentationFor(fromInst);
-            FigNode toFN = (FigNode) lay.presentationFor(toInst);
-            lnkFig.setSourcePortFig(fromFN);
-            lnkFig.setSourceFigNode(fromFN);
-            lnkFig.setDestPortFig(toFN);
-            lnkFig.setDestFigNode(toFN);
-            lnkFig.getFig().setLayer(lay);
-            newEdge = lnkFig;
-        } else if (Model.getFacade().isAGeneralization(edge)) {
-            newEdge = new FigGeneralization(edge, settings);
-        } else if (Model.getFacade().isAPackageImport(edge)) {
-            newEdge = new FigPermission(edge, settings);
-        } else if (Model.getFacade().isAUsage(edge)) {
-            newEdge = new FigUsage(edge, settings);
-        } else if (Model.getFacade().isAAbstraction(edge)) {
-            newEdge = new FigAbstraction(edge, settings);
-        } else if (Model.getFacade().isADependency(edge)) {
-
-            String name = "";
-            for (Object stereotype : Model.getFacade().getStereotypes(edge)) {
-                name = Model.getFacade().getName(stereotype);
-                if (CoreFactory.REALIZE_STEREOTYPE.equals(name)) {
-                    break;
-                }
-            }
-            if (CoreFactory.REALIZE_STEREOTYPE.equals(name)) {
-                // TODO: This code doesn't look like it will get reached because
-                // any abstraction/realization is going to take the 
-                // isAAbstraction leg of the if before it gets to this more
-                // general case. - tfm 20080508
-                FigAbstraction realFig = new FigAbstraction(edge, settings);
-
-                Object supplier =
-                    ((Model.getFacade().getSuppliers(edge).toArray())[0]);
-                Object client =
-                    ((Model.getFacade().getClients(edge).toArray())[0]);
-
-                FigNode supFN = (FigNode) lay.presentationFor(supplier);
-                FigNode cliFN = (FigNode) lay.presentationFor(client);
-
-                realFig.setSourcePortFig(cliFN);
-                realFig.setSourceFigNode(cliFN);
-                realFig.setDestPortFig(supFN);
-                realFig.setDestFigNode(supFN);
-                realFig.getFig().setLayer(lay);
-                newEdge = realFig;
-            } else {
-                FigDependency depFig = new FigDependency(edge, settings);
-                newEdge = depFig;
-            }
-        } else if (edge instanceof CommentEdge) {
-            newEdge = new FigEdgeNote(edge, settings);
+        final FigEdge newEdge;
+
+        // Although not generally true for GEF, for Argo we know that the layer
+        // is a LayerPerspective which knows the associated diagram
+        Diagram diag = ((LayerPerspective) lay).getDiagram(); 
+        if (diag instanceof UMLDiagram
+                && ((UMLDiagram) diag).doesAccept(edge)) {
+            newEdge = (FigEdge) ((UMLDiagram) diag)
+                    .drop(edge, null);
+        } else {
+            LOG.error("TODO: ClassDiagramRenderer getFigEdgeFor " + edge);
+            throw new IllegalArgumentException(
+                    "Edge is not a recognised type. Received "
+                    + edge.getClass().getName());
         }
 
         addEdge(lay, newEdge, edge);

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigEdgeNote.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigEdgeNote.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigEdgeNote.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigEdgeNote.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,14 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
+ *    Tom Morris
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -44,10 +45,12 @@
 
 import org.apache.log4j.Logger;
 import org.argouml.i18n.Translator;
+import org.argouml.kernel.Owned;
 import org.argouml.kernel.Project;
 import org.argouml.model.Model;
 import org.argouml.model.RemoveAssociationEvent;
 import org.argouml.uml.CommentEdge;
+import org.argouml.uml.diagram.DiagramElement;
 import org.argouml.uml.diagram.DiagramSettings;
 import org.argouml.uml.diagram.ui.ArgoFig;
 import org.argouml.uml.diagram.ui.ArgoFigUtil;
@@ -67,8 +70,8 @@
  * @author Andreas Rueckert [email protected]
  * @author [email protected]
  */
-public class FigEdgeNote extends FigEdgePoly implements ArgoFig, IItemUID,
-        PropertyChangeListener {
+public class FigEdgeNote extends FigEdgePoly
+        implements ArgoFig, DiagramElement, Owned, IItemUID, PropertyChangeListener {
 
     private static final Logger LOG = Logger.getLogger(FigEdgeNote.class);
 

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/UMLClassDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/UMLClassDiagram.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/UMLClassDiagram.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/UMLClassDiagram.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,14 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    thn
+ *    Thomas Neustupny
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -46,7 +47,11 @@
 
 import org.apache.log4j.Logger;
 import org.argouml.i18n.Translator;
+import org.argouml.model.CoreFactory;
 import org.argouml.model.Model;
+import org.argouml.uml.CommentEdge;
+import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.DiagramEdgeSettings;
 import org.argouml.uml.diagram.DiagramElement;
 import org.argouml.uml.diagram.DiagramSettings;
 import org.argouml.uml.diagram.deployment.ui.FigComponent;
@@ -55,7 +60,16 @@
 import org.argouml.uml.diagram.deployment.ui.FigNodeInstance;
 import org.argouml.uml.diagram.deployment.ui.FigObject;
 import org.argouml.uml.diagram.static_structure.ClassDiagramGraphModel;
+import org.argouml.uml.diagram.ui.FigAbstraction;
+import org.argouml.uml.diagram.ui.FigAssociation;
+import org.argouml.uml.diagram.ui.FigAssociationClass;
+import org.argouml.uml.diagram.ui.FigAssociationEnd;
+import org.argouml.uml.diagram.ui.FigDependency;
+import org.argouml.uml.diagram.ui.FigEdgeModelElement;
+import org.argouml.uml.diagram.ui.FigGeneralization;
 import org.argouml.uml.diagram.ui.FigNodeModelElement;
+import org.argouml.uml.diagram.ui.FigPermission;
+import org.argouml.uml.diagram.ui.FigUsage;
 import org.argouml.uml.diagram.ui.ModeCreateDependency;
 import org.argouml.uml.diagram.ui.ModeCreatePermission;
 import org.argouml.uml.diagram.ui.ModeCreateUsage;
@@ -65,8 +79,10 @@
 import org.argouml.uml.ui.foundation.core.ActionAddAttribute;
 import org.argouml.uml.ui.foundation.core.ActionAddOperation;
 import org.argouml.util.ToolBarUtility;
+import org.tigris.gef.base.Layer;
 import org.tigris.gef.base.LayerPerspective;
 import org.tigris.gef.base.LayerPerspectiveMutable;
+import org.tigris.gef.presentation.FigEdge;
 import org.tigris.gef.presentation.FigNode;
 
 /**
@@ -660,6 +676,12 @@
             return true;
         } else if (Model.getFacade().isAComponent(objectToAccept)) {
             return true;
+        } else if (Model.getFacade().isAAssociationEnd(objectToAccept)) {
+            return true;
+        } else if (Model.getFacade().isADependency(objectToAccept)) {
+            return true;
+        } else if (Model.getFacade().isAGeneralization(objectToAccept)) {
+            return true;
         }
         return false;
 
@@ -670,8 +692,136 @@
             final Rectangle bounds) {
         
         FigNodeModelElement figNode = null;
+        FigEdge figEdge = null;
         
         DiagramSettings settings = getDiagramSettings();
+
+        if (Model.getFacade().isAAssociationClass(modelElement)) {
+            Object[] associationEnds = 
+                Model.getFacade().getConnections(modelElement).toArray();
+            figEdge = new FigAssociationClass(
+                    new DiagramEdgeSettings(
+                            modelElement, 
+                            associationEnds[0], 
+                            associationEnds[1]), 
+                            settings);
+            FigNode sourceFig =
+                getFigNodeForAssociationEnd(associationEnds[0]);
+            FigNode destFig =
+                getFigNodeForAssociationEnd(associationEnds[1]);
+            figEdge.setSourceFigNode(sourceFig);
+            figEdge.setSourcePortFig(sourceFig);
+            figEdge.setDestFigNode(destFig);
+            figEdge.setDestPortFig(destFig);
+        } else if (Model.getFacade().isAAssociationEnd(modelElement)) {
+            figEdge = new FigAssociationEnd(modelElement, settings);
+            Model.getFacade().getAssociation(modelElement);
+            FigNode associationFN =
+                (FigNode) getLayer().presentationFor(
+                        Model.getFacade().getAssociation(modelElement));
+            FigNode classifierFN =
+                (FigNode) getLayer().presentationFor(Model.getFacade().getType(modelElement));
+
+            figEdge.setSourcePortFig(associationFN);
+            figEdge.setSourceFigNode(associationFN);
+            figEdge.setDestPortFig(classifierFN);
+            figEdge.setDestFigNode(classifierFN);
+        } else if (Model.getFacade().isAAssociation(modelElement)
+                && !Model.getFacade().isANaryAssociation(modelElement)) {
+            Object[] associationEnds = 
+                Model.getFacade().getConnections(modelElement).toArray();
+            figEdge = new FigAssociation(
+                    new DiagramEdgeSettings(
+                            modelElement, 
+                            associationEnds[0], 
+                            associationEnds[1]), 
+                            settings);
+            FigNode sourceFig =
+                getFigNodeForAssociationEnd(associationEnds[0]);
+            FigNode destFig =
+                getFigNodeForAssociationEnd(associationEnds[1]);
+            figEdge.setSourceFigNode(sourceFig);
+            figEdge.setSourcePortFig(sourceFig);
+            figEdge.setDestFigNode(destFig);
+            figEdge.setDestPortFig(destFig);
+        } else if (Model.getFacade().isALink(modelElement)) {
+            figEdge = new FigLink(modelElement, settings);
+            Collection linkEndsColn = Model.getFacade().getConnections(modelElement);
+
+            Object[] linkEnds = linkEndsColn.toArray();
+            Object fromInst = Model.getFacade().getInstance(linkEnds[0]);
+            Object toInst = Model.getFacade().getInstance(linkEnds[1]);
+
+            FigNode fromFN = (FigNode) getLayer().presentationFor(fromInst);
+            FigNode toFN = (FigNode) getLayer().presentationFor(toInst);
+            figEdge.setSourcePortFig(fromFN);
+            figEdge.setSourceFigNode(fromFN);
+            figEdge.setDestPortFig(toFN);
+            figEdge.setDestFigNode(toFN);
+            figEdge.getFig().setLayer(getLayer());
+        } else if (Model.getFacade().isAGeneralization(modelElement)) {
+            figEdge = new FigGeneralization(modelElement, settings);
+
+            Object supplier =
+                (Model.getFacade().getSpecific(modelElement));
+            Object client =
+                (Model.getFacade().getGeneral(modelElement));
+           
+            FigNode supFN = (FigNode) getLayer().presentationFor(supplier);
+            FigNode cliFN = (FigNode) getLayer().presentationFor(client);
+            
+            figEdge.setSourceFigNode(supFN);
+            figEdge.setSourcePortFig(supFN);
+            figEdge.setDestFigNode(cliFN);
+            figEdge.setDestPortFig(cliFN);
+        } else if (Model.getFacade().isADependency(modelElement)) {
+            
+            if (Model.getFacade().isAPackageImport(modelElement)) {
+                figEdge = new FigPermission(modelElement, settings);
+            } else if (Model.getFacade().isAUsage(modelElement)) {
+                figEdge = new FigUsage(modelElement, settings);
+            } else if (Model.getFacade().isAAbstraction(modelElement)) {
+                figEdge = new FigAbstraction(modelElement, settings);
+            } else {
+    
+                String name = "";
+                for (Object stereotype : Model.getFacade().getStereotypes(modelElement)) {
+                    name = Model.getFacade().getName(stereotype);
+                    if (CoreFactory.REALIZE_STEREOTYPE.equals(name)) {
+                        break;
+                    }
+                }
+                if (CoreFactory.REALIZE_STEREOTYPE.equals(name)) {
+                    // TODO: This code doesn't look like it will get reached because
+                    // any abstraction/realization is going to take the 
+                    // isAAbstraction leg of the if before it gets to this more
+                    // general case. - tfm 20080508
+                    figEdge = new FigAbstraction(modelElement, settings);
+                } else {
+                    figEdge = new FigDependency(modelElement, settings);
+                }
+            }
+            Object supplier =
+                ((Model.getFacade().getSuppliers(modelElement).toArray())[0]);
+            Object client =
+                ((Model.getFacade().getClients(modelElement).toArray())[0]);
+            figEdge = new FigDependency(modelElement, settings);
+            FigNode supFN = (FigNode) getLayer().presentationFor(supplier);
+            FigNode cliFN = (FigNode) getLayer().presentationFor(client);
+
+            figEdge.setSourcePortFig(cliFN);
+            figEdge.setSourceFigNode(cliFN);
+            figEdge.setDestPortFig(supFN);
+            figEdge.setDestFigNode(supFN);
+            figEdge.getFig().setLayer(getLayer());
+        } else if (modelElement instanceof CommentEdge) {
+            figEdge = new FigEdgeNote(modelElement, settings);
+        }
+        
+        if (figEdge != null) {
+            figEdge.computeRoute();
+            return (DiagramElement) figEdge;
+        }
         
         if (Model.getFacade().isAAssociation(modelElement)) {
             figNode =
@@ -723,4 +873,43 @@
         }
         return figNode;
     }
+    
+    protected FigNode getFigNodeForAssociationEnd(
+            final Object associationEnd) {
+        Object classifier = 
+            Model.getFacade().getClassifier(associationEnd);
+        return getNodePresentationFor(getLayer(), classifier);
+    }
+    
+    /**
+     * Get the FigNode from the given layer that represents the given
+     * model element.
+     * The FigNode portion of an association class is returned in preference
+     * to the FigEdge portion.
+     * If no FigNode is found then a FIgEdge is searched for and the FigNode
+     * that acts as its edge port is returned.
+     * @param lay the layer containing the Fig
+     * @param modelElement the model element to find presentation for
+     * @return the FigNode presentation of the model element
+     */
+    private FigNode getNodePresentationFor(Layer lay, Object modelElement) {
+        assert modelElement != null : "A modelElement must be supplied";
+        for (Object fig : lay.getContentsNoEdges()) {
+ 
+            if (fig instanceof FigNode
+                    && modelElement.equals(((FigNode) fig).getOwner())) {
+                return ((FigNode) fig);
+            }
+        }
+        for (Object fig : lay.getContentsEdgesOnly()) {
+            if (fig instanceof FigEdgeModelElement
+                    && modelElement.equals(((FigEdgeModelElement) fig)
+                            .getOwner())) {
+                return ((FigEdgeModelElement) fig).getEdgePort();
+            }
+        }
+        return null;
+    }
+    
+    
 }

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/DnDJGraph.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/DnDJGraph.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/DnDJGraph.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/DnDJGraph.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,14 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    mvw
+ *    Michiel van der Wulp
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -51,8 +52,10 @@
 import java.util.Iterator;
 
 import org.apache.log4j.Logger;
+import org.argouml.kernel.Owned;
 import org.argouml.ui.TransferableModelElements;
 import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.DiagramElement;
 import org.argouml.uml.diagram.DiagramUtils;
 import org.tigris.gef.base.Diagram;
 import org.tigris.gef.base.Editor;
@@ -61,6 +64,7 @@
 import org.tigris.gef.graph.GraphModel;
 import org.tigris.gef.graph.MutableGraphModel;
 import org.tigris.gef.graph.presentation.JGraph;
+import org.tigris.gef.presentation.Fig;
 import org.tigris.gef.presentation.FigNode;
 
 /**
@@ -211,21 +215,23 @@
             while (i.hasNext()) {
                 /* TODO: Why not call UMLDiagram.doesAccept() first, 
                  * like in ClassDiagramRenderer?  */
-                FigNode figNode = ((UMLDiagram ) diagram).drop(i.next(),
+                DiagramElement figNode = ((UMLDiagram ) diagram).drop(i.next(),
                         dropTargetDropEvent.getLocation());
                 
-                if (figNode != null) {
+                if (figNode != null && figNode instanceof Owned) {
                     MutableGraphModel gm =
                         (MutableGraphModel) diagram.getGraphModel();
-                    if (!gm.getNodes().contains(figNode.getOwner())) {
-                        gm.getNodes().add(figNode.getOwner());
+                    Object owner = ((Owned) figNode).getOwner();
+                    if (!gm.getNodes().contains(owner)) {
+                        gm.getNodes().add(owner);
                     }
                     
                     Globals.curEditor().getLayerManager().getActiveLayer()
-                            .add(figNode);
-                    gm.addNodeRelatedEdges(figNode.getOwner());
+                            .add((Fig) figNode);
+                    if (figNode instanceof FigNode && figNode instanceof Owned) {
+                        gm.addNodeRelatedEdges(((Owned) figNode).getOwner());
+                    }
                 }
-                
             }
 
             dropTargetDropEvent.getDropTargetContext().dropComplete(true);

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	2010-09-10 09:10:34-0700
@@ -81,6 +81,7 @@
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.DelayedChangeNotify;
 import org.argouml.kernel.DelayedVChangeListener;
+import org.argouml.kernel.Owned;
 import org.argouml.kernel.Project;
 import org.argouml.model.AddAssociationEvent;
 import org.argouml.model.AssociationChangeEvent;
@@ -102,6 +103,7 @@
 import org.argouml.ui.ProjectActions;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.StereotypeUtility;
+import org.argouml.uml.diagram.DiagramElement;
 import org.argouml.uml.diagram.DiagramSettings;
 import org.argouml.uml.ui.ActionDeleteModelElements;
 import org.argouml.util.IItemUID;
@@ -144,7 +146,9 @@
         Highlightable,
         IItemUID,
         ArgoFig,
-        Clarifiable {
+        Clarifiable,
+        DiagramElement,
+        Owned {
 
     private static final Logger LOG =
         Logger.getLogger(FigEdgeModelElement.class);

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java	2010-09-10 09:10:34-0700
@@ -83,6 +83,7 @@
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.DelayedChangeNotify;
 import org.argouml.kernel.DelayedVChangeListener;
+import org.argouml.kernel.Owned;
 import org.argouml.kernel.Project;
 import org.argouml.model.AssociationChangeEvent;
 import org.argouml.model.AttributeChangeEvent;
@@ -153,7 +154,8 @@
         Clarifiable,
         ArgoFig,
         StereotypeStyled,
-        DiagramElement {
+        DiagramElement,
+        Owned {
 
 
     private static final Logger LOG =

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/UMLDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/UMLDiagram.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/UMLDiagram.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/UMLDiagram.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -61,6 +61,7 @@
 import org.argouml.ui.CmdCreateNode;
 import org.argouml.uml.UUIDHelper;
 import org.argouml.uml.diagram.ArgoDiagramImpl;
+import org.argouml.uml.diagram.DiagramElement;
 import org.argouml.uml.diagram.DiagramSettings;
 import org.argouml.uml.diagram.Relocatable;
 import org.argouml.uml.diagram.UMLMutableGraphSupport;
@@ -637,17 +638,14 @@
      * @param location The location in the diagram where the object is dropped.
      * @return The object that has been added to the diagram.
      */
-    public FigNode drop(Object droppedObject, Point location) {
-        FigNode figNode = null;
-       
+    public DiagramElement drop(Object droppedObject, Point location) {
         // If location is non-null, convert to a rectangle that we can use
         Rectangle bounds = null;
         if (location != null) {
             bounds = new Rectangle(location.x, location.y, 0, 0);
         }
 
-        figNode = (FigNode) createDiagramElement(droppedObject, bounds);
-        return figNode;
+        return createDiagramElement(droppedObject, bounds);
     }
     
     /**

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/UMLUseCaseDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/UMLUseCaseDiagram.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/UMLUseCaseDiagram.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/UMLUseCaseDiagram.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,14 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    mvw
+ *    Michiel van der Wulp
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -494,8 +495,8 @@
     }
     
     @Override
-    public FigNode drop(Object droppedObject, Point location) {
-        FigNode figNode = null;
+    public DiagramElement drop(Object droppedObject, Point location) {
+        DiagramElement figNode = null;
        
         // If location is non-null, convert to a rectangle that we can use
         Rectangle bounds = null;
@@ -503,8 +504,7 @@
             bounds = new Rectangle(location.x, location.y, 0, 0);
         }
 
-        figNode = (FigNode) createDiagramElement(droppedObject, bounds);
-        return figNode;
+        return createDiagramElement(droppedObject, bounds);
     }
 
     public DiagramElement createDiagramElement(

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramRenderer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramRenderer.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramRenderer.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramRenderer.java	2010-09-10 09:10:34-0700
@@ -43,7 +43,7 @@
         Diagram diag = ((LayerPerspective) lay).getDiagram(); 

         if (diag instanceof UMLDiagram

                 && ((UMLDiagram) diag).doesAccept(node)) {

-            result = ((UMLDiagram) diag).drop(node, null);

+            result = (FigNode) ((UMLDiagram) diag).drop(node, null);

         } else {

             LOG.warn("ActivityDiagramRenderer getFigNodeFor unexpected node " 

                     + node);


Modified: trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/SequenceDiagramRenderer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/SequenceDiagramRenderer.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/SequenceDiagramRenderer.java	(original)
+++ trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/SequenceDiagramRenderer.java	2010-09-10 09:10:34-0700
@@ -1,13 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -80,7 +80,7 @@
         Diagram diag = ((LayerPerspective) lay).getDiagram(); 
         if (diag instanceof UMLDiagram
                 && ((UMLDiagram) diag).doesAccept(node)) {
-            result = ((UMLDiagram) diag).drop(node, null);
+            result = (FigNode) ((UMLDiagram) diag).drop(node, null);
         } else {
             LOG.warn("SequenceDiagramRenderer getFigNodeFor unexpected node " 
                     + node);

Modified: trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramRenderer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramRenderer.java?view=diff&pathrev=18729&r1=18728&r2=18729
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramRenderer.java	(original)
+++ trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramRenderer.java	2010-09-10 09:10:34-0700
@@ -1,4 +1,4 @@
-/* $Id: $

+/* $Id:$

  *****************************************************************************

  * Copyright (c) 2010 Contributors - see below

  * All rights reserved. This program and the accompanying materials

@@ -40,7 +40,7 @@
         Diagram diag = ((LayerPerspective) lay).getDiagram(); 

         if (diag instanceof UMLDiagram

                 && ((UMLDiagram) diag).doesAccept(node)) {

-            result = ((UMLDiagram) diag).drop(node, null);

+            result = (FigNode) ((UMLDiagram) diag).drop(node, null);

         } else {

             LOG.warn("StateDiagramRenderer getFigNodeFor unexpected node " 

                     + node);



------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2657575

To unsubscribe from this discussion, e-mail: [[email protected]].
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.