Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef-dev] Problems with layout

Hello,
I'm writing simple application using gef and draw2d (version 3.0), displaying simplified UML class diagram. I have diagram figure (using FlowLayout for lines wrapping), which contains hierarchy figures (one for each inheritance hierarchy, each using DirectedGraphLayout). I added some functionality for changing fonts, and my layout works no more (after changing font). I update layout very simple, every field or method in a EditPart representing a type is separate EditPart, it listens for properties change, and change font (while changing font, revalidate() is called in standard Figure class). In hierarchy figure, I use overrided setBounds(). I got it from gef flow example, from class ActivityDiagramPart (anonymous Figure in this class). It differs from standard method in Figure with only this part:
New setBounds():
if (resize || translate) {
 fireMoved();
 repaint();
}
Standard:
if (resize)
 invalidate();
if (resize || translate) {
 fireMoved();
 repaint();
}
When I use standard method, graph displays from the beginning bad (the same like after changing font - Hierarchies' client areas are in different places than child figures). Is this some problem with revalidate()? Any help would be appreciated!!! I'm new to this stuff :(


Back to the top