Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » A node takes the width of its container
A node takes the width of its container [message #176568] Mon, 10 March 2008 19:05 Go to next message
Truong Ivan is currently offline Truong IvanFriend
Messages: 10
Registered: July 2009
Junior Member
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 #176962 is a reply to message #176568] Wed, 12 March 2008 18:38 Go to previous messageGo to next message
Eclipse UserFriend
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 #177595 is a reply to message #176962] Mon, 17 March 2008 10:43 Go to previous messageGo to next message
Truong Ivan is currently offline Truong IvanFriend
Messages: 10
Registered: July 2009
Junior Member
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 #177745 is a reply to message #177595] Mon, 17 March 2008 17:49 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Truong Ivan is currently offline Truong IvanFriend
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
Re: A node takes the width of its container [message #177838 is a reply to message #177745] Tue, 18 March 2008 12:42 Go to previous message
Eclipse UserFriend
Originally posted by: marsha.rohrer.swisscom.com

Hi Jan,

I have the same problem quite some time now, see
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg10893.html.

I tried what you suggest but I don't get the behaviour you descripe.

A picture of my graphical definition may be found here:
http://www.tschaedi.ch/pictures/gmfgraph.png. The figure that results is
shown here: http://www.tschaedi.ch/pictures/figure.png

The StepBodyFigure which is colored in red (just for making explanations
easier) should be filled with the ActivityFigure that is contained in it.
If the StepFigure is resized, also the ActivityFigure should be resized to
fill the compartment again. The StepPropertyFigure is not of interest here.

Can anyone tell me what I'm doing wrong?

Thanks a lot,
Marsha
Previous Topic:preference page and gmfgen
Next Topic:model entities w/o graphical representation
Goto Forum:
  


Current Time: Thu Sep 19 15:17:00 GMT 2024

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

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

Back to the top