|
Re: A node takes the width of its container [message #176962 is a reply to message #176568] |
Wed, 12 March 2008 18:38 |
Eclipse User |
|
|
|
Originally posted by: jan.koehnlein.web.de
To match the width of the container use a FlowLayout vertical=true and
fillMinorSize=true.
To match both directions, you can define your own custom layout. Look at
the generated layout for the first solution and modify it accoringl, e.g.
public class CustomLayout extends ConstrainedToolbarLayout {
public CustomLayout() {
setStretchMinorAxis(true);
setStretchMajorAxis(true);
setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
setSpacing(3);
setVertical(true);
}
}
Regards
Jan
Ivan Truong wrote:
> Hello again,
>
> I would like to put one Node in a container.
> I wish to know if it's possible to have this node fitting perfectly the
> width of its container.
>
> I'm facing 2 problems.
> - The first one is to have the width changing when the father's one
> changing.
> - The second one is that when the node width is near from its container,
> the XXXContainmentEditPart is creating some space on the borders and
> adds a scrollbar.
> How is it possible to disable this feature?
>
> Thank you for any help.
> Ivan
>
|
|
|
|
Re: A node takes the width of its container [message #177745 is a reply to message #177595] |
Mon, 17 March 2008 17:49 |
Eclipse User |
|
|
|
Originally posted by: jan.koehnlein.web.de
Ivan-
what do you mean by "add anything back in the container"?
I'd suggest you put a FlowLayout on the container with
Force Single Line = true
Major Alignment = BEGINNING
Major Spacing = 0
Match minor size = true
Minor Alignment = CENTER
Minor Spacing = 0
Vertical = true
This should cause the children of the container to be arranged
vertically (vertical, single line), starting from the top (Major
Alignment) of the container with no space vertically between them (Major
Spacing) nor left or right (Minor Spacing), and each taking the full
width of the container (Match Minor Size).
-Jan
Ivan Truong wrote:
> Hello Jan,
>
> Thank you for the answer and sorry for the late reply.
>
> I tried what you suggested me.
> I added a Flow Layout in the container figure and used
>
> Force single Line = false
> Major Alignment = BEGINNING
> MAJOR Spacing = 5
> Match minor size = false
> Minor Alignment = CENTER
> Minor Spacing = 0
> Vertical = true.
>
> The problem is that I can add anything back in the container.
>
> What did I wrong?
>
> Thank you for your help.
> Ivan
>
|
|
|
Re: A node takes the width of its container [message #177814 is a reply to message #177745] |
Tue, 18 March 2008 09:39 |
Truong Ivan Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Hello Jan,
Thanks again for your reply.
I wanted to say that after we added a flowLayout on the container,
it doesn't accept anymore any children.
For instance, after I select from the palette the children and put the
mouse cursor on the compartment bounds, it's impossible to click and add
this children inside.
As I feel I don't have the right behavior, maybe will you need some file
or code snippets where I can reproduce it ?
Thanks,
Ivan
Jan Köhnlein wrote:
> Ivan-
> what do you mean by "add anything back in the container"?
> I'd suggest you put a FlowLayout on the container with
> Force Single Line = true
> Major Alignment = BEGINNING
> Major Spacing = 0
> Match minor size = true
> Minor Alignment = CENTER
> Minor Spacing = 0
> Vertical = true
> This should cause the children of the container to be arranged
> vertically (vertical, single line), starting from the top (Major
> Alignment) of the container with no space vertically between them (Major
> Spacing) nor left or right (Minor Spacing), and each taking the full
> width of the container (Match Minor Size).
> -Jan
|
|
|
|
Powered by
FUDForum. Page generated in 0.03621 seconds