svn commit: r12955 - trunk/src_new/org/argouml: application language/java/cognitive/critics pattern/cognitive/critics uml/cognitive/critics

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2007-07-01 12:46:05-0700
New Revision: 12955

Added:
   trunk/src_new/org/argouml/language/java/cognitive/critics/InitJavaCritics.java   (contents, props changed)
   trunk/src_new/org/argouml/pattern/cognitive/critics/InitPatternCritics.java   (contents, props changed)
Modified:
   trunk/src_new/org/argouml/application/Main.java
   trunk/src_new/org/argouml/application/StartCritics.java
   trunk/src_new/org/argouml/uml/cognitive/critics/Init.java

Log:
Fixed 2 circular dependencies from org.argouml.language.java.cognitive.critics and org.argouml.pattern.cognitive.critics to org.argouml.uml.cognitive.critics.

Modified: trunk/src_new/org/argouml/application/Main.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/application/Main.java?view=diff&rev=12955&p1=trunk/src_new/org/argouml/application/Main.java&p2=trunk/src_new/org/argouml/application/Main.java&r1=12954&r2=12955
==============================================================================
--- trunk/src_new/org/argouml/application/Main.java	(original)
+++ trunk/src_new/org/argouml/application/Main.java	2007-07-01 12:46:05-0700
@@ -773,7 +773,7 @@
      * 
      * @param subsystem the subsystem to be initialised
      */
-    private static void initSubsystem(InitSubsystem subsystem) {
+    static void initSubsystem(InitSubsystem subsystem) {
         subsystem.init();
         for (GUISettingsTabInterface tab : subsystem.getSettingsTabs()) {
             GUI.getInstance().addSettingsTab(tab);

Modified: trunk/src_new/org/argouml/application/StartCritics.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/application/StartCritics.java?view=diff&rev=12955&p1=trunk/src_new/org/argouml/application/StartCritics.java&p2=trunk/src_new/org/argouml/application/StartCritics.java&r1=12954&r2=12955
==============================================================================
--- trunk/src_new/org/argouml/application/StartCritics.java	(original)
+++ trunk/src_new/org/argouml/application/StartCritics.java	2007-07-01 12:46:05-0700
@@ -31,7 +31,9 @@
 import org.argouml.configuration.Configuration;
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
+import org.argouml.language.java.cognitive.critics.InitJavaCritics;
 import org.argouml.model.Model;
+import org.argouml.pattern.cognitive.critics.InitPatternCritics;
 import org.argouml.uml.cognitive.UMLDecision;
 import org.argouml.uml.cognitive.critics.ChildGenUML;
 
@@ -50,6 +52,8 @@
     public void run() {
         Designer dsgr = Designer.theDesigner();
         org.argouml.uml.cognitive.critics.Init.init();
+        Main.initSubsystem(new InitJavaCritics());
+        Main.initSubsystem(new InitPatternCritics());
         org.argouml.uml.cognitive.checklist.Init.init();
         Project p = ProjectManager.getManager().getCurrentProject();
         // set the icon for this poster

Added: trunk/src_new/org/argouml/language/java/cognitive/critics/InitJavaCritics.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/cognitive/critics/InitJavaCritics.java?view=auto&rev=12955
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/language/java/cognitive/critics/InitJavaCritics.java	2007-07-01 12:46:05-0700
@@ -0,0 +1,61 @@
+// $Id$
+// Copyright (c) 2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.language.java.cognitive.critics;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.argouml.application.api.GUISettingsTabInterface;
+import org.argouml.application.api.InitSubsystem;
+import org.argouml.cognitive.Agency;
+import org.argouml.cognitive.Critic;
+import org.argouml.model.Model;
+
+/**
+ * Initialise the Java related critics.
+ *
+ * @author Michiel
+ */
+public class InitJavaCritics implements InitSubsystem {
+
+    private static Critic crMultiInherit = new CrMultipleInheritance();
+    private static Critic crMultiRealization = new CrMultipleRealization();
+
+    public List<GUISettingsTabInterface> getProjectSettingsTabs() {
+        return Collections.emptyList();
+    }
+
+    public List<GUISettingsTabInterface> getSettingsTabs() {
+        return Collections.emptyList();
+    }
+
+    public void init() {
+        Object classCls = Model.getMetaTypes().getUMLClass();
+        Object interfaceCls = Model.getMetaTypes().getInterface();
+        Agency.register(crMultiInherit, classCls);
+        Agency.register(crMultiRealization, interfaceCls);
+    }
+
+}

Added: trunk/src_new/org/argouml/pattern/cognitive/critics/InitPatternCritics.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/pattern/cognitive/critics/InitPatternCritics.java?view=auto&rev=12955
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/pattern/cognitive/critics/InitPatternCritics.java	2007-07-01 12:46:05-0700
@@ -0,0 +1,66 @@
+// $Id$
+// Copyright (c) 2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.pattern.cognitive.critics;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.argouml.application.api.GUISettingsTabInterface;
+import org.argouml.application.api.InitSubsystem;
+import org.argouml.cognitive.Agency;
+import org.argouml.cognitive.Critic;
+import org.argouml.model.Model;
+
+/**
+ * Initialise the Pattern related Critics.
+ *
+ * @author Michiel
+ */
+public class InitPatternCritics implements InitSubsystem {
+
+    private static Critic crConsiderSingleton = new CrConsiderSingleton();
+
+    private static Critic crSingletonViolatedMSA =
+        new CrSingletonViolatedMissingStaticAttr();
+
+    private static Critic crSingletonViolatedOPC =
+        new CrSingletonViolatedOnlyPrivateConstructors();
+
+    public List<GUISettingsTabInterface> getProjectSettingsTabs() {
+        return Collections.emptyList();
+    }
+
+    public List<GUISettingsTabInterface> getSettingsTabs() {
+        return Collections.emptyList();
+    }
+
+    public void init() {
+        Object classCls = Model.getMetaTypes().getUMLClass();
+        Agency.register(crConsiderSingleton, classCls);
+        Agency.register(crSingletonViolatedMSA, classCls);
+        Agency.register(crSingletonViolatedOPC, classCls);
+    }
+
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/Init.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/Init.java?view=diff&rev=12955&p1=trunk/src_new/org/argouml/uml/cognitive/critics/Init.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/Init.java&r1=12954&r2=12955
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/Init.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/Init.java	2007-07-01 12:46:05-0700
@@ -27,12 +27,7 @@
 import org.argouml.cognitive.Agency;
 import org.argouml.cognitive.CompoundCritic;
 import org.argouml.cognitive.Critic;
-import org.argouml.language.java.cognitive.critics.CrMultipleInheritance;
-import org.argouml.language.java.cognitive.critics.CrMultipleRealization;
 import org.argouml.model.Model;
-import org.argouml.pattern.cognitive.critics.CrConsiderSingleton;
-import org.argouml.pattern.cognitive.critics.CrSingletonViolatedMissingStaticAttr;
-import org.argouml.pattern.cognitive.critics.CrSingletonViolatedOnlyPrivateConstructors;
 import org.argouml.uml.diagram.deployment.ui.UMLDeploymentDiagram;
 import org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram;
 import org.argouml.uml.diagram.ui.FigEdgeModelElement;
@@ -243,28 +238,14 @@
 
     private static Critic crReservedName = new CrReservedName();
 
-    private static Critic crMultiInherit = new CrMultipleInheritance();
-
-    private static Critic crMultiRealization = new CrMultipleRealization();
-
     // code generation
     private static Critic crIllegalName = new CrIllegalName();
 
-    // Pattern specific
-    private static Critic crConsiderSingleton = new CrConsiderSingleton();
-
-    private static Critic crSingletonViolatedMSA =
-	new CrSingletonViolatedMissingStaticAttr();
-
-    private static Critic crSingletonViolatedOPC =
-	new CrSingletonViolatedOnlyPrivateConstructors();
-
     // Presentation critics
     private static Critic crNodesOverlap = new CrNodesOverlap();
 
     private static Critic crZeroLengthEdge = new CrZeroLengthEdge();
 
-
     // Compound critics
     private static CompoundCritic clsNaming =
 	new CompoundCritic(crMissingClassName, crDisambigClassName);
@@ -304,7 +285,6 @@
         Object stateCls = Model.getMetaTypes().getState();
         Object compositieStateCls = Model.getMetaTypes().getCompositeState();
         Object synchStateCls = Model.getMetaTypes().getSynchState();
-
 	// Class stateDiagramCls   = UMLStateDiagram.class;
 	// Class useCaseDiagramCls = UMLUseCaseDiagram.class;
 
@@ -369,8 +349,6 @@
 	Agency.register(crReservedName, attrCls);
 	Agency.register(crReservedName, stateCls);
 	Agency.register(crReservedName, assocCls);
-	Agency.register(crMultiInherit, classCls);
-	Agency.register(crMultiRealization, interfaceCls);
 	Agency.register(crTooManyAssoc, classCls);
 	Agency.register(crTooManyAttr, classCls);
 	Agency.register(crTooManyOper, classCls);
@@ -393,9 +371,6 @@
 	Agency.register(crUnconventionalAttrName, attrCls);
 	Agency.register(crUnconventionalClassName, classCls);
 	Agency.register(crUnconventionalPackName, packageCls);
-	Agency.register(crConsiderSingleton, classCls);
-	Agency.register(crSingletonViolatedMSA, classCls);
-	Agency.register(crSingletonViolatedOPC, classCls);
 	Class deploymentDiagramCls = UMLDeploymentDiagram.class;
 	Agency.register(crNodeInsideElement, deploymentDiagramCls);
 	Agency.register(crNodeInstanceInsideElement, deploymentDiagramCls);
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.