svn commit: r17350 - 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-09-24 00:12:15-0700
New Revision: 17350

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAttributesCompartment.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigCompartment.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEnumLiteralsCompartment.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigOperationsCompartment.java

Log:
One of the first steps to a more general approach to the Compartments.
According the UML, a List Compartment has a name.
I intend to use this initially to identify a more generic compartment. 
Later we can also optionally show it in the compartments.
This is a preparation for future enhancements, but performed now and separately since it is a public interface change.

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAttributesCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAttributesCompartment.java?view=diff&pathrev=17350&r1=17349&r2=17350
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAttributesCompartment.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAttributesCompartment.java	2009-09-24 00:12:15-0700
@@ -89,4 +89,9 @@
             Rectangle bounds, DiagramSettings settings) {
         return new FigAttribute(owner, bounds, settings);
     }
+
+    @Override
+    public String getName() {
+        return "attributes";
+    }
 }

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigCompartment.java?view=diff&pathrev=17350&r1=17349&r2=17350
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigCompartment.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigCompartment.java	2009-09-24 00:12:15-0700
@@ -34,7 +34,12 @@
 import org.tigris.gef.presentation.FigRect;
 
 /**
- * Presentation logic for a boxed compartment,
+ * Presentation logic for a UML List Compartment. <p>
+ * 
+ * The UML defines a Name Compartment, and a List Compartment. 
+ * This class implements the latter.<p>
+ * 
+ * A List Compartment is a boxed compartment,
  * containing vertically stacked figs,
  * which is common to e.g. an operations
  * compartment and an attributes compartment.<p>
@@ -173,4 +178,15 @@
         return bigPort.isFilled();
     }
 
+    /**
+     * This operation shall return a name unique for this type of 
+     * compartment. Potential use: show at the top in the compartment 
+     * as described in the UML, of as an identification string for 
+     * the compartment type. <p>
+     * See UML 1.4.2 OMG: chapter 5.24.1.2 Compartment name.
+     * 
+     * @return the name of the compartment 
+     */
+    public abstract String getName();
+    
 }

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEnumLiteralsCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEnumLiteralsCompartment.java?view=diff&pathrev=17350&r1=17349&r2=17350
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEnumLiteralsCompartment.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEnumLiteralsCompartment.java	2009-09-24 00:12:15-0700
@@ -94,5 +94,11 @@
     protected FigSingleLineTextWithNotation createFigText(Object owner,
             Rectangle bounds, DiagramSettings settings) {
         return new FigEnumerationLiteral(owner, bounds, settings);
-    }  
+    }
+
+    @Override
+    public String getName() {
+        /* TODO: The UML does not seem to define this name. Or is it? */
+        return "enumeration literals";
+    }
 }

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigOperationsCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigOperationsCompartment.java?view=diff&pathrev=17350&r1=17349&r2=17350
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigOperationsCompartment.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigOperationsCompartment.java	2009-09-24 00:12:15-0700
@@ -98,4 +98,9 @@
         TargetManager.getInstance().setTarget(oper);
     }
 
+    @Override
+    public String getName() {
+        return "operations";
+    }
+
 }

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

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.