Re: UML: use case diagrams: actors and connection points
From: Lars Clausen <lrclause cs uiuc edu>
To: dia-list gnome org
Subject: Re: UML: use case diagrams: actors and connection points
Date: 09 Feb 2002 15:36:39 -0600
On Sat, 9 Feb 2002, Neil Zanella wrote:
>
> Hello,
>
> There are some problems when specifying generalization relationships
> among use case diagram actors in dia. Such relationships are described
> in The Unified Modeling Language User Guide by Grady Booch, James
> Rumbaugh, and Ivar Jacobson. The problem is that the label used
> to describe the role of a stick figure is below the connection
> points pertaining to that figure. Thus the hollow triangle of
> the arrow representing the generalizing relationship overlaps
> with the text which makes the text hard to read even when the
> arrow is Sent to Back. It would be nice if the connection points
> were below the text. This is how they are used in the book.
I see the problem, fortunately the solution is not far away. Of course
making this change will momentarily mess up saved diagrams. Apply the
patch below, or get the new CVS version tomorrow (when the mirrors have
updated).
-Lars
Index: objects/UML/actor.c
===================================================================
RCS file: /cvs/gnome/dia/objects/UML/actor.c,v
retrieving revision 1.23
diff -u -r1.23 actor.c
--- objects/UML/actor.c 2002/01/30 11:05:35 1.23
+++ objects/UML/actor.c 2002/02/09 21:34:08
@@ -264,7 +264,7 @@
Point p;
elem->width = ACTOR_WIDTH + ACTOR_MARGIN_X;
- elem->height = ACTOR_HEIGHT;
+ elem->height = ACTOR_HEIGHT+actor->text->height;
/* Update connections: */
actor->connections[0].pos.x = elem->corner.x;
@@ -288,7 +288,7 @@
p = elem->corner;
p.x += elem->width/2;
- p.y += ACTOR_HEIGHT + actor->text->height;
+ p.y += ACTOR_HEIGHT + actor->text->ascent;
text_set_position(actor->text, &p);
/* Add bounding box for text: */
--
Lars Clausen (http://shasta.cs.uiuc.edu/~lrclause)| Hårdgrim of Numenor
"I do not agree with a word that you say, but I |----------------------------
will defend to the death your right to say it." | Where are we going, and
--Evelyn Beatrice Hall paraphrasing Voltaire | what's with the handbasket?