Show graphical classview modification proposal

p_george p_george at club-internet.fr
Fri Oct 1 22:10:06 BST 1999


The popup window 'show graphical classview' does not show enough of the
code structure IMHO.

Is there any plan to make it look closer to UML standard ?

I propose the following (very small & esthetic) change in kdevelop 1.0
beta 3, wich will draw a small triangle pointing to a parent's class. I
think it would be worth now to draw a diamond-shaped widget to show the
aggregation link (an object embedded in another).

in file gfxview/GfxClassTree.cpp 
--------------------------------
in function

           void CGfxClassTree::drawConnection(CGfxClassBox *abox)

just change the following code :

// Else draw up to parent 
  else {
/* REMOVED ::    p.lineTo(abox->x() + CONN_CHILD_DELTA_STOPX,
	     abox->m_parent->y() + CLASSBOXHEIGHT); */
// ADDED BEGIN  	
    const int CONN_ARROW_H = 6;
    const int CONN_ARROW_W = 4;

    p.lineTo(abox->x() + CONN_CHILD_DELTA_STOPX, abox->m_parent->y() +
CONN_ARROW_H + CLASSBOXHEIGHT);
    p.drawLine(abox->x() + CONN_CHILD_DELTA_STOPX - CONN_ARROW_W,
abox->m_parent->y() + CONN_ARROW_H + CLASSBOXHEIGHT,
               abox->x() + CONN_CHILD_DELTA_STOPX + CONN_ARROW_W,
abox->m_parent->y() + CONN_ARROW_H + CLASSBOXHEIGHT);
    p.drawLine(abox->x() + CONN_CHILD_DELTA_STOPX - CONN_ARROW_W,
abox->m_parent->y() + CONN_ARROW_H + CLASSBOXHEIGHT,
               abox->x() + CONN_CHILD_DELTA_STOPX, abox->m_parent->y() +
CLASSBOXHEIGHT);
    p.drawLine(abox->x() + CONN_CHILD_DELTA_STOPX + CONN_ARROW_W,
abox->m_parent->y() + CONN_ARROW_H + CLASSBOXHEIGHT,
               abox->x() + CONN_CHILD_DELTA_STOPX, abox->m_parent->y() +
CLASSBOXHEIGHT);
    }
// ADDED END  	

  p.end();
}




More information about the KDevelop mailing list