Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to layout and repaint all EditParts?
How to layout and repaint all EditParts? [message #233766] Wed, 02 May 2007 11:02
Eclipse UserFriend
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?
Previous Topic:Draw2D Transparency
Next Topic:"Unhandled event loop exception" when using custom dll with GEF Prj
Goto Forum:
  


Current Time: Tue Apr 23 11:43:28 GMT 2024

Powered by FUDForum. Page generated in 0.02933 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top