Skip to main content



      Home
Home » Eclipse Projects » GEF » Problems with ToolbarLayout
Problems with ToolbarLayout [message #142114] Wed, 07 July 2004 15:57 Go to next message
Eclipse UserFriend
Originally posted by: News.Karsten-Becker.de

Hi,
I don't know why, but it seems LayoutManagers hate me...
If you take a look at this it is easier to explain:
http://www.karsten-becker.de/Layout.png

I use tow Figures. The topFigure with a ToolbarLayout that is vertically
aligned and contains the RectangleFigure with the Label and:
The subFigure that has a ToolbarLayout too, but is Horizontally aligned.
So in my Picture Amplifier,Blubber and Blubber2 are contained in the
subFigure, while the MixerLabel and subFigure are contained in topFigure.

Is there any better way to create such a layout for example with FlowLayout?

So, now to my questions. Why does the toolbarLayout doesn't calculate
the correct needed Size?
I mean, the Label is contained in a Rectangle that initally has a
..setSize(100,25). So I would expect the LayoutManager to calculate a
Minimum size of 300x100 for the MixerPart.
But he shrinks it to a completly useless size.

And I got some understanding Problems with the FlowLayoutPolicy. How do
I reorder the Child? I mean If i got my Part I can get the Children of
it with getChildren. If i remove and make a add(index,child), this is
not reflected in visual. Do i have to do anything else?

Thanks in advance,
Karsten
Re: Problems with ToolbarLayout [message #142120 is a reply to message #142114] Wed, 07 July 2004 17:46 Go to previous message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Hello,

> And I got some understanding Problems with the FlowLayoutPolicy. How d=
o =

> I reorder the Child? I mean If i got my Part I can get the Children of=
=

> it with getChildren. If i remove and make a add(index,child), this is =
=

> not reflected in visual. Do i have to do anything else?

I may be wrong but if you remove a child EditPart and then add it =

elsewhere with add(index,child), the next time the refreshChildren metho=
d =

will be called, the order will be the same as before because the =

refreshChildren method orders the children EditParts as their model =

objects are ordered in the List returned by the getModelChildren method.=
=

So you should not do it like that. But if you don't call the =

refreshchildren method, the change should be visually apparent at least =
=

before the next call to refreshchildren, so I/you must be missing =

something else...I don't know...

Anyway, I think what you should do is reordering the list of the *model*=
=

children of the parent EditPart, in your model, with a Command. This =

should fire events, catched by the parent EditPart (you have to implemen=
t =

this notification mechanism by yourself), and you should react to these =
=

events by calling the this.refreshChildren() method (or remove/addchild =
=

instead, for efficiency purpose, if it is needed). This should trigger a=
n =

update of the children editparts order and of their figures as well.



For the layout problem, I don't know. Usually if ToolbarLayout shrinks a=
=

Figure too much it is because its minimum size is too small. Maybe if yo=
u =

post a picture of what you would like to have (made with Paint...), alon=
g =

with the one showing what you have by now, it would help people to help =
=

you.

good luck,

r=E9gis
Previous Topic:Reference article not accessible from gef home page ?
Next Topic:how to implement a simple uml editor?
Goto Forum:
  


Current Time: Tue Sep 16 19:20:23 EDT 2025

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

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

Back to the top