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

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-01-19 18:45:37-0800
New Revision: 16663

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.java

Log:
Done't create name/stereotype figs on association-class edge (or draggable path items for them)

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java?view=diff&pathrev=16663&r1=16662&r2=16663
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java	2009-01-19 18:45:37-0800
@@ -154,18 +154,8 @@
      */
     public FigAssociation(Object owner, DiagramSettings settings) {
         super(owner, settings);
-
-        middleGroup = new FigTextGroup(owner, settings);
-
-        // let's use groups to construct the different text sections at
-        // the association
-        if (getNameFig() != null) {
-            middleGroup.addFig(getNameFig());
-        }
-        middleGroup.addFig(getStereotypeFig());
-        addPathItem(middleGroup,
-                new PathItemPlacement(this, middleGroup, 50, 25));
-        ArgoFigUtil.markPosition(this, 50, 0, 90, 25, Color.yellow);
+        
+        createNameLabel(owner, settings);
         
         Object[] ends = // UML objects of AssociationEnd type
             Model.getFacade().getConnections(owner).toArray();
@@ -211,7 +201,29 @@
         setLayer(lay);
     }
 
-
+    /**
+     * Create the main draggable label for the association.
+     * This can be overridden in subclasses to change behaviour.
+     * TODO: Consider introducing this to FigEdgeModelElement and
+     * using throughout all edges.
+     * 
+     * @param owner owning uml element
+     * @param settings rendering settings
+     */
+    protected void createNameLabel(Object owner, DiagramSettings settings) {
+        middleGroup = new FigTextGroup(owner, settings);
+     
+        // let's use groups to construct the different text sections at
+        // the association
+        if (getNameFig() != null) {
+            middleGroup.addFig(getNameFig());
+        }
+        middleGroup.addFig(getStereotypeFig());
+        addPathItem(middleGroup,
+                new PathItemPlacement(this, middleGroup, 50, 25));
+        ArgoFigUtil.markPosition(this, 50, 0, 90, 25, Color.yellow);
+    }
+    
     /**
      * Set the owner.
      * 

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.java?view=diff&pathrev=16663&r1=16662&r2=16663
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.java	2009-01-19 18:45:37-0800
@@ -114,6 +114,17 @@
     }
     
     /**
+     * This overrides the parent class to do nothing here. An association class
+     * has no name label but instead has the name and stereotype editable in
+     * the association-classes class box.
+     * 
+     * @param owner owning uml element
+     * @param settings rendering settings
+     */
+    protected void createNameLabel(Object owner, DiagramSettings settings) {
+    }
+    
+    /**
      * Remove entire composite Fig from Diagram. Discover the attached
      * FigEdgeAssociationClass and the FigClassAssociationClass attached to
      * that. Remove them from the diagram before removing this.

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

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.