Coverage Report - org.argouml.model.euml.ActivityGraphsFactoryEUMLlImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
ActivityGraphsFactoryEUMLlImpl
0%
0/19
0%
0/2
1.833
ActivityGraphsFactoryEUMLlImpl$1
0%
0/5
N/A
1.833
 
 1  
 // $Id: ActivityGraphsFactoryEUMLlImpl.java 18787 2010-10-10 20:22:28Z linus $
 2  
 /*****************************************************************************
 3  
  * Copyright (c) 2007,2010 Tom Morris and other contributors
 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  
  *    Tom Morris - initial framework
 11  
  *****************************************************************************/
 12  
 
 13  
 package org.argouml.model.euml;
 14  
 
 15  
 import java.util.Collection;
 16  
 
 17  
 import org.argouml.model.AbstractModelFactory;
 18  
 import org.argouml.model.ActivityGraphsFactory;
 19  
 import org.eclipse.uml2.uml.Activity;
 20  
 import org.eclipse.uml2.uml.UMLFactory;
 21  
 
 22  
 /**
 23  
  * The implementation of the ActivityGraphsFactory for EUML2.
 24  
  */
 25  
 class ActivityGraphsFactoryEUMLlImpl implements ActivityGraphsFactory,
 26  
         AbstractModelFactory {
 27  
 
 28  
     /**
 29  
      * The model implementation.
 30  
      */
 31  
     private EUMLModelImplementation modelImpl;
 32  
 
 33  
     /**
 34  
      * Constructor.
 35  
      *
 36  
      * @param implementation The ModelImplementation.
 37  
      */
 38  
     public ActivityGraphsFactoryEUMLlImpl(
 39  0
             EUMLModelImplementation implementation) {
 40  0
         modelImpl = implementation;
 41  0
     }
 42  
 
 43  
     /**
 44  
      * ActivityGraph is a UML1.x element that has been dropped in UML2.
 45  
      * For convenience and prevent changes to interfaces this is currently
 46  
      * being used to build an Activity for UML2
 47  
      * @param theContext the package the activity is to be contained inside
 48  
      * @return the Activity created
 49  
      * @see org.argouml.model.ActivityGraphsFactory#buildActivityGraph(java.lang.Object)
 50  
      */
 51  
     public Object buildActivityGraph(final Object theContext) {
 52  0
         if (!(theContext instanceof org.eclipse.uml2.uml.Package)) {
 53  0
             throw new IllegalArgumentException(
 54  
                     "Didn't expect a " //$NON-NLS-1$
 55  
                     + theContext); 
 56  
         }
 57  0
         RunnableClass run = new RunnableClass() {
 58  
             public void run() {
 59  0
                 Activity activity = (Activity) createActivityGraph();
 60  0
                 activity.setPackage((org.eclipse.uml2.uml.Package) theContext);
 61  0
                 getParams().add(activity);
 62  0
             }
 63  
         };
 64  0
         ChangeCommand cmd = new ChangeCommand(
 65  
                 modelImpl, run,
 66  
                 "Create the activity # in the package #");
 67  0
         modelImpl.getEditingDomain().getCommandStack().execute(cmd);
 68  0
         cmd.setObjects(run.getParams().get(0), theContext);
 69  
 
 70  0
         return (Activity) run.getParams().get(0);
 71  
     }
 72  
 
 73  
     public Object buildClassifierInState(Object classifier, Collection state) {
 74  0
         throw new NotYetImplementedException();
 75  
     }
 76  
 
 77  
     public Object buildObjectFlowState(Object compositeState) {
 78  0
         throw new NotYetImplementedException();
 79  
     }
 80  
 
 81  
     public Object createActionState() {
 82  0
         throw new NotYetImplementedException();
 83  
     }
 84  
 
 85  
     public Object createActivityGraph() {
 86  0
         return UMLFactory.eINSTANCE.createActivity();
 87  
     }
 88  
 
 89  
     public Object createCallState() {
 90  0
         throw new NotYetImplementedException();
 91  
     }
 92  
 
 93  
     public Object createClassifierInState() {
 94  0
         throw new NotYetImplementedException();
 95  
     }
 96  
 
 97  
     public Object createObjectFlowState() {
 98  0
         throw new NotYetImplementedException();
 99  
     }
 100  
 
 101  
     public Object createPartition() {
 102  0
         throw new NotYetImplementedException();
 103  
     }
 104  
 
 105  
     public Object createSubactivityState() {
 106  0
         throw new NotYetImplementedException();
 107  
     }
 108  
 
 109  
 }