Author: mvw
Date: 2008-04-16 00:41:00-0700
New Revision: 14368
Added:
trunk/src/app/src/org/argouml/uml/diagram/ui/FigMultiLineTextWithBold.java (contents, props changed)
Modified:
trunk/src/app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java
Log:
Improving the solution for issue 5013 further: this for Action State alone.
Modified: trunk/src/app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java?view=diff&rev=14368&p1=trunk/src/app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java&p2=trunk/src/app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java&r1=14367&r2=14368
==============================================================================
--- trunk/src/app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java (original)
+++ trunk/src/app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java 2008-04-16 00:41:00-0700
@@ -37,7 +37,7 @@
import org.argouml.notation.NotationProvider;
import org.argouml.notation.NotationProviderFactory2;
import org.argouml.uml.diagram.state.ui.FigStateVertex;
-import org.argouml.uml.diagram.ui.FigMultiLineText;
+import org.argouml.uml.diagram.ui.FigMultiLineTextWithBold;
import org.tigris.gef.graph.GraphModel;
import org.tigris.gef.presentation.FigRRect;
import org.tigris.gef.presentation.FigText;
@@ -79,7 +79,8 @@
cover.setCornerRadius(getHeight() / 2);
// overrule the single-line namefig created by the parent
- setNameFig(new FigMultiLineText(10 + PADDING, 10, 90 - PADDING * 2, 25,
+ setNameFig(new FigMultiLineTextWithBold(10 + PADDING, 10,
+ 90 - PADDING * 2, 25,
true));
getNameFig().setText(placeString());
getNameFig().setBotMargin(7); // make space for the clarifier
Added: trunk/src/app/src/org/argouml/uml/diagram/ui/FigMultiLineTextWithBold.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/app/src/org/argouml/uml/diagram/ui/FigMultiLineTextWithBold.java?view=auto&rev=14368
==============================================================================
--- (empty file)
+++ trunk/src/app/src/org/argouml/uml/diagram/ui/FigMultiLineTextWithBold.java 2008-04-16 00:41:00-0700
@@ -0,0 +1,67 @@
+// $Id$
+// Copyright (c) 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
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.uml.diagram.ui;
+
+import java.awt.Font;
+
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectSettings;
+
+/**
+ * A FigMultiLineText that handles cases where the projectsettings
+ * indicate that the node name should be in bold. <p>
+ *
+ * Since this Fig follows the setting "Show name of NODES in bold font",
+ * it would be wise to use it for nodes only. See issue 5013.
+ *
+ * @author Michiel
+ */
+public class FigMultiLineTextWithBold extends FigMultiLineText {
+
+ /**
+ * @param x location x
+ * @param y location y
+ * @param w width
+ * @param h height
+ * @param expandOnly impacts behavior
+ */
+ public FigMultiLineTextWithBold(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;
+
+ return super.getFigFontStyle() | boldStyle;
+ }
+}
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.