|
Re: getBounds() within a GEF diagram [message #195674 is a reply to message #195666] |
Mon, 12 September 2005 20:50 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
getBounds() is returning the current bounds. getContraint() is returning
the bounds that the figure will be once the layout manager gets a chance to
lay the child out.
"Nick Allen" <nwa@bitwiser.org> wrote in message
news:dg4lm4$af$1@news.eclipse.org...
> I have a figure drawn in a GEF diagram using FreeflowLayout.
> IFigure.getBounds() seems to always return Rectangle(0,0,0,0). When I
> use an alternative approach to get the bounds through the layout manager
> I receive the correct bounds
> (IFigure.getParent().getLayoutManager().getConstraint(figure )). Why the
> discrepency?
>
> Thanks,
> Nick
|
|
|
|
Re: getBounds() within a GEF diagram [message #195774 is a reply to message #195695] |
Tue, 13 September 2005 15:31 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
If you have a LWS, then try invoking
figure.getUpdateManager().performUpdate(). Otherwise you can make the root
figure layout on your own by invoking figure.valdiate().
"Nick Allen" <nwa@bitwiser.org> wrote in message
news:dg57ss$n2e$1@news.eclipse.org...
> The problem I am trying to solve has arisen from my unit testing. One
> test aims to determine whether I am able to set the location of a model
> element.
>
> In my test case, I add the model to the diagram via a command, which I
> then execute on the command stack. I can see that a property-change
> event is being propagated from my model to its EditPart and that the
> model is being updated properly. I then check to make sure that the
> figure's location has been updated. Calling getBounds() on the Figure
> returns the default value of (0,0,0,0). I can see from my debugger that
> the layout manager is never calling Figure.setBounds(...).
>
> When I run the plugin manually everything works fine. The layout
> manager does call Figure.setBounds(...) and Figure.getBounds() returns a
> correct value.
>
> What else do I need to add to my unit tests to ensure that the layout
> manager's layout() method is called so that subsequently my figure's
> setBounds method is called?
>
> Any help is appreciated.
|
|
|
|
Re: getBounds() within a GEF diagram [message #195872 is a reply to message #195815] |
Tue, 13 September 2005 22:00 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
You can also call EditPartViewer.flush()
"Nick Allen" <nwa@bitwiser.org> wrote in message
news:dg6ueq$cg4$1@news.eclipse.org...
> Pratik Shah wrote:
>> If you have a LWS, then try invoking
>> figure.getUpdateManager().performUpdate(). Otherwise you can make the
>> root
>> figure layout on your own by invoking figure.valdiate().
>
> That does the trick. Thanks for your help, Pratik.
|
|
|
Powered by
FUDForum. Page generated in 0.03487 seconds