Re: dia uml hsm statechart shape

Hi Hans,

sorry for the late answer, I am not subscribed to the dia-list. The
reason for hsms->redraw_parent is: if you update the HsmState, it can
be that the new size of the diagram extends that of the parent
HsmState. In this case I update the parent shape by calling the
MoveHandle method of it, but I have to ensure that it will be redrawn,
too. I cannot find a solution for this in the API, so I use the
following "hack": in the hsmstate_update_data I set the bounding box
(temporarily) to the size of the BB of the parent. In the
hsmstate_draw method the boundingbox will be updated to the "normal"
bounding box, as hopefully the parent is already refreshed.

If you want to see a working example, try this with HsmState and

Create a (small) parent shape. Put a child state inside this shape.
Now edit the name of the child shape: use a long name. In case of
LargePackage the child shape has an invalid position: it is not inside
the parent. If you try to move it, you can see strange behaviour. In
case of HsmState, the parent is automatically enlarged, and everything
is OK.

Best Regards,


At 13.05.2009 09:50, Matyas Forstner wrote:

    Hi dia-team,

    here is a patch that adds a new shape to the UML sheet: this is the
    HSM State usable to draw the states of a hierarchical state machine.
    Please let me know whether you can use it.

Finally I got around to look at your patch and it is (almost;)) included.
The one thing which stoppedme is some code you added by I don't understand,
namely everything which is in
        if (hsms->redraw_parent) {}

What problem is it supposed to solve, or better: why don't you just
update the bounding box in *_update_data() as in other shape


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