Coverage Report - org.argouml.uml.diagram.collaboration.ui.UMLCollaborationDiagram
 
Classes in this File Line Coverage Branch Coverage Complexity
UMLCollaborationDiagram
36%
58/159
16%
13/80
2.759
 
 1  
 /* $Id: UMLCollaborationDiagram.java 18729 2010-09-10 16:10:34Z bobtarling $
 2  
  *****************************************************************************
 3  
  * Copyright (c) 2009-2010 Contributors - see below
 4  
  * All rights reserved. This program and the accompanying materials
 5  
  * are made available under the terms of the Eclipse Public License v1.0
 6  
  * which accompanies this distribution, and is available at
 7  
  * http://www.eclipse.org/legal/epl-v10.html
 8  
  *
 9  
  * Contributors:
 10  
  *    Bob Tarling
 11  
  *****************************************************************************
 12  
  *
 13  
  * Some portions of this file was previously release using the BSD License:
 14  
  */
 15  
 
 16  
 // Copyright (c) 1996-2009 The Regents of the University of California. All
 17  
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 18  
 // software and its documentation without fee, and without a written
 19  
 // agreement is hereby granted, provided that the above copyright notice
 20  
 // and this paragraph appear in all copies.  This software program and
 21  
 // documentation are copyrighted by The Regents of the University of
 22  
 // California. The software program and documentation are supplied "AS
 23  
 // IS", without any accompanying services from The Regents. The Regents
 24  
 // does not warrant that the operation of the program will be
 25  
 // uninterrupted or error-free. The end-user understands that the program
 26  
 // was developed for research purposes and is advised not to rely
 27  
 // exclusively on the program for any reason.  IN NO EVENT SHALL THE
 28  
 // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
 29  
 // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
 30  
 // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
 31  
 // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
 32  
 // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
 33  
 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 34  
 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
 35  
 // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
 36  
 // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
 37  
 // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 38  
 
 39  
 package org.argouml.uml.diagram.collaboration.ui;
 40  
 
 41  
 import java.awt.Point;
 42  
 import java.awt.Rectangle;
 43  
 import java.beans.PropertyVetoException;
 44  
 import java.util.Collection;
 45  
 import java.util.HashSet;
 46  
 import java.util.Iterator;
 47  
 
 48  
 import javax.swing.Action;
 49  
 
 50  
 import org.apache.log4j.Logger;
 51  
 import org.argouml.i18n.Translator;
 52  
 import org.argouml.model.Model;
 53  
 import org.argouml.uml.diagram.DiagramElement;
 54  
 import org.argouml.uml.diagram.DiagramSettings;
 55  
 import org.argouml.uml.diagram.collaboration.CollabDiagramGraphModel;
 56  
 import org.argouml.uml.diagram.static_structure.ui.FigComment;
 57  
 import org.argouml.uml.diagram.ui.ActionAddAssociationRole;
 58  
 import org.argouml.uml.diagram.ui.ActionAddMessage;
 59  
 import org.argouml.uml.diagram.ui.ActionSetMode;
 60  
 import org.argouml.uml.diagram.ui.FigMessage;
 61  
 import org.argouml.uml.diagram.ui.FigNodeModelElement;
 62  
 import org.argouml.uml.diagram.ui.RadioAction;
 63  
 import org.argouml.uml.diagram.ui.UMLDiagram;
 64  
 import org.argouml.util.ToolBarUtility;
 65  
 import org.tigris.gef.base.Editor;
 66  
 import org.tigris.gef.base.Globals;
 67  
 import org.tigris.gef.base.Layer;
 68  
 import org.tigris.gef.base.LayerPerspective;
 69  
 import org.tigris.gef.base.LayerPerspectiveMutable;
 70  
 import org.tigris.gef.base.ModeCreatePolyEdge;
 71  
 import org.tigris.gef.graph.GraphModel;
 72  
 import org.tigris.gef.presentation.Fig;
 73  
 import org.tigris.gef.presentation.FigNode;
 74  
 
 75  
 /**
 76  
  * The base class of the collaboration diagram.<p>
 77  
  *
 78  
  * Defines the toolbar, provides for its initialization and provides
 79  
  * constructors for a top level diagram and one within a defined
 80  
  * namespace.<p>
 81  
  *
 82  
  * @author agauthie@ics.uci.edu
 83  
  */
 84  
 public class UMLCollaborationDiagram extends UMLDiagram {
 85  
 
 86  
     /**
 87  
      * Logging.
 88  
      */
 89  19
     private static final Logger LOG =
 90  
         Logger.getLogger(UMLCollaborationDiagram.class);
 91  
 
 92  
     ////////////////////////
 93  
     // actions for toolbar
 94  
 
 95  
     private Action actionClassifierRole;
 96  
     private Action actionGeneralize;
 97  
 
 98  
     private Action actionAssociation;
 99  
     private Action actionAggregation;
 100  
     private Action actionComposition;
 101  
     private Action actionUniAssociation;
 102  
     private Action actionUniAggregation;
 103  
     private Action actionUniComposition;
 104  
 
 105  
     private Action actionDepend;
 106  
     private Action actionMessage;
 107  
 
 108  
     ////////////////////////////////////////////////////////////////
 109  
     // contructors
 110  
 
 111  
     /**
 112  
      * This constructor is used to build a dummy collaboration diagram so
 113  
      * that a project will load properly.
 114  
      * @deprecated for 0.28 by tfmorris.  Use 
 115  
      * {@link #UMLActivityDiagram(String, Object, GraphModel)}.
 116  
      */
 117  
     @Deprecated
 118  19
     public UMLCollaborationDiagram() {
 119  
         try {
 120  19
             setName(getNewDiagramName());
 121  19
         } catch (PropertyVetoException pve) { }
 122  
         // TODO: All super constrcutors should take a GraphModel
 123  19
         setGraphModel(createGraphModel());
 124  19
     }
 125  
 
 126  
     /**
 127  
      * The constructor.
 128  
      *
 129  
      * @param collaboration the collaboration aka namespace for the diagram
 130  
      * @deprecated for 0.28 by tfmorris.  Use 
 131  
      * {@link #UMLActivityDiagram(String, Object, GraphModel)}.
 132  
      */
 133  
     @Deprecated
 134  
     public UMLCollaborationDiagram(Object collaboration) {
 135  19
         this();
 136  19
         setNamespace(collaboration);
 137  19
     }
 138  
 
 139  
     /**
 140  
      * @return the number of UML messages in the diagram
 141  
      */
 142  
     public int getNumMessages() {
 143  0
         Layer lay = getLayer();
 144  0
         Collection figs = lay.getContents();
 145  0
         int res = 0;
 146  0
         Iterator it = figs.iterator();
 147  0
         while (it.hasNext()) {
 148  0
             Fig f = (Fig) it.next();
 149  0
             if (Model.getFacade().isAMessage(f.getOwner())) {
 150  0
                 res++;
 151  
             }
 152  0
         }
 153  0
         return res;
 154  
     }
 155  
 
 156  
     /**
 157  
      * Method to perform a number of important initializations of a
 158  
      * <em>CollaborationDiagram</em>.<p>
 159  
      *
 160  
      * Each diagram type has a similar <em>UMLxxxDiagram</em> class.<p>
 161  
      *
 162  
      * Changed <em>lay</em> from <em>LayerPerspective</em> to
 163  
      * <em>LayerPerspectiveMutable</em>.  This class is a child of
 164  
      * <em>LayerPerspective</em> and was implemented to correct some
 165  
      * difficulties in changing the model.  <em>Lay</em> is used mainly
 166  
      * in <em>LayerManager</em>(GEF) to control the adding, changing and
 167  
      * deleting layers on the diagram...
 168  
      *
 169  
      * @param handle the collaboration from the UML model
 170  
      * @author psager@tigris.org Jan. 24, 2002
 171  
      */
 172  
     public void setNamespace(Object handle) {
 173  19
         if (!Model.getFacade().isANamespace(handle)) {
 174  0
             LOG.error(
 175  
                 "Illegal argument. Object " + handle + " is not a namespace");
 176  0
             throw new IllegalArgumentException(
 177  
                 "Illegal argument. Object " + handle + " is not a namespace");
 178  
         }
 179  19
         super.setNamespace(handle);
 180  19
         CollabDiagramGraphModel gm = createGraphModel();
 181  19
         gm.setCollaboration(handle);
 182  19
         LayerPerspective lay =
 183  
             new LayerPerspectiveMutable(Model.getFacade().getName(handle), gm);
 184  19
         CollabDiagramRenderer rend = new CollabDiagramRenderer(); // singleton
 185  19
         lay.setGraphNodeRenderer(rend);
 186  19
         lay.setGraphEdgeRenderer(rend);
 187  19
         setLayer(lay);
 188  19
     }
 189  
     
 190  
     
 191  
     // TODO: Needs to be tidied up after stable release. Graph model
 192  
     // should be created in constructor
 193  
     private CollabDiagramGraphModel createGraphModel() {
 194  38
         if ((getGraphModel() instanceof CollabDiagramGraphModel)) {
 195  19
             return (CollabDiagramGraphModel) getGraphModel();
 196  
         } else {
 197  19
             return new CollabDiagramGraphModel();
 198  
         }
 199  
     }
 200  
 
 201  
     /**
 202  
      * Get the actions from which to create a toolbar or equivalent
 203  
      * graphic triggers.
 204  
      * {@inheritDoc}
 205  
      */
 206  
     protected Object[] getUmlActions() {
 207  19
         Object[] actions = {
 208  
             getActionClassifierRole(),
 209  
             null,
 210  
             getAssociationActions(),
 211  
             getActionGeneralize(),
 212  
             getActionDepend(),
 213  
             null,
 214  
             getActionMessage(), //this one behaves differently, hence seperated!
 215  
         };
 216  19
         return actions;
 217  
     }
 218  
 
 219  
     private Object[] getAssociationActions() {
 220  19
         Object[][] actions = {
 221  
             {getActionAssociation(), getActionUniAssociation() },
 222  
             {getActionAggregation(), getActionUniAggregation() },
 223  
             {getActionComposition(), getActionUniComposition() },
 224  
         };
 225  19
         ToolBarUtility.manageDefault(actions, 
 226  
                 "diagram.collaboration.association");
 227  19
         return actions;
 228  
     }
 229  
 
 230  
     /**
 231  
      * After loading the diagram it is necessary to connect
 232  
      * every FigMessage to its FigAssociationRole.
 233  
      * This is done by adding the FigMessage
 234  
      * to the PathItems of its FigAssociationRole.
 235  
      */
 236  
     public void postLoad() {
 237  
 
 238  0
         super.postLoad();
 239  
 
 240  0
         if (getNamespace() == null) {
 241  0
             throw new IllegalStateException(
 242  
                     "The namespace of the collaboration diagram is not set");
 243  
         }
 244  
 
 245  
         Collection messages;
 246  
         Iterator msgIterator;
 247  0
         Collection ownedElements =
 248  
             Model.getFacade().getOwnedElements(getNamespace());
 249  0
         Iterator oeIterator = ownedElements.iterator();
 250  0
         Layer lay = getLayer();
 251  0
         while (oeIterator.hasNext()) {
 252  0
             Object me = oeIterator.next();
 253  0
             if (Model.getFacade().isAAssociationRole(me)) {
 254  0
                 messages = Model.getFacade().getMessages(me);
 255  0
                 msgIterator = messages.iterator();
 256  0
                 while (msgIterator.hasNext()) {
 257  0
                     Object message = msgIterator.next();
 258  0
                     FigMessage figMessage =
 259  
                         (FigMessage) lay.presentationFor(message);
 260  0
                     if (figMessage != null) {
 261  0
                         figMessage.addPathItemToFigAssociationRole(lay);
 262  
                     }
 263  0
                 }
 264  
             }
 265  0
         }
 266  0
     }
 267  
 
 268  
     /*
 269  
      * @see org.argouml.uml.diagram.ui.UMLDiagram#getLabelName()
 270  
      */
 271  
     public String getLabelName() {
 272  19
         return Translator.localize("label.collaboration-diagram");
 273  
     }
 274  
 
 275  
     /**
 276  
      * @return Returns the actionClassifierRole.
 277  
      */
 278  
     private Action getActionClassifierRole() {
 279  19
         if (actionClassifierRole == null) {
 280  19
             actionClassifierRole =
 281  
                 new RadioAction(new ActionAddClassifierRole());
 282  
         }
 283  19
         return actionClassifierRole;
 284  
     }
 285  
 
 286  
     /**
 287  
      * @return Returns the actionAssociation.
 288  
      */
 289  
     protected Action getActionAssociation() {
 290  19
         if (actionAssociation == null) {
 291  19
             actionAssociation =
 292  
                 new RadioAction(
 293  
                     new ActionAddAssociationRole(
 294  
                         Model.getAggregationKind().getNone(),
 295  
                         false,
 296  
                         "button.new-associationrole",
 297  
                         "Association"));
 298  
         }
 299  19
         return actionAssociation;
 300  
     }
 301  
     /**
 302  
      * @return Returns the actionComposition.
 303  
      */
 304  
     protected Action getActionComposition() {
 305  19
         if (actionComposition == null) {
 306  19
             actionComposition =
 307  
                 new RadioAction(
 308  
                     new ActionAddAssociationRole(
 309  
                         Model.getAggregationKind().getComposite(),
 310  
                         false,
 311  
                         "button.new-composition"));
 312  
         }
 313  19
         return actionComposition;
 314  
     }
 315  
     /**
 316  
      * @return Returns the actionDepend.
 317  
      */
 318  
     protected Action getActionDepend() {
 319  19
         if (actionDepend == null) {
 320  19
             actionDepend =
 321  
                 new RadioAction(
 322  
                     new ActionSetMode(
 323  
                         ModeCreatePolyEdge.class,
 324  
                         "edgeClass",
 325  
                         Model.getMetaTypes().getDependency(),
 326  
                         "button.new-dependency"));
 327  
         }
 328  19
         return actionDepend;
 329  
     }
 330  
     /**
 331  
      * @return Returns the actionGeneralize.
 332  
      */
 333  
     protected Action getActionGeneralize() {
 334  19
         if (actionGeneralize == null) {
 335  19
             actionGeneralize =
 336  
                 new RadioAction(
 337  
                     new ActionSetMode(
 338  
                         ModeCreatePolyEdge.class,
 339  
                         "edgeClass",
 340  
                         Model.getMetaTypes().getGeneralization(),
 341  
                         "button.new-generalization"));
 342  
         }
 343  19
         return actionGeneralize;
 344  
     }
 345  
 
 346  
     /**
 347  
      * @return Returns the actionUniAggregation.
 348  
      */
 349  
     protected Action getActionUniAggregation() {
 350  19
         if (actionUniAggregation == null) {
 351  19
             actionUniAggregation =
 352  
                 new RadioAction(
 353  
                     new ActionAddAssociationRole(
 354  
                         Model.getAggregationKind().getAggregate(),
 355  
                         true,
 356  
                         "button.new-uniaggregation"));
 357  
         }
 358  19
         return actionUniAggregation;
 359  
     }
 360  
     /**
 361  
      * @return Returns the actionUniAssociation.
 362  
      */
 363  
     protected Action getActionUniAssociation() {
 364  19
         if (actionUniAssociation  == null) {
 365  19
             actionUniAssociation =
 366  
                 new RadioAction(
 367  
                     new ActionAddAssociationRole(
 368  
                         Model.getAggregationKind().getNone(),
 369  
                         true,
 370  
                         "button.new-uniassociation"));
 371  
         }
 372  19
         return actionUniAssociation;
 373  
     }
 374  
     /**
 375  
      * @return Returns the actionUniComposition.
 376  
      */
 377  
     protected Action getActionUniComposition() {
 378  19
         if (actionUniComposition == null) {
 379  19
             actionUniComposition =
 380  
                 new RadioAction(
 381  
                     new ActionAddAssociationRole(
 382  
                         Model.getAggregationKind().getComposite(),
 383  
                         true,
 384  
                         "button.new-unicomposition"));
 385  
         }
 386  19
         return actionUniComposition;
 387  
     }
 388  
 
 389  
     /**
 390  
      * @return Returns the actionAggregation.
 391  
      */
 392  
     private Action getActionAggregation() {
 393  19
         if (actionAggregation == null) {
 394  19
             actionAggregation =
 395  
                 new RadioAction(
 396  
                     new ActionAddAssociationRole(
 397  
                         Model.getAggregationKind().getAggregate(),
 398  
                         false,
 399  
                         "button.new-aggregation"));
 400  
         }
 401  19
         return actionAggregation;
 402  
     }
 403  
 
 404  
     /**
 405  
      * @return Returns the actionMessage.
 406  
      */
 407  
     private Action getActionMessage() {
 408  19
         if (actionMessage == null) {
 409  19
             actionMessage = ActionAddMessage.getTargetFollower();
 410  
         }
 411  19
         return actionMessage;
 412  
     }
 413  
 
 414  
     /*
 415  
      * @see org.argouml.uml.diagram.ui.UMLDiagram#isRelocationAllowed(java.lang.Object)
 416  
      */
 417  
     public boolean isRelocationAllowed(Object base) {
 418  
         /* TODO: We may return the following when the
 419  
          * relocate() has been implemented.
 420  
          */
 421  
 //      if (Model.getFacade().isAOperation(base)
 422  
 //      || Model.getFacade().isANamespace(base))
 423  
 //      return Model.getCollaborationsHelper()
 424  
 //      .isAddingCollaborationAllowed(base);
 425  0
         return false;
 426  
     }
 427  
 
 428  
     /*
 429  
      * @see org.argouml.uml.diagram.ui.UMLDiagram#relocate(java.lang.Object)
 430  
      */
 431  
     public boolean relocate(Object base) {
 432  0
         return false;
 433  
     }
 434  
 
 435  
     @SuppressWarnings("unchecked")
 436  
     public Collection getRelocationCandidates(Object root) {
 437  
         /* TODO: We may return something useful when the
 438  
          * relocate() has been implemented. */
 439  0
         Collection c =  new HashSet();
 440  0
         c.add(getOwner());
 441  0
         return c;
 442  
     }
 443  
 
 444  
     public void encloserChanged(FigNode enclosed, 
 445  
             FigNode oldEncloser, FigNode newEncloser) {
 446  
         // Do nothing.        
 447  0
     }
 448  
     
 449  
     /**
 450  
      * A sequence diagram can accept all classifiers. It will add them as a new 
 451  
      * Classifier Role with that classifier as a base. All other accepted figs 
 452  
      * are added as is.
 453  
      * @param objectToAccept
 454  
      * @return true if the diagram can accept the object, else false
 455  
      * @see org.argouml.uml.diagram.ui.UMLDiagram#doesAccept(java.lang.Object)
 456  
      */
 457  
     @Override
 458  
     public boolean doesAccept(Object objectToAccept) {
 459  0
         if (Model.getFacade().isAClassifierRole(objectToAccept)) {
 460  0
             return true;
 461  0
         } else if (Model.getFacade().isAMessage(objectToAccept)) {
 462  0
             return true;
 463  0
         } else if (Model.getFacade().isAComment(objectToAccept)) {
 464  0
             return true;
 465  0
         } else if (Model.getFacade().isAClassifier(objectToAccept)) {
 466  0
             return true;
 467  
         }
 468  0
         return false;
 469  
     }
 470  
     
 471  
     /**
 472  
      * Creates a new Classifier Role with a specified base.
 473  
      * @param base
 474  
      * @return The new CR
 475  
      */
 476  
     private Object makeNewCR(Object base) {
 477  0
         Object node = null;
 478  0
         Editor ce = Globals.curEditor();
 479  0
         GraphModel gm = ce.getGraphModel();
 480  0
         if (gm instanceof CollabDiagramGraphModel) {
 481  0
             Object collaboration =
 482  
                 ((CollabDiagramGraphModel) gm).getHomeModel();
 483  0
             node =
 484  
                 Model.getCollaborationsFactory().buildClassifierRole(
 485  
                         collaboration);
 486  
           }
 487  0
         Model.getCollaborationsHelper().addBase(node, base);
 488  
         
 489  0
         return node;
 490  
     }
 491  
     
 492  
     /**
 493  
      * Creates the Fig for the CR. Y position will be adjusted to match other 
 494  
      * the other CRs.
 495  
      * @param classifierRole
 496  
      * @param location The position where to put the new fig.
 497  
      * @return
 498  
      */
 499  
     private FigClassifierRole makeNewFigCR(Object classifierRole, 
 500  
             Point location) {
 501  0
         if (classifierRole != null) {
 502  0
             FigClassifierRole newCR = new FigClassifierRole(classifierRole,
 503  
                     new Rectangle(location), getDiagramSettings());
 504  
             
 505  0
             getGraphModel().getNodes().add(newCR.getOwner());
 506  
 
 507  0
             return newCR;
 508  
         }
 509  0
         return null;
 510  
     }
 511  
     
 512  
     @Override
 513  
     public DiagramElement drop(Object droppedObject, Point location) {
 514  0
         DiagramElement figNode = null;
 515  0
         GraphModel gm = getGraphModel();
 516  0
         Layer lay = Globals.curEditor().getLayerManager().getActiveLayer();
 517  
         
 518  
         // If location is non-null, convert to a rectangle that we can use
 519  0
         Rectangle bounds = null;
 520  0
         if (location != null) {
 521  0
             bounds = new Rectangle(location.x, location.y, 0, 0);
 522  
         }
 523  0
         DiagramSettings settings = getDiagramSettings();
 524  
         
 525  0
         if (Model.getFacade().isAClassifierRole(droppedObject)) {
 526  0
             figNode = new FigClassifierRole(droppedObject, bounds, settings);
 527  0
         } else if (Model.getFacade().isAMessage(droppedObject)) {
 528  0
             figNode = new FigMessage(droppedObject, bounds, settings);
 529  0
         } else if (Model.getFacade().isAComment(droppedObject)) {
 530  0
             figNode = new FigComment(droppedObject, bounds, settings);
 531  0
         } else if (Model.getFacade().isAClassifierRole(droppedObject)) {
 532  0
             figNode = makeNewFigCR(droppedObject, location);           
 533  0
         } else if (Model.getFacade().isAClassifier(droppedObject)) {
 534  0
             figNode = makeNewFigCR(makeNewCR(droppedObject), location);
 535  
         }
 536  0
         if (figNode != null) {
 537  0
             LOG.debug("Dropped object " + droppedObject + " converted to " 
 538  
                     + figNode);
 539  
         } else {
 540  0
             LOG.debug("Dropped object NOT added " + droppedObject);
 541  
         }
 542  0
         return figNode;
 543  
     }
 544  
     
 545  
 
 546  
     public DiagramElement createDiagramElement(
 547  
             final Object modelElement,
 548  
             final Rectangle bounds) {
 549  
         
 550  0
         FigNodeModelElement figNode = null;
 551  
         
 552  0
         DiagramSettings settings = getDiagramSettings();
 553  
         
 554  0
         if (Model.getFacade().isAClassifierRole(modelElement)) {
 555  0
             figNode = new FigClassifierRole(modelElement, bounds, settings);
 556  0
         } else if (Model.getFacade().isAMessage(modelElement)) {
 557  0
             figNode = new FigMessage(modelElement, bounds, settings);
 558  0
         } else if (Model.getFacade().isAComment(modelElement)) {
 559  0
             figNode = new FigComment(modelElement, bounds, settings);
 560  0
         } else if (Model.getFacade().isAClassifierRole(modelElement)) {
 561  0
             figNode =
 562  
                 makeNewFigCR(modelElement, bounds.getLocation());           
 563  0
         } else if (Model.getFacade().isAClassifier(modelElement)) {
 564  0
             figNode =
 565  
                 makeNewFigCR(makeNewCR(modelElement), bounds.getLocation());
 566  
         }
 567  
         
 568  0
         if (figNode != null) {
 569  0
             LOG.debug("Model element " + modelElement + " converted to " 
 570  
                     + figNode);
 571  
         } else {
 572  0
             LOG.debug("Dropped object NOT added " + figNode);
 573  
         }
 574  0
         return figNode;
 575  
     }
 576  
     
 577  
     @Override
 578  
     public String getInstructions(Object droppedObject) {
 579  0
         if (Model.getFacade().isAClassifierRole(droppedObject)) {
 580  0
                     return super.getInstructions(droppedObject);
 581  0
             } else if (Model.getFacade().isAClassifier(droppedObject)) {
 582  0
             return Translator.localize(
 583  
                     "misc.message.click-on-diagram-to-add-as-cr", 
 584  
                     new Object[] {Model.getFacade().toString(droppedObject)});
 585  
         }
 586  0
         return super.getInstructions(droppedObject);
 587  
     }
 588  
 
 589  
     /**
 590  
      * The UID.
 591  
      */
 592  
     private static final long serialVersionUID = 8081715986963837750L;
 593  
 }