Home » Modeling » GMF (Graphical Modeling Framework) » Collapsible compartment
Collapsible compartment [message #140002] |
Wed, 27 June 2007 09:44  |
Eclipse User |
|
|
|
Originally posted by: thanaele.gmail.com
Hi there,
New on the forum, I'd like to thank all the askers and givers of answers for
they have been useful too me more than once...
Now I'd need a little help understanding why my collapse function doesn't
work (I didn't seem to find any previous answer to this, but please inform
me if I'm calling for an old Post, and what's the title) :
-the compartment is set on collapsible : true
-this is also visible in the code generation
-but when I open my application, the little triangle used to show if a
compartment is collapsible or not only let the information contained in this
compartment disappear or re-appear.
My problem is the Figure that owns the compartment doesn't get smaller to
addapt to the compartment collapse, so it isn't useful for space managing...
The tutorial 2 of GMF shows a collapse that works well : the compartment is
resized as well as the figure, we can see this in the first viewlet. I tried
to compare the code of the solution tutorial with mine and things seem Ok as
far as collapsing is conserned :
in the view Factory, the collapse is set with
setupCompartmentCollapsed(view);
/*and is defined in the same way as in the tutorial with :
/**
* @generated
*/
protected void setupCompartmentCollapsed(View view) {
DrawerStyle drawerStyle = (DrawerStyle) view
..getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
if (drawerStyle != null) {
drawerStyle.setCollapsed(false);
}
}
Any Ideas ??
Thanks in advance,
Thanaele
|
|
|
Re: Collapsible compartment [message #145153 is a reply to message #140002] |
Thu, 02 August 2007 09:15   |
Eclipse User |
|
|
|
Thanaele,
This is an interesting and important issue which seems to have been left
unanswered. I cannot help you either, since I'm also looking for a
solution yet.
As you have rightly pointed out, in the Mindmap example from the
tutorial the Topic compartment gets properly resized when collapsed but
in my own diagram editor it fails to do so.
I'm reiterating the question: does anybody have an idea how to make this
work?
Regards,
Robert
Eleanath wrote:
> Hi there,
>
> New on the forum, I'd like to thank all the askers and givers of answers for
> they have been useful too me more than once...
> Now I'd need a little help understanding why my collapse function doesn't
> work (I didn't seem to find any previous answer to this, but please inform
> me if I'm calling for an old Post, and what's the title) :
>
> -the compartment is set on collapsible : true
> -this is also visible in the code generation
> -but when I open my application, the little triangle used to show if a
> compartment is collapsible or not only let the information contained in this
> compartment disappear or re-appear.
>
> My problem is the Figure that owns the compartment doesn't get smaller to
> addapt to the compartment collapse, so it isn't useful for space managing...
>
> The tutorial 2 of GMF shows a collapse that works well : the compartment is
> resized as well as the figure, we can see this in the first viewlet. I tried
> to compare the code of the solution tutorial with mine and things seem Ok as
> far as collapsing is conserned :
> in the view Factory, the collapse is set with
> setupCompartmentCollapsed(view);
>
> /*and is defined in the same way as in the tutorial with :
>
> /**
>
> * @generated
>
> */
>
> protected void setupCompartmentCollapsed(View view) {
>
> DrawerStyle drawerStyle = (DrawerStyle) view
>
> .getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
>
> if (drawerStyle != null) {
>
> drawerStyle.setCollapsed(false);
>
> }
>
> }
>
>
>
> Any Ideas ??
>
>
>
> Thanks in advance,
>
> Thanaele
>
>
|
|
|
Re: Collapsible compartment [message #145160 is a reply to message #145153] |
Thu, 02 August 2007 09:42   |
Eclipse User |
|
|
|
Originally posted by: tobk.gmx.de
The compartment will only resize if you clicked on AutoSize (in the Toolbar)
before. As soon as you manually resize the figure it will not collapse
anymore, until you click on AutoSize gain.
I haven't tried this yet, but maybe you could call autosize programmatically
every time the compartment is hidden?
Tobias
Robert Enyedi wrote:
> Thanaele,
>
> This is an interesting and important issue which seems to have been left
> unanswered. I cannot help you either, since I'm also looking for a
> solution yet.
>
> As you have rightly pointed out, in the Mindmap example from the
> tutorial the Topic compartment gets properly resized when collapsed but
> in my own diagram editor it fails to do so.
>
> I'm reiterating the question: does anybody have an idea how to make this
> work?
>
> Regards,
> Robert
>
> Eleanath wrote:
>> Hi there,
>>
>> New on the forum, I'd like to thank all the askers and givers of answers
>> for they have been useful too me more than once...
>> Now I'd need a little help understanding why my collapse function doesn't
>> work (I didn't seem to find any previous answer to this, but please
>> inform me if I'm calling for an old Post, and what's the title) :
>>
>> -the compartment is set on collapsible : true
>> -this is also visible in the code generation
>> -but when I open my application, the little triangle used to show if a
>> compartment is collapsible or not only let the information contained in
>> this compartment disappear or re-appear.
>>
>> My problem is the Figure that owns the compartment doesn't get smaller to
>> addapt to the compartment collapse, so it isn't useful for space
>> managing...
>>
>> The tutorial 2 of GMF shows a collapse that works well : the compartment
>> is resized as well as the figure, we can see this in the first viewlet. I
>> tried to compare the code of the solution tutorial with mine and things
>> seem Ok as far as collapsing is conserned :
>> in the view Factory, the collapse is set with
>> setupCompartmentCollapsed(view);
>>
>> /*and is defined in the same way as in the tutorial with :
>>
>> /**
>>
>> * @generated
>>
>> */
>>
>> protected void setupCompartmentCollapsed(View view) {
>>
>> DrawerStyle drawerStyle = (DrawerStyle) view
>>
>> .getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
>>
>> if (drawerStyle != null) {
>>
>> drawerStyle.setCollapsed(false);
>>
>> }
>>
>> }
>>
>>
>>
>> Any Ideas ??
>>
>>
>>
>> Thanks in advance,
>>
>> Thanaele
>>
>>
|
|
|
Re: Collapsible compartment [message #145163 is a reply to message #145160] |
Thu, 02 August 2007 10:20   |
Eclipse User |
|
|
|
Tobias,
You can see the behavior I need in this viewlet of the GMF tutorial part
2, around the 6:55 timeframe:
http://www.eclipse.org/gmf/tutorial/viewlets/tutorial2.html
When I click AutoSize, it only restores the compartment to its original
size. But what the tutorial shows it that the compartment memorizes two
sizes (one for collapsed and one for expanded) and switches between them
as you click the collapse button.
Regards,
Robert
tobias wrote:
> The compartment will only resize if you clicked on AutoSize (in the Toolbar)
> before. As soon as you manually resize the figure it will not collapse
> anymore, until you click on AutoSize gain.
>
> I haven't tried this yet, but maybe you could call autosize programmatically
> every time the compartment is hidden?
>
> Tobias
>
>
> Robert Enyedi wrote:
>> Thanaele,
>>
>> This is an interesting and important issue which seems to have been left
>> unanswered. I cannot help you either, since I'm also looking for a
>> solution yet.
>>
>> As you have rightly pointed out, in the Mindmap example from the
>> tutorial the Topic compartment gets properly resized when collapsed but
>> in my own diagram editor it fails to do so.
>>
>> I'm reiterating the question: does anybody have an idea how to make this
>> work?
>>
>> Regards,
>> Robert
>>
>> Eleanath wrote:
>>> Hi there,
>>>
>>> New on the forum, I'd like to thank all the askers and givers of answers
>>> for they have been useful too me more than once...
>>> Now I'd need a little help understanding why my collapse function doesn't
>>> work (I didn't seem to find any previous answer to this, but please
>>> inform me if I'm calling for an old Post, and what's the title) :
>>>
>>> -the compartment is set on collapsible : true
>>> -this is also visible in the code generation
>>> -but when I open my application, the little triangle used to show if a
>>> compartment is collapsible or not only let the information contained in
>>> this compartment disappear or re-appear.
>>>
>>> My problem is the Figure that owns the compartment doesn't get smaller to
>>> addapt to the compartment collapse, so it isn't useful for space
>>> managing...
>>>
>>> The tutorial 2 of GMF shows a collapse that works well : the compartment
>>> is resized as well as the figure, we can see this in the first viewlet. I
>>> tried to compare the code of the solution tutorial with mine and things
>>> seem Ok as far as collapsing is conserned :
>>> in the view Factory, the collapse is set with
>>> setupCompartmentCollapsed(view);
>>>
>>> /*and is defined in the same way as in the tutorial with :
>>>
>>> /**
>>>
>>> * @generated
>>>
>>> */
>>>
>>> protected void setupCompartmentCollapsed(View view) {
>>>
>>> DrawerStyle drawerStyle = (DrawerStyle) view
>>>
>>> .getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
>>>
>>> if (drawerStyle != null) {
>>>
>>> drawerStyle.setCollapsed(false);
>>>
>>> }
>>>
>>> }
>>>
>>>
>>>
>>> Any Ideas ??
>>>
>>>
>>>
>>> Thanks in advance,
>>>
>>> Thanaele
>>>
>>>
>
|
|
| |
Re: Collapsible compartment [message #145225 is a reply to message #145179] |
Fri, 03 August 2007 04:32  |
Eclipse User |
|
|
|
Vinary,
I did not observe that behavior when the compartment is resized. Thanks
for pointing this out.
Under these circumstances, I rephrase my original question :-) How can
the compartments be programatically resized when clicking the "collapse"
button?
Regards,
Robert
Vinay wrote:
> May be you have observed this thing.
>
> In mindmap example, you drop a Topic and add a Thread to it (without
> resizing Topic). Now if you collapse Topic compartment, it shrinks but
> as soon as you resize Topic, you loose this feature. Seems like there is
> some indicator getting reset on resize to cause this behavior.
>
> Thanks.
> Vinay
>
|
|
|
Goto Forum:
Current Time: Tue Jul 15 11:24:28 EDT 2025
Powered by FUDForum. Page generated in 0.05839 seconds
|