How to layout and repaint all EditParts? [message #233766] |
Wed, 02 May 2007 11:02 |
Eclipse User |
|
|
|
Originally posted by: l8storm.arcor.de
Hi,
what is the simplest way to force GEF to relayout all EditPart's figures? I had something like
((ScalableRootEditPart) getRoot()).getFigure().invalidateTree();
((ScalableRootEditPart) getRoot()).getFigure().validate();
but this did not work. My model is displayed correctly when initially displaying the editor, even if I expand a figure the layout is correct. But if I want to shrink that figure back to its original size, the surrounding figures are not updated correctly. See also the attached images.
Here is a snippet of what I am doing:
IFigure contentPane;
IFigure shrinkedFigure = new SmallFigure();
IFigure expandedFigure = new BigFigure();
boolean isExpanded = false;
refreshVisuals() {
contentPane.removeAll();
if (isExpanded)
contentPane.add(expandedFigure);
else
contentPane.add(shrinkedFigure);
// this did not work
contentPane.validate();
// this did not work, too
((ScalableRootEditPart) getRoot()).getFigure().invalidateTree();
((ScalableRootEditPart) getRoot()).getFigure().validate();
}
The first and easiest step therefore would be to relayout all edit parts. But how?
|
|
|
Powered by
FUDForum. Page generated in 0.02933 seconds