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

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-10-19 06:30:49-0700
New Revision: 17407

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBoxWithAttributes.java

Log:
Begin merging FigClassifierBoxWithAttributes to FigClassifierBox

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java?view=diff&pathrev=17407&r1=17406&r2=17407
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java	2009-10-19 06:30:49-0700
@@ -43,6 +43,7 @@
 import org.argouml.uml.diagram.ui.ActionAddNote;
 import org.argouml.uml.diagram.ui.ActionCompartmentDisplay;
 import org.argouml.uml.diagram.ui.ActionEdgesDisplay;
+import org.argouml.uml.diagram.ui.FigAttributesCompartment;
 import org.argouml.uml.diagram.ui.FigCompartmentBox;
 import org.argouml.uml.diagram.ui.FigOperationsCompartment;
 import org.argouml.uml.ui.foundation.core.ActionAddOperation;
@@ -65,6 +66,11 @@
     private FigOperationsCompartment operationsFigCompartment;
     
     /**
+     * The Fig for the attributes compartment (if any).
+     */
+    private FigAttributesCompartment attributesFigCompartment;
+    
+    /**
      * Initialization shared by all constructors.
      */
     private void constructFigs() {
@@ -216,6 +222,66 @@
         setCompartmentVisible(operationsFigCompartment, isVisible);
     }
     
+    /**
+     * @return The graphics for the UML attributes (if any).
+     * @deprecated in 0.29.1 use getAttributesCompartment
+     */
+    protected FigAttributesCompartment getAttributesFig() {
+        return getAttributesCompartment();
+    }
+    
+    public Rectangle getAttributesBounds() {
+        return getAttributesCompartment().getBounds();
+    }
+
+    public boolean isAttributesVisible() {
+        return attributesFigCompartment != null 
+            && attributesFigCompartment.isVisible();
+    }
+    
+    /**
+     * Updates the attributes in the fig. Called from modelchanged if there is
+     * a modelEvent effecting the attributes and from renderingChanged in all
+     * cases.
+     * TODO: Looks like this should be private - Bob.
+     */
+    protected void updateAttributes() {
+        if (!isAttributesVisible()) {
+            return;
+        }
+        attributesFigCompartment.populate();
+
+        // TODO: make setBounds, calcBounds and updateBounds consistent
+        setBounds(getBounds());
+    }
+    
+    /**
+     * @param isVisible true if the attribute compartment is visible
+     *
+     * @see org.argouml.uml.diagram.AttributesCompartmentContainer#setAttributesVisible(boolean)
+     */
+    public void setAttributesVisible(boolean isVisible) {
+        setCompartmentVisible(attributesFigCompartment, isVisible);
+    }
+
+    /**
+     * @return the Fig for the Attribute compartment
+     */
+    public FigAttributesCompartment getAttributesCompartment() {
+        // Set bounds will be called from our superclass constructor before
+        // our constructor has run, so make sure this gets set up if needed.
+        if (attributesFigCompartment == null) {
+            attributesFigCompartment = new FigAttributesCompartment(
+                    getOwner(),
+                    DEFAULT_COMPARTMENT_BOUNDS, 
+                    getSettings());
+        }
+        return attributesFigCompartment;
+    }
+    
+    
+    
+    
     /*
      * @see org.tigris.gef.presentation.Fig#translate(int, int)
      */

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBoxWithAttributes.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBoxWithAttributes.java?view=diff&pathrev=17407&r1=17406&r2=17407
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBoxWithAttributes.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBoxWithAttributes.java	2009-10-19 06:30:49-0700
@@ -50,8 +50,6 @@
 public abstract class FigClassifierBoxWithAttributes extends FigClassifierBox 
     implements AttributesCompartmentContainer {
     
-    private FigAttributesCompartment attributesFigCompartment;
-    
     /**
      * Construct a Fig with owner, bounds, and settings.
      * 
@@ -65,23 +63,6 @@
         getAttributesCompartment(); // this creates the compartment fig
     }
 
-    /**
-     * @return The graphics for the UML attributes (if any).
-     * @deprecated use getAttributesCompartment
-     */
-    protected FigAttributesCompartment getAttributesFig() {
-        return getAttributesCompartment();
-    }
-    
-    public Rectangle getAttributesBounds() {
-        return getAttributesCompartment().getBounds();
-    }
-
-    public boolean isAttributesVisible() {
-        return attributesFigCompartment != null 
-            && attributesFigCompartment.isVisible();
-    }
-    
     /*
      * Insert an Add Attribute entry before the default menu.
      * 
@@ -197,44 +178,4 @@
         }
     }
 
-    /**
-     * Updates the attributes in the fig. Called from modelchanged if there is
-     * a modelEvent effecting the attributes and from renderingChanged in all
-     * cases.
-     * TODO: Looks like this should be private - Bob.
-     */
-    protected void updateAttributes() {
-        if (!isAttributesVisible()) {
-            return;
-        }
-        attributesFigCompartment.populate();
-
-        // TODO: make setBounds, calcBounds and updateBounds consistent
-        setBounds(getBounds());
-    }
-    
-    /**
-     * @param isVisible true if the attribute compartment is visible
-     *
-     * @see org.argouml.uml.diagram.AttributesCompartmentContainer#setAttributesVisible(boolean)
-     */
-    public void setAttributesVisible(boolean isVisible) {
-        setCompartmentVisible(attributesFigCompartment, isVisible);
-    }
-
-    /**
-     * @return the Fig for the Attribute compartment
-     */
-    public FigAttributesCompartment getAttributesCompartment() {
-        // Set bounds will be called from our superclass constructor before
-        // our constructor has run, so make sure this gets set up if needed.
-        if (attributesFigCompartment == null) {
-            attributesFigCompartment = new FigAttributesCompartment(
-                    getOwner(),
-                    DEFAULT_COMPARTMENT_BOUNDS, 
-                    getSettings());
-        }
-        return attributesFigCompartment;
-    }
-    
 }

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

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.