svn commit: r16583 - trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java

Tom Morris <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2009-01-12 08:36:22-0800
New Revision: 16583

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java

Log:
Repair build.  Move magic numbers to constants.

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java?view=diff&pathrev=16583&r1=16582&r2=16583
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java	2009-01-12 08:36:22-0800
@@ -34,7 +34,6 @@
 import org.argouml.model.UmlChangeEvent;
 import org.argouml.notation.NotationProviderFactory2;
 import org.argouml.uml.diagram.DiagramSettings;
-import org.argouml.uml.diagram.ui.ArgoFigText;
 import org.argouml.uml.diagram.ui.FigNodeModelElement;
 import org.tigris.gef.base.Layer;
 import org.tigris.gef.base.Selection;
@@ -56,6 +55,10 @@
  */
 public class FigClassifierRole extends FigNodeModelElement {
 
+    private static final int DEFAULT_HEIGHT = 50;
+
+    private static final int DEFAULT_WIDTH = 90;
+
     /**
      * The minimum padding top and bottom.
      */
@@ -134,8 +137,10 @@
     private void initClassifierRoleFigs() {
         // The big port and cover. Color of the big port is irrelevant
 
-        setBigPort(new FigRect(X0, Y0, 90, 50, DEBUG_COLOR, DEBUG_COLOR));
-        cover   = new FigRect(X0, Y0, 90, 50, LINE_COLOR, FILL_COLOR);
+        setBigPort(new FigRect(X0, Y0, DEFAULT_WIDTH, DEFAULT_HEIGHT,
+                DEBUG_COLOR, DEBUG_COLOR));
+        cover = new FigRect(X0, Y0, DEFAULT_WIDTH, DEFAULT_HEIGHT, LINE_COLOR,
+                FILL_COLOR);
 
         // The stereotype. Width is the same as the cover, height is its default
         // (since the font is not yet set). The text should be centered.
@@ -145,7 +150,7 @@
         //getStereotypeFig().setFilled(false);
         getStereotypeFig().setFillColor(DEBUG_COLOR);
         getStereotypeFig().setBounds(X0, Y0, 
-                90, ArgoFigText.DEFAULT_TEXT_HEIGHT);
+                DEFAULT_WIDTH, getStereotypeFig().getHeight());
 
         // The name. Width is the same as the cover, height is the default.
         // The text of the name will be centered by
@@ -159,7 +164,7 @@
         getNameFig().setUnderline(true);
 
         getNameFig().setBounds(X0, Y0, 
-                90, ArgoFigText.DEFAULT_TEXT_HEIGHT);
+                DEFAULT_WIDTH, getStereotypeFig().getHeight());
 
         // add Figs to the FigNode in back-to-front order
 
@@ -386,7 +391,8 @@
         int extraEach = (newH - nameMin.height - stereoMin.height) / 2;
         if (!(stereoMin.height == 0 && stereoMin.width == 0)) {
             /* At least one stereotype is visible */
-            getStereotypeFig().setBounds(x, y + extraEach, newW, getStereotypeFig().getHeight());
+            getStereotypeFig().setBounds(x, y + extraEach, newW, 
+                    getStereotypeFig().getHeight());
         }
         getNameFig().setBounds(x, y + stereoMin.height + extraEach, newW,
                 nameMin.height);

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

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.