Author: mvw
Date: 2008-04-14 13:45:43-0700
New Revision: 14347

Modified:
   trunk/src/app/src/org/argouml/uml/diagram/ui/FigNameWithAbstract.java

Log:
Fix for issue 5013: Show bold names.

Modified: trunk/src/app/src/org/argouml/uml/diagram/ui/FigNameWithAbstract.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/app/src/org/argouml/uml/diagram/ui/FigNameWithAbstract.java?view=diff&rev=14347&p1=trunk/src/app/src/org/argouml/uml/diagram/ui/FigNameWithAbstract.java&p2=trunk/src/app/src/org/argouml/uml/diagram/ui/FigNameWithAbstract.java&r1=14346&r2=14347
==============================================================================
--- trunk/src/app/src/org/argouml/uml/diagram/ui/FigNameWithAbstract.java       
(original)
+++ trunk/src/app/src/org/argouml/uml/diagram/ui/FigNameWithAbstract.java       
2008-04-14 13:45:43-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -26,29 +26,48 @@
 
 import java.awt.Font;
 
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectSettings;
 import org.argouml.model.Model;
 
 /**
  * A FigSingleLineText that represents the name of a modelelement,
  * which handles italic font if the element is abstract. <p>
+ * Also, handles cases where the projectsettings 
+ * indicate that names should be in bold. <p>
  * 
- * For this to work, the owner of this FigText needs to be set!
+ * For the italics to work, the owner of this FigText needs to be set!
  *
  * @author Michiel
  */
 class FigNameWithAbstract extends FigSingleLineText {
 
+    /**
+     * @param x location x
+     * @param y location y
+     * @param w width
+     * @param h height
+     * @param expandOnly impacts behavior
+     */
     public FigNameWithAbstract(int x, int y, int w, int h, boolean expandOnly) 
{
         super(x, y, w, h, expandOnly);
     }
 
     @Override
     protected int getFigFontStyle() {
+        boolean showBoldName = false;
+        Project p = getProject();
+        if (p != null) {
+            ProjectSettings ps = p.getProjectSettings();
+            showBoldName = ps.getShowBoldNamesValue();
+        }
+        int boldStyle =  showBoldName ? Font.BOLD : Font.PLAIN;
+
         int style = 0;
         if (getOwner() != null) {
             style = Model.getFacade().isAbstract(getOwner()) 
                 ? Font.ITALIC : Font.PLAIN;
         }
-        return super.getFigFontStyle() | style;
+        return super.getFigFontStyle() | style | boldStyle;
     }
 }
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to