Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » adjusting a layout
adjusting a layout [message #150512] Sat, 11 September 2004 18:59
Eclipse UserFriend
Originally posted by: dag.s.rende.se

I have written a planning application where the user can manually place
boxes. Sometimes the user opens a file where some boxes have no position
information. Here I want the editor to automatically place these boxes
using a simple algorithm.

My question is, where should i put the code that can use the layout made by
the layout manager and complete it. Is there some listener I can put that
tells when the layout managers have done their work after opening the input
file.
Or can I call some validate method myself after inputting the file, and then
do the layout fixup? (in this case, what should i call and where)

I was tempted to fix this in one of my layout managers, but it doesn't feel
right to change the model from there (to save the coords in the box model
objects).

Best Regards,
Dag Rende
Re: adjusting a layout [message #150544 is a reply to message #150512] Sat, 11 September 2004 16:53 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
This does not quite qualify as a change to the model. You are merely
assuming default values for where there were none specified. You cannot
undo/redo such changes. So, I think it's not all that bad to subclass the
LayoutManager and put your algorithm in the layout() method.

Alternatively, you could do a sweep when the model is loaded (in your
Editor's setInput() method) to check for missing locations and they provide
defaults for them. If your algorithm is truly simple, the model objects
themselves, upon initialization, might be able to choose meaningful defaults
(perhaps via a static variable).

--

Pratik Shah
"Dag Rende" <dag.s@rende.se> wrote in message
news:cht041$rlc$1@eclipse.org...
> I have written a planning application where the user can manually place
> boxes. Sometimes the user opens a file where some boxes have no position
> information. Here I want the editor to automatically place these boxes
> using a simple algorithm.
>
> My question is, where should i put the code that can use the layout made
by
> the layout manager and complete it. Is there some listener I can put that
> tells when the layout managers have done their work after opening the
input
> file.
> Or can I call some validate method myself after inputting the file, and
then
> do the layout fixup? (in this case, what should i call and where)
>
> I was tempted to fix this in one of my layout managers, but it doesn't
feel
> right to change the model from there (to save the coords in the box model
> objects).
>
> Best Regards,
> Dag Rende
Previous Topic:WSDL VIEWER
Next Topic:UPDATE : Model-View-Controller Question
Goto Forum:
  


Current Time: Tue Sep 24 09:46:14 GMT 2024

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

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

Back to the top