svn commit: r17558 - trunk/src/argouml-app/src/org/argouml/uml/diagram: . ui

Michiel van der Wulp <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2009-11-28 00:11:25-0800
New Revision: 17558

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ExtensionPointsCompartmentContainer.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/OperationsCompartmentContainer.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ActionCompartmentDisplay.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/EnumLiteralsCompartmentContainer.java

Log:
Getting rid of the XxxxCompartmentContainer interfaces (according architecture from Bob). Not complete yet.

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ExtensionPointsCompartmentContainer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ExtensionPointsCompartmentContainer.java?view=diff&pathrev=17558&r1=17557&r2=17558
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ExtensionPointsCompartmentContainer.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ExtensionPointsCompartmentContainer.java	2009-11-28 00:11:25-0800
@@ -27,8 +27,12 @@
 /**
  * An interface to be implemented by any Fig that contains
  * a Extensions Compartment.
- *
- * @author [email protected]
+ *@deprecated in 0.29.2 by MVW. We can't assume at compile time what
+ * Figs contain what compartments. This is proved in the UML1.4 to UML2 conversion
+ * where UML1.4 does not want this interface for FigInterface but UML2 does.
+ * Use FigCompartment.getCompartment(Object metaType) to fetch a compartment
+ * and check the existence and methods of the returned object.
+ * @author mvw
  */
 public interface ExtensionPointsCompartmentContainer {
 

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/OperationsCompartmentContainer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/OperationsCompartmentContainer.java?view=diff&pathrev=17558&r1=17557&r2=17558
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/OperationsCompartmentContainer.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/OperationsCompartmentContainer.java	2009-11-28 00:11:25-0800
@@ -29,6 +29,11 @@
 /**
  * An interface to be implemented by any Fig that contains
  * a FigOperationsCompartment.
+ * @deprecated in 0.29.2 by MVW. We can't assume at compile time what
+ * Figs contain what compartments. This is proved in the UML1.4 to UML2 conversion
+ * where UML1.4 does not want this interface for FigInterface but UML2 does.
+ * Use FigCompartment.getCompartment(Object metaType) to fetch a compartment
+ * and check the existence and methods of the returned object.
  * @author Bob Tarling
  */
 public interface OperationsCompartmentContainer {

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ActionCompartmentDisplay.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ActionCompartmentDisplay.java?view=diff&pathrev=17558&r1=17557&r2=17558
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ActionCompartmentDisplay.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ActionCompartmentDisplay.java	2009-11-28 00:11:25-0800
@@ -203,8 +203,8 @@
 
         List<Fig> figs = ce.getSelectionManager().getSelectedFigs();
         for (Fig f : figs) {
-            
             final FigCompartmentBox fcb = (FigCompartmentBox) f;
+
             final FigCompartment attributeCompartment =
                 fcb.getCompartment(Model.getMetaTypes().getAttribute());
             if (attributeCompartment != null) {
@@ -215,31 +215,32 @@
                     visible++;
                 }
             }
-            if (f instanceof OperationsCompartmentContainer) {
+            final FigCompartment operationCompartment =
+                fcb.getCompartment(Model.getMetaTypes().getOperation());
+            if (operationCompartment != null) {
                 present++;
                 operPresent = true;
-                operVisible =
-                    ((OperationsCompartmentContainer) f).isOperationsVisible();
+                operVisible = operationCompartment.isVisible();
                 if (operVisible) {
                     visible++;
                 }
             }
-            if (f instanceof ExtensionPointsCompartmentContainer) {
+            final FigCompartment epCompartment =
+                fcb.getCompartment(Model.getMetaTypes().getExtensionPoint());
+            if (epCompartment != null) {
                 present++;
                 epPresent = true;
-                epVisible =
-                        ((ExtensionPointsCompartmentContainer) f)
-                                .isExtensionPointsVisible();
+                epVisible = epCompartment.isVisible();
                 if (epVisible) {
                     visible++;
                 }
             }
-            if (f instanceof EnumLiteralsCompartmentContainer) {
+            final FigCompartment elCompartment =
+                fcb.getCompartment(Model.getMetaTypes().getEnumerationLiteral());
+            if (elCompartment != null) {
                 present++;
                 enumPresent = true;
-                enumVisible =
-                        ((EnumLiteralsCompartmentContainer) f)
-                                .isEnumLiteralsVisible();
+                enumVisible = elCompartment.isVisible();
                 if (enumVisible) {
                     visible++;
                 }

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/EnumLiteralsCompartmentContainer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/EnumLiteralsCompartmentContainer.java?view=diff&pathrev=17558&r1=17557&r2=17558
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/EnumLiteralsCompartmentContainer.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/EnumLiteralsCompartmentContainer.java	2009-11-28 00:11:25-0800
@@ -35,6 +35,12 @@
  * needs to be refactored into something more general so that we can easily deal
  * with arbitrary types and numbers of optionally displayed containers. - 
  * tfm - 20060315
+ * 
+ * @deprecated in 0.29.2 by MVW. We can't assume at compile time what
+ * Figs contain what compartments. This is proved in the UML1.4 to UML2 conversion
+ * where UML1.4 does not want this interface for FigInterface but UML2 does.
+ * Use FigCompartment.getCompartment(Object metaType) to fetch a compartment
+ * and check the existence and methods of the returned object.
  */
 public interface EnumLiteralsCompartmentContainer {
     /**

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

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.