svn commit: r18528 - trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/ActivityDiagramModule.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-07-18 03:29:35-0700
New Revision: 18528

Modified:
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/ActivityDiagramModule.java

Log:
Do notjing in the module unless we are UML2. This allows us to distribute this module without affecting UML1.4.

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/ActivityDiagramModule.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/ActivityDiagramModule.java?view=diff&pathrev=18528&r1=18527&r2=18528
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/ActivityDiagramModule.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/ActivityDiagramModule.java	2010-07-18 03:29:35-0700
@@ -15,6 +15,7 @@
 
 import org.apache.log4j.Logger;
 import org.argouml.activity2.diagram.ActivityDiagramFactory;
+import org.argouml.model.Model;
 import org.argouml.moduleloader.ModuleInterface;
 import org.argouml.notation.Notation;
 import org.argouml.notation.NotationName;
@@ -34,15 +35,16 @@
     private ActivityDiagramPropPanelFactory propPanelFactory;
         
     public boolean enable() {
-        
-        propPanelFactory =
-            new ActivityDiagramPropPanelFactory();
-        PropPanelFactoryManager.addPropPanelFactory(propPanelFactory);
-        // TODO: Remove the casting to DiagramFactoryInterface2
-        // as soon as DiagramFactoryInterface is removed.
-        DiagramFactory.getInstance().registerDiagramFactory(
-                DiagramType.Activity, 
-                (DiagramFactoryInterface2) new ActivityDiagramFactory());
+        if (Model.getFacade().getUmlVersion().indexOf("2") >= 0) {
+            // This module will still register as enabled for UML1.4 but it won't
+            // actually do anything.
+            propPanelFactory =
+                new ActivityDiagramPropPanelFactory();
+            PropPanelFactoryManager.addPropPanelFactory(propPanelFactory);
+            DiagramFactory.getInstance().registerDiagramFactory(
+                    DiagramType.Activity, 
+                    new ActivityDiagramFactory());
+        }
         return true;
     }

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

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.