Re: Dia contribution - system modelling sheets



larsrc raeder dk wrote:

Sounds good.  If you can send us the fixes in parts as you get them done
rather than one big chunk at the end, it'd be easier for all parts.

-Lars

Hello here is the first part of fixes addressing the following issues:
- Jackson shared/requirement phenomena  property selector is now working
- handler cannot resize smaller than the minimum size of the related item (goal, obstacle...)
- i* actor can be resized

I also removed the bold fonts but at this point I still don't give control for fine tuning properties such as font, line...) I plan to do this for a limited number of styles (such as font size or a global color)

The main issue about stability remains unfixed but I must have a deeper look at the code (probably wrt to evolution of the code I was relying on, mostly in UML and flowcharts sheets)

Let me know if the patch is correct (I checked it on a new copy but I am not very familiar
with diff-ing/patch-ing)

regards
christophe


Les sous-répertoires dia/objects/KAOS/CVS et dia-work/objects/KAOS/CVS sont identiques.
diff -uN dia/objects/KAOS/goal.c dia-work/objects/KAOS/goal.c
--- dia/objects/KAOS/goal.c     2004-06-17 22:22:05.000000000 +0200
+++ dia-work/objects/KAOS/goal.c        2004-06-20 23:09:58.000000000 +0200
@@ -523,7 +523,8 @@
 
   /* Update connections: */
   nw = elem->corner;
-  se = bottom_right;
+  se.x = nw.x+elem->width;
+  se.y = nw.y+elem->height;
   ne.x = se.x;
   ne.y = nw.y;
   sw.y = se.y;
@@ -653,7 +654,7 @@
   p.x += elem->width / 2.0;
   p.y += elem->height / 2.0 + DEFAULT_FONT / 2;
 
-  font = dia_font_new_from_style( DIA_FONT_SANS|DIA_FONT_BOLD , DEFAULT_FONT);
+  font = dia_font_new_from_style( DIA_FONT_SANS , DEFAULT_FONT);
 
   goal->text = new_text("", font,
                        DEFAULT_FONT, &p,
diff -uN dia/objects/KAOS/other.c dia-work/objects/KAOS/other.c
--- dia/objects/KAOS/other.c    2004-06-17 22:22:05.000000000 +0200
+++ dia-work/objects/KAOS/other.c       2004-06-20 19:36:43.000000000 +0200
@@ -73,7 +73,7 @@
 #define DEFAULT_BORDER 0.2
 #define DEFAULT_PADDING 0.4
 #define DEFAULT_FONT 0.7
-#define OTHER_LINE_SIMPLE_WIDTH 0.9
+#define OTHER_LINE_SIMPLE_WIDTH 0.09
 #define OTHER_LINE_DOUBLE_WIDTH 0.18
 #define OTHER_FG_COLOR color_black
 #define OTHER_BG_COLOR color_white
@@ -603,7 +603,7 @@
   p.x += elem->width / 2.0;
   p.y += elem->height / 2.0 + DEFAULT_FONT / 2;
 
-  font = dia_font_new_from_style( DIA_FONT_SANS|DIA_FONT_BOLD , DEFAULT_FONT);
+  font = dia_font_new_from_style( DIA_FONT_SANS , DEFAULT_FONT);
 
   other->text = new_text("", font,
                        DEFAULT_FONT, &p,
Les sous-répertoires dia/objects/KAOS/pixmaps et dia-work/objects/KAOS/pixmaps sont identiques.
diff -uN dia/objects/Istar/actor.c dia-work/objects/Istar/actor.c
--- dia/objects/Istar/actor.c   2004-06-17 22:22:05.000000000 +0200
+++ dia-work/objects/Istar/actor.c      2004-06-20 20:38:36.000000000 +0200
@@ -359,7 +359,7 @@
 
   Point center, bottom_right,p,c;
   real width, height, dw, dh;
-  real radius;
+  real radius, mradius;
   int i;
 
   center = bottom_right = elem->corner;
@@ -372,10 +372,17 @@
   width = actor->text->max_width+0.5;
   height = actor->text->height * (actor->text->numlines + 3); // added 3 blank lines for top
 
-  // enforce circle here
-  radius=width;
-  if (radius<height) radius=height;
-  if (radius<ACTOR_RADIUS) radius=ACTOR_RADIUS;
+  // minimal radius
+  mradius=width;
+  if (mradius<height) mradius=height;
+  if (mradius<ACTOR_RADIUS) mradius=ACTOR_RADIUS;
+  
+  // radius
+  radius=elem->width;
+  if (radius<elem->height) radius=elem->height;
+  
+  // enforce (minimal or resized) radius
+  if (radius<mradius) radius=mradius;
   elem->width=elem->height=radius;
 
   // move shape if necessary ... (untouched)
@@ -448,7 +455,7 @@
   elem->width = ACTOR_RADIUS;
   elem->height = ACTOR_RADIUS;
 
-  font = dia_font_new_from_style( DIA_FONT_SANS|DIA_FONT_BOLD , ACTOR_FONT);
+  font = dia_font_new_from_style( DIA_FONT_SANS, ACTOR_FONT);
 //  attributes_get_default_font(&font, &font_height);
   p = *startpoint;
   p.x += elem->width / 2.0;
Les sous-répertoires dia/objects/Istar/CVS et dia-work/objects/Istar/CVS sont identiques.
diff -uN dia/objects/Istar/goal.c dia-work/objects/Istar/goal.c
--- dia/objects/Istar/goal.c    2004-06-17 22:22:05.000000000 +0200
+++ dia-work/objects/Istar/goal.c       2004-06-20 23:07:42.000000000 +0200
@@ -440,7 +440,6 @@
     case SOFTGOAL: update_softgoal_connectors(c,p,w,h); break;
     case GOAL:     update_goal_connectors(c,p,w,h); break;
   }
-
 }
 
 static void update_softgoal_connectors(ConnectionPoint *c, Point p, double w, double h) {
@@ -524,7 +523,7 @@
   p.x += elem->width / 2.0;
   p.y += elem->height / 2.0 + DEFAULT_FONT / 2;
 
-  font = dia_font_new_from_style( DIA_FONT_SANS|DIA_FONT_BOLD , DEFAULT_FONT);
+  font = dia_font_new_from_style( DIA_FONT_SANS , DEFAULT_FONT);
 
   goal->text = new_text("", font,
                        DEFAULT_FONT, &p,
diff -uN dia/objects/Istar/other.c dia-work/objects/Istar/other.c
--- dia/objects/Istar/other.c   2004-06-17 22:22:05.000000000 +0200
+++ dia-work/objects/Istar/other.c      2004-06-20 22:14:54.000000000 +0200
@@ -419,7 +419,8 @@
 
   /* Update connections: */
   nw = elem->corner;
-  se = bottom_right;
+  se.x = nw.x + elem->width;
+  se.y = nw.y + elem->height;
   ne.x = se.x;
   ne.y = nw.y;
   sw.y = se.y;
@@ -549,7 +550,7 @@
   p.x += elem->width / 2.0;
   p.y += elem->height / 2.0 + DEFAULT_FONT / 2;
 
-  font = dia_font_new_from_style( DIA_FONT_SANS|DIA_FONT_BOLD , DEFAULT_FONT);
+  font = dia_font_new_from_style( DIA_FONT_SANS, DEFAULT_FONT);
 
   other->text = new_text("", font,
                        DEFAULT_FONT, &p,
Les sous-répertoires dia/objects/Istar/pixmaps et dia-work/objects/Istar/pixmaps sont identiques.
Les sous-répertoires dia/objects/Jackson/CVS et dia-work/objects/Jackson/CVS sont identiques.
diff -uN dia/objects/Jackson/domain.c dia-work/objects/Jackson/domain.c
--- dia/objects/Jackson/domain.c        2004-06-17 22:22:05.000000000 +0200
+++ dia-work/objects/Jackson/domain.c   2004-06-20 22:07:18.000000000 +0200
@@ -474,7 +474,8 @@
 
   /* Update connections: */
   nw = elem->corner;
-  se = bottom_right;
+  se.x = nw.x + elem->width;
+  se.y = nw.y + elem->height;
   ne.x = se.x;
   ne.y = nw.y;
   sw.y = se.y;
@@ -605,7 +606,7 @@
   p.x += (LEFT_SPACE +elem->width) / 2.0;
   p.y += elem->height / 2.0 + DEFAULT_FONT / 2;
 
-  font = dia_font_new_from_style( DIA_FONT_SANS|DIA_FONT_BOLD , DEFAULT_FONT);
+  font = dia_font_new_from_style( DIA_FONT_SANS, DEFAULT_FONT);
 
   box->text = new_text("", font,
                        DEFAULT_FONT, &p,
diff -uN dia/objects/Jackson/phenomenon.c dia-work/objects/Jackson/phenomenon.c
--- dia/objects/Jackson/phenomenon.c    2004-06-17 22:22:05.000000000 +0200
+++ dia-work/objects/Jackson/phenomenon.c       2004-06-20 21:29:21.000000000 +0200
@@ -150,7 +150,7 @@
 static PropOffset message_offsets[] = {
   CONNECTION_COMMON_PROPERTIES_OFFSETS,
   { "text", PROP_TYPE_STRING, offsetof(Message, text) },
-//  { "type", PROP_TYPE_ENUM, offsetof(Message, type) },
+  { "type", PROP_TYPE_ENUM, offsetof(Message, type) },
   { "text_pos", PROP_TYPE_POINT, offsetof(Message,text_pos) },
   { NULL, 0, 0 }
 };
@@ -166,7 +166,6 @@
 message_set_props(Message *message, GPtrArray *props)
 {
   if (message->init==-1) { message->init++; return; }
-
   object_set_props_from_offsets(&message->connection.object,
                                 message_offsets, props);
   message_update_data(message);
@@ -247,7 +246,7 @@
 message_draw(Message *message, DiaRenderer *renderer)
 {
   DiaRendererClass *renderer_ops = DIA_RENDERER_GET_CLASS (renderer);
-  Point *endpoints, p1, p2, px;
+  Point *endpoints, p1, p2;
   Arrow arrow;
   int n1 = 1, n2 = 0;
   gchar *mname = g_strdup(message->text);
@@ -317,13 +316,6 @@
   obj = &conn->object;
   extra = &conn->extra_spacing;
 
-  // init type
-  switch (GPOINTER_TO_INT(user_data)) {
-    case 1: message->type=MSG_SHARED; break;
-    case 2: message->type=MSG_REQ; break;
-    default: message->type=MSG_SHARED; break;
-  }
-
   obj->type = &jackson_phenomenon_type;
   obj->ops = &message_ops;
 
@@ -348,6 +340,13 @@
   *handle1 = obj->handles[0];
   *handle2 = obj->handles[1];
 
+  // init type
+  switch (GPOINTER_TO_INT(user_data)) {
+    case 1: message->type=MSG_SHARED; break;
+    case 2: message->type=MSG_REQ; break;
+    default: message->type=MSG_SHARED; break;
+  }
+    
   if (GPOINTER_TO_INT(user_data)!=0) message->init=-1; else message->init=0;
   return &message->connection.object;
 }
Les sous-répertoires dia/objects/Jackson/pixmaps et dia-work/objects/Jackson/pixmaps sont identiques.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]