Login | Register
My pages Projects Community openCollabNet

Discussions > Commit Messages > svn commit: r19954 - trunk/src/argouml-app/src/org/argouml/ui/cmd/RelationshipActionFactory.java

argouml
Discussion topic

Back to topic list

svn commit: r19954 - trunk/src/argouml-app/src/org/argouml/ui/cmd/RelationshipActionFactory.java

Author mvw
Full name Michiel van der Wulp
Date 2014-09-19 12:07:47 PDT
Message Author: mvw
Date: 2014-09-19 12:07:40-0700
New Revision: 19954

Modified:
   trunk/src/argouml-ap​p/src/org/argouml/ui​/cmd/RelationshipAct​ionFactory.java

Log:
Fix some exceptions when right-clicking on elements in an activity diagram

Modified: trunk/src/argouml-ap​p/src/org/argouml/ui​/cmd/RelationshipAct​ionFactory.java
Url: http://argouml.tigri​s.org/source/browse/​argouml/trunk/src/ar​gouml-app/src/org/ar​gouml/ui/cmd/Relatio​nshipActionFactory.j​ava?view=diff&pa​threv=19954&r1=1​9953&r2=19954
====================​====================​====================​==================
--- trunk/src/argouml-ap​p/src/org/argouml/ui​/cmd/RelationshipAct​ionFactory.java (original)
+++ trunk/src/argouml-ap​p/src/org/argouml/ui​/cmd/RelationshipAct​ionFactory.java 2014-09-19 12:07:40-0700
@@ -8,6 +8,7 @@
  *
  * Contributors:
  * Bob Tarling
+ * Michiel van der Wulp
  ********************​********************​********************​*****************/
 
 package org.argouml.ui.cmd;
@@ -168,7 +169,7 @@
     }
     
     private ActionList getDependancyToActions(final Object element, ArgoDiagram diagram) {
- ActionList al= new ActionList("Add Dependancies to ");
+ ActionList al= new ActionList("Add Dependencies to ");
         if (Model.getFacade().i​sAClass(element)) {
             
             Collection dependenciesTo = Model.getFacade().ge​tClientDependencies(​element);
@@ -179,7 +180,7 @@
                     Collection suppliers = Model.getFacade().ge​tSuppliers(dependenc​y);
                     for (Object supplier : suppliers) {
                         al.add(new AddUsageAction(
- "Add dependancy to "+ Model.getFacade().ge​tName(supplier),
+ "Add dependency to "+ Model.getFacade().ge​tName(supplier),
                                 diagram, element, dependency, supplier));
                     }
                 }
@@ -189,7 +190,7 @@
     }
     
     private ActionList getDependancyFromActions(final Object element, ArgoDiagram diagram) {
- ActionList al= new ActionList("Add Dependancies from ");
+ ActionList al= new ActionList("Add Dependencies from ");
         if (Model.getFacade().i​sAClass(element)) {
             
             Collection dependenciesFrom = Model.getFacade().ge​tSupplierDependencie​s(element);
@@ -200,7 +201,7 @@
                     Collection clients = Model.getFacade().ge​tClients(dependency)​;
                     for (Object client : clients) {
                         al.add(new AddUsageAction(
- "Add dependancy from "+ Model.getFacade().ge​tName(client),
+ "Add dependency from "+ Model.getFacade().ge​tName(client),
                                 diagram, element, dependency, client));
                     }
                 }
@@ -211,15 +212,17 @@
     
     private ActionList getGeneralizationToA​ctions(final Object element, ArgoDiagram diagram) {
         ActionList al= new ActionList("Add Generalizations to ");
- Collection generalizations = Model.getFacade().ge​tGeneralizations(ele​ment);
- for (Object generalization : generalizations) {
-
- // Only show actions for associations not already on diagram
- if (diagram.presentatio​nFor(generalization)​ == null) {
- Object general = Model.getFacade().ge​tGeneral(generalizat​ion);
- al.add(new AddGeneralAction(
- "Add Generalization to "+ Model.getFacade().ge​tName(general),
- diagram, element, generalization, general));
+ if (Model.getFacade().i​sAGeneralizableEleme​nt(element)) {
+ Collection generalizations = Model.getFacade().ge​tGeneralizations(ele​ment);
+ for (Object generalization : generalizations) {
+
+ // Only show actions for associations not already on diagram
+ if (diagram.presentatio​nFor(generalization)​ == null) {
+ Object general = Model.getFacade().ge​tGeneral(generalizat​ion);
+ al.add(new AddGeneralAction(
+ "Add Generalization to "+ Model.getFacade().ge​tName(general),
+ diagram, element, generalization, general));
+ }
             }
         }
         return al;
@@ -227,15 +230,17 @@
     
     private ActionList getGeneralizationFro​mActions(final Object element, ArgoDiagram diagram) {
         ActionList al= new ActionList("Add Generalizations from ");
- Collection specializations = Model.getFacade().ge​tSpecializations(ele​ment);
- for (Object specialization : specializations) {
-
- // Only show actions for associations not already on diagram
- if (diagram.presentatio​nFor(specialization)​ == null) {
- Object specific = Model.getFacade().ge​tSpecific(specializa​tion);
- al.add(new AddSpecialAction(
- "Add Specialization from "+ Model.getFacade().ge​tName(specific),
- diagram, element, specialization, specific));
+ if (Model.getFacade().i​sAGeneralizableEleme​nt(element)) {
+ Collection specializations = Model.getFacade().ge​tSpecializations(ele​ment);
+ for (Object specialization : specializations) {
+
+ // Only show actions for associations not already on diagram
+ if (diagram.presentatio​nFor(specialization)​ == null) {
+ Object specific = Model.getFacade().ge​tSpecific(specializa​tion);
+ al.add(new AddSpecialAction(
+ "Add Specialization from "+ Model.getFacade().ge​tName(specific),
+ diagram, element, specialization, specific));
+ }
             }
         }
         return al;

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r19954 - trunk/src/argouml-app/src/org/argouml/ui/cmd/RelationshipActionFactory.java mvw Michiel van der Wulp 2014-09-19 12:07:47 PDT
Messages per page: