Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Auto-size for nodes on a compartment with list layout
Auto-size for nodes on a compartment with list layout [message #65165] Wed, 18 October 2006 09:08 Go to next message
Eclipse UserFriend
Hi everybody,
i've got a problem with list layout. i have a node inside a compartment
(A), that is a compartment itself.

---------
-.......-
-. A .-
-.......-
- -
---------

Im able to insert more nodes on the major compartment (now with A and B)
---------
-.......-
-. A .-
-.......-
-.......-
-. B .-
-.......-
- -
---------

im using list layout to put those. But my problem is that i cant resize
them. I mean, when i insert nodes on A and B (like A.1, A.2 and B.1) i
would like them to resize automatically. Which i cant realize how to do.

---------
-.......-
-. A.1 .- <-this is the compartment A
-. A.2 .-
-.......-
-.......-
-. B.2 .- <-this is the compartment B
-.......-
- -
---------

I have a figure that explain better the whole thing ->
http://www.projetos.dee.ufba.br/eln/chrome/site/list_layout. png

I hope i was clear enough, im desperate for help =)
Thanks!
Ugo
Re: Auto-size for nodes on a compartment with list layout [message #66353 is a reply to message #65165] Fri, 20 October 2006 08:01 Go to previous messageGo to next message
Eclipse UserFriend
List compartments are not suited for resizable and not-equally sized items.


Artem

"Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
news:eh590i$c4c$1@utils.eclipse.org...
> Hi everybody,
> i've got a problem with list layout. i have a node inside a compartment
> (A), that is a compartment itself.
>
> ---------
> -.......-
> -. A .-
> -.......-
> - -
> ---------
>
> Im able to insert more nodes on the major compartment (now with A and B)
> ---------
> -.......-
> -. A .-
> -.......-
> -.......-
> -. B .-
> -.......-
> - -
> ---------
>
> im using list layout to put those. But my problem is that i cant resize
> them. I mean, when i insert nodes on A and B (like A.1, A.2 and B.1) i
> would like them to resize automatically. Which i cant realize how to do.
>
> ---------
> -.......-
> -. A.1 .- <-this is the compartment A
> -. A.2 .-
> -.......-
> -.......-
> -. B.2 .- <-this is the compartment B
> -.......-
> - -
> ---------
>
> I have a figure that explain better the whole thing ->
> http://www.projetos.dee.ufba.br/eln/chrome/site/list_layout. png
>
> I hope i was clear enough, im desperate for help =)
> Thanks!
> Ugo
Re: Auto-size for nodes on a compartment with list layout [message #66371 is a reply to message #66353] Fri, 20 October 2006 08:24 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Artem,
in that case there are some way i could place the compartment nodes as
kind of "non-floating" objects?
Because im just using list layout so i can get this behavior.
Thanks for your help
Ugo

Artem Tikhomirov wrote:
> List compartments are not suited for resizable and not-equally sized items.
>
>
> Artem
>
> "Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
> news:eh590i$c4c$1@utils.eclipse.org...
>> Hi everybody,
>> i've got a problem with list layout. i have a node inside a compartment
>> (A), that is a compartment itself.
>>
>> ---------
>> -.......-
>> -. A .-
>> -.......-
>> - -
>> ---------
>>
>> Im able to insert more nodes on the major compartment (now with A and B)
>> ---------
>> -.......-
>> -. A .-
>> -.......-
>> -.......-
>> -. B .-
>> -.......-
>> - -
>> ---------
>>
>> im using list layout to put those. But my problem is that i cant resize
>> them. I mean, when i insert nodes on A and B (like A.1, A.2 and B.1) i
>> would like them to resize automatically. Which i cant realize how to do.
>>
>> ---------
>> -.......-
>> -. A.1 .- <-this is the compartment A
>> -. A.2 .-
>> -.......-
>> -.......-
>> -. B.2 .- <-this is the compartment B
>> -.......-
>> - -
>> ---------
>>
>> I have a figure that explain better the whole thing ->
>> http://www.projetos.dee.ufba.br/eln/chrome/site/list_layout. png
>>
>> I hope i was clear enough, im desperate for help =)
>> Thanks!
>> Ugo
>
>
Re: Auto-size for nodes on a compartment with list layout [message #66382 is a reply to message #66371] Fri, 20 October 2006 08:48 Go to previous messageGo to next message
Eclipse UserFriend
I'd start with different layouts in NodeEditPart#setupContentPane to figure
out which one suits you most. Perhaps, you'll need to write a custom one ;)?

Artem

"Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
news:ehaf56$ln6$1@utils.eclipse.org...
> Thanks Artem,
> in that case there are some way i could place the compartment nodes as
> kind of "non-floating" objects?
> Because im just using list layout so i can get this behavior.
> Thanks for your help
> Ugo
>
> Artem Tikhomirov wrote:
>> List compartments are not suited for resizable and not-equally sized
>> items.
>>
>>
>> Artem
>>
>> "Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
>> news:eh590i$c4c$1@utils.eclipse.org...
>>> Hi everybody,
>>> i've got a problem with list layout. i have a node inside a compartment
>>> (A), that is a compartment itself.
>>>
>>> ---------
>>> -.......-
>>> -. A .-
>>> -.......-
>>> - -
>>> ---------
>>>
>>> Im able to insert more nodes on the major compartment (now with A and B)
>>> ---------
>>> -.......-
>>> -. A .-
>>> -.......-
>>> -.......-
>>> -. B .-
>>> -.......-
>>> - -
>>> ---------
>>>
>>> im using list layout to put those. But my problem is that i cant resize
>>> them. I mean, when i insert nodes on A and B (like A.1, A.2 and B.1) i
>>> would like them to resize automatically. Which i cant realize how to do.
>>>
>>> ---------
>>> -.......-
>>> -. A.1 .- <-this is the compartment A
>>> -. A.2 .-
>>> -.......-
>>> -.......-
>>> -. B.2 .- <-this is the compartment B
>>> -.......-
>>> - -
>>> ---------
>>>
>>> I have a figure that explain better the whole thing ->
>>> http://www.projetos.dee.ufba.br/eln/chrome/site/list_layout. png
>>>
>>> I hope i was clear enough, im desperate for help =)
>>> Thanks!
>>> Ugo
>>
Re: Auto-size for nodes on a compartment with list layout [message #66634 is a reply to message #66382] Fri, 20 October 2006 15:37 Go to previous messageGo to next message
Eclipse UserFriend
Hi Artem,
I tried everything, even extending FlowLayout, but it didnt worked out.
I just want the nodes to stand fixed at the upper left corner, just like
the ListLayout(which i couldnt find to extend), but with variable size.

i drawed here:
http://www.projetos.dee.ufba.br/eln/chrome/site/hiperioncad_ problem.png

can i extend the ListLayout and count how much nodes exists in the
mini-compartments so i can resize them? is that possible?

Please give me some directions on this, im lost!
i really appreciate your help

Ugo


Artem Tikhomirov wrote:
> I'd start with different layouts in NodeEditPart#setupContentPane to figure
> out which one suits you most. Perhaps, you'll need to write a custom one ;)?
>
> Artem
>
> "Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
> news:ehaf56$ln6$1@utils.eclipse.org...
>> Thanks Artem,
>> in that case there are some way i could place the compartment nodes as
>> kind of "non-floating" objects?
>> Because im just using list layout so i can get this behavior.
>> Thanks for your help
>> Ugo
>>
>> Artem Tikhomirov wrote:
>>> List compartments are not suited for resizable and not-equally sized
>>> items.
>>>
>>>
>>> Artem
>>>
>>> "Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
>>> news:eh590i$c4c$1@utils.eclipse.org...
>>>> Hi everybody,
>>>> i've got a problem with list layout. i have a node inside a compartment
>>>> (A), that is a compartment itself.
>>>>
>>>> ---------
>>>> -.......-
>>>> -. A .-
>>>> -.......-
>>>> - -
>>>> ---------
>>>>
>>>> Im able to insert more nodes on the major compartment (now with A and B)
>>>> ---------
>>>> -.......-
>>>> -. A .-
>>>> -.......-
>>>> -.......-
>>>> -. B .-
>>>> -.......-
>>>> - -
>>>> ---------
>>>>
>>>> im using list layout to put those. But my problem is that i cant resize
>>>> them. I mean, when i insert nodes on A and B (like A.1, A.2 and B.1) i
>>>> would like them to resize automatically. Which i cant realize how to do.
>>>>
>>>> ---------
>>>> -.......-
>>>> -. A.1 .- <-this is the compartment A
>>>> -. A.2 .-
>>>> -.......-
>>>> -.......-
>>>> -. B.2 .- <-this is the compartment B
>>>> -.......-
>>>> - -
>>>> ---------
>>>>
>>>> I have a figure that explain better the whole thing ->
>>>> http://www.projetos.dee.ufba.br/eln/chrome/site/list_layout. png
>>>>
>>>> I hope i was clear enough, im desperate for help =)
>>>> Thanks!
>>>> Ugo
>
Re: Auto-size for nodes on a compartment with list layout [message #67638 is a reply to message #66634] Mon, 23 October 2006 06:45 Go to previous messageGo to next message
Eclipse UserFriend
You may try to use Grid Layout (check
https://bugs.eclipse.org/bugs/show_bug.cgi?id=133279 for details), though
it's not part of GMF yet.

Artem

"Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
news:ehb8h7$htm$1@utils.eclipse.org...
> Hi Artem,
> I tried everything, even extending FlowLayout, but it didnt worked out. I
> just want the nodes to stand fixed at the upper left corner, just like the
> ListLayout(which i couldnt find to extend), but with variable size.
>
> i drawed here:
> http://www.projetos.dee.ufba.br/eln/chrome/site/hiperioncad_ problem.png
>
> can i extend the ListLayout and count how much nodes exists in the
> mini-compartments so i can resize them? is that possible?
>
> Please give me some directions on this, im lost!
> i really appreciate your help
>
> Ugo
>
>
> Artem Tikhomirov wrote:
>> I'd start with different layouts in NodeEditPart#setupContentPane to
>> figure out which one suits you most. Perhaps, you'll need to write a
>> custom one ;)?
>>
>> Artem
>>
>> "Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
>> news:ehaf56$ln6$1@utils.eclipse.org...
>>> Thanks Artem,
>>> in that case there are some way i could place the compartment nodes as
>>> kind of "non-floating" objects?
>>> Because im just using list layout so i can get this behavior.
>>> Thanks for your help
>>> Ugo
>>>
>>> Artem Tikhomirov wrote:
>>>> List compartments are not suited for resizable and not-equally sized
>>>> items.
>>>>
>>>>
>>>> Artem
>>>>
>>>> "Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
>>>> news:eh590i$c4c$1@utils.eclipse.org...
>>>>> Hi everybody,
>>>>> i've got a problem with list layout. i have a node inside a
>>>>> compartment (A), that is a compartment itself.
>>>>>
>>>>> ---------
>>>>> -.......-
>>>>> -. A .-
>>>>> -.......-
>>>>> - -
>>>>> ---------
>>>>>
>>>>> Im able to insert more nodes on the major compartment (now with A and
>>>>> B)
>>>>> ---------
>>>>> -.......-
>>>>> -. A .-
>>>>> -.......-
>>>>> -.......-
>>>>> -. B .-
>>>>> -.......-
>>>>> - -
>>>>> ---------
>>>>>
>>>>> im using list layout to put those. But my problem is that i cant
>>>>> resize them. I mean, when i insert nodes on A and B (like A.1, A.2 and
>>>>> B.1) i would like them to resize automatically. Which i cant realize
>>>>> how to do.
>>>>>
>>>>> ---------
>>>>> -.......-
>>>>> -. A.1 .- <-this is the compartment A
>>>>> -. A.2 .-
>>>>> -.......-
>>>>> -.......-
>>>>> -. B.2 .- <-this is the compartment B
>>>>> -.......-
>>>>> - -
>>>>> ---------
>>>>>
>>>>> I have a figure that explain better the whole thing ->
>>>>> http://www.projetos.dee.ufba.br/eln/chrome/site/list_layout. png
>>>>>
>>>>> I hope i was clear enough, im desperate for help =)
>>>>> Thanks!
>>>>> Ugo
>>
Re: Auto-size for nodes on a compartment with list layout [message #67842 is a reply to message #67638] Mon, 23 October 2006 10:05 Go to previous messageGo to next message
Eclipse UserFriend
Artem,
actually there are GridLayout on gmfmap, but it seems to have no effect
at all (the nodes are still loose, as they can be dragged around).
I downloaded the GridLayout and GridLayoutData, but i dont know exactly
how to apply it to the compartment.. can you point me some directions?
Thank you!

Artem Tikhomirov wrote:
> You may try to use Grid Layout (check
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=133279 for details), though
> it's not part of GMF yet.
>
> Artem
>
> "Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
> news:ehb8h7$htm$1@utils.eclipse.org...
>> Hi Artem,
>> I tried everything, even extending FlowLayout, but it didnt worked out. I
>> just want the nodes to stand fixed at the upper left corner, just like the
>> ListLayout(which i couldnt find to extend), but with variable size.
>>
>> i drawed here:
>> http://www.projetos.dee.ufba.br/eln/chrome/site/hiperioncad_ problem.png
>>
>> can i extend the ListLayout and count how much nodes exists in the
>> mini-compartments so i can resize them? is that possible?
>>
>> Please give me some directions on this, im lost!
>> i really appreciate your help
>>
>> Ugo
>>
>>
>> Artem Tikhomirov wrote:
>>> I'd start with different layouts in NodeEditPart#setupContentPane to
>>> figure out which one suits you most. Perhaps, you'll need to write a
>>> custom one ;)?
>>>
>>> Artem
>>>
>>> "Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
>>> news:ehaf56$ln6$1@utils.eclipse.org...
>>>> Thanks Artem,
>>>> in that case there are some way i could place the compartment nodes as
>>>> kind of "non-floating" objects?
>>>> Because im just using list layout so i can get this behavior.
>>>> Thanks for your help
>>>> Ugo
>>>>
>>>> Artem Tikhomirov wrote:
>>>>> List compartments are not suited for resizable and not-equally sized
>>>>> items.
>>>>>
>>>>>
>>>>> Artem
>>>>>
>>>>> "Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
>>>>> news:eh590i$c4c$1@utils.eclipse.org...
>>>>>> Hi everybody,
>>>>>> i've got a problem with list layout. i have a node inside a
>>>>>> compartment (A), that is a compartment itself.
>>>>>>
>>>>>> ---------
>>>>>> -.......-
>>>>>> -. A .-
>>>>>> -.......-
>>>>>> - -
>>>>>> ---------
>>>>>>
>>>>>> Im able to insert more nodes on the major compartment (now with A and
>>>>>> B)
>>>>>> ---------
>>>>>> -.......-
>>>>>> -. A .-
>>>>>> -.......-
>>>>>> -.......-
>>>>>> -. B .-
>>>>>> -.......-
>>>>>> - -
>>>>>> ---------
>>>>>>
>>>>>> im using list layout to put those. But my problem is that i cant
>>>>>> resize them. I mean, when i insert nodes on A and B (like A.1, A.2 and
>>>>>> B.1) i would like them to resize automatically. Which i cant realize
>>>>>> how to do.
>>>>>>
>>>>>> ---------
>>>>>> -.......-
>>>>>> -. A.1 .- <-this is the compartment A
>>>>>> -. A.2 .-
>>>>>> -.......-
>>>>>> -.......-
>>>>>> -. B.2 .- <-this is the compartment B
>>>>>> -.......-
>>>>>> - -
>>>>>> ---------
>>>>>>
>>>>>> I have a figure that explain better the whole thing ->
>>>>>> http://www.projetos.dee.ufba.br/eln/chrome/site/list_layout. png
>>>>>>
>>>>>> I hope i was clear enough, im desperate for help =)
>>>>>> Thanks!
>>>>>> Ugo
>
>
Re: Auto-size for nodes on a compartment with list layout [message #111488 is a reply to message #67842] Tue, 13 March 2007 09:07 Go to previous message
Eclipse UserFriend
Originally posted by: diegobc.gmail.com

Hi everyone,

this is how I made auto-resize works on a compartment.

You'll have to edit the CompartmentNodeFigure inner class and override
the paintFigure method. It's on the CompartimentEditPart.java file.

This inner class is automatically generated and extends a class from
org.eclipse.draw2d.

This is my code for a node I'm resizing VERTICALLY so I could fit all my
objects in the compartment.

@Override
public void paintFigure(Graphics arg0) {
CompartmentNode instance = (CompartmentNode) resolveSemanticElement();

//number of nodes inside the compartment
int subNodesQuantity = instance.getSubNodes.size();

//math for new compartment height according the number of
//nodes inside it
subNodesQuantity = _EXTRA_ + (subNodesQuantity * _SUBNODE_HEIGHT_);

//setting the new object size.
this.setPreferredSize(getMapMode().DPtoLP( _WIDTH_SIZE_ ),
subNodesQuantity);
super.paintFigure(arg0);
}

Hope it helps.

Diego

On Mon, 2006-10-23 at 11:05 -0300, Ugo Sangiorgi wrote:
> Artem,
> actually there are GridLayout on gmfmap, but it seems to have no effect
> at all (the nodes are still loose, as they can be dragged around).
> I downloaded the GridLayout and GridLayoutData, but i dont know exactly
> how to apply it to the compartment.. can you point me some directions?
> Thank you!
>
> Artem Tikhomirov wrote:
> > You may try to use Grid Layout (check
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=133279 for details), though
> > it's not part of GMF yet.
> >
> > Artem
> >
> > "Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
> > news:ehb8h7$htm$1@utils.eclipse.org...
> >> Hi Artem,
> >> I tried everything, even extending FlowLayout, but it didnt worked out. I
> >> just want the nodes to stand fixed at the upper left corner, just like the
> >> ListLayout(which i couldnt find to extend), but with variable size.
> >>
> >> i drawed here:
> >> http://www.projetos.dee.ufba.br/eln/chrome/site/hiperioncad_ problem.png
> >>
> >> can i extend the ListLayout and count how much nodes exists in the
> >> mini-compartments so i can resize them? is that possible?
> >>
> >> Please give me some directions on this, im lost!
> >> i really appreciate your help
> >>
> >> Ugo
> >>
> >>
> >> Artem Tikhomirov wrote:
> >>> I'd start with different layouts in NodeEditPart#setupContentPane to
> >>> figure out which one suits you most. Perhaps, you'll need to write a
> >>> custom one ;)?
> >>>
> >>> Artem
> >>>
> >>> "Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
> >>> news:ehaf56$ln6$1@utils.eclipse.org...
> >>>> Thanks Artem,
> >>>> in that case there are some way i could place the compartment nodes as
> >>>> kind of "non-floating" objects?
> >>>> Because im just using list layout so i can get this behavior.
> >>>> Thanks for your help
> >>>> Ugo
> >>>>
> >>>> Artem Tikhomirov wrote:
> >>>>> List compartments are not suited for resizable and not-equally sized
> >>>>> items.
> >>>>>
> >>>>>
> >>>>> Artem
> >>>>>
> >>>>> "Ugo Sangiorgi" <ugorox@gmail.com> wrote in message
> >>>>> news:eh590i$c4c$1@utils.eclipse.org...
> >>>>>> Hi everybody,
> >>>>>> i've got a problem with list layout. i have a node inside a
> >>>>>> compartment (A), that is a compartment itself.
> >>>>>>
> >>>>>> ---------
> >>>>>> -.......-
> >>>>>> -. A .-
> >>>>>> -.......-
> >>>>>> - -
> >>>>>> ---------
> >>>>>>
> >>>>>> Im able to insert more nodes on the major compartment (now with A and
> >>>>>> B)
> >>>>>> ---------
> >>>>>> -.......-
> >>>>>> -. A .-
> >>>>>> -.......-
> >>>>>> -.......-
> >>>>>> -. B .-
> >>>>>> -.......-
> >>>>>> - -
> >>>>>> ---------
> >>>>>>
> >>>>>> im using list layout to put those. But my problem is that i cant
> >>>>>> resize them. I mean, when i insert nodes on A and B (like A.1, A.2 and
> >>>>>> B.1) i would like them to resize automatically. Which i cant realize
> >>>>>> how to do.
> >>>>>>
> >>>>>> ---------
> >>>>>> -.......-
> >>>>>> -. A.1 .- <-this is the compartment A
> >>>>>> -. A.2 .-
> >>>>>> -.......-
> >>>>>> -.......-
> >>>>>> -. B.2 .- <-this is the compartment B
> >>>>>> -.......-
> >>>>>> - -
> >>>>>> ---------
> >>>>>>
> >>>>>> I have a figure that explain better the whole thing ->
> >>>>>> http://www.projetos.dee.ufba.br/eln/chrome/site/list_layout. png
> >>>>>>
> >>>>>> I hope i was clear enough, im desperate for help =)
> >>>>>> Thanks!
> >>>>>> Ugo
> >
> >
Previous Topic:GMF Examples from the CVS repository
Next Topic:Creating flat ecore_diagram for complex EMF models?
Goto Forum:
  


Current Time: Sun May 11 08:59:28 EDT 2025

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

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

Back to the top